platform/upstream/xf86-video-intel.git
10 years ago2.99.910 snapshot 2.99.910
Chris Wilson [Mon, 10 Feb 2014 09:35:11 +0000 (09:35 +0000)]
2.99.910 snapshot

10 years agosna/gen6: Restore stall dropped when not flushing instead
Chris Wilson [Sun, 9 Feb 2014 12:28:27 +0000 (12:28 +0000)]
sna/gen6: Restore stall dropped when not flushing instead

commit 82e6d41c2f4f343bd1854d3d8ee4b624b5d68971
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>
10 years agosna: And clear drawable->id on reused pixmaps
Chris Wilson [Thu, 6 Feb 2014 10:13:41 +0000 (10:13 +0000)]
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>
10 years agouxa: Do not expose TextureVideo Xv adapters when acceleration is disabled
Chris Wilson [Thu, 6 Feb 2014 09:24:17 +0000 (09:24 +0000)]
uxa: Do not expose TextureVideo Xv adapters when acceleration is disabled

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Add some DBG to clarify the source pixmap (for tiles)
Chris Wilson [Thu, 6 Feb 2014 09:04:30 +0000 (09:04 +0000)]
sna: Add some DBG to clarify the source pixmap (for tiles)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Reset composite offsets when reusing freed pixmaps
Chris Wilson [Thu, 6 Feb 2014 08:29:20 +0000 (08:29 +0000)]
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>
10 years agosna: Add some DBG around tiled blts
Chris Wilson [Wed, 5 Feb 2014 15:30:30 +0000 (15:30 +0000)]
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>
10 years agosna: Pass read hints from move-to-cpu to wait_for_shadow
Chris Wilson [Wed, 5 Feb 2014 11:41:42 +0000 (11:41 +0000)]
sna: Pass read hints from move-to-cpu to wait_for_shadow

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Tweak assert_bo_retired() to be callable on cached bo
Chris Wilson [Tue, 4 Feb 2014 20:57:24 +0000 (20:57 +0000)]
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>
10 years agosna: Rearrange assertion to ease use of substitute cached bo
Chris Wilson [Tue, 4 Feb 2014 17:51:51 +0000 (17:51 +0000)]
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>
10 years agosna/gen4: Disable use of pipecontrol invalidates again
Chris Wilson [Tue, 4 Feb 2014 10:36:21 +0000 (10:36 +0000)]
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>
10 years agosna/glyphs: Reset composite state between switching glyph formats
Chris Wilson [Tue, 4 Feb 2014 08:51:17 +0000 (08:51 +0000)]
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>
10 years agosna/gen4,5: Fix setting pipe control cache flush bits
Edward Sheldrake [Mon, 3 Feb 2014 09:34:33 +0000 (09:34 +0000)]
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.

10 years agosna: Reconstruct damage for the partially replaced discarded CPU bo
Chris Wilson [Sun, 2 Feb 2014 03:52:11 +0000 (03:52 +0000)]
sna: Reconstruct damage for the partially replaced discarded CPU bo

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: If IGNORE_CPU is not set we must mark the move as MOVE_READ
Chris Wilson [Sat, 1 Feb 2014 21:55:09 +0000 (21:55 +0000)]
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>
10 years agosna: Add some more DBG for choosing render targets
Chris Wilson [Sat, 1 Feb 2014 21:54:43 +0000 (21:54 +0000)]
sna: Add some more DBG for choosing render targets

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Skip discarding CPU bo when using as a render target
Chris Wilson [Sat, 1 Feb 2014 21:38:47 +0000 (21:38 +0000)]
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>
10 years agosna: Allow more inplace promotions of CPU to GPU bo
Chris Wilson [Sat, 1 Feb 2014 21:37:41 +0000 (21:37 +0000)]
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>
10 years agosna: Undo region translation before returning
Chris Wilson [Sat, 1 Feb 2014 20:13:53 +0000 (20:13 +0000)]
sna: Undo region translation before returning

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years ago2.99.909 snapshot 2.99.909
Chris Wilson [Sat, 1 Feb 2014 17:59:29 +0000 (17:59 +0000)]
2.99.909 snapshot

