Commit Graph

5958 Commits

Author SHA1 Message Date
Chris Wilson f4cff22afa sna: Relax the buffer size assertion to only be larger than required
Not all paths request alloc pages, a few just request sufficient pages
for the original size. So we can only assert that condition is
satisfied.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-06 15:35:57 +00:00
Chris Wilson 8bc593c732 sna: Make sure we always replace io buffers before inserting into the cache
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-06 15:35:57 +00:00
Chris Wilson cd6d8f9b9d xvmc: Add the complementary XCB_CFLAGS
After splitting the xvmc dependences into xcb and non-xcb, we then also
have to add the xcb CFLAGS to build libIntelXVmc.la

Reported-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-06 10:37:50 +00:00
Paul Menzel b96ee47ad9 configure.ac: Split out XCB libraries from `XVMCLIB` into `XCB`
Building the package under Debian Sid/unstable, `dh_shlibdeps` informs
that `libI810XvMC.so.1.0.0` does not need to be linked against
`libX11-xcb.so.1`, `libxcb-dri2.so.0`, `libxcb-util.so.0` or
`libxcb.so.1` [1].

        $ debuild -b -us -uc
        […]
        make[1]: Entering directory `/src/xserver-xorg-video-intel'
        dh_shlibdeps -- --warnings=6
        dpkg-shlibdeps: Warnung: debian/xserver-xorg-video-intel/usr/lib/libI810XvMC.so.1.0.0 sollte nicht gegen libX11-xcb.so.1 gelinkt werden (es verwendet keines der Bibliotheks-Symbole)
        dpkg-shlibdeps: Warnung: debian/xserver-xorg-video-intel/usr/lib/libI810XvMC.so.1.0.0 sollte nicht gegen libxcb-dri2.so.0 gelinkt werden (es verwendet keines der Bibliotheks-Symbole)
        dpkg-shlibdeps: Warnung: debian/xserver-xorg-video-intel/usr/lib/libI810XvMC.so.1.0.0 sollte nicht gegen libxcb-util.so.0 gelinkt werden (es verwendet keines der Bibliotheks-Symbole)
        dpkg-shlibdeps: Warnung: debian/xserver-xorg-video-intel/usr/lib/libI810XvMC.so.1.0.0 sollte nicht gegen libxcb.so.1 gelinkt werden (es verwendet keines der Bibliotheks-Symbole)
        make[1]: Leaving directory `/src/xserver-xorg-video-intel'
        […]

Moving `x11-xcb`, `xcb-dri2` and `xcb-aux` from `XVMCLIBS` into `XCB`
and adding `XCB_LIBS` only to the `LIBADD` variables of `libIntelXvMC`
makes the warnings go away and the libraries are still built without any
issues.

        make[1]: Entering directory `/src/xserver-xorg-video-intel'
        dh_shlibdeps -- --warnings=6
        make[1]: Leaving directory `/src/xserver-xorg-video-intel'
           dh_installdeb -O--builddirectory=build/
           dh_xsf_substvars -O--builddirectory=build/
           dh_gencontrol -O--builddirectory=build/
        dpkg-gencontrol: Warnung: Feld Depends von Paket xserver-xorg-video-intel-dbg: unbekannte Substitutionsvariable ${shlibs:Depends}
           dh_md5sums -O--builddirectory=build/
           dh_builddeb -O--builddirectory=build/
        dpkg-deb: Paket »xserver-xorg-video-intel« wird in »../xserver-xorg-video-intel_2.19.0-6.1_i386.deb« gebaut.
        dpkg-deb: Paket »xserver-xorg-video-intel-dbg« wird in »../xserver-xorg-video-intel-dbg_2.19.0-6.1_i386.deb« gebaut.
         dpkg-genchanges -b >../xserver-xorg-video-intel_2.19.0-6.1_i386.changes
        dpkg-genchanges: rein binärer Upload - es ist kein Quellcode hinzugefügt
         dpkg-source --after-build xserver-xorg-video-intel
        dpkg-buildpackage: Binärpaket(e) hochzuladen (keine Quellen enthalten)
        Now running lintian...
        W: xserver-xorg-video-intel: hardening-no-relro usr/lib/libI810XvMC.so.1.0.0
        W: xserver-xorg-video-intel: hardening-no-fortify-functions usr/lib/libI810XvMC.so.1.0.0
        W: xserver-xorg-video-intel: hardening-no-relro usr/lib/libIntelXvMC.so.1.0.0
        W: xserver-xorg-video-intel: hardening-no-fortify-functions usr/lib/libIntelXvMC.so.1.0.0
        W: xserver-xorg-video-intel: hardening-no-relro usr/lib/xorg/modules/drivers/intel_drv.so
        W: xserver-xorg-video-intel: hardening-no-fortify-functions usr/lib/xorg/modules/drivers/intel_drv.so
        N: 1 tag overridden (1 warning)
        Finished running lintian.

