platform/upstream/xf86-video-intel.git
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>
10 years agouxa: Always treat DPMSModeSuspend/Standby similar to DPMSModeOff
Chris Wilson [Mon, 6 Jan 2014 14:30:56 +0000 (14:30 +0000)]
uxa: Always treat DPMSModeSuspend/Standby similar to DPMSModeOff

As we assume that Suspend, Standby alias to Off and disable the crtc
when switching to any mode other than On, we need to also perform the
backlight updates for Suspend,Standby prior to passing the DPMS value
onto the kernel.

Suggested-by: Alexander Monakov <amonakov@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agouxa: Disable updating properties upon reading their values
Chris Wilson [Mon, 6 Jan 2014 14:37:09 +0000 (14:37 +0000)]
uxa: Disable updating properties upon reading their values

Backport commit e76b08cad2770015346fd4cd757de3bb3b6ff37c
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Oct 15 12:46:09 2013 +0100

    sna: Disable updating properties upon reading their values

in order to prevent random screen blanking upon return from DPMS.

Reported-by: Alexander Monakov <amonakov@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73181
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Always treat DPMSModeSuspend/Standby similar to DPMSModeOff
Chris Wilson [Mon, 6 Jan 2014 14:30:56 +0000 (14:30 +0000)]
sna: Always treat DPMSModeSuspend/Standby similar to DPMSModeOff

As we assume that Suspend, Standby alias to Off and disable the crtc
when switching to any mode other than On, we need to also perform the
backlight updates for Suspend,Standby prior to passing the DPMS value
onto the kernel.

Suggested-by: Alexander Monakov <amonakov@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agouxa/dri: Pixmap are offscreen and not attached to any display
Chris Wilson [Mon, 6 Jan 2014 14:26:38 +0000 (14:26 +0000)]
uxa/dri: Pixmap are offscreen and not attached to any display

As the code current assumes that pixmaps are located at screen origin
(0,0), it assumes that they are all on the first CRTC. However, since
they are offscreen, this leads to such complications as attempting to
emit vsync swapbuffers, and even worse attempting to swap a GLXPixmap
onto the scanout following a DRI2SwapBuffers.

Reported-by: Alexander Monakov <amonakov@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73282
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna/gen7+: Emit invalidate between operations if rendering to source/mask
Chris Wilson [Thu, 2 Jan 2014 15:01:38 +0000 (15:01 +0000)]
sna/gen7+: Emit invalidate between operations if rendering to source/mask

Fixes regression from
commit c79cb18407273dc7798618390bd0b7d69b0f80d6 [2.99.907]
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Nov 20 11:17:20 2013 +0000

    sna/gen7: Try to reduce flushes between primitive continuations

Reported-by: Simon Munton <simon.j.munton@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73208
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years ago2.99.907 snapshot 2.99.907
Chris Wilson [Wed, 18 Dec 2013 10:33:52 +0000 (10:33 +0000)]
2.99.907 snapshot

10 years agosna/gen4: Sacrifice performance to workaround render corruption
Chris Wilson [Mon, 16 Dec 2013 11:39:20 +0000 (11:39 +0000)]
sna/gen4: Sacrifice performance to workaround render corruption

The long running saga of trying to find an acceptable workaround for the
gen4 rendering corruption (seems to be a read-write hazard failure inside
the gpu) is failing, the only w/a found so far is to send a single
rectangle through the GPU at a time.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Remove stale assertion
Chris Wilson [Sun, 15 Dec 2013 10:41:22 +0000 (10:41 +0000)]
sna: Remove stale assertion

Now that we do not remove the move-to-gpu for a plain read from the
TearFree buffer, it is viable to use that buffer as source for cloning.
So we need to kill the stale assertion.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agointel-virtual-output: Disable build if timerfd is not present
Chris Wilson [Sun, 15 Dec 2013 09:45:24 +0000 (09:45 +0000)]
intel-virtual-output: Disable build if timerfd is not present

Otherwise the build breaks on *BSD.

Reported-by: Yuta SATOH <nigoro.gentoo@0x100.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72707
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Avoid recursive out-of-order operations in the middle of TearFree
Chris Wilson [Sun, 15 Dec 2013 09:39:54 +0000 (09:39 +0000)]
sna: Avoid recursive out-of-order operations in the middle of TearFree

During TearFree, if we have to wait for the shadow flip to complete, we
run the event handler for the device. This can then cause us to evaluate
pending completed vblank events, which may in turn then attempt to use
the shadow bo and recurse into the TearFree handler. Try to prevent this
and requeue the vblank event.

Reported-by: Pascal de Bruijn <pmjdebruijn@pcode.nl>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72690
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna/gen4+: Drop new assertion that we only finish a vbo after use in this batch
Chris Wilson [Thu, 12 Dec 2013 16:49:02 +0000 (16:49 +0000)]
sna/gen4+: Drop new assertion that we only finish a vbo after use in this batch