10 years agosna: Apply drawable offsets to partial CPU damage being replaced
Chris Wilson [Sat, 1 Feb 2014 18:57:06 +0000 (18:57 +0000)]
sna: Apply drawable offsets to partial CPU damage being replaced

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Don't discard the GPU prior to using it for stashing CPU damage
Chris Wilson [Sat, 1 Feb 2014 18:13:04 +0000 (18:13 +0000)]
sna: Don't discard the GPU prior to using it for stashing CPU damage

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Remark the region as damaged after uploading the rest to the GPU
Chris Wilson [Sat, 1 Feb 2014 17:56:58 +0000 (17:56 +0000)]
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>
10 years agosna: Only discard CPU damage for an replacing region
Chris Wilson [Sat, 1 Feb 2014 17:37:42 +0000 (17:37 +0000)]
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>
10 years agoglamor: Enable Xv support
Chris Wilson [Sat, 1 Feb 2014 16:55:32 +0000 (16:55 +0000)]
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>
10 years ago2.99.908 snapshot 2.99.908
Chris Wilson [Fri, 31 Jan 2014 17:59:30 +0000 (17:59 +0000)]
2.99.908 snapshot

10 years agosna: remove short-circuit for move-to-CPU when damage covers region
Chris Wilson [Fri, 31 Jan 2014 20:02:44 +0000 (20:02 +0000)]
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>
10 years agosna: Use 24bpp rendering by default for gen2 again
Chris Wilson [Fri, 31 Jan 2014 18:02:51 +0000 (18:02 +0000)]
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>
10 years agosna: Balance memory accounting for buffer objects
Chris Wilson [Fri, 31 Jan 2014 16:42:46 +0000 (16:42 +0000)]
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>
10 years agosna: Reorder assignments vs DBG
Chris Wilson [Fri, 31 Jan 2014 15:39:23 +0000 (15:39 +0000)]
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>
10 years agosna: Actually reuse pixmap headers for ordinary pixmaps
Chris Wilson [Fri, 31 Jan 2014 15:03:43 +0000 (15:03 +0000)]
sna: Actually reuse pixmap headers for ordinary pixmaps

commit 3dbf17f00e200e864818b0b8ca762183cff9085f [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>
10 years agosna: Tidy up pixmap header allocations
Chris Wilson [Fri, 31 Jan 2014 14:28:56 +0000 (14:28 +0000)]
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>
10 years agosna: Show the memory debug info again
Chris Wilson [Fri, 31 Jan 2014 14:10:36 +0000 (14:10 +0000)]
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>
10 years agosna: Silence a compiler warning for mismatching const strings
Chris Wilson [Thu, 30 Jan 2014 12:19:04 +0000 (12:19 +0000)]
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>
10 years agosna: Suppress warning for freeing a "constant" string
Chris Wilson [Thu, 30 Jan 2014 12:18:05 +0000 (12:18 +0000)]
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>
10 years agosna: Handle char *backlight_iface
Chris Wilson [Thu, 30 Jan 2014 12:17:02 +0000 (12:17 +0000)]
sna: Handle char *backlight_iface

The backlight_iface is a freeable string, in places we were assigning a
constant string and later freeing it.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Constify GCFunc to quieten the compiler.
Chris Wilson [Thu, 30 Jan 2014 12:13:16 +0000 (12:13 +0000)]
sna: Constify GCFunc to quieten the compiler.

We keep a pointer to the old funcs when wrapping, this now needs to be const.

sna_accel.c: In function 'sna_gc_move_to_cpu':
sna_accel.c:4008:17: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]
  sgc->old_funcs = gc->funcs;

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Fix format specifier typo ('%D') in DBG
Chris Wilson [Wed, 29 Jan 2014 16:48:21 +0000 (16:48 +0000)]
sna: Fix format specifier typo ('%D') in DBG

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Always clear the domain even only a potential sync
Chris Wilson [Wed, 29 Jan 2014 13:42:50 +0000 (13:42 +0000)]
sna: Always clear the domain even only a potential sync

It helps to keep the domain-tracking bookkeeping consistent.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: We can only retire a bo if is not referenced by the current batch
Chris Wilson [Wed, 29 Jan 2014 13:39:20 +0000 (13:39 +0000)]
sna: We can only retire a bo if is not referenced by the current batch

