Commit Graph

7641 Commits

Author SHA1 Message Date
Chris Wilson 637e7c2186 intel-virtual-output: Print error events for debugging
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-20 12:33:47 +00:00
Chris Wilson 92e9bf82b2 intel-virtual-output: Disable remote display if SetCrtcConfig fails
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-20 12:33:47 +00:00
Chris Wilson 3138d06893 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>
2014-01-20 12:03:13 +00:00
Chris Wilson de0797edac 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>
2014-01-20 09:32:50 +00:00
Chris Wilson 50a45a1cdd 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>
2014-01-19 15:59:42 +00:00
Chris Wilson d41bbfc97c 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>
2014-01-19 15:18:44 +00:00
Chris Wilson d7f753ba89 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>
2014-01-19 12:52:20 +00:00
Chris Wilson 498fcb0013 sna: Refactor common routines for debugfs file dumping
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-18 22:38:40 +00:00
Chris Wilson b68c35a11d sna: Fix typo in debugfs paths
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-18 22:21:35 +00:00
Chris Wilson 9342bc3dfd 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>
2014-01-18 21:38:59 +00:00
Chris Wilson 35ea7b2dd5 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>
2014-01-17 12:55:33 +00:00
Rinat f23ab963c4 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
2014-01-17 10:54:21 +00:00
Chris Wilson 5f3ee21a30 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>
2014-01-17 09:16:38 +00:00
Chris Wilson 34192006c6 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>
2014-01-17 09:16:34 +00:00
Chris Wilson cea442c0d0 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>
2014-01-17 09:15:37 +00:00
Chris Wilson 6db99169a9 sna: Regularly check that the devPrivate.ptr is valid
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-16 12:18:28 +00:00
Chris Wilson 242d7503dd sna: Avoid allocating temporary storage for TearFree rotations
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-16 12:18:28 +00:00
Chris Wilson 587452a6ad sna: Make the temporary upload pixmap as having a statically allocated pointer
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-16 12:18:28 +00:00
Chris Wilson 40beee995e 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>
2014-01-15 10:15:14 +00:00
Chris Wilson 9a0a132939 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>
2014-01-10 21:38:44 +00:00
Chris Wilson b351f4a000 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>
2014-01-10 12:05:17 +00:00
Chris Wilson b1694c8ea5 sna: Include the deferred hotplug uevent propagation in DBG
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-10 12:05:17 +00:00
Chris Wilson bfabdb7ebf 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>
2014-01-09 12:35:51 +00:00
Chris Wilson a2fc9e5f86 Revert "sna: Remove spurious SAMPLER writemask for gen4"
This reverts commit 4966f8374a.

Not so spurious after all!

Reported-by: Michal Suchanek
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-08 11:09:46 +00:00
Chris Wilson b858c28d04 sna/gen4: Tidy URB_FENCE command
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-07 14:42:41 +00:00
Chris Wilson b7565a2640 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>
2014-01-07 14:05:09 +00:00
Chris Wilson 9d8473c5d9 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>
2014-01-07 14:04:18 +00:00
Chris Wilson 3b177a5e97 sna/gen4: Reduce flushes between primitive continuations
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-07 10:22:32 +00:00
Chris Wilson 4966f8374a sna: Remove spurious SAMPLER writemask for gen4
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-07 10:20:53 +00:00
Chris Wilson 82fa7ec352 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>
2014-01-06 14:39:07 +00:00
Chris Wilson 28a057105b uxa: Disable updating properties upon reading their values
Backport commit e76b08cad2
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>
2014-01-06 14:38:10 +00:00
Chris Wilson 0138b38dfc 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>
2014-01-06 14:34:25 +00:00
Chris Wilson 28810d5b36 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>
2014-01-06 14:26:38 +00:00
Chris Wilson 4d8f78bc95 sna/gen7+: Emit invalidate between operations if rendering to source/mask
Fixes regression from
commit c79cb18407 [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>
2014-01-02 15:02:56 +00:00
Chris Wilson c4b88d6026 2.99.907 snapshot 2013-12-30 10:35:18 +00:00
Chris Wilson 9289e2c56b 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>
2013-12-16 11:39:20 +00:00
Chris Wilson 660fbdac8d 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>
2013-12-15 10:42:35 +00:00
Chris Wilson 989198f3dd 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>
2013-12-15 09:45:24 +00:00
Chris Wilson c8e339edd3 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>
2013-12-15 09:39:54 +00:00
Chris Wilson f350a1369b 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>
2013-12-12 16:49:02 +00:00
Chris Wilson 7c62925ba7 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>
2013-12-11 21:39:40 +00:00
Chris Wilson 7e76f21a4d 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>
2013-12-11 21:39:40 +00:00
Chris Wilson f7d1c2b8d1 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>
2013-12-11 21:39:40 +00:00
Chris Wilson e017542d10 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>
2013-12-11 21:39:40 +00:00
Chris Wilson 610af0c70e 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>
2013-12-11 21:39:34 +00:00
Chris Wilson 628b68f3a0 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>
2013-12-10 12:49:24 +00:00
Chris Wilson 6c91ec2980 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>
2013-12-10 12:38:35 +00:00
Chris Wilson ade25f4f95 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>
2013-12-09 10:51:28 +00:00
Chris Wilson a66db75bf3 sna: Fallback gracefully when redisplaying after a GPU hang
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-12-09 10:51:28 +00:00
Chris Wilson cf89fb8b73 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>
2013-12-08 16:36:32 +00:00