Before attaching properties to any connector, check that we can indeed
control the backlight through the sysfs interface by doing an access
check. If the xserver is started without root privileges, we cannot
write through /sys/class/backlight and so should take care not to
advertise that we can.
Reported-by: Hans de Geode <hdegeode@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
The sprite plane can be independently rotated to the CRTC primary plane.
To rotate the sprite plane, we just set a property on the plane similar
to how we rotate the CRTC, so we can refactor them together to use the
same routines.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Otherwise X tells Clients that the cursor is still in the unrotated
location when it appears rotated on the display.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This reverts commit 4497212307.
Unfortunately, this simple fix does not work for UXA as DPMS is used by
the xserver to turn off CRTCs and outputs. Since UXA does not implement
CRTC DPMS, this commit causes us to fail to turn off outputs.
The kernel has been fixed up in the meantime and that commit has been
recommended to be backported to all stable kernels:
commit c9976dcf55c8aaa7037427b239f15e5acfc01a3a
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Sun Sep 29 19:15:07 2013 +0100
drm/i915: Only apply DPMS to the encoder if enabled
so it should be safe for UXA to rely on its old behaviour.
Bugzilla: https://code.google.com/p/chromium/issues/detail?id=341135
References: https://bugs.freedesktop.org/show_bug.cgi?id=68030
Suggested-by: Dominik Behr <dbehr@google.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
In some cases, such as querying the mode from the CRTC, we may not have
a name associated with the mode. However, RandR always expects a valid
name. To satisfy this requirement, always generate the canonical mode
name if no other is specified.
References: https://bugs.freedesktop.org/show_bug.cgi?id=70132
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
When we change the blend mode between operations, it appears that we
must flush the render cache or else we risk render corruption. This is
usually noticeable in rendering of single glyphs.
This was originally fixed for bug 51422, but was reintroduced by
commit 37eb7343be
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Sat Dec 1 09:40:11 2012 +0000
sna/gen5: Inspired by gen4, reorder the flushing
and the desire to reduce the impact of this w/a.
Reported-by: itumaykin@gmail.com
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74882
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If all the outputs are off, we try to resize the screen to 1x1, which is
typically illegal. So, just keep the existing screen and xfer buffer for
next time it is enabled.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Use the display hardware for simple rotations, when exported through the
rotation property on the CRTC.
As the kernel support is not yet merged upstream, the feature is hidden
behind --enable-rotation.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This reverts commit 2a5ad9c015.
Oops, pushed from the wrong machine and merged in a incomplete bugfix
branch.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
When flushing between operations, we can choose between doing a full
flush to memory, or just a pipeline flush. For debugging it is better to
do the full flush to rule out cache effects.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
The MOVE_READ else branch is repeated immediately below when marking up
damage for MOVE_WRITE, so remove it for simplicity.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
When preparing a pixmap for CPU rendering, one of the last steps is to
copy the outstanding GPU damage back to the CPU. Currently, we flush any
outstanding pageflips (for TearFree) and in the process accidentally
destroy the shadow buffer if there is no outstanding GPU damage. Rearrange
the code to avoid tripping over that by only processing the move-to-gpu if
we need to touch the GPU bo.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
An optimisation for 1x1 reads of a clear buffer lead to a bug whereby
the damage for a 1x1 write would not be tracked correctly (conflicting
full GPU damage vs partial CPU damage).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
commit 82e6d41c2f
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Thu Oct 31 13:35:59 2013 +0000
sna/gen6: Tweak flush around CC state changes
Replaced the pipeline stall with a flush - but only when the target was
dirty. The missing stall however seems to be required as well.
v2: Actually emit the stall for all CC state changes [Ilia Mirkin]
Reported-by: Ilia Mirkin <imirkin@alum.mit.edu>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72375
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Since we call kgem_bo_submit() along one path when synchronising a
cached bo (which is known to be inactive) but still want to keep the
assertion on the refcnt, simply rearrange the code to only assert on the
active path.
References: https://bugs.freedesktop.org/show_bug.cgi?id=73406
Reported-by: Matti Hamalainen <ccr@tnsp.org>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
One day, just not today, we may make gen4 work correctly, efficiently and
fast. Today, we can barely pick one.
References: https://bugs.freedesktop.org/show_bug.cgi?id=55500
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
One path uses the mask channel, the other does not. We cannot rely on
overwriting all reused state in this case, and so we must clear the
composite state prior to use each time.
Reported-by: Arkadiusz Miskiewicz <arekm@maven.pl>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74494
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Tested-by: Arkadiusz Miskiewicz <arekm@maven.pl>
Logic reversal in discarding CPU damage. An old bug revealed by the more
aggressive attempts to discard CPU damage.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If the CPU bo is wholly damaged, then it makes an ideal candidate for
simply converting into the GPU bo.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If we upload outside of the replaced region to the GPU, we need to
remark the region of operation as dirty.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
When considering move-region-to-cpu, we need to take into account that
the region may not replace the whole drawable, in which case we cannot
simply dispose of an active CPU bo.
Reported-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reported-by: Conley Moorhous <conleymoorhous@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74327
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>