Commit Graph

8230 Commits

Author SHA1 Message Date
Chris Wilson 91bc9e42e4 sna: Mark up const boxes to keep the compiler happy
Pass around const to suppress a few compiler warnings.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-20 16:23:18 +01:00
Chris Wilson e5c68b4358 sna: Feed more operations into the 8x8 BLT tiler
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-20 15:08:57 +01:00
Chris Wilson d2b90ac969 sna: Color patterns for BLT are required to be aligned to 256 byte boundaries
This so far appears to be the most restrictive alignment required, so
simply increase the upload alignment to 256 bytes.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80033
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-20 15:08:56 +01:00
Chris Wilson 8d7e7010e3 test: Increase number of tiled sources
Significantly improve the stress impose upon the tiled BLT operations.
Also start dumping pngs of the failures.

References: https://bugs.freedesktop.org/show_bug.cgi?id=80033
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-20 15:08:56 +01:00
Chris Wilson db6dfc3227 sna/dri2: Don't decouple front buffer tracking for invalid SwapBuffer calls
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-20 10:57:22 +01:00
Chris Wilson 113a8b9be9 sna: Mark upload from SHM segment as read-only
As this may be mapped by the Xserver using a read-only SHM segment, we
are forced to treat it always as read-only. And this being X, that it is
using a SHM segment is opaque to the driver. Fantastic middlelayer.

This was incorrectly removed in
commit e680e54eab
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Jun 11 10:48:26 2014 +0100

    sna: Ignore setting read-only for temporary userptr maps

Also let's not forget the ShmPutImage -> CopyArea path.

Reported-by: Christoph Haag <haagch.christoph@googlemail.com>
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=78411
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-20 10:57:22 +01:00
Chris Wilson df89b49411 sna: Mark upload from SHM segment as read-only
As this may be mapped by the Xserver using a read-only SHM segment, we
are forced to treat it always as read-only. And this being X, that it is
using a SHM segment is opaque to the driver. Fantastic middlelayer.

This was incorrectly removed in
commit e680e54eab
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Jun 11 10:48:26 2014 +0100

    sna: Ignore setting read-only for temporary userptr maps

Reported-by: Christoph Haag <haagch.christoph@googlemail.com>
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=78411
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-19 20:40:30 +01:00
Chris Wilson 6b32cf3a3c sna: Missed fixing y tile offset in last commit
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-19 12:29:58 +01:00
Chris Wilson edeb2ddd17 sna: Use the right pattern origin for tiled 8x8 extraction
References: https://bugs.freedesktop.org/show_bug.cgi?id=80033
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-19 11:51:00 +01:00
Chris Wilson 1752e2d647 sna: Fix up small extents for 8x8 tile construction
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-19 11:50:54 +01:00
Chris Wilson f866a20c99 sna: Wrap pointer access for 8x8 tile construction
The kernel can quite happily send a SIGBUS whenever we read from an bo
(due to oom), so catch it and handle it.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-19 10:49:09 +01:00
Chris Wilson b1aab55d59 sna: Always readback shadow damage after replacing the buffer
Instead track what we explicitly want to discard for the next operation,
so that we don't have to copy back the whole buffer if we have to
replace the shadow and intend to overwrite it all.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-19 09:47:02 +01:00
Chris Wilson f4b930318c sna/dri2: Replace assertion with code to skip updating the back buffer
After a window resize or redirection, the DRI2BufferPtr become stale but
it may take a while for the Client to notice and reconfigure. Just
skip touching stale backbuffers and let the Client catch up.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-19 07:40:16 +01:00
Chris Wilson c257c936b4 sna: Fix modulus for partial conversion of tiles to 8x8 patterns
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-18 22:15:42 +01:00
Chris Wilson 9489cc6c70 sna: Delete the silly typo
Not checking DAMAGE_IS_ALL() correctly leads to an assertion failure.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-18 21:28:11 +01:00
Chris Wilson 51a0559b12 sna: Do not treat both src/dst having no clones as being the same
Fixes regression from
commit 62aaf2ff4f
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Jun 18 18:41:15 2014 +0100

    sna: Skip redundant copies when already cloned

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-18 20:55:02 +01:00
Chris Wilson 377b0e8657 sna: Add log breadcrumbs with valgrind
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-18 19:59:14 +01:00
Chris Wilson 273c82a574 sna: Fix DBG compilation
Missed updaing the DBG message in

commit 83c0f03445
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Jun 18 16:51:46 2014 +0100

    sna: Pass desired CRTC viewport for completing single CRTC flips

References: https://bugs.freedesktop.org/show_bug.cgi?id=80157
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-18 18:47:40 +01:00
Chris Wilson 62aaf2ff4f sna: Skip redundant copies when already cloned
References: https://bugs.freedesktop.org/show_bug.cgi?id=77436
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-18 18:41:15 +01:00
Chris Wilson 83c0f03445 sna: Pass desired CRTC viewport for completing single CRTC flips
We cannot simply compare against the crtc->shadow_bo for all our needs,
so pass in exactly the setup we want and apply that. In particular this
is required when flipping away from the single CRTC setup on secondary
pipes.

Fixes TearFree multi-monitor regression from
commit 3932e97057 [2.99.912]
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Mon Jun 9 08:58:15 2014 +0100

    sna/dri2: Allow TearFree flipping to individual CRTC