Fixes regression from
commit 8b0ebebcab21647348f769c25ca0c1d81d169e75
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Jan 28 16:30:47 2014 +0000

    sna: Be a little more assertive in retiring after set-domain

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74176
Reported-by: Jan Alexander Steffens <jan.steffens@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Add assertions for set/get binding
Chris Wilson [Wed, 29 Jan 2014 13:15:43 +0000 (13:15 +0000)]
sna: Add assertions for set/get binding

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna/gen4+: Assert that the cached binding location is valid
Chris Wilson [Wed, 29 Jan 2014 13:06:08 +0000 (13:06 +0000)]
sna/gen4+: Assert that the cached binding location is valid

We can at least check that it is in the right region (i.e. not past
where the current surface has been allocated from).

References: https://bugs.freedesktop.org/show_bug.cgi?id=74176
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Do not use color corrected pixel values for comparing against gc
Chris Wilson [Wed, 29 Jan 2014 11:15:45 +0000 (11:15 +0000)]
sna: Do not use color corrected pixel values for comparing against gc

Dashed zero-width lines devolve into two passes (first to draw the
foreground dashes, and then to draw the gaps). The code was using the
pixel value to decide which phase was being drawn -- however the color
on the gc is not always bit exact (e.g. alpha channel) with the pixel
value. As a result, we would oft miss drawing anything when rendering
into the scanout.

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1059152
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna/gen6+: Encourage inplace uploads for Composite
Chris Wilson [Wed, 29 Jan 2014 05:40:00 +0000 (05:40 +0000)]
sna/gen6+: Encourage inplace uploads for Composite

First try using the blt path for a potential inplace upload for a
simple composite operation copying from a ShmPixmap.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Skip undamaged TearFree redisplays
Chris Wilson [Wed, 29 Jan 2014 05:32:25 +0000 (05:32 +0000)]
sna: Skip undamaged TearFree redisplays

If we have not had cause to flush the wait_for_shadow buffer during the
course of the rendering, then we never wrote to the backbuffer and its
contents are still identical to the current frontbuffer. So if the
wait_for_shadow is still flagged as required on the scanout, we know we
can safely discard the redisplay request.

References: https://bugs.freedesktop.org/show_bug.cgi?id=70905
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agoAllow selection of glamor as the default acceleration method
Chris Wilson [Tue, 28 Jan 2014 21:56:23 +0000 (21:56 +0000)]
Allow selection of glamor as the default acceleration method

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74162
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Check for a hang after a spurious error return from set-domain-ioctl
Chris Wilson [Tue, 28 Jan 2014 19:17:14 +0000 (19:17 +0000)]
sna: Check for a hang after a spurious error return from set-domain-ioctl

set-domain-ioctl should only ever fail for invalid user input, beyond
the normal signal handling. As such if we do find a spurious error
return from the kernel, check for a GPU hang.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Be a little more assertive in retiring after set-domain
Chris Wilson [Tue, 28 Jan 2014 16:30:47 +0000 (16:30 +0000)]
sna: Be a little more assertive in retiring after set-domain

After a successful set-domain for writing with the CPU, we know that the
buffer is idle so remove it from our request tracking. (External clients
complicate matters in that they may keep the bo active even after our
set-domain.) On the contrary, because of read-read optimisations a bo
may still be active after a set-domain for reading by the CPU, in which
we need to remain conservative in retiring the bo.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Cancel the backlight change if set-property(DPMS) fails
Chris Wilson [Tue, 28 Jan 2014 12:51:00 +0000 (12:51 +0000)]
sna: Cancel the backlight change if set-property(DPMS) fails

If the kernel reports an error from setting the DPMS property, we need
to undo the local changes and propagate back the error to the caller.
Although the latter is prevented by the RandR API, we can at least
restore the backlight.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Rearrange damage allocation to handle malloc failure more gracefully
Chris Wilson [Mon, 27 Jan 2014 21:48:33 +0000 (21:48 +0000)]
sna: Rearrange damage allocation to handle malloc failure more gracefully

If we fail to allocate new damage boxes, first try collescing the
existing boxes to free up memory.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Use signal-safe DBG
Chris Wilson [Mon, 27 Jan 2014 21:20:40 +0000 (21:20 +0000)]
sna: Use signal-safe DBG