The modules were originally added with the following commit present
since tag 2.10.0.

        commit 3e8f2eae3a
        Author: Eric Anholt <eric@anholt.net>
        Date:   Thu Oct 15 13:48:56 2009 -0700

            XVMC: Use XCB DRI2 instead of cargo-culting our own copy of Xlib stuff. (v2)

[1] https://buildd.debian.org/status/fetch.php?pkg=xserver-xorg-video-intel&arch=i386&ver=2%3A2.19.0-6&stamp=1347825458

Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net>
2013-02-06 10:19:44 +00:00
Chris Wilson a8cfddd280 sna: Tidy buffer allocation size assertions
Rather than perilously update a local variable with the allocated size,
just use the size of the bo in the assertion that is large enough to
satisfy the allocation request.

Reported-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-05 22:07:46 +00:00
Chris Wilson 9c80a0337e sna: ValleyView uses the same scanline registers as SandyBridge
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-05 14:56:10 +00:00
Chris Wilson 4c45e3fe45 intel: add more ValleyView PCI IDs
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-05 14:45:39 +00:00
Chris Wilson 6346c84452 sna/gen4: Remove old single-thread SF w/a
The alternative of disabling GPU spans seems to be far more effective.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-05 10:17:45 +00:00
Chris Wilson 1565917f10 sna/gen4: Disable non-rectilinear GPU span compositing
This seems to be the primary victim of the render corruption, so disable
until the root cause is fixed.

References: https://bugs.freedesktop.org/show_bug.cgi?id=55500
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-05 10:16:10 +00:00
Damien Lespiau 37bc822190 build: Make generation of gen code depend on intel-gen4asm
This way, when a new intel-gen4asm is available (because one just hacked
on it and has installed a new version for instance) the shaders will be
recompiled. This helps catching regressions, testing the latest changes
in the assembler haven't broken too many things.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-04 20:38:08 +00:00
Damien Lespiau 18f8d2291f build: Use $(AM_V_GEN) to silence the assembly of gen programs
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-04 20:36:52 +00:00
Chris Wilson 9807bba950 sna: Drop bogus refcnt assertion during kgem_bo_retire()
As we may call it kgem_bo_sync(), during preparation of the upload
buffer which in turn may operate on an object straight out of the snoop
cache and hence not yet referenced (or in some cases, ever).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-01 18:25:48 +00:00
Chris Wilson a5561f1349 sna: Do not add the INPLACE hint if we have the ASYNC hint set
If the caller is preparing to use the GPU to rendering into the CPU bo,
it will request an ASYNC migration. In those cases, we do not want to
substitute it with an INPLACE operation.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-01 18:05:35 +00:00
Chris Wilson 008f8230a7 sna: Assert that if we have GPU damage we have a GPU bo
Scatter the asserts around the migration points to catch where this
invariant may be untrue.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-01 02:07:11 +00:00
Chris Wilson cf0576f871 sna/video: Correct computation of planar frame size
The total frame size is less than 3 times the subsampled chroma planes
due to the additional alignment bytes.

