Commit Graph

7727 Commits

Author SHA1 Message Date
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
Chris Wilson 3e784832a5 glamor: Enable Xv support
In addition to the UXA texture paths (which in theory support VSync) and
direct overlay support, create a textured video paths that utilize the
glamor acceleration code.

Requested-by: Fabio Pedretti <fabio.ped@libero.it>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74311
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-01 16:59:13 +00:00
Chris Wilson 3f2e199b6b 2.99.908 snapshot 2014-02-01 09:07:13 +00:00
Chris Wilson 1f9a6156e9 sna: remove short-circuit for move-to-CPU when damage covers region
The short-circuit path missed translating the damage from drawable space
into the pixmap (for Composite setups) which may have resulted in
corruption. The path was also failing to consider the impact of reusing
an active CPU bo when it could be discarding the unwanted damage and
reallocating.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-31 20:42:51 +00:00
Chris Wilson 539b749416 sna: Use 24bpp rendering by default for gen2 again
Too many users where unhappy that their software was broken. Too bad the
same software is also broken at high bit depths as well.

References: https://bugs.freedesktop.org/show_bug.cgi?id=73877
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-31 20:42:51 +00:00
Chris Wilson bdb1a62ce2 sna: Balance memory accounting for buffer objects
A couple bugs ended up with CPU bo gradually accumulating whilst the
overall number of bo vanished.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-31 16:42:46 +00:00
Chris Wilson f934ee78a0 sna: Reorder assignments vs DBG
It helps reading the debug log if what we print is correct.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-31 15:39:23 +00:00
Chris Wilson bdbb928ea3 sna: Actually reuse pixmap headers for ordinary pixmaps
commit 3dbf17f00e [2.99.907]
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Dec 3 12:10:01 2013 +0000

    sna: Mark up an ordinary pixmap for reuse

started to put the frequently allocated pixmaps into the object cache -
but as those frequent allocations themselves did not use the cache, the
cache kept growing.

Bugzilla: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1272338
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-31 15:20:11 +00:00
Chris Wilson dfac4650e6 sna: Tidy up pixmap header allocations
Refactor some more of the common code, and add some debug tracking.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-31 14:29:50 +00:00
Chris Wilson 098a1163e9 sna: Show the memory debug info again
This needs to be visible whenever we --enable-debug=memory. Make it so,
and trim it to a single line in the process.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-31 14:29:49 +00:00
Chris Wilson 166e8e9e5d sna: Silence a compiler warning for mismatching const strings
sna_display.c: In function 'preferred_mode':
sna_display.c:3393:7: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]
  mode = xf86GetOptValString(output->options, OPTION_PREFERRED_MODE);

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-30 12:24:47 +00:00
Chris Wilson ca2d9e69d0 sna: Suppress warning for freeing a "constant" string
We allocated and own the string, so we can free it!

sna_display.c: In function 'sna_output_get_modes':
sna_display.c:2314:4: warning: passing argument 1 of 'free' discards 'const' qualifier from pointer target type [enabled by default]
    free(current->name);

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-30 12:24:47 +00:00