A full vbo might not be discarded and so upon first use in the following
batch we decided to finish the old vbo and allocate a new. This can
happen before we even emit any relocations and so the assert is bogus.

Reported-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Remove unused variable
Chris Wilson [Wed, 11 Dec 2013 21:30:06 +0000 (21:30 +0000)]
sna: Remove unused variable

sna_display.c: In function 'sna_crtc_redisplay__fallback':
sna_display.c:4104:19: warning: unused variable 'sna_crtc' [-Wunused-variable]
  struct sna_crtc *sna_crtc = to_sna_crtc(crtc);

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agointel: Recognise gen8
Chris Wilson [Mon, 22 Jul 2013 17:56:03 +0000 (18:56 +0100)]
intel: Recognise gen8

Assign gen=8 to the Broadwell PCI IDs, no marketing names are known at
this point in time.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Enable scanline waits for Broadwell
Chris Wilson [Tue, 23 Jul 2013 07:17:58 +0000 (08:17 +0100)]
sna: Enable scanline waits for Broadwell

Broadwell uses the same mechanism as Haswell for vsync.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna/gen8: Initial backend for Broadwell
Chris Wilson [Thu, 6 Dec 2012 22:11:32 +0000 (22:11 +0000)]
sna/gen8: Initial backend for Broadwell

Should match the functionality of the earlier generations, but untuned.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agoUpdate i915_pciids.h
Chris Wilson [Wed, 13 Nov 2013 11:50:52 +0000 (11:50 +0000)]
Update i915_pciids.h

Pulling in changes from:

kernel commit 4d4dead67a4ab1d5de393f15ed5e4e2aa63d3bcf
Author: Ben Widawsky <benjamin.widawsky@intel.com>
Date:   Sun Nov 3 16:47:33 2013 -0800

    drm/i915/bdw: Add device IDs

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna/gen2,3: Replace stale bo replacement with simple asserts
Chris Wilson [Tue, 10 Dec 2013 10:25:56 +0000 (10:25 +0000)]
sna/gen2,3: Replace stale bo replacement with simple asserts

The surface creation routines should ensure that the minimum pitch
alignments are met. However, when rendering to a CPU bo, the pitch is
not under our control so we need to be more careful.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Set minimum pitch alignment to 8 bytes
Chris Wilson [Tue, 10 Dec 2013 12:37:44 +0000 (12:37 +0000)]
sna: Set minimum pitch alignment to 8 bytes

This prevents render corruption on gen3 and should not adversely affect
BLT pitch requirements or other GPUs.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Only discard READ hint for TearFree copy iff it subsumes the pixmap
Chris Wilson [Mon, 9 Dec 2013 10:49:56 +0000 (10:49 +0000)]
sna: Only discard READ hint for TearFree copy iff it subsumes the pixmap

Remembering that the target window may be smaller than its backing
pixmap.

Reported-by: Andreas Klauer <Andreas.Klauer@metamorpher.de>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72430
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Fallback gracefully when redisplaying after a GPU hang
Chris Wilson [Mon, 9 Dec 2013 10:32:05 +0000 (10:32 +0000)]
sna: Fallback gracefully when redisplaying after a GPU hang

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Simplify kgem_bo_can_map()
Chris Wilson [Sun, 8 Dec 2013 16:35:27 +0000 (16:35 +0000)]
sna: Simplify kgem_bo_can_map()

Remove the attempt to trick us into mapping large bo.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Pass MOVE_READ for partial TearFree move-to-gpu
Chris Wilson [Thu, 5 Dec 2013 16:12:22 +0000 (16:12 +0000)]
sna: Pass MOVE_READ for partial TearFree move-to-gpu

When fixing up a pending shadow pageflip for TearFree, we must tell it
that it needs to flush the damage for a partial move-to-gpu. Even though
the current area does not read from the destination, the move-to-gpu
callback is a global pass, and we need to assume the worst for the
region outside of the target.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72343
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: OsRegisterSigWrapper was only introduced in 1.6.99.900
Chris Wilson [Thu, 5 Dec 2013 11:09:39 +0000 (11:09 +0000)]
sna: OsRegisterSigWrapper was only introduced in 1.6.99.900

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agoconfigure: Correct closing ']'
Chris Wilson [Thu, 5 Dec 2013 11:06:59 +0000 (11:06 +0000)]
configure: Correct closing ']'

Too many closed, too few opened.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Compilation fixes for squeeze
Chris Wilson [Thu, 5 Dec 2013 11:00:44 +0000 (11:00 +0000)]
sna: Compilation fixes for squeeze

Older version of glibc and valgrind require a slight massage.

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