Otherwise we end up confusing the core Xserver functions when called
from auxilliary threads.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna/gen3+: Allow for spill when aligning vertices
Chris Wilson [Fri, 24 Jan 2014 14:21:44 +0000 (14:21 +0000)]
sna/gen3+: Allow for spill when aligning vertices

We need to flush the batch if we run out of space aligning our vertex
buffer - but the test must anticipate the space required for the new
alignment.

Reported-by: Arkadiusz Miskiewicz
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna/gen2+: Inspect composite flags to discard unneeded CPU damage
Chris Wilson [Fri, 24 Jan 2014 11:29:26 +0000 (11:29 +0000)]
sna/gen2+: Inspect composite flags to discard unneeded CPU damage

We can now check whether the Composite operation will require existing
CPU damage and if not discard it.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna/gen2,3: Don't set BLT_DST_TILED
Chris Wilson [Thu, 23 Jan 2014 19:04:27 +0000 (19:04 +0000)]
sna/gen2,3: Don't set BLT_DST_TILED

This bit only exists for gen4+ so avoid setting it on gen2 and gen3,
whilst setting it doesn't seem to cause any harm, there is no reason to
risk it...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Protect against fake CRTCs during initial probe
Chris Wilson [Thu, 23 Jan 2014 16:30:07 +0000 (16:30 +0000)]
sna: Protect against fake CRTCs during initial probe

Reported-by: Nick Bowler <nbowler@draconx.ca>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73981
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Avoid erroneous discarding operations for partial composites
Chris Wilson [Thu, 23 Jan 2014 17:30:29 +0000 (17:30 +0000)]
sna: Avoid erroneous discarding operations for partial composites

Composite operations were presumed to cover their entire width x height
area. However, a few paths submit boxes that do not cover the clip
region and so the optimisation made during prepare to discard completely
overwritten data is incorrect (and leads to corruption - stale data is
seen which the client expected to have been overdrawn). So along these
more unusual paths, we must add a flag to prevent the overzealous
discard. Notably, xfce4 triggers this as it uses a lot of unantialiased
trapezoids in its theme drawing.

References: https://bugs.freedesktop.org/show_bug.cgi?id=69528
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agoglamor: Don't require the glamoregl module to be pre-loaded with xserver >= 1.15
Chris Wilson [Thu, 23 Jan 2014 12:57:48 +0000 (12:57 +0000)]
glamor: Don't require the glamoregl module to be pre-loaded with xserver >= 1.15

Inspired by (ok, copied from):

xf86-video-ati commit f2a0a5cf6c5a21e2a02280e110a4eb8e6609dace
Author: Michel Dänzer <michel.daenzer@amd.com>
Date:   Wed Jan 22 11:04:42 2014 +0900

    Don't require the glamoregl module to be pre-loaded with xserver >= 1.15

    The issues with loading it on demand have been fixed in xserver 1.15.

    Inspired by Jérôme Glisse on IRC.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Assert that the fill box is within bounds
Chris Wilson [Wed, 22 Jan 2014 16:26:14 +0000 (16:26 +0000)]
sna: Assert that the fill box is within bounds

References: https://bugs.freedesktop.org/show_bug.cgi?id=73811
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Restore gc->serialNumber correctly after falling back
Chris Wilson [Tue, 21 Jan 2014 22:40:11 +0000 (22:40 +0000)]
sna: Restore gc->serialNumber correctly after falling back

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73856
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Initialise the TearFree shadow output from the current front buffer
Chris Wilson [Tue, 21 Jan 2014 10:17:03 +0000 (10:17 +0000)]
sna: Initialise the TearFree shadow output from the current front buffer

Otherwise we may end up in a sitation where we show stale contents for a
(sometimes signification) fraction of a second before it is refreshed
with the correct contents.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73842
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna/gen4: Add an ALWAYS_FLUSH debugging option
Chris Wilson [Fri, 17 Jan 2014 14:33:26 +0000 (14:33 +0000)]
sna/gen4: Add an ALWAYS_FLUSH debugging option

Still gen4 is cursed. This should restore the plateau we reached with
2.99.907 by forcing a full GPU flush between every operation.