Reported-by: Leo Wolf <jclw@ymail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80191
2014-06-18 16:55:04 +01:00
Hans de Goede 7119d394a6 uxa: Mark the output as off before making pipe changes
This is a partial "backport" of commit c6cd10f536, which makes the same
change for sna, to avoid users still using uxa ending up with a blackscreen
after plugging in an external monitor.

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1032978
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1103806
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2014-06-18 15:00:00 +01:00
Hans de Goede 52af321a11 uxa: When the output is off, report the cached backlight value
This is a "backport" of commit b545e10c50 to uxa, so that users who are
still using uxa, don't end up with a black screen after suspend / resume.

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1032978
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1103806
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2014-06-18 14:59:46 +01:00
Chris Wilson 44b5912ffc sna/gen8: Fix cleanup after failing to convert channel
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-18 14:52:45 +01:00
Chris Wilson 21b6e55152 sna/gen8: Fix unaligned() to return true when not aligned
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-18 14:52:45 +01:00
Chris Wilson c5b063b8cc sna: Assert that we do not try to mmap a proxy
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-18 14:52:45 +01:00
Hans de Goede 40bd45fb80 backlight: Fix compiler error
/usr/include/xorg/os.h around line 579 reads:

extern _X_EXPORT char *
strndup(const char *str, size_t n);

However strndup is already defined by glibc, and this redefine causes a
compile error.

This gets triggered because backlight.c does:

Without first doing:

Causing HAVE_STRNDUP to not be defined.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2014-06-18 14:11:05 +01:00
Chris Wilson e52f917a23 sna: Use nxm tiled blits for small regions of large tiles
If the region we are blitting is either narrow or short, we may be able
to construct a tiling pattern out of a large pixmap.

In the process, spot a regression due to

commit 542aeca6e6
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Jun 17 12:26:30 2014 +0100

    sna: Tweak creation 8x8 tiled patterns

which copied too much from the source line.

References: https://bugs.freedesktop.org/show_bug.cgi?id=79888
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-18 10:54:57 +01:00
Chris Wilson b90f6c5aa7 sna: Simplify sna_pixmap_get_source
kgem_bo_upload_image was open-coded, so replace it with a call to the
common function

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-18 10:43:01 +01:00
Chris Wilson 8ea2dd23ab sna: Add DBG option to disable snoop bo cacheing
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-18 10:32:07 +01:00
Chris Wilson b208134584 sna/dri2: fix invalid DBG string
References: https://bugs.freedesktop.org/show_bug.cgi?id=80157
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-18 07:37:28 +01:00
Chris Wilson 77f1a16f11 sna: Set the correct mapping type after calling mmap__async
References: https://bugs.freedesktop.org/show_bug.cgi?id=80001
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-17 23:29:43 +01:00
Chris Wilson d49f53cc00 sna: Fix computing source bo for BLT operations
If we migrate the pixmap to the GPU, use the GPU bo. This may fix an issue
where we might end up using the CPU bo in a rare circumstance.

References: https://bugs.freedesktop.org/show_bug.cgi?id=80033
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-17 22:40:37 +01:00
Chris Wilson 475562d713 sna: Align some function parameters
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-17 22:30:43 +01:00
Chris Wilson c91fc0aad8 sna: Remove invalid assert
Present and flip fallback may queue self-flips, so the assertion that
the crtc->flip_bo != crtc->bo is false.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-17 17:06:05 +01:00
Chris Wilson 0ca25c7b49 sna: Cache small pixmaps rather than forcing a large fallback for BLT operations
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-17 14:35:21 +01:00
Chris Wilson 322e51a3a5 sna: Relax PREFER_GPU so that we don't needless create small GPU bo
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-17 14:35:20 +01:00
Chris Wilson 542aeca6e6 sna: Tweak creation 8x8 tiled patterns
Avoid reading back from a GTT mmapping.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-17 12:26:30 +01:00
Chris Wilson 4ff5cc539b sna/dri2: Fixup failure to do a render copy for DRI2CopyRegion
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-17 10:54:39 +01:00
Chris Wilson 96d1fe314c sna: Add a few missing checks for all-damaged
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-17 09:21:25 +01:00
Chris Wilson 30f521c717 sna: Discard GPU damage for the magic upload proxy
The magic upload proxy is initially considered damaged in both the GPU
and CPU.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-17 09:21:24 +01:00
Chris Wilson e5b94c2d9b sna/glyphs: DBG compile fix
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-17 08:12:42 +01:00
Chris Wilson a4d845bc8f sna: Regularly check the cache level on bo
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-16 15:59:12 +01:00
Chris Wilson 09f0fe9b39 sna/dri2: Allow single crtc exchanges to be queued up
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-16 14:20:12 +01:00
Chris Wilson 4ab99d6799 uxa: Allocate frontbuffer to meet old fence constaints
libdrm is a little lax and does not allocate sufficient space for us to
safely use buffers on old gen. So compute the size we want for
ourselves.

Reported-by: Cem Aydin <cem.aydin@gmx.ch>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80088
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-16 13:01:17 +01:00
Chris Wilson 10cb36e1dd sna/glyphs: Add DBG option to force use of the glyph image mask
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-16 10:33:07 +01:00
Chris Wilson 8f0fc2ed4c uxa: Add some explanation to why bo were rejected
References: https://bugs.freedesktop.org/show_bug.cgi?id=80088
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-16 10:27:16 +01:00
Chris Wilson 6b82962e58 sna: Fix logic inversion for final placement in is_gpu_dst()
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-16 10:13:09 +01:00
Chris Wilson 62102f505c sna: Promote better active buffer reuse
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-16 09:50:23 +01:00
Chris Wilson 2877d018d3 sna/glyphs: Show number of glyphs in DBG
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-16 09:25:48 +01:00
Chris Wilson 38434b29f4 sna: Fix some batch DBG
Helps to check for a successful read when we want to show the batch
after execution.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-16 08:03:21 +01:00