Commit Graph

7738 Commits

Author SHA1 Message Date
Chris Wilson 611490a176 sna: Check for access to backlight interface
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>
2014-02-13 16:18:43 +00:00
Chris Wilson 83d17cded8 sna: Clear DPMS tracking on VT switch
Assume the worst and force us to reset the property when we restore
control.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-13 14:55:30 +00:00
Chris Wilson 135da29410 sna: Extend native rotation support to sprites
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>
2014-02-13 14:55:30 +00:00
Chris Wilson e35017e36e sna: Enable coordinate transforms for native CRTC rotation
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>
2014-02-13 14:55:30 +00:00
Chris Wilson 72e909953c Revert "uxa: Do not change DPMS mode on unconnected outputs"
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>
2014-02-13 09:52:32 +00:00
Chris Wilson 1c5ccf5d9d sna: Always assign a name to the modes
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>
2014-02-13 01:10:48 +00:00
Chris Wilson fb89bfc73f sna/gen5: Flush the render cache between operations
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>
2014-02-12 16:46:04 +00:00
Chris Wilson 564a766a6b intel-virtual-output: Do not resize the screen whilst all outputs are off
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>
2014-02-12 16:21:30 +00:00
Chris Wilson 87b9d9f507 intel-virtual-output: Force an output probe on initial connection to remote display
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-12 15:56:45 +00:00
Chris Wilson dda57f2e28 intel-virtual-output: Fix checking for no change in output modes
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-12 15:56:45 +00:00
Chris Wilson 94e5ca3d5a intel-virtual-output: Always requery modes after OutputNotify
References: https://bugs.freedesktop.org/show_bug.cgi?id=74800
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-12 15:13:42 +00:00
Chris Wilson d84940cc9d intel-virtul-output: Double check timestamps
Compare both res->timestamp and res->configTimestamp for changes in
state.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-12 14:48:24 +00:00
Chris Wilson 607737cc47 sna: Support native primary plane rotations
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>
2014-02-12 14:26:21 +00:00
Chris Wilson 3b43630f55 Revert "sna/gen6: Serialise write to DERRMR register using STORE_REGISTER_MEM"
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>
2014-02-12 10:44:46 +00:00
Chris Wilson fb69bd16a3 sna/gen5: Use the DBG option ALWAYS_FLUSH to force a full flush
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>
2014-02-12 10:34:34 +00:00
Chris Wilson 77f8d9ca84 Merge branch 'master' of hsw:/usr/src/xf86-video-intel 2014-02-12 10:32:50 +00:00
Chris Wilson 27663f3116 sna/gen5: Add a DBG option to force flushes between operations
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-12 09:58:06 +00:00
Chris Wilson 834e8078fc sna: Retrieve tiling for fbcon
Yikes, there appear to be tiled fbcon framebuffers on the horizon.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-12 09:50:35 +00:00
Chris Wilson 69d4c15d52 sna: Delete redundant branch
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>
2014-02-12 08:00:44 +00:00
Chris Wilson ec39adc93a Record Video ABI version that we configure against
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-11 23:08:35 +00:00
Chris Wilson 3fb39d4779 Merge branch 'master' of hsw:/usr/src/xf86-video-intel 2014-02-11 21:57:23 +00:00
Chris Wilson c02067dcf5 sna: Defer move-to-gpu until we need to transfer GPU damage to CPU
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>
2014-02-11 21:32:04 +00:00
Chris Wilson 2a5ad9c015 sna/gen6: Serialise write to DERRMR register using STORE_REGISTER_MEM
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-11 11:23:37 +00:00
Chris Wilson 5142d1ca3f sna: Remove damaged region after converting CPU bo to GPU bo
Reported-by: Jiri Slaby <jirislaby@gmail.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=70461
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-10 16:42:06 +00:00
Chris Wilson 1267235fd4 sna: Check for overwriting damage before applying clear
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-10 16:39:17 +00:00
Chris Wilson 2f99070708 sna: Clear GPU damage flag for 1x1 writes onto a clear buffer
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>
2014-02-10 14:19:53 +00:00
Chris Wilson 2fb2cd092d 2.99.910 snapshot 2014-02-10 09:38:16 +00:00
Chris Wilson 37d8566ee7 sna/gen6: Restore stall dropped when not flushing instead
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>
2014-02-10 08:54:57 +00:00
Chris Wilson 823382d289 sna: And clear drawable->id on reused pixmaps
References: https://bugs.freedesktop.org/show_bug.cgi?id=74550
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-06 10:13:41 +00:00
Chris Wilson 6fc46adb18 uxa: Do not expose TextureVideo Xv adapters when acceleration is disabled
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-06 09:24:17 +00:00
Chris Wilson 1eadd1d0b1 sna: Add some DBG to clarify the source pixmap (for tiles)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-06 09:04:30 +00:00
Chris Wilson 4d1a2ef955 sna: Reset composite offsets when reusing freed pixmaps
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74550
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-06 08:29:20 +00:00
Chris Wilson 79d2f96bdf sna: Add some DBG around tiled blts
References: https://bugs.freedesktop.org/show_bug.cgi?id=74550
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-05 15:30:30 +00:00
Chris Wilson 02eceefa29 sna: Pass read hints from move-to-cpu to wait_for_shadow
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-05 11:44:01 +00:00
Chris Wilson de73c5fd1c sna: Tweak assert_bo_retired() to be callable on cached bo
References: https://bugs.freedesktop.org/show_bug.cgi?id=73406
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-04 20:57:24 +00:00
Chris Wilson 0906769c1b sna: Rearrange assertion to ease use of substitute cached bo
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>
2014-02-04 18:03:06 +00:00
Chris Wilson fc001615ff sna/gen4: Disable use of pipecontrol invalidates again
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>
2014-02-04 10:36:21 +00:00
Chris Wilson c6a21f0355 sna/glyphs: Reset composite state between switching glyph formats
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>
2014-02-04 09:56:44 +00:00
Edward Sheldrake 1cbc59a917 sna/gen4,5: Fix setting pipe control cache flush bits
Cache flush bits are on dword 0, not 1, on gen4 and gen5. Also texture
cache invalidate is only available from Cantiga onwards.
2014-02-03 10:04:15 +00:00
Chris Wilson 7f08250a89 sna: Reconstruct damage for the partially replaced discarded CPU bo
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-02 03:52:11 +00:00
Chris Wilson 853588ad5b sna: If IGNORE_CPU is not set we must mark the move as MOVE_READ
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>
2014-02-01 21:55:09 +00:00
Chris Wilson 8b0748c57e sna: Add some more DBG for choosing render targets
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-01 21:54:43 +00:00
Chris Wilson ed8d4f0ce3 sna: Skip discarding CPU bo when using as a render target
The issue with unwanted serialisation does not affect the async
move-to-cpu of a render target.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-01 21:43:02 +00:00
Chris Wilson 26613b0460 sna: Allow more inplace promotions of CPU to GPU bo
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>
2014-02-01 21:40:54 +00:00
Chris Wilson 699b4fd313 sna: Undo region translation before returning
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-01 20:14:07 +00:00
Chris Wilson 2c4b2ed558 2.99.909 snapshot 2014-02-01 18:57:29 +00:00
Chris Wilson 495bf89496 sna: Apply drawable offsets to partial CPU damage being replaced
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-01 18:57:29 +00:00
Chris Wilson 2ba8d40bf7 sna: Don't discard the GPU prior to using it for stashing CPU damage
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-01 18:13:37 +00:00
Chris Wilson 534f19dc5a sna: Remark the region as damaged after uploading the rest to the GPU
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>
2014-02-01 17:56:58 +00:00
Chris Wilson 2814748b91 sna: Only discard CPU damage for an replacing region
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>
2014-02-01 17:46:14 +00:00