References: https://bugs.freedesktop.org/show_bug.cgi?id=55500
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Drop bogus assert added in recent patches
Chris Wilson [Tue, 21 Jan 2014 10:35:30 +0000 (10:35 +0000)]
sna: Drop bogus assert added in recent patches

The intention was to detect if the gc->pCompositeClip still pointed to
the temporary region. However, the assert failed to accomplish that
goal.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Reduce zeal of new gc->pCompositeClip
Chris Wilson [Tue, 21 Jan 2014 10:00:07 +0000 (10:00 +0000)]
sna: Reduce zeal of new gc->pCompositeClip

gc->pCompositeClip starts off NULL, just like sna_gc->priv.

Reported-by: Arkadiusz Miskiewicz
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Fix typo in assertion from previous commit
Chris Wilson [Tue, 21 Jan 2014 09:25:45 +0000 (09:25 +0000)]
sna: Fix typo in assertion from previous commit

Sigh. It helps to remember to do compile testing with the right
configuration.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: More assertions for tracking gc->pCompositeClip
Chris Wilson [Tue, 21 Jan 2014 09:05:54 +0000 (09:05 +0000)]
sna: More assertions for tracking gc->pCompositeClip

Tracking down who leaves it modified...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: build fix for OpenBSD
Mark Kettenis [Mon, 20 Jan 2014 22:33:16 +0000 (22:33 +0000)]
sna: build fix for OpenBSD

Commit 50a45a1cdd4d8319ba9358974d241069689591c5 introduced the use of
"struct stat" but doesn't include <sys/stat.h>.  Presumably that leaks
in trough some other header on Linux, but on OpenBSD compilation fails
because the struct isn't known.

10 years agosna: Include serial numbers in ValidateGC DBG
Chris Wilson [Mon, 20 Jan 2014 20:47:15 +0000 (20:47 +0000)]
sna: Include serial numbers in ValidateGC DBG

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Short-cut the fallback for XCopyArea with depth < 8
Chris Wilson [Mon, 20 Jan 2014 14:35:55 +0000 (14:35 +0000)]
sna: Short-cut the fallback for XCopyArea with depth < 8

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Add some more DBG output around the clipping in sna_do_copy()
Chris Wilson [Mon, 20 Jan 2014 14:35:35 +0000 (14:35 +0000)]
sna: Add some more DBG output around the clipping in sna_do_copy()

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agointel-virtual-output: Tidy some DBG for copying new modes
Chris Wilson [Mon, 20 Jan 2014 13:29:22 +0000 (13:29 +0000)]
intel-virtual-output: Tidy some DBG for copying new modes

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Increase limit on number of possible outputs
Chris Wilson [Mon, 20 Jan 2014 12:19:25 +0000 (12:19 +0000)]
sna: Increase limit on number of possible outputs

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agointel-virtual-output: Print error events for debugging
Chris Wilson [Mon, 20 Jan 2014 12:33:19 +0000 (12:33 +0000)]
intel-virtual-output: Print error events for debugging

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agointel-virtual-output: Disable remote display if SetCrtcConfig fails
Chris Wilson [Mon, 20 Jan 2014 12:25:34 +0000 (12:25 +0000)]
intel-virtual-output: Disable remote display if SetCrtcConfig fails

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agointel-virtual-output: Clone modes onto remote display
Chris Wilson [Mon, 20 Jan 2014 10:38:23 +0000 (10:38 +0000)]
intel-virtual-output: Clone modes onto remote display

If the user adds a mode to the VIRTUAL display and then attempts to use
it, add that mode to the remote display.

Reported-by: Christoph Bessei <admin@schwarzwald-falke.de>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73816
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Yield the processor if the kernel reports EAGAIN
Chris Wilson [Mon, 20 Jan 2014 09:32:50 +0000 (09:32 +0000)]
sna: Yield the processor if the kernel reports EAGAIN

An artifact of our kernel/userspace interaction is that under certain
circumstances the kernel will report EAGAIN in order for it to have CPU
time to run its own workqueues before it can process the userspace
request. We can be cooperative and yield ourselves rather than busy-spin
waiting for the scheduler to demote us.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Use device minor to narrow search for debugfs files
Chris Wilson [Sun, 19 Jan 2014 15:59:42 +0000 (15:59 +0000)]
sna: Use device minor to narrow search for debugfs files

Also vital in case we ever have two Intel GPUs!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Always emit an error message when an execbuffer fails
Chris Wilson [Sun, 19 Jan 2014 15:18:44 +0000 (15:18 +0000)]
sna: Always emit an error message when an execbuffer fails

So that we are not left with a puzzled user with a mysteriously slow
machine.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Discard pending wait_for_shadow updates before the TearFree flip
Chris Wilson [Sun, 19 Jan 2014 12:52:20 +0000 (12:52 +0000)]
sna: Discard pending wait_for_shadow updates before the TearFree flip

Rather than just assert that we have used the pending update in
wait_for_shadow, discard it first.

Reported-by: Joe Peterson <joe@wildlava.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=70905
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Refactor common routines for debugfs file dumping
Chris Wilson [Sat, 18 Jan 2014 22:38:40 +0000 (22:38 +0000)]
sna: Refactor common routines for debugfs file dumping

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Fix typo in debugfs paths
Chris Wilson [Sat, 18 Jan 2014 22:21:35 +0000 (22:21 +0000)]
sna: Fix typo in debugfs paths

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Dump fence registers upon starvation
Chris Wilson [Sat, 18 Jan 2014 21:38:59 +0000 (21:38 +0000)]
sna: Dump fence registers upon starvation

References: https://bugs.freedesktop.org/show_bug.cgi?id=73696
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agointel: Silence a compiler warning (-Wshadow)
Chris Wilson [Fri, 17 Jan 2014 12:55:33 +0000 (12:55 +0000)]
intel: Silence a compiler warning (-Wshadow)

intel_device.c: In function 'intel_entity_get_devid':
intel_device.c:82:32: warning: declaration of 'index' shadows a global declaration [-Wshadow]

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agoProvide DRI2DriverVDPAU for future compatibility
Rinat [Fri, 17 Jan 2014 10:47:44 +0000 (10:47 +0000)]
Provide DRI2DriverVDPAU for future compatibility

Since 2010, DRI2 supports multiple driver names. That was added to ease
selection of appropriate driver by libvdpau. As for today, intel driver
support only DRI2DriverDRI (== 0), but not DRI2DriverVDPAU (== 1).

Although there is no any hardware-specific VDPAU driver for intel video
adapters at the moment, it would be easier to use generic drivers like
libvdpau-va-gl by creating symlink named libvdpau_i965.so.1. That way
appropriate driver will be selected in run time automatically:
libvdpau_i965.so.1 on i965 equipped machines, and libvdpau_nvidia.so.1
on nvidia equipped ones.

[ickle: Whilst I think this is a workaround for a brainfart in libvdpau
that it defaults to libvdpau_nvidia.so rather than first to
libdvpau_${DRI2DriverDRI} and then to a hardcoded libvdpau_backend.so,
I have no better solution, and this does seem in accordance with the
spec.]

Signed-off-by: Rinat <ibragimovrinat@mail.ru>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73507

10 years agosna: Nullify pixmap->devPrivate.ptr after promoting CPU bo to GPU
Chris Wilson [Fri, 17 Jan 2014 08:40:34 +0000 (08:40 +0000)]
sna: Nullify pixmap->devPrivate.ptr after promoting CPU bo to GPU

When we convert a CPU bo into a GPU bo, we need to remove any dangling
shadow pointers we use for devPrivate.ptr. Whilst the bo remains alive
these are incoherent, but if we ever replace the GPU bo (for example to
change tiling for DRI2) then the dangling pointer becomes invalid and
will explode on next use.

Reported-by: Mike Aury <mike.auty@gmail.com>
Reported-by: Marti Raudsepp <marti@juffo.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73351
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Intensify the move-to-cpu pointer paranoia
Chris Wilson [Fri, 17 Jan 2014 09:02:55 +0000 (09:02 +0000)]
sna: Intensify the move-to-cpu pointer paranoia

Rather than just state that the final pixmap->devPrivate.ptr is
non-NULL, we can assert that it matches the shadow value.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Cull the DBG spew to stderr
Chris Wilson [Thu, 16 Jan 2014 22:37:41 +0000 (22:37 +0000)]
sna: Cull the DBG spew to stderr

Reduce the logging verbosity of DBG so that it only appears in the
logfile by default - makes debugging much more pleasant.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Regularly check that the devPrivate.ptr is valid
Chris Wilson [Thu, 16 Jan 2014 11:20:30 +0000 (11:20 +0000)]
sna: Regularly check that the devPrivate.ptr is valid

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Avoid allocating temporary storage for TearFree rotations
Chris Wilson [Thu, 16 Jan 2014 11:08:05 +0000 (11:08 +0000)]
sna: Avoid allocating temporary storage for TearFree rotations

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Make the temporary upload pixmap as having a statically allocated pointer
Chris Wilson [Thu, 16 Jan 2014 10:27:50 +0000 (10:27 +0000)]
sna: Make the temporary upload pixmap as having a statically allocated pointer

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Add some more paranoia around dangling pointers
Chris Wilson [Wed, 15 Jan 2014 10:07:32 +0000 (10:07 +0000)]
sna: Add some more paranoia around dangling pointers

References: https://bugs.freedesktop.org/show_bug.cgi?id=73351
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Handle release of active stolen scanouts
Chris Wilson [Fri, 10 Jan 2014 21:08:28 +0000 (21:08 +0000)]
sna: Handle release of active stolen scanouts

If the scanout is still active we want to defer our release until the
request is retired.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna/dri: Handle TearFree vblanks whilst the pipe is off
Chris Wilson [Fri, 10 Jan 2014 12:01:29 +0000 (12:01 +0000)]
sna/dri: Handle TearFree vblanks whilst the pipe is off

As an extra complication for handling TearFree is that if we attempt to
requeue a swap whilst the pipe is off, that fails. As we have recursed
from the pixmap migration path, we have to abort the blit but still send
the event back to the client so that they unblock.

Reported-by: Harald Judt <h.judt@gmx.at>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73469
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Include the deferred hotplug uevent propagation in DBG
Chris Wilson [Thu, 9 Jan 2014 15:53:42 +0000 (15:53 +0000)]
sna: Include the deferred hotplug uevent propagation in DBG

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Add regular refcnt checks on pixmap bo
Chris Wilson [Thu, 9 Jan 2014 12:34:58 +0000 (12:34 +0000)]
sna: Add regular refcnt checks on pixmap bo

References: https://bugs.freedesktop.org/show_bug.cgi?id=73406
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agoRevert "sna: Remove spurious SAMPLER writemask for gen4"
Chris Wilson [Wed, 8 Jan 2014 11:08:47 +0000 (11:08 +0000)]
Revert "sna: Remove spurious SAMPLER writemask for gen4"

This reverts commit 4966f8374a068ca2a533e30594bfd333551ffd37.

Not so spurious after all!

Reported-by: Michal Suchanek
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna/gen4: Tidy URB_FENCE command
Chris Wilson [Tue, 7 Jan 2014 14:42:41 +0000 (14:42 +0000)]
sna/gen4: Tidy URB_FENCE command

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna/gen4: Use PIPE_CONTROL for a smaller hammer
Chris Wilson [Tue, 7 Jan 2014 14:05:09 +0000 (14:05 +0000)]
sna/gen4: Use PIPE_CONTROL for a smaller hammer

Using MI_FLUSH to break up primitive is overkill when a top-of-pipe
PIPE_CONTROL will suffice.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna/gen4: Check for available batch space before restoring state after CA pass
Chris Wilson [Tue, 7 Jan 2014 13:43:35 +0000 (13:43 +0000)]
sna/gen4: Check for available batch space before restoring state after CA pass

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73348
References: https://bugs.freedesktop.org/show_bug.cgi?id=55500
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna/gen4: Reduce flushes between primitive continuations
Chris Wilson [Wed, 20 Nov 2013 14:22:05 +0000 (14:22 +0000)]
sna/gen4: Reduce flushes between primitive continuations

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Remove spurious SAMPLER writemask for gen4
Chris Wilson [Wed, 20 Nov 2013 14:20:54 +0000 (14:20 +0000)]
sna: Remove spurious SAMPLER writemask for gen4

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>