Bugzilla: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1104180
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-01 00:22:57 +00:00
Chris Wilson 268285d9a6 sna/gen3+: Flush vertex threads before touching global state
We need to be careful not just when finishing the current vbo to
synchronize with the sharing threads, but also before we emit the batch
state that no other thread will try and do the same.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-31 22:51:31 +00:00
Chris Wilson 1239e012ae sna: Make sure the needs_flush is always accompanied by a tracking request
References: https://bugs.freedesktop.org/show_bug.cgi?id=47597
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-31 22:51:31 +00:00
Chris Wilson 9712f49fdd sna: Remove stale assertion
Now the reset is meant to restablish 'rq' if the bo was busy.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-31 18:08:05 +00:00
Chris Wilson cd7df0004c sna: Pass width/height to composite for rotated displays
This is essential to handle displays that are too large to be rendered
normally via the 3D pipeline and so that the bounds of the fixup region
are known.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=60124
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-31 17:32:57 +00:00
Chris Wilson 38376b56cf sna: Remember to move scanouts to the scanout cache after retiring
Reported-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-31 17:30:09 +00:00
Chris Wilson 0a08de1f02 sna: After removing the bo from a batch, check whether it is still busy
If we transfer a bo to the current batch, then subsequently discard it,
we lose the information about its current active state. Try to recover
this information, by querying the kernel and adding it to the flushing
list if necessary.

Reported-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-31 16:41:31 +00:00
Chris Wilson fff0686342 sna/traps: Thread the fallback rectilinear compositor
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-31 14:26:27 +00:00
Chris Wilson 839542d219 sna/traps: Allow inplace compositing for non-GPU buffers and rectilinear traps
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-31 12:08:52 +00:00
Chris Wilson e329e04b10 sna/traps: Translate the extents for the rasterization threads
The single-threaded code used the pre-computed width/height and only
required the origin from the bounds. However, the threads need to
allocate memory for themselves based on the computed bounds, and so it
helps if those bounds are then correct (rather than only the top-left
being in local space with the bottom-right in global coordinates).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-31 11:33:37 +00:00
Chris Wilson 033f75e5bd sna: Stage retirement through the flushing list
If the kernel replies that a bo is still busy, stage its retirement
through the flushing list to be certain that we never stall on a
subsequent write.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-31 01:43:00 +00:00
Chris Wilson 5f5711e62c sna: Disable dangerous assertions that depend upon external state
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-31 01:27:44 +00:00
Chris Wilson 42529336fd sna: Prevent falling back to swrast if source is on the GPU
Currently if the dst is wholly contained within the CPU, then we try to
continue to operate on the GPU. However, if we have FORCE_GPU set, it
means that one of the sources for the operation resides on the GPU, and
that would require a readback in order to perform the operation on the
CPU. Hence, if we try to use a CPU bo and fail, convert back to using
the GPU bo if forced.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-31 00:58:51 +00:00
Chris Wilson c2d06c407e sna: Improve DBG output for damaged slave outputs
After computing the intersection of the damage with the slave, give the
region extents.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-30 21:17:42 +00:00
Chris Wilson 8867aa6a46 sna/dri: Handle change of BackBuffer across a pending flip
If we encounter a delayed flip with a different back buffer than the
current, simply update the info rather than bug out.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-30 21:17:32 +00:00
Chris Wilson a31fd03bd4 sna: Add a bunch of assertions to make sure we do not misplace scanouts
As scanouts are uncached, they need to be treated carefully and
decontaminated before being placed in the general cache. So double check
that no bo in those caches are still marked as a scanout.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-30 17:28:19 +00:00
Chris Wilson 6f1b862282 sna: Pass the correct WRITE hint when migrating for rendering into the CPU bo
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-30 16:47:02 +00:00
Chris Wilson 5011ed2e72 sna: Only discard the clear hint when writing inplace to the GPU pixmap
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-30 16:47:02 +00:00
Chris Wilson 6312f58014 sna: Don't force a migration from CPU rendering for a DRI2 flushed pixmap
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-30 16:47:02 +00:00
Chris Wilson 60a3b370ae sna: Retire the bo after a set-domain(CPU,0)
Having relaxed the earlier assertion because the kernel is wrong, we can
now retire for READ-READ optimisations.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-30 16:47:02 +00:00
Chris Wilson 78ad5a742f sna: Relax assertion the the kernel considers the bo idle when we call retire
All the callers have explicitly changed the domain upon the bo before
calling kgem_bo_retire(), so we still get the occasional sporadic
failure as kgem_busy() reports true. Kill the assertion for now.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-30 16:47:02 +00:00
Chris Wilson 83bcd310d2 sna: Prefer to use snooped buffers for readbacks
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-30 16:47:02 +00:00
Chris Wilson 496f3ff044 uxa: Harden against failures to submit batchbuffers
If we fail to submit a batchbuffer, the driver is broken and likely to
continue to fail to render. Give up, and fallback to swrast so that the
session remains usable.

References: https://bugs.freedesktop.org/show_bug.cgi?id=59771
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-30 16:47:02 +00:00
Chris Wilson 04d48fee71 sna: Fix errors found from asserts in a66c5f9ed5
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-30 11:46:20 +00:00
Chris Wilson bc8b191ef6 sna: Return early if the Drawable box exactly matches one CRTC
If we are trying to find the best coverage, then by definition if the
drawable is an exact match for one CRTC, we can stop looking.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-30 09:04:10 +00:00
Chris Wilson de28027ffc sna/dri: Make sure we discard the existing mappings when swapping GPU bo
If the GPU bo is currently mapped to the Pixmap, we need to be sure to
invalidate that mapping if we swap the GPU bo (for SwapBuffers). If we
forget, we leave a dangling pointer to chase.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=60042
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-30 08:45:47 +00:00
Chris Wilson cf9b9ac318 sna: Only discard the mapping prior to the actual read when uploading
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-30 08:45:47 +00:00
Chris Wilson a66c5f9ed5 sna: Before replacing the devPrivate.ptr assert it is not already mapped
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-30 08:45:46 +00:00
Chris Wilson 3fdd28419a sna: Only migrate the sample box if using the BLT engine for a composite
Modify the presumption that if we are using a core operation on a shadow
pixmap, then we are likely to continue migrating that pixmap back and
forth.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-29 22:26:15 +00:00
Chris Wilson 0c3b0f11d7 sna: Verify that we always add the SHM CPU bo to the flush list when using
As we need to synchronize that bo before the next reply, we need to keep
track of it whenever it is active on the GPU.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-29 22:24:30 +00:00
Chris Wilson f743cd5734 sna: Avoid promoting SHM CPU bo to GPU to maintain coherence with SHM clients
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-29 18:04:40 +00:00
Chris Wilson 9383c5efe9 sna/gen3+: Fix a DBG for composite_boxes()
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-29 17:26:10 +00:00
Chris Wilson b02a1ea557 sna: Add GT1/GT2 thread counts for Haswell
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-29 09:28:33 +00:00
Chris Wilson 1dc2d9ede5 sna: Add some more paranoia that we correctly map before fallbacks
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-28 23:14:57 +00:00
Chris Wilson 63c71bcd96 sna: Fix typo in vertex count for threaded source span emitter
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-27 23:17:13 +00:00
Chris Wilson b0d26ca931 sna: Replace the forced vertex finish with just a wait
When completing a batch mid-operation, we need to wait upon the other
threads to complete their writes so that memory is coherent before
submitting the work to the GPU. This was achieved by forcing the finish,
but all that from that is the wait, which makes the handling of threads
much explicit and removes the unnecessary vbo refresh.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-27 21:07:03 +00:00