Commit Graph

7504 Commits

Author SHA1 Message Date
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
Chris Wilson 243bd26ad3 sna: Clear our private hints about front rendering exported bo
Unlike GLXWindows, GLXPixmaps are rendered directly into, without a
staging copy. Therefore we must treat those carefully when exported and
clear our hints everytime control passes back to the Client.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79999
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-16 07:00:40 +01:00
Chris Wilson 500e77d765 sna: Add more DBG to track transitions between CRTC and its shadow or flip bo
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-16 06:59:01 +01:00
Chris Wilson 981aafe797 sna: Enable TearFree by default for systems with PSR
Panel Self-Refresh requires us to avoid frontbuffer rendering in order
to be power efficient. This is a job for TearFree!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-14 06:53:02 +01:00
Chris Wilson b27837d537 sna: Fix assertions for discarding upload caches
The upload caches are special, along with having a bo->proxy, they also
claim to be completely damaged on both the GPU and CPU. Allow that to
pass through when discarding the proxy.

Reported-by: Nick Bowler <nbowler@draconx.ca>
Bugzilla; https://bugs.freedesktop.org/show_bug.cgi?id=79992
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-14 06:53:02 +01:00
Chris Wilson 15485602d8 sna: Use the right is-clipped hint
The region here has yet to be clipped, and so the only valid is-clipped
hint is from the flags computed from the PolyRect extents. Make sure we
use those when determining whether it is valid to discard damage.

Fixes regression from
commit ad03900688 [2.99.903]
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Sep 24 10:00:03 2013 +0100

	sna: Separate out copy preferrence from operating in place decision

Reported-by: Nick Bowler <nbowler@draconx.ca>
Tested-by: Nick Bowler <nbowler@draconx.ca>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79992
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-13 21:45:22 +01:00
Chris Wilson b082a07a69 sna: Only discard the CPU bo if we have a GPU bo to transfer the damage to
References: https://bugs.freedesktop.org/show_bug.cgi?id=79992
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-13 21:43:59 +01:00
Chris Wilson 0a0b9dc353 sna: Refine decision whether to use the GPU or render inplace
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-13 16:53:35 +01:00
Chris Wilson dd87aa8f85 sna: Track the pageflip bo's busyness
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-13 15:06:13 +01:00
Chris Wilson 8322e3e5c6 intel: Check that the fd points to i915 after authorising
The call to GETPARAM requires either a rendernode or authorisation.
Therefore we can only assert that the fd is a valid i915 handle after
authorise() and not before.

Reported-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-13 13:52:52 +01:00
Chris Wilson 97003b1a2d sna/gen6+: Prefer the BLT for large overlapping copies
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-13 13:52:41 +01:00
Chris Wilson 87fc78ac4f sna: Try to reuse the current cursor if we fail to update
As a last resort, continue to display the old cursor if we tried and
failed to create a new cursor.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-13 10:52:47 +01:00
Chris Wilson d47a01fce4 sna: Reorder ignore_cpu_damage() to avoid asserts
Tricksy asserts making sure that the correct arguments are passed
around!

Reported-by: Arkadiusz Miskiewicz <arekm@maven.pl
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-13 08:51:20 +01:00
Chris Wilson c4d4bd5d92 sna/gen8: Allow reads from scanout to be cached
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-13 08:32:34 +01:00
Chris Wilson 8e743ccef8 sna/gen8: Check for WT support before attempting to use the WT mocs
It appears the kernel has a better idea when WT is supported on which
gen8 parts. I assumed it was always supported, but experience suggests
otherwise, so only use WT support when advertised.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79967
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-13 08:27:05 +01:00
Chris Wilson ffe067705b sna: Try to use CPU uploads before BLT uploads
As the BLT upload implies a sync (and a likely GPU boost), only do so if
we cannot do an immediate upload with the CPU, either directly to
backing memory or through the GTT.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-12 18:17:04 +01:00
Chris Wilson 93444ea673 sna: Refactor USE_INPLACE debug macro
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-12 09:26:14 +01:00
Chris Wilson abbf6d6b79 sna/gen8: Clear a couple more push constants
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-11 21:14:00 +01:00
Chris Wilson 7f9b015d87 sna: Remove bogus assertion
The sna_pixmap is cleared afterwards, it does not need to be clear on
free.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-11 19:10:22 +01:00
Chris Wilson e3a0e40310 sna: Fix direction flags for memmove
Under a compositor, the current deltas may invert the sense of the copy
direction, causing scrolling corruption. Simplify handling those flags
by making them invariant for the function.

Reported-by: Bruno Prémont <bonbons@linux-vserver.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79843
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-11 18:54:54 +01:00
Chris Wilson 55660376d5 sna: Use the pixmap header creation routine
A few more places could use the common pixmap creator, just remember to
handle the SHMPixmap complication!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-11 18:54:54 +01:00
Chris Wilson 1beaa980ea sna/gen6+: On small GT avoid the intermediate copy for overlaps
If the memory bw is constrained on the GPU avoid doing the 2-pass copy
for overlaps on the render ring, and do the single pass slower BLT copy
instead - as since it has to transfer less data it will be faster.

Reported-by: Ildar Nurislamov <absorbb@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77436
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-11 16:57:14 +01:00
Chris Wilson 31467b01e3 sna/gen6+: Overlapping bo by definition have compatible depths
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-11 16:21:13 +01:00