chromiumos/third_party/xf86-video-armsoc.git
14 months agoUse xf86ScreenToScrn and xf86ScrnToScreen 43/65843/2 master
Daniel Kurtz [Wed, 14 Aug 2013 13:07:01 +0000 (21:07 +0800)]
Use xf86ScreenToScrn and xf86ScrnToScreen

Part of the new compat-api.h are ScreenPtr <-> ScrnInfoPtr APIs.
Let's use them.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
BUG=chromium:265459
TEST=builds clean; sanity check ui

Change-Id: I347f5973eae02066b9a6fc27e07599e519b95abf
Reviewed-on: https://gerrit.chromium.org/gerrit/65843
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
Commit-Queue: Daniel Kurtz <djkurtz@chromium.org>

14 months agoAdd compat api support for newer server 60/62160/3 release-R30-4537.B
Daniel Kurtz [Wed, 7 Aug 2013 03:49:34 +0000 (11:49 +0800)]
Add compat api support for newer server

Prepare for xorg-server-1.13.0+

Cherry-picked slightly modified versions of:
82b51835a5f2a6ef4bfb70364d3cddfabcecfc4d
a83caa604017b051aceb99c3afe47e97bc0bbe42

From linaro:
git://git.linaro.org/arm/xorg/driver/xf86-video-armsoc.git

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>Conflicts:
BUG=chromium:265459
TEST=armsoc builds clean; sanity check on ui daisy

Change-Id: I99597f2514fdcbf9f7b77f3d64e74c09b5d4c53c
Reviewed-on: https://gerrit.chromium.org/gerrit/62160
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Queue: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
14 months agoCall DRI2CloseScreen after pScreen->CloseScreen 52/63552/3 firmware-pit-4482.B stabilize-4512.B
Daniel Kurtz [Tue, 30 Jul 2013 05:28:46 +0000 (13:28 +0800)]
Call DRI2CloseScreen after pScreen->CloseScreen

Both DRI2 and RandR may wrap pScrn functions.  Thus, it is important that
they get closed in the opposite order that they were initialized.

OMAPScreenInit() calls DRI2ScreenInit() before xf86CrtcScreenInit() (which
in turn calls xf86RandR12Init12).

Therefore, OMAPScreenCloseScreen() must unwrap xf86CrtcCloseScreen() and
call it (which in turn calls xf86RandR12CloseScreen) before calling
DRI2CloseScreen.

This should ensure that wrapped function order is correct between DRI2 and
RandR12.

In particular, this fixes the EnterVT handler such that it is correct on
subsequent server generations.

BUG=chromium:265051
TEST=ssh to device
  stop ui
  X :1 &  # start a test X server
  ORIG_VT=`fgconsole` # save original VT
  DISPLAY=:1 xev &    # start a test X client
  kill %2             # kill test X client (causes X server regeneration)
  DISPLAY=:1 xev &    # start a second test X client
  chvt 2              # VT-2 switch
  chvt $ORIG_VT       # switch back to original VT
  => No X server crash

Change-Id: I5665c3452a18bf2009640453f62dda0f33eb215f
Reviewed-on: https://gerrit.chromium.org/gerrit/63552
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Queue: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
16 months agoSet resized flag when discarding scanouts 03/56603/3 factory-4290.B factory-4455.B factory-pit-4280.B factory-pit-4390.B factory-pit-4471.B factory-spring-4262.B firmware-falco_peppy-4389.B firmware-leon-4389.26.B firmware-wolf-4389.24.B release-R29-4319.B stabilize-4255.B stabilize-4287.B stabilize-4443.B
Sean Paul [Fri, 24 May 2013 15:43:54 +0000 (11:43 -0400)]
Set resized flag when discarding scanouts

This patch sets the has_resized flag when we discard active scanout
buffers. The reason we need to do this is because the unreference here
removes the fb from the crtc in the kernel. Subsequent flips to that
crtc will fail b/c the front buffer is non-existant. Setting the
has_resized flag will ensure that we transition to blit mode before
trying to flip on that crtc (which will setcrtc to a valid fb).

BUG=None
TEST=Idle on/off works for HDMI on 3.8 kernel

Change-Id: I295f5b2cdcc1b923ff86c6f01e9eff2477032b42
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56603

17 months agoFix error path when drmmode_set_flip_mode fails 06/55806/3
Stéphane Marchesin [Mon, 20 May 2013 19:24:16 +0000 (12:24 -0700)]
Fix error path when drmmode_set_flip_mode fails

With the current code, the refcount becomes wrong if
drmmode_set_flip_mode fails, which is the first step in a cascade of
bugs which eventually panic the kernel.

BUG=chromium:241679
TEST=compiles and runs, but I can't reproduce the issue

Change-Id: I79bab35cbb7128e55443ebf748f43c3ad5bfcd20
Reviewed-on: https://gerrit.chromium.org/gerrit/55806
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Commit-Queue: Stéphane Marchesin <marcheu@chromium.org>

18 months agoDon't Attend/Ignore all clients in driver Enter/Leave VT handlers 62/42962/3 factory-4128.B factory-spring-4131.B stabilize-4008.0.B stabilize-4035.0.B stabilize-4068.0.B
Daniel Kurtz [Fri, 12 Apr 2013 19:12:15 +0000 (03:12 +0800)]
Don't Attend/Ignore all clients in driver Enter/Leave VT handlers

DRI2 now does this for us, and does it properly by tracking which
clients are currently using DRI2, and also ignoring any new clients that
arrive while we are currently away on another VT.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
BUG=chromium:220687
TEST=Install developer image
  Login as guest
  Browse to www.youtube.com
  VT switch
  Wait 15 seconds
  VT switch back
  => User should NOT be logged out!

Change-Id: I850b97d77e9cc4b905dcad95e4fc2c0136a6b466
Reviewed-on: https://gerrit.chromium.org/gerrit/42962
Commit-Queue: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
18 months agoDRI2GetMSC: Send a monotonic ust when the drawable is not full screen 13/47713/2
Daniel Kurtz [Wed, 10 Apr 2013 02:32:30 +0000 (10:32 +0800)]
DRI2GetMSC: Send a monotonic ust when the drawable is not full screen

According to the opengl glx_sync_control spec, the Unadjusted System Time
(or UST) is a 64-bit monotonically increasing counter that is available
throughout the system:
http://www.opengl.org/registry/specs/OML/glx_sync_control.txt

For the case where the Drawable cannot be mapped to a crtc (e.g., not full
screen, or there is no crtc), other drivers cannot just return FALSE here
as that triggers a BadDrawable error to be sent, and as is often the case
mishandled, to the client. This results in a certain compositor terminating, for example.

So, to be consistent with other drivers, return TRUE and set ust to a
monotonic system timestamp which in theory should also be monotonic with
the previous and subsequent vblank times.

Adopted from xf86-video-intel commit:
f09aa788d79d36688bcfdd3b49b92367590c5f16

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Suggested-by: Chris Wilson <chris@chris-wilson.co.uk>
BUG=chromium:223001
TEST=manually on daisy:
 1) attach external monitor (DP)
 2) start youtube video on external monitor
 3) uplug external monitor
 4) No regressions, and no error messages in /var/log/Xorg.0.log like:
    (EE) ARMSOC(0): ERROR: No crtc associated with given drawable
TEST=run_remote_tests --board=daisy graphics_SyncControlTest

Change-Id: I6a7dc70c79d46dce29ff3d7c5154916f849e0b96
Reviewed-on: https://gerrit.chromium.org/gerrit/47713
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
Commit-Queue: Daniel Kurtz <djkurtz@chromium.org>

18 months agodrmmode_display: remove old zpos ioctl fallback 58/46958/2
Mandeep Singh Baines [Fri, 29 Mar 2013 22:45:47 +0000 (15:45 -0700)]
drmmode_display: remove old zpos ioctl fallback

Now that we've backported the zpos property to 3.4, we no longer
need the old zpos ioctl fallback.

BUG=chromium:222980
TEST=Verified that cursor works on 3.8 and still works on 3.4.

Change-Id: I90de2e1b9c7d633496ad4e30f9066ce78a3a51f7
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/46958
Reviewed-by: John Sheu <sheu@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
18 months agodrmmode_display: add support for setting zpos via property 31/46931/2
Mandeep Singh Baines [Fri, 29 Mar 2013 22:45:47 +0000 (15:45 -0700)]
drmmode_display: add support for setting zpos via property

The following kernel commit removes the exynos-specific zpos ioctl
and replaces it with a plane object property:

commit 00ae67cf26fad3889e71e3bdbec012b1f938dc0e
Author: Joonyoung Shim <jy0922.shim@samsung.com>
Date:   Wed Jun 27 14:27:06 2012 +0900

    drm/exynos: add property for plane zpos

For 3.8 kernels, we need to use the property. And for 3.4
kernels, we need to call the exynos-specific ioctl.

Once we've migrated to 3.8, we can remove the code for calling
the old ioctl.

BUG=chromium:222980
TEST=Verified that cursor works on 3.8 and still works on 3.4.

Change-Id: I2b2623d37c911024d1f51e0db329ca37ca6a2a13
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/46931
Reviewed-by: John Sheu <sheu@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
18 months agoOMAPLeaveVT: fix TRACE_ENTER location 29/46729/4
Daniel Kurtz [Thu, 28 Mar 2013 01:56:28 +0000 (09:56 +0800)]
OMAPLeaveVT: fix TRACE_ENTER location

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
BUG=none
TEST=In /etc/X11/xorg.conf.d/exynos.conf
  set Option "Debug" in Section "Device" to "true"
TEST=VT switch
TEST=In /var/log/Xorg.0.log, see lines like:
  (II) ARMSOC(0): OMAPLeaveVT:1014: Entering
  (II) ARMSOC(0): OMAPLeaveVT:1026: Exiting

Change-Id: Id798f3304b13c5520c86ed31b847cd35215ebb5c
Reviewed-on: https://gerrit.chromium.org/gerrit/46729
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
Commit-Queue: Daniel Kurtz <djkurtz@chromium.org>

18 months agoExplicitly set .resize member of xf86CrtcConfigFuncsRec 39/46639/5
Daniel Kurtz [Tue, 25 Dec 2012 08:43:04 +0000 (16:43 +0800)]
Explicitly set .resize member of xf86CrtcConfigFuncsRec

resize is currently the only member of xf86CrtcConfigFuncsRec, but specify
it explicitly to be more clear, and also more consistent with other
struct initializations.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
BUG=none
TEST=builds clean

Change-Id: I5e7abf0e36290caf141705c93ff2400d4e0044ef
Reviewed-on: https://gerrit.chromium.org/gerrit/46639
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
Commit-Queue: Daniel Kurtz <djkurtz@chromium.org>

18 months agoCheck result from fstat 38/46638/5
Daniel Kurtz [Fri, 29 Mar 2013 04:27:32 +0000 (12:27 +0800)]
Check result from fstat

From xf86-video-intel commit:
2dc93b2a6c832ce8b972de90d09080e860dcd40f

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
BUG=none
TEST=builds clean; verify HDMI hotplug still works

Change-Id: I6679df260314e5336477a0c48a7c62699695235d
Reviewed-on: https://gerrit.chromium.org/gerrit/46638
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
Commit-Queue: Daniel Kurtz <djkurtz@chromium.org>

18 months agoNameForAtom may return NULL 37/46637/5
Daniel Kurtz [Wed, 27 Mar 2013 12:19:45 +0000 (20:19 +0800)]
NameForAtom may return NULL

Copied from xf86-video-intel commit
46fbb3d31bf73df4bd0259a146e9929f62a9c488

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
BUG=none
TEST=builds clean

Change-Id: I4eddce9449b782315f7a3323793875f143d77e4e
Reviewed-on: https://gerrit.chromium.org/gerrit/46637
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
Commit-Queue: Daniel Kurtz <djkurtz@chromium.org>

18 months agoRemove error message for GetMSC when drawable is not fullscreen 11/46211/7
Daniel Kurtz [Thu, 28 Mar 2013 04:05:17 +0000 (12:05 +0800)]
Remove error message for GetMSC when drawable is not fullscreen

DRI2 test applications (glmark, glbench, etc.) are not run full screen,
and hence will not have a valid crtc_index.
This will error-out MSC requests, but since this isn't a real error
condition, don't print an error message to the log.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
BUG=chromium:223001
TEST=Run glbench on daisy.
     Inspect /var/log/Xorg.1.log
     There should be no messages like this:
  (EE) ARMSOC(0): ERROR: No crtc associated with given drawable

Change-Id: Ib836f4dd44f0e5d8fae32c7a06304bf8b22b3fa0
Reviewed-on: https://gerrit.chromium.org/gerrit/46211
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Daniel Kurtz <djkurtz@chromium.org>

18 months agoFix accessing per-crtc scanouts in OMAPPrepareAccess. 99/46599/2
Yuly Novikov [Wed, 27 Mar 2013 01:05:18 +0000 (21:05 -0400)]
Fix accessing per-crtc scanouts in OMAPPrepareAccess.

Actually give back the main scanout, as the comment says.
Used to return the per-crtc scanout, leading to crashes.

BUG=chromium:222157
TEST=Swap primary display

Change-Id: I65ab677d98dded6aaecf9069dcd07e2bfdb1da6b
Reviewed-on: https://gerrit.chromium.org/gerrit/46599
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Tested-by: Yuly Novikov <ynovikov@chromium.org>
19 months agoOnly flip a window if it is not clipped 03/45503/3 stabilize-3881.0.B
Daniel Kurtz [Thu, 14 Mar 2013 23:23:59 +0000 (16:23 -0700)]
Only flip a window if it is not clipped

A window is flippable if its dimensions exactly match one of the scanout
buffers. However, we may not actually be able to flip it if it is clipped.

BUG=chromium-os:34777
TEST=From crosh shell:
TEST=sudo DISPLAY=:0.0 mtplot -g 100x100+100+100 /dev/input/event1
 mtplot window should

Change-Id: I3bb215fd19a68ff62ec2ff1375cbb2bdd817f7d7
Reviewed-on: https://gerrit.chromium.org/gerrit/45503
Tested-by: Ricky Liang <jcliang@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Queue: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
19 months agoReport error correctly in drmmode_page_flip 24/43224/3 firmware-spring-3824.4.B firmware-spring-3824.55.B firmware-spring-3824.84.B firmware-spring-3824.B
John Sheu [Wed, 13 Feb 2013 23:17:01 +0000 (15:17 -0800)]
Report error correctly in drmmode_page_flip

drmmode_page_flip() presently returns the (negated) error code from
drmModePageFlip() in the failure case, when we're expecting a count of
flips that succeeded before the failure.  Fix this.

BUG=chromium:175868
TEST=local build, run on snow

Change-Id: I2175febcbf56b2b52247a8bd3867166e4f52d69c
Reviewed-on: https://gerrit.chromium.org/gerrit/43224
Tested-by: John Sheu <sheu@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Queue: John Sheu <sheu@chromium.org>

20 months agoRemove '\n' from _MSG() format strings 03/42603/3 stabilize-3701.30.0 stabilize-3701.30.0b stabilize-3701.46.B stabilize-bluetooth-smart toolchain-3701.42.B
Daniel Kurtz [Tue, 5 Feb 2013 05:50:12 +0000 (13:50 +0800)]
Remove '\n' from _MSG() format strings

The (armsoc-specific) {DEBUG,INFO,ERROR,WARNING}_MSG() macros always
append '\n' to their string format argument.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
BUG=chromium-os:38551
TEST=sanity check on device:
TEST=See steps in crosbug.com/38551
  /var/log/xorg/Xorg.0.log.old should have a message like this, but it is
   no longer followed by a blank log entry (except for a timestamp).
 [ 71223.362] (EE) ARMSOC(0): ERROR: Cannot get DRM master: Invalid argument

Change-Id: Ic54a7cce138bc88fe0e16a7b77c660522595a504
Reviewed-on: https://gerrit.chromium.org/gerrit/42603
Commit-Queue: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
20 months agoCause server abort on drmSetMaster failure 95/42595/2
Daniel Kurtz [Tue, 5 Feb 2013 02:19:51 +0000 (10:19 +0800)]
Cause server abort on drmSetMaster failure

Currently armsoc spits an error message, but otherwise just ignores the
fact that it couldn't set itself as DRM master.  This will lead to various
strange crashes later as all subsequent drm ioctls fail.

Instead, if we just return FALSE from EnterVT() immediately, the server
will terminate in a slightly more predictable way.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
BUG=chromium-os:38551
TEST=See steps in crosbug.com/38551
  Xorg should terminate immediately after the following message, instead
  of trying and failing many ioctls and possibly seg-faulting later:
 (EE) ARMSOC(0): ERROR: Cannot get DRM master:  Invalid argument

Change-Id: Id9f59253a935f92f46bcd2849ad4b98532d0fdab
Reviewed-on: https://gerrit.chromium.org/gerrit/42595
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Queue: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
20 months agoFix drmSetMaster error reporting 90/42590/2
Daniel Kurtz [Tue, 5 Feb 2013 01:41:44 +0000 (09:41 +0800)]
Fix drmSetMaster error reporting

Unlike libdrm's other drm*() wrapped DRM ioctls, drmSetMaster() and
drmDropMaster() just return -1 on error instead of returning errno.

Thus, to get the relevent error string, we must pass errno to strerror(),
not ret.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
BUG=chromium-os:38551
TEST=See steps in crosbug.com/38551
/var/log/xorg/Xorg.0.log should now have a message like:
 [  1691.477] (EE) ARMSOC(0): ERROR: Cannot get DRM master:  Invalid argument

Change-Id: Ib3f59be04a806a93607b11f3b057e5ba4977e247
Reviewed-on: https://gerrit.chromium.org/gerrit/42590
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Queue: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
22 months agoUse exynos BO acquire/release before CPU access 86/39286/4 factory-3536.B linux-3.8 stabilize-3658.0.0
John Sheu [Sat, 17 Nov 2012 03:17:09 +0000 (19:17 -0800)]
Use exynos BO acquire/release before CPU access

Use the new exynos DRM acquire/release ioctls to synchronize CPU access
to pixmaps and the framebuffers.

BUG=chrome-os-partner:11949
TEST=local build, run on exynos

CQ-DEPEND=Ibcef79dab636a9a532559c72cb4b5e37d231b2c7
CQ-DEPEND=Ie4b04530701adf3054f150cfe5143680efceb531

Change-Id: I76f981ae4bf1e7a9a98c5ad35997ad42794ee6e8
Reviewed-on: https://gerrit.chromium.org/gerrit/39286
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Ready: John Sheu <sheu@chromium.org>
Tested-by: John Sheu <sheu@chromium.org>
22 months agoCorrect OMAPDRI2GetMSC to query the correct display 07/39607/6 release-R25-3428.B stabilize-3428.110.0 stabilize-3428.149 stabilize-3428.149.B stabilize-3428.193 toolchain-3428.65.B
Ryan Harrison [Wed, 12 Dec 2012 20:50:02 +0000 (15:50 -0500)]
Correct OMAPDRI2GetMSC to query the correct display

Currently the function will always ask the kernel for the information about the
first display device, which is normally the internal display, regardless of
where the drawable is displayed. This change packs the crtc value for drawable
into the request, so the the uts and msc values returned are the ones associated
with the display that it is occuring on.

This change is needed to make my egl extension prototype
(https://gerrit-int.chromium.org/30212) behave correctly when there are multiple
monitors.

BUG=chrome-os-partner:16624
TEST=Manual. I have tested this locally, but this margin it too narrow to
     contain a proper description.

Change-Id: I223b511feaf3e0fec6111ab924fec1da7d43ffb1
Reviewed-on: https://gerrit.chromium.org/gerrit/39607
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Tested-by: Ryan Harrison <rharrison@chromium.org>
Commit-Ready: Ryan Harrison <rharrison@chromium.org>

22 months agodrmmode_display: debug_modes should not be set explictly 36/39536/3
Mandeep Singh Baines [Tue, 11 Dec 2012 06:16:23 +0000 (22:16 -0800)]
drmmode_display: debug_modes should not be set explictly

The correct way to set debug_modes is via the ModeDebug option
in xorg.conf. We also don't want this debug printed by default.

Also, removed PrintEDID call since this is redundant and not
typically done inside the get_modes callback.

BUG=chromium-os:37139
TEST=Verified that Xorg.0.log is less verbose.
TEST=Verified that mode debug can be re-enabied as follows:

Add:

Option          "ModeDebug"                 "true"

To (Device section):

/etc/X11/xorg.conf.d/exynos.conf

Note: there is still a lot of mode debug in the logs but less than
before.

Change-Id: I85606aeabcc7654367fd5cac980a3e038c9ee8fe
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/39536
Reviewed-by: Sean Paul <seanpaul@chromium.org>
22 months agoPer-scanout tracking of BO dirty state 83/39283/4 stabilize2
John Sheu [Tue, 4 Dec 2012 01:04:52 +0000 (17:04 -0800)]
Per-scanout tracking of BO dirty state

Presently the flip_mode OMAP private data flag is overloaded to carry
status information about whether the scanouts have valid contents, as
well as whether we are in blit or flip mode.

* Change flip_mode only to carry blit/flip mode status info.
* Track valid-contents on a per-scanout basis.
* When doing copies to/from the large merged scanout (e.g. on transition
  to or from blit mode), only copy scanouts that have invalidated data.

BUG=chrome-os-partner:15405
TEST=local build, run on exynos

Change-Id: Ibcef79dab636a9a532559c72cb4b5e37d231b2c7
Reviewed-on: https://gerrit.chromium.org/gerrit/39283
Reviewed-by: John Sheu <sheu@chromium.org>
Tested-by: John Sheu <sheu@chromium.org>
Commit-Ready: John Sheu <sheu@chromium.org>

22 months agoRemove SET_PLANE_ZPOS ioctl from set_cursor_pos 22/39122/5
John Sheu [Mon, 3 Dec 2012 22:11:42 +0000 (14:11 -0800)]
Remove SET_PLANE_ZPOS ioctl from set_cursor_pos

This ioctl only needs to be called on cursor show, not every time cursor
position changes.

BUG=chromium-os:36991
TEST=local build, run on exynos
CQ-DEPEND: I4c3490ef05d1ecdfeea6cbf26f020b9a19ebe764

Change-Id: I95a06023cd752a85ecfcdac406af413e261344cb
Reviewed-on: https://gerrit.chromium.org/gerrit/39122
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Commit-Ready: John Sheu <sheu@chromium.org>
Tested-by: John Sheu <sheu@chromium.org>
22 months agoRemove omap_drm dependency 66/38766/5
Stéphane Marchesin [Tue, 27 Nov 2012 23:16:04 +0000 (15:16 -0800)]
Remove omap_drm dependency

Remove the omap_drm dependency from xf86-video-armsoc.
Also remove the cpu_fini msync() call which always fails anyway.

BUG=none
TEST=compiles, works

Change-Id: Ic9af26465202abc127e19b8215f1aff3d47408a5
Reviewed-on: https://gerrit.chromium.org/gerrit/38766
Reviewed-by: John Sheu <sheu@chromium.org>
Commit-Ready: Stéphane Marchesin <marcheu@chromium.org>
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
23 months agoFix drmmode_copy_from_to 11/37811/2
Daniel Kurtz [Sat, 10 Nov 2012 10:25:58 +0000 (18:25 +0800)]
Fix drmmode_copy_from_to

The number of useful data pixels in a buffer row is its width.  The total
storage (in bytes) of that row, including padding, is its pitch.

The previous version of drmmode_copy_from_to() would try to copy the
entire row pitch, including padding, instead of just its width.

This was arguably inefficient when copying from a bigger buffer into a
smaller buffer as it would also fill the padding bytes.
It was wrong when copying from a smaller buffer into a bigger buffer
as it would also copy from the padding region, overwriting existing data
bytes in the bigger buffer.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
BUG=chromium-os:36241
TEST=No X crashes on HDMI plug/unplug.
     No corruption seen when switching between blit & flip mode
     (Tested by starting a non-full screen X app, such as xev or mtplot)

Change-Id: Id203d052090c69167a6fa47091033df2411449c2
Reviewed-on: https://gerrit.chromium.org/gerrit/37811
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Ready: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
23 months agoFix fb0 copy bounds 10/37810/2
Daniel Kurtz [Sat, 10 Nov 2012 10:20:26 +0000 (18:20 +0800)]
Fix fb0 copy bounds

The dst buffer is pScrn. Its bounds (pitch/height) are pScrn->virtualX/Y.
The src buffer is fb0, it makes sense that its bounds should be fb0's
x/yres_virtual (instead of visual).

In any case, this change is purely cosmetic, since drmmode_copy_from_to()
does the math to only copy the smallest overlapping region between the
two buffers.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
BUG=chromium-os:36241
TEST=manually:
     At boot, clean transition from Chrome Ball to login screen.

Change-Id: Ifa1c4de6bb30b26c347f87461ddf2e6d9d0ddcb8
Reviewed-on: https://gerrit.chromium.org/gerrit/37810
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Ready: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
23 months agoFix hotplug info message 09/37809/2
Daniel Kurtz [Sat, 10 Nov 2012 04:20:35 +0000 (12:20 +0800)]
Fix hotplug info message

memcmp() returns 0 on successful match.
Inver the logic so it says "match=1" when the match is successful.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
BUG=none
TEST=On daisy...
  tail -F /var/log/Xorg.0.log | grep hotplug
  hotplug HDMI cable
  See message like:
    [ 15534.355] (II) ARMSOC(0): hotplug=1, match=1

Change-Id: Ifae963531581a67989e1a1587d617b9c20365bb1
Reviewed-on: https://gerrit.chromium.org/gerrit/37809
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Ready: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
23 months agoMake OMAPDRI2BufferRec keep less state
John Sheu [Thu, 27 Sep 2012 00:20:48 +0000 (17:20 -0700)]
Make OMAPDRI2BufferRec keep less state

* Remove refcnt from OMAPDRI2BufferRec
Remove Yet Another Layer Of Refcounting by removing the refcount in
OMAPDRI2BufferRec.  Use Pixmap refcounts instead, and pass PixmapPtrs to
OMAPDRI2SwapComplete accordingly.

* Use ReuseBufferNotify to sync BO name with Xorg

We do some BO shuffling (especially on the flip path), so we'll need to
make sure that Xorg's accounting of the BO (a cross-process BO flink) is
pointing to the BO that we're actually holding (in the process as a BO
handle).

Do this in the ReuseBufferNotify callback so as to do this reliably
every time before Xorg is about to hand a buffer back to the
application.  This allows us to avoid having to touch the DRI2Buffer
internally every time we switch around BOs.

Also: dead code removal.

TEST=local build, run on lucas
BUG=chromium-os:151712
BUG=chrome-os-partner:14196

Change-Id: I4c535d36dbd9ecf2f01dff2d0b8981a0c9d0d15c
Reviewed-on: https://gerrit.chromium.org/gerrit/34155
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Ready: John Sheu <sheu@chromium.org>
Tested-by: John Sheu <sheu@chromium.org>
2 years agoExport the real front buffer in PrepareAccess
Stéphane Marchesin [Fri, 19 Oct 2012 22:01:32 +0000 (15:01 -0700)]
Export the real front buffer in PrepareAccess

When someone uses a 2D function on one of our per-crtc scanouts, 2D
acceleration expects the dimensions to be that of the full screen
buffer. This leads to crashes since the dimensions don't always
match. This change ensures that we expose the global scanout when
PrepareAccess is called on per-crtc scanouts.

BUG=chrome-os-partner:15427
TEST=try to take a screenshot multiple times with ctrl-F5 and
TEST=an HDMI screen plugged in, X doesn't crash.

Change-Id: I8bbe3237ec992c35a4a2416ab8fc26aba5c17264
Reviewed-on: https://gerrit.chromium.org/gerrit/36156
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Ready: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
2 years agoMake sure there is room before copying a scanout
Daniel Kurtz [Fri, 19 Oct 2012 21:11:06 +0000 (14:11 -0700)]
Make sure there is room before copying a scanout

If a CRTC is removed or shrunk, pOMAP->scanout may shrink such that it no
longer contains ANY of one or more of the pOMAP->scanouts.  In this case,
make sure not to copy anything from the pOMAP->scanouts.

This patch fixes two bugs:
 (a) the omap_bo_*() functions return uint32_t, so the subtraction was
     resulting in a large positive number, instead of a negative.  Thus,
     the min() would choose to copy all of scanout.
 (b) even if the subtraction was cast to int, the copy operation would
     still do the wrong thing when given a negative range.

It also refactors how we copy between the overlapping regions of bo's.
And, while we are at it, we use the same function to copy from fb to scanout.

BUG=chrome-os-partner:15240
TEST=manually:
  1. Attach external monitor using HDMI-HDMI cable
  2. boot
  3. DISPLAY=:0.0 xrandr --output --off
  4. Wait for both screens to come back on (~40 seconds)
  5. DISPLAY=:0.0 xrandr --output --off
  6. Ensure no "Segmentation fault" in /var/log/Xorg.0.log

Change-Id: Idc927fe6ef3e5076790f4734a1ccbc73bb719c4d
Reviewed-on: https://gerrit.chromium.org/gerrit/35805
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
Commit-Ready: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
2 years agoRefactor bytes-per-pixel computation
Daniel Kurtz [Fri, 19 Oct 2012 21:02:05 +0000 (14:02 -0700)]
Refactor bytes-per-pixel computation

The computation of bytes-per-pixel was assuming that bpp was evenly
divisible by 8.

Also, since we actually use bytes per pixel very often and it is constant
for a given bo, let's just precompute it provide an accessor

BUG=chrome-os-partner:15240
TEST=manual, plug/unplug external monitor; xrandr --auto

Change-Id: Ibdf089fb5e2ab89383c193eb5f0d9770b9dbd011
Reviewed-on: https://gerrit.chromium.org/gerrit/35804
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
Commit-Ready: Daniel Kurtz <djkurtz@chromium.org>

2 years agoFree props struct when destroying drmmode_output
Daniel Kurtz [Tue, 16 Oct 2012 18:03:34 +0000 (02:03 +0800)]
Free props struct when destroying drmmode_output

We were freeing the individual properties, and we were freeing the
drmmode_output, but we weren't freeing the calloc'ed array of kernel
property to drmModePropertyPtr/Atom maps.

BUG=chrome-os-partner:15376
TEST=no crash when attaching/removing external display

Change-Id: I9679b09784c0f97d3a5c0c4bb3bf065ca91710da
Reviewed-on: https://gerrit.chromium.org/gerrit/35802
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
Commit-Ready: Daniel Kurtz <djkurtz@chromium.org>

2 years agofix memleaks when iterating drmMode property list
Daniel Kurtz [Tue, 16 Oct 2012 17:39:54 +0000 (01:39 +0800)]
fix memleaks when iterating drmMode property list

Be sure to free properties that don't match the expected flags.

Also, renames "props" to "prop", since the variable only holds a single
property.

BUG=chrome-os-partner:15376
TEST=manual on device; no regressions with:
  xrandr --output eDP-1 --off
  xrandr --output eDP-1 --auto
  xset dpms force off
  xset dpms force on

Change-Id: Id56335831e0471dee3ffe5201737486644171f88
Reviewed-on: https://gerrit.chromium.org/gerrit/35651
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Ready: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
2 years agoFix property flag check when setting dpms
Daniel Kurtz [Tue, 16 Oct 2012 03:41:42 +0000 (11:41 +0800)]
Fix property flag check when setting dpms

This bug had no affect, unless there was another property called "DPMS"
that was not a DRM_MODE_PROP_ENUM.

BUG=none
TEST=none

Change-Id: I1e0c9b59c0b1255e9d7c5f12dd168407bc420cf9
Reviewed-on: https://gerrit.chromium.org/gerrit/35650
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Ready: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
2 years agoAlways reset flip_mode to OMAP_FLIP_INVALID even when we skip reallocation
Stéphane Marchesin [Thu, 11 Oct 2012 23:49:59 +0000 (16:49 -0700)]
Always reset flip_mode to OMAP_FLIP_INVALID even when we skip reallocation

Otherwise we don't trigger the copy code.

BUG=chromium-os:35239
TEST=by hand, switch to VT2 and back, suspend/resume and back.

Change-Id: I1a53f14a86f22801a0fcb6a137a194d5b85d7921
Reviewed-on: https://gerrit.chromium.org/gerrit/35353
Reviewed-by: Haixia Shi <hshi@chromium.org>
Tested-by: Haixia Shi <hshi@chromium.org>
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
Commit-Ready: Stéphane Marchesin <marcheu@chromium.org>

2 years agoarmsoc: Make sure we need to update the scanouts before doing so.
Stéphane Marchesin [Wed, 10 Oct 2012 04:09:53 +0000 (21:09 -0700)]
armsoc: Make sure we need to update the scanouts before doing so.

Otherwise we lose the contents on resume. This is only half of the
suspend/resume fixes for bug 14978, the other half will be in the
kernel.

BUG=chrome-os-partner:14978
TEST=by hand, check that the buffer is kept

Change-Id: If5036f0d6b704d28008d95fca1cc8c4d1823ad40
Reviewed-on: https://gerrit.chromium.org/gerrit/35121
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Stuart Abercrombie <sabercrombie@chromium.org>
Commit-Ready: Stéphane Marchesin <marcheu@chromium.org>

2 years agoCleanup bo reference counting factory-2993.B factory-3004.B
Mandeep Singh Baines [Wed, 3 Oct 2012 19:11:38 +0000 (12:11 -0700)]
Cleanup bo reference counting

Made the bo reference counting consistent across the driver.

1) unreference whenever we unassign a bo pointer
2) reference whenever we assign a bo pointer unless
   its a new allocation

BUG=chromium-os:34914
TEST=Multiple VT switch. HDMI. Multiple sign in/out. MPD.

Change-Id: I8aeed5cb2f99ba9c62a2078255ff5b93c43bde43
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/34540
Reviewed-by: John Sheu <sheu@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
2 years agoomap_driver: remove redundant call to xf86SetDesiredModes
Mandeep Singh Baines [Wed, 3 Oct 2012 17:31:48 +0000 (10:31 -0700)]
omap_driver: remove redundant call to xf86SetDesiredModes

xf86SetDesiredModes is already called by OMAPEnterVT. Also,
checking of OMAPEnterVT return value.

BUG=chromium-os:34914
TEST=restart ui

Change-Id: I72e3b27594c9f4da54f093abe8bfa2655a7b7048
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/34539
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
2 years agoTrack cursor visibility per-crtc
Stéphane Marchesin [Wed, 3 Oct 2012 03:27:40 +0000 (20:27 -0700)]
Track cursor visibility per-crtc

The cursor is shared between crtc, but its visibility is tracked
per-crtc. So track it in the crtc struct. This fixes missing cursor
when we move across crtcs.

BUG=chrome-os-partner:13583
TEST=by hand

Change-Id: I0a0a08eb2e328fe046bed10dca7098ec34f1bfd6
Reviewed-on: https://gerrit.chromium.org/gerrit/34493
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
Commit-Ready: Stéphane Marchesin <marcheu@chromium.org>

2 years agodrmmode: Introduce clipping in the to_blit and to_flip functions. factory-2985.B
Stéphane Marchesin [Wed, 3 Oct 2012 00:46:48 +0000 (17:46 -0700)]
drmmode: Introduce clipping in the to_blit and to_flip functions.

We need to clip, because we can end up in a situation after a mode
change where a buffer from a different size will be copied to our
fake/real front.

BUG=chrome-os-partner:14801
TEST=by hand, doesn't crash any more with xrandr --output eDP-1 --off

Change-Id: I0af6e99c5abe54a942c2029321e23b6a0c1c7fe6
Reviewed-on: https://gerrit.chromium.org/gerrit/34489
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
Commit-Ready: Stéphane Marchesin <marcheu@chromium.org>

2 years agoomap_dri2: update DRIBuf name when allocating a new scanout
Mandeep Singh Baines [Wed, 26 Sep 2012 20:47:15 +0000 (13:47 -0700)]
omap_dri2: update DRIBuf name when allocating a new scanout

The GL driver maintains a cache of DRIBuf's indexed by name. When we
go from blitting to flipping, we replace the underlying bo so we
need to update the name or we'll confuse the GL driver's cache.

BUG=chrome-os-partner:14575
TEST=Verified that I now get a solid 60 FPS on MPD.

Verifed that the following error message goes away:

[    8.477897] [drm:exynos_drm_crtc_page_flip] *ERROR* flipping a non-kds buffer

Change-Id: Ica87105720ebb1402efa106168ff491e7454b857
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/34130
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
2 years agoCopy FB contents to scanout buffer on startup.
John Sheu [Mon, 24 Sep 2012 23:34:49 +0000 (16:34 -0700)]
Copy FB contents to scanout buffer on startup.

This fixes some issues with our initial copy of FB contents to the
primary scanout buffer when we're booting up X.  Previously, the main
scanout buffer was being overwritten with the cleared contents of the
per-CRTC scanout buffers, causing a black flash on bootup.

TEST=local build, run on lucas
BUG=chrome-os-partner:14196

Change-Id: I6faecc0d1ee70a12aec08d3524e337b4c7de32e0
Reviewed-on: https://gerrit.chromium.org/gerrit/33956
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Ready: John Sheu <sheu@chromium.org>
Tested-by: John Sheu <sheu@chromium.org>
2 years agoReset the CRTCs when we update the scanouts
Sean Paul [Sat, 22 Sep 2012 00:25:34 +0000 (17:25 -0700)]
Reset the CRTCs when we update the scanouts

When we do dpms off, we unbind the CRTC's framebuffer. If we don't
resize the buffers, we never setup the CRTC and as such will fail any
pageflips that follow. This patch ensures that we always setup the
CRTC's when we dpms (or change modes).

BUG=chrome-os-partner:14038
TEST=Tested on snow, cycled brightness up and down

Change-Id: I89c8360fce3f356dd7836ab42255d4b2297cc215
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/33830
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
2 years agoExport 64x64 cursor size to X, including padding factory-2914.B
John Sheu [Tue, 18 Sep 2012 22:44:30 +0000 (15:44 -0700)]
Export 64x64 cursor size to X, including padding

X has trouble with cursor sizes not a multiple of 32, so the old 48x64
size was causing issues (with bitmap cursors).  Fix by allocating a
96x64 overlay, and exporting the 64x64 subrect to X.

BUG=chrome-os-partner:13800
BUG=chrome-os-partner:14192
TEST=local build, run on lucas

Change-Id: Ie55608a2491997d32eb2fe14c810087e77a0768e
Reviewed-on: https://gerrit.chromium.org/gerrit/33565
Tested-by: John Sheu <sheu@chromium.org>
Commit-Ready: John Sheu <sheu@chromium.org>
Reviewed-by: John Sheu <sheu@chromium.org>
2 years agoSupport multiple scanout buffers
Sean Paul [Tue, 4 Sep 2012 22:20:04 +0000 (15:20 -0700)]
Support multiple scanout buffers

This patch adds a scanout buffer for each unique crtc region. This
allows us to flip multiple crtcs when we have fullscreen windows.

BUG=chrome-os-partner:12889
TEST=Tested on snow with a 1080p monitor

Change-Id: Ibbdcba375f882bd5a0c594eee1cb1cc14be16ba1
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/31227
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
2 years agoAdd padding to HW overlay cursor edges
John Sheu [Tue, 11 Sep 2012 19:56:09 +0000 (12:56 -0700)]
Add padding to HW overlay cursor edges

Workaround issue with cursor corruption when cursor gets too close to
screen edges.  We're exporting (with this change) a 48x64 max cursor
size, instead of 64x64 -- typical cursors don't go over 32x32 anyways.

BUG=chrome-os-partner:13800
TEST=local build, run on lucas

Change-Id: If34cf75d6c00c4c66e6e3dc2eff779dac9aaf046
Reviewed-on: https://gerrit.chromium.org/gerrit/32966
Tested-by: John Sheu <sheu@chromium.org>
Reviewed-by: Akshu Agrawal <akshu@chromium.org>
Commit-Ready: John Sheu <sheu@chromium.org>
Reviewed-by: John Sheu <sheu@chromium.org>
2 years agodrmmode_display: comment out gamma settting
Mandeep Singh Baines [Wed, 29 Aug 2012 23:18:51 +0000 (16:18 -0700)]
drmmode_display: comment out gamma settting

Exynos does not have any gamma setting support so don't try to
set gamma. This fixes the following error:

[     5.770] (EE) ARMSOC(0): failed to set gamma: Invalid argument

gamma is not an optional drm property so no way to really probe
for it. So only option is to comment out the code.

BUG=chrome-os-partner:13087
TEST=Verify that error message no longer appears.

Change-Id: I705601e95d1a52f60a01ed5464ecfd4f98545997
Reviewed-on: https://gerrit.chromium.org/gerrit/31763
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Ready: Mandeep Singh Baines <msb@chromium.org>
Tested-by: Mandeep Singh Baines <msb@chromium.org>
2 years agoAdd reference counting to omap_bo factory-2848.B
Sean Paul [Tue, 4 Sep 2012 22:17:33 +0000 (15:17 -0700)]
Add reference counting to omap_bo

Add reference counting to omap_bo to avoid freeing a buffer object
during page flip.

BUG=chrome-os-partner:12889
TEST=Tested on snow, could hotplug & resize while flipping

Change-Id: I7b65e9553427ce1668d2838712e1e18e47a80f79
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/31771
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
2 years agoClean up OMAPModifyPixmapHeader
Sean Paul [Tue, 4 Sep 2012 16:44:57 +0000 (09:44 -0700)]
Clean up OMAPModifyPixmapHeader

OMAPModifyPixmapHeader shouldn't call miModifyPixmapHeader directly
since it can reset the pixmap's reference count, causing memory issues
on free (specifically, we saw crashes using the root pixmap). This patch
removes the direct call and cleans up the structure of the function.

BUG=chrome-os-partner:12593
TEST=Tested on snow, resized the root pixmap a few times, no crashes.

Signed-off-by: Sean Paul <seanpaul@chromium.org>
Change-Id: I7793979939316ef167c646ef5457826cf7d8618e
Reviewed-on: https://gerrit.chromium.org/gerrit/32035
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
2 years agoRemove OMAP_BO_TILED references
Sean Paul [Sat, 1 Sep 2012 00:12:21 +0000 (17:12 -0700)]
Remove OMAP_BO_TILED references

These masks are set to 0 and the allocator is not defined, so just get
rid of it.

BUG=None
TEST=Compiled and ran on snow

Change-Id: I10c21be288bb0a17d2a779e58297ccacf520d9fa
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/32146
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
2 years agoMove drmModeAddFB into omap_bo factory-2846.B
Sean Paul [Thu, 30 Aug 2012 19:08:12 +0000 (12:08 -0700)]
Move drmModeAddFB into omap_bo

We do RmFB from omap_bo, so this patch moves addFB in as well. This
patch also does a bit of clean up in the omap_dumb.c file.

BUG=chrome-os-partner:12889
TEST=Tested on snow, ensured nothing regressed

Change-Id: I768bc69ef43add6a7aa730be9b39380ebf7f0292
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/31919
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
Reviewed-by: John Sheu <sheu@chromium.org>
2 years agoomap_exa.c: handle zero-size pixmaps in ModifyPixmapHeader
Mandeep Singh Baines [Wed, 29 Aug 2012 00:56:47 +0000 (17:56 -0700)]
omap_exa.c: handle zero-size pixmaps in ModifyPixmapHeader

X will sometimes create an empty pixmap and then use ModifyPixmapHeader
to point it at PixData. We'll hit this path during the CreatePixmap call.

To avoid trying to allocate a zero-byte buffer and eventually erroring out,
just return true.

Fixes:

[     5.772] (EE) _CREATE_DUMB({height: 0x0, width: 0x0, bpp: 0x20, flags:

BUG=chrome-os-partner:13087
TEST=Browse some sites (incl. webgl) and verify Xorg.0.log is clean.

Change-Id: I8130cdde89ee0fadb3169a1878b085657cf14d52
Reviewed-on: https://gerrit.chromium.org/gerrit/31665
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Ready: Mandeep Singh Baines <msb@chromium.org>
Tested-by: Mandeep Singh Baines <msb@chromium.org>
2 years agoomap_dumb: Add missing LF to error message in omap_bo_new_with_dim firmware-stout-2817.B
Mandeep Singh Baines [Sat, 25 Aug 2012 01:42:27 +0000 (18:42 -0700)]
omap_dumb: Add missing LF to error message in omap_bo_new_with_dim

The missing LF causes the message to join with the next message.

BUG=chrome-os-partner:13807
TEST=Verified that message is now printed correctly.

Before:

[ 12992.083] (EE) _CREATE_DUMB({height: 0x0, width: 0x0, bpp: 0x20, flags: 0x1}) failed. errno:0x16(II) ARMSOC(0): OMAPModifyPixmapHeader:167 failed to allocate 0x0 bo, flags=00000001

After:

[ 14625.203] (EE) _CREATE_DUMB({height: 0x0, width: 0x0, bpp: 0x20, flags: 0x1}) failed. errno:0x16
[ 14625.203] (II) ARMSOC(0): OMAPModifyPixmapHeader:167 failed to allocate 0x0 bo, flags=00000001

Change-Id: I5e970f52d5aa648048a3e19df57800beeecf2196
Reviewed-on: https://gerrit.chromium.org/gerrit/31421
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Ready: Mandeep Singh Baines <msb@chromium.org>
Tested-by: Mandeep Singh Baines <msb@chromium.org>
2 years agoTo implement smooth transition during resize firmware-butterfly-2788.B
akshu agrawal [Thu, 9 Aug 2012 11:32:21 +0000 (17:02 +0530)]
To implement smooth transition during resize

Initializing the contents of new scanout buffer to 0.
This would avoid the corruption screen during switching of modes.

BUG=chrome-os-partner:12594
TEST=Tested with HDMI and on changing modes

Change-Id: I2a251010ac304241c0f959d6c56e620d5458e5ad
Signed-off-by: akshu agrawal <akshu.a@samsung.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/29760
Tested-by: Akshu Agrawal <akshu@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Shirish S <shirish@chromium.org>
Commit-Ready: Akshu Agrawal <akshu@chromium.org>

2 years agoRevert "xf86-video-armsoc: Add workaround for VT2 issues."
John Sheu [Thu, 16 Aug 2012 22:44:22 +0000 (15:44 -0700)]
Revert "xf86-video-armsoc: Add workaround for VT2 issues."

This reverts commit 8cd9e30eeb31d78d47c9308af522e78c79b18a9a.  The
underlying issues are fixed and we'd like this hack out of the codebase.

BUG=chrome-os-partner:11059
TEST=local build, run

Change-Id: I7c680c9050f8bacd926f5d1c590193227db1dd40
Reviewed-on: https://gerrit.chromium.org/gerrit/30603
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Ready: John Sheu <sheu@chromium.org>
Tested-by: John Sheu <sheu@chromium.org>
2 years agoHandle disabled/multiple CRTCs correctly.
John Sheu [Wed, 15 Aug 2012 18:40:11 +0000 (11:40 -0700)]
Handle disabled/multiple CRTCs correctly.

Don't call the page flip ioctl on disabled CRTCs.  If all CRTCs are
disabled, then fake a flip completion.  Also, when multiple CRTCs are
enabled, report the swap completion event only once back to DRI.

BUG=chrome-os-partner:12083
BUG=chrome-os-partner:12387
TEST=local build, run on ARM (CRTC off, suspend/resume)

Change-Id: I0c31a1b1b8ccd8c1f4bffedea3b9c289486c88ad
Reviewed-on: https://gerrit.chromium.org/gerrit/30441
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Ready: John Sheu <sheu@chromium.org>
Tested-by: John Sheu <sheu@chromium.org>
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
2 years agoexynos: Initialize scanout before enabling it
Jeff Disher [Wed, 15 Aug 2012 21:36:13 +0000 (17:36 -0400)]
exynos: Initialize scanout before enabling it

Be sure to initialize the contents of the new OMAP scanout resource with
the existing contents of the framebuffer prior to enabling it as our
active scanout memory.  The memory is otherwise arbitrary texture memory
until this is done so it could cause a frame of corruption when X was
first starting.

BUG=chrome-os-partner:11522
TEST=Manually tested turning X on and off with solid colours written in
to the framebuffer on Snow to verify that there was no visible
corruption.

Change-Id: I8a9c7fb9726f37392abd962238a385dc66894808
Reviewed-on: https://gerrit.chromium.org/gerrit/30463
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Commit-Ready: Jeff Disher <disher@chromium.org>
Tested-by: Jeff Disher <disher@chromium.org>
2 years agoAdd PRESUBMIT.cfg
Jeff Disher [Wed, 15 Aug 2012 21:51:26 +0000 (17:51 -0400)]
Add PRESUBMIT.cfg

This project uses tabs and has its own license so we it needs this
config file.

BUG=none
TEST=repo upload worked on a change made within the project while it
failed prior to this file being created

Change-Id: I04d8bc820a71f2ca7ad668495ff8e9029722dde6
Reviewed-on: https://gerrit.chromium.org/gerrit/30464
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Jeff Disher <disher@chromium.org>
Tested-by: Jeff Disher <disher@chromium.org>
2 years agoDon't copy fb0 if resolutions differ
Sean Paul [Fri, 10 Aug 2012 20:40:21 +0000 (13:40 -0700)]
Don't copy fb0 if resolutions differ

Don't copy fb0 if the resolutions don't match. This causes a segfault
when booting with HDMI connected.

BUG=chrome-os-partner:12534
TEST=Booted snow with HDMI connected, verified the screen came up

Change-Id: I9a10eae3fe23ec275e3104e192154062d987d6c2
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/29915
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
2 years agoFixes X crash on boot, when HDMI is connected
akshu agrawal [Thu, 9 Aug 2012 10:41:01 +0000 (16:11 +0530)]
Fixes X crash on boot, when HDMI is connected

When HDMI is connected and we boot the FB size is 1920x1080.
Thus, copying /dev/fb0 contents to scanout buffer causes crash.

Change-Id: If4387052baf242114caab3ea322dc726fa91bdbe
Signed-off-by: akshu agrawal <akshu.a@samsung.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/29759
Reviewed-by: Shirish S <shirish@chromium.org>
Reviewed-by: Prashanth Godrehal <prashanth.g@samsung.com>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Ready: Stéphane Marchesin <marcheu@chromium.org>
Commit-Ready: Akshu Agrawal <akshu@chromium.org>
Tested-by: Akshu Agrawal <akshu@chromium.org>
2 years agoRevert "armsoc: HACK: Avoid blitting and always flip" factory-2717.B factory-2723.14.orig.B
Abhinav Kochhar [Fri, 3 Aug 2012 20:53:45 +0000 (13:53 -0700)]
Revert "armsoc: HACK: Avoid blitting and always flip"

This reverts commit b016434e23539c462591a18082e98e51e9f6a2e8.
Now after having the changes in where the clients are ignored
at VT switch we can revert this workaround

Change-Id: I749ddddf5c11a4c910797287cc90e881b62867b5
Reviewed-on: https://gerrit.chromium.org/gerrit/29204
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
Tested-by: Abhinav Kochhar <abhinav@chromium.org>
Commit-Ready: Abhinav Kochhar <abhinav@chromium.org>
Commit-Ready: Mandeep Singh Baines <msb@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
2 years agoarmsoc: Ignore/Add X clients at VT switch
abhinav.k [Tue, 31 Jul 2012 18:29:19 +0000 (11:29 -0700)]
armsoc: Ignore/Add X clients at VT switch

This patch will ignore the clients when we leave
current VT and add to the service list again when
we enter VT.

BUG=chrome-os-partner:11708
TEST=tested suspend/resume iterations on lucas

Change-Id: I5ea5293115ef81d189ebe0c0da3cce41ade1019a
Signed-off-by: Abhinav Kochhar <abhinav@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/28831
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
Commit-Ready: Mandeep Singh Baines <msb@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
2 years agoarmsoc: Force page flip event even if crtc disabed
Abhinav Kochhar [Thu, 2 Aug 2012 21:09:53 +0000 (14:09 -0700)]
armsoc: Force page flip event even if crtc disabed

This patch will ensure that the last schedule swap is acknowledged
by the driver by completing the page flip ioctl and sending the
event for swap complete.
This fixes the issue when the screen goes "dim" and X had issued a swap
call A->B. Meanwhile before the swap was completed the crtc was disabled
and a corresponding check for this in the armsoc ddx could not complete the
page flip.
This resulted in crash when X tried to swap again from the same
buffers A->B instead of B->A.

BUG=chrome-os-partner:12083
TEST=tested with screen idle->dim->resume

Change-Id: I724420a95a85500b7bd7f9258a59bad43493c55d
Signed-off-by: Akshu Agarwal <akshu@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/29074
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Anush Elangovan <anush@google.com>
Tested-by: Anush Elangovan <anush@google.com>
Commit-Ready: Abhinav Kochhar <abhinav@chromium.org>

2 years agoImplement smooth bootup firmware-link-2695.2.B firmware-link-2695.B firmware-snow-2695.90.B firmware-snow-2695.B
Stéphane Marchesin [Thu, 26 Jul 2012 01:29:58 +0000 (18:29 -0700)]
Implement smooth bootup

We copy the /dev/fb0 contents on boot.

BUG=chrome-os-partner:11609
TEST=by hand

Change-Id: I4a8c6158c3c671fe9cf93d02031d98bd4b304b93
Reviewed-on: https://gerrit.chromium.org/gerrit/28460
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Anush Elangovan <anush@google.com>
Commit-Ready: Stéphane Marchesin <marcheu@chromium.org>

2 years agoarmsoc: HACK: Avoid blitting and always flip firmware-parrot-2685.B
Abhinav Kochhar [Thu, 26 Jul 2012 22:03:28 +0000 (15:03 -0700)]
armsoc: HACK: Avoid blitting and always flip

Blitting on the exynos5 seems to show flickering on the screen.
For some reason we seem to be failing the DRI2CanFlip() check
on suspend/resume. For now force the flip path.
This is also expected to fix one more case of the fimd irq

BUG=chrome-os-partner:11708
TEST=build armsoc and loop through 50 suspend/resume cycles

Change-Id: I154b82e73d4ee9c5b9f56a86fe3b28029825cd07
Signed-off-by: Anush Elangovan <anush@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/28521
Reviewed-by: Pawel Osciak <posciak@google.com>
Commit-Ready: Anush Elangovan <anush@google.com>
Tested-by: Anush Elangovan <anush@google.com>
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
2 years agoRevert "select() on dma_buf fd in cpu_prep (so PrepareAccess)."
David Garbett [Wed, 18 Jul 2012 22:47:28 +0000 (15:47 -0700)]
Revert "select() on dma_buf fd in cpu_prep (so PrepareAccess)."

This reverts commit 9c73490967e9c117db91ca5c1a34a357e35eb0dd

Causes X server crashes when multi-head is used.
Currently not used as corresponding poll() implementation has not been committed.

Change-Id: I0af881ed634a2b6a6a19a6d6bb993f7146feed34
Reviewed-on: https://gerrit.chromium.org/gerrit/27823
Tested-by: David Garbett <David.Garbett@arm.com>
Reviewed-by: Shirish S <s.shirish@samsung.com>
Reviewed-by: Anush Elangovan <anush@google.com>
Commit-Ready: Anush Elangovan <anush@google.com>

2 years agoxf86-video-armsoc: Add workaround for VT2 issues.
Stéphane Marchesin [Wed, 18 Jul 2012 00:24:04 +0000 (17:24 -0700)]
xf86-video-armsoc: Add workaround for VT2 issues.

The real issue is double:
- we need refcounting on the pixmaps
- we need to allocate in CreatePixmap and not in ModifyPixmapHeader

BUG=chromeos-partner:11059
TEST=by hand

Change-Id: I27636bfbab1aa1ef8579837e4cc22c41e1095bcd
Reviewed-on: https://gerrit.chromium.org/gerrit/27730
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: David Garbett <David.Garbett@arm.com>
Commit-Ready: Anush Elangovan <anush@google.com>
Reviewed-by: Anush Elangovan <anush@google.com>
2 years agoselect() on dma_buf fd in cpu_prep (so PrepareAccess).
David Garbett [Mon, 2 Jul 2012 09:15:47 +0000 (10:15 +0100)]
select() on dma_buf fd in cpu_prep (so PrepareAccess).

Only attach dma_buf to dumb buffers that back DRI2 Buffers, so the fd limit is
not reached.

If poll() is not implemented on the dma_buf file then the select() does
nothing.

Reference counts the dmabuf on the bo, for cases where multiple DRI2Buffers
wrap the scannout Pixmap.

(cherry picked from commit 7ed84240beac96998cb34790db9cf1f41bd90597
 from git.linaro.org)

BUG=None
TEST=None

Change-Id: I207ad06f09bdfa01c73507125ad93bd61ec4e828
Signed-off-by: David Garbett <David.Garbett@arm.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/26982
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Ready: Anush Elangovan <anush@google.com>

2 years agodrmmode_display.c :Exynos: Fix HDMI hotplugging
Shirish S [Sat, 14 Jul 2012 02:34:24 +0000 (19:34 -0700)]
drmmode_display.c :Exynos: Fix HDMI hotplugging

HDMI when plugged in or out calls for a screen resize,
Xserver invalidates only the front buffer on resize but
for flipping the back buffer also needs to be invalidated.
This patch uses flag to release the back buffer.

BUG=chrome-os-partner:10851
TEST=Plugged in/out HDMI cable several times on snow,
     both in login screen and after login, the resolution
               switches accordingly

Change-Id: Ia333645c4ba93d1cb14a2b4760e76dbbcf7aef28
Signed-off-by: Shirish S <s.shirish@samsung.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/27447
Reviewed-by: Anush Elangovan <anush@google.com>
Reviewed-by: Ray Smith <Raymond.Smith@arm.com>
2 years agoFix transition between non-flippable and flippable
Raymond Smith [Wed, 20 Jun 2012 09:50:39 +0000 (10:50 +0100)]
Fix transition between non-flippable and flippable

Before this patch it was not possible for a window to be moved to
the origin and have it begin page flipping. Because the size didn't
change, the DRI2 buffers would never get re-allocated and the buffers
would remain without a DRM fb and therefore unable to be flipped to.

This change forces DRI2 buffers to be re-allocated whenever a
drawable transitions between being flippable and non-flippable, and
vice versa. This both allows previously non-flippable windows to
start flipping, and saves possibly scarce scanout-capable memory
when a flippable window becomes non-flippable again.

As a somewhat unrelated change, this patch also removes the
possibility of exchanging pixmaps to effect a swap. This is because
it crashed whenever we hit this case, and we don't understand enough
what is meant by exchange to be able to implement it properly.

(cherry picked from commit 4a0c0aadb21782d81bdfb4a287b72b4c473c1e5c
 from git.linaro.org)

BUG=None
TEST=None

Change-Id: I22777525cc9085f510fb0924e7981179a7cdb1ce
Signed-off-by: David Garbett <David.Garbett@arm.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/26981
Reviewed-by: Anush Elangovan <anush@google.com>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Ray Smith <Raymond.Smith@arm.com>
Reviewed-by: Akshu Agrawal <akshu@chromium.org>
2 years agoDumb: Adds a function to return mapped address
Akshu Agrawal [Tue, 3 Jul 2012 00:39:30 +0000 (17:39 -0700)]
Dumb: Adds a function to return mapped address

This function will return user virtual address for the buffer
if it is mapped. If not, then NULL as is initialized with same.

Change-Id: I772d7fc7d279edf9171667ea53fe2ab530249efe
Signed-off-by: Akshu Agrawal <akshu.a@samsung.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/26628
Reviewed-by: Akshu Agrawal <akshu@chromium.org>
Tested-by: Akshu Agrawal <akshu@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Abhinav Kochhar <abhinav@chromium.org>
Commit-Ready: Anush Elangovan <anush@google.com>

2 years agoRemove vbe.h include.
Stéphane Marchesin [Thu, 28 Jun 2012 21:58:45 +0000 (14:58 -0700)]
Remove vbe.h include.

Vesa is not needed, and is of no use on ARM.

BUG=none
TEST=emerge by hand

Change-Id: I02e7346eefc4713f4c97f59b4518844ea4dd2f98
Reviewed-on: https://gerrit.chromium.org/gerrit/26349
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Anush Elangovan <anush@google.com>
Commit-Ready: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Akshu Agrawal <akshu@chromium.org>
Tested-by: Akshu Agrawal <akshu@chromium.org>
Commit-Ready: Akshu Agrawal <akshu@chromium.org>

2 years agoChange DRI2 driver name "omap" -> "armsoc" factory-2475.B
John Sheu [Sat, 16 Jun 2012 00:44:24 +0000 (17:44 -0700)]
Change DRI2 driver name "omap" -> "armsoc"

BUG=chrome-os-partner:10059
TEST=local build, run on ARM

Change-Id: I0d3dac85b66593ee408ed343b8d6e49b639915ec
Reviewed-on: https://gerrit.chromium.org/gerrit/25458
Reviewed-by: Anush Elangovan <anush@google.com>
Tested-by: John Sheu <sheu@chromium.org>
Commit-Ready: John Sheu <sheu@chromium.org>

2 years agodrmmode_display.c :Exynos: Fix the flicker issue in HW cursor factory-2460.B release-R21-2465.B
Akshu [Thu, 14 Jun 2012 04:03:08 +0000 (21:03 -0700)]
drmmode_display.c :Exynos: Fix the flicker issue in HW cursor

To enable the overlay for HW cursor layer a specific ioctl need to
be called. This Ioctl will set the postion of layer and thus calling
chroma keying, which is required for overlay.

BUG=Flicker in browser tab is being observed which I guess
is in x86 too
TEST=Tested on Daisy with xorg.conf having HWCursor "true"

Change-Id: Ibf04777fa9da331e6b6d69713f324e7dbd862d1c
Signed-off-by: Akshu <akshu.a@samsung.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/25276
Reviewed-by: Anush Elangovan <anush@google.com>
2 years agoPass explicit dimensions when creating a buffer. factory-2394.B
David Garbett [Tue, 29 May 2012 12:00:52 +0000 (13:00 +0100)]
Pass explicit dimensions when creating a buffer.

Replace omap_bo_new interface from libdrm omap layer with omap_bo_new_with_dim,
which takes width, height and bpp instead of a size. This enables the
pitch and size calculations from the DRM driver to be used by the DDX driver.

Change-Id: I84543860f9b149fefbb65c6100eb7bf00598be78

Conflicts:

src/omap_driver.c

2 years agoRename 'omap' to 'armsoc' for driver binary
John Sheu [Thu, 31 May 2012 23:26:33 +0000 (16:26 -0700)]
Rename 'omap' to 'armsoc' for driver binary

This change doesn't actually do any identifier renaming in the sources
-- just renames the output binary to "armsoc_drv.so" for now.

BUG=chrome-os-partner:10055
TEST=local build and run
CQ-DEPEND:I477be20e4667149bab921babae83b2823ae79e34

Change-Id: Idb25d7653847f21f52e691801f661a5510a937aa
Reviewed-on: https://gerrit.chromium.org/gerrit/24269
Reviewed-by: Anush Elangovan <anush@google.com>
Reviewed-by: John Sheu <sheu@chromium.org>
Tested-by: John Sheu <sheu@chromium.org>
Commit-Ready: John Sheu <sheu@chromium.org>

2 years agoUse AC_CHECK_HEADER to check for DRI headers
John Sheu [Tue, 22 May 2012 23:46:28 +0000 (16:46 -0700)]
Use AC_CHECK_HEADER to check for DRI headers

Using AC_CHECK_FILE causes configure to abort on a cross-compiling
platform.

BUG=chrome-os-partner:9889
TEST=local build

Change-Id: Ifecd868317a0ac988e72d1205c50325d1976a17f
Reviewed-on: https://gerrit.chromium.org/gerrit/23297
Commit-Ready: Anush Elangovan <anush@google.com>
Reviewed-by: Anush Elangovan <anush@google.com>
Tested-by: Anush Elangovan <anush@google.com>
2 years agoDAISY: Stride value changed from 32 to 2 to support 1368x768
Akshu Agrawal [Wed, 23 May 2012 12:19:45 +0000 (13:19 +0100)]
DAISY: Stride value changed from 32 to 2 to support 1368x768

1366x768 is still an issue

Signed-off-by: Akshu Agrawal <akshu.a@samsung.com>
2 years agoPass 1 as flag to DRM_IOCTL_MODE_CREATE_DUMB.
David Garbett [Tue, 22 May 2012 17:14:40 +0000 (18:14 +0100)]
Pass 1 as flag to DRM_IOCTL_MODE_CREATE_DUMB.

Signifies to the Exynos DRM driver to use non-contiguous allocations.
Updated by changing the _WC flag in the omap libdrm interface.

2 years agoEnable handler of page flip events.
David Garbett [Tue, 22 May 2012 17:20:36 +0000 (18:20 +0100)]
Enable handler of page flip events.

2 years agoDon't change scanout if we blitted
Raymond Smith [Tue, 22 May 2012 14:07:26 +0000 (15:07 +0100)]
Don't change scanout if we blitted

We still scanout the same buffer if we blitted in DRI2ScheduleSwap,
so don't change it.

2 years agoFix error in allocating dumb bos of size 1
Raymond Smith [Fri, 18 May 2012 15:39:07 +0000 (16:39 +0100)]
Fix error in allocating dumb bos of size 1

A rounding error meant these were always turning into size 0 when
DRM converts the faked width and height back to a size.

2 years agoAdded omap_dumb.c to Makefile.
David Garbett [Wed, 16 May 2012 13:53:03 +0000 (14:53 +0100)]
Added omap_dumb.c to Makefile.

2 years agoRedefine omap specific flags as 0 in src/omap_drmif_fb.h.
David Garbett [Fri, 11 May 2012 16:00:48 +0000 (17:00 +0100)]
Redefine omap specific flags as 0 in src/omap_drmif_fb.h.

2 years agoRemoved omap_drmif.h
David Garbett [Fri, 11 May 2012 15:41:10 +0000 (16:41 +0100)]
Removed omap_drmif.h

Using the version from libdrm instead. Created omap_drmif_fb to contain the
extra functions added (for getting and setting the framebuffer).

2 years agoAdded MIT header to omap_dumb.c
David Garbett [Fri, 11 May 2012 15:22:13 +0000 (16:22 +0100)]
Added MIT header to omap_dumb.c

2 years agoRemoved references to drmmode_remove_fb.
David Garbett [Fri, 11 May 2012 12:22:51 +0000 (13:22 +0100)]
Removed references to drmmode_remove_fb.

2 years agoReadded code to create scanout FB into set_mode_major as there is no call to realloca...
David Garbett [Fri, 11 May 2012 12:12:50 +0000 (13:12 +0100)]
Readded code to create scanout FB into set_mode_major as there is no call to reallocate_scannout_buffer (which no longer exists) to do it.

2 years agoExplicitly set DRI2 flags to 0
Raymond Smith [Thu, 10 May 2012 06:41:34 +0000 (07:41 +0100)]
Explicitly set DRI2 flags to 0

We use the flags as the offset into the buffer, so better make sure it's always
valid.

2 years agoOnly exchange if the new buffer has a framebuffer
David Garbett [Wed, 9 May 2012 17:02:02 +0000 (18:02 +0100)]
Only exchange if the new buffer has a framebuffer

2 years agoCheck that the drawable can still be flipped at ScheduleSwap time, in case something...
David Garbett [Wed, 9 May 2012 17:00:48 +0000 (18:00 +0100)]
Check that the drawable can still be flipped at ScheduleSwap time, in case something has changed since the buffers were created (such as the window resizing).

2 years agoDon't leak drmModePageFlip events
Raymond Smith [Wed, 9 May 2012 12:04:51 +0000 (13:04 +0100)]
Don't leak drmModePageFlip events

Tidying up the hack a little to not request an event back from drmModePageFlip
if we know we can't handle it. Otherwise we ended up running out of memory in
the kernel because all the events got leaked.

As it's now two changes, added a quick #if to handle both cases.

2 years agoRemove a few unused variables
Raymond Smith [Wed, 9 May 2012 06:01:06 +0000 (07:01 +0100)]
Remove a few unused variables

2 years agoUpdate pOMAP->scanout on page flip too
David Garbett [Fri, 11 May 2012 11:17:34 +0000 (12:17 +0100)]
Update pOMAP->scanout on page flip too

When we do a page flip a new omap_bo gets scanned out, so this
updates pOMAP->scanout accordingly after a page flip has completed.

Conflicts:

src/drmmode_display.c

2 years agoAssert dumb bo and fb deletion succeeds
Raymond Smith [Wed, 2 May 2012 10:09:30 +0000 (11:09 +0100)]
Assert dumb bo and fb deletion succeeds

To warn upon double deletion of dumb bos and DRM fbs

2 years agoMove page flip handler hack
Raymond Smith [Wed, 2 May 2012 09:27:51 +0000 (10:27 +0100)]
Move page flip handler hack

2 years agoNever delete fb in DRI2DestroyBuffer
Raymond Smith [Wed, 2 May 2012 09:16:56 +0000 (10:16 +0100)]
Never delete fb in DRI2DestroyBuffer

Just missed this from the previous commit

2 years agoDumb implementation for omap_bo fb tracking
Raymond Smith [Wed, 2 May 2012 08:34:32 +0000 (09:34 +0100)]
Dumb implementation for omap_bo fb tracking