Commit Graph

6830 Commits

Author SHA1 Message Date
Chris Wilson fd375da5ca sna: Allow tiled uploads to accumulate damage
And for the upload to create the bo as required.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-23 22:33:42 +01:00
Chris Wilson b0e383363e sna/gen5: Elide the forced flush after a drawrect
Presume that the non-pipelined drawrect is sufficient to serialise
operations to the render cache.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-23 10:55:21 +01:00
Chris Wilson 16fb786bd0 sna/gen5: Force a write flush when changing blend modes
Otherwise it appears that the hardware will readback from memory
bypassing its render cache after a change of modes. There is probably a
lot more subtly to it than this, but this appears to be a good first
approximation.

Reported-by: Clemens Eisserer <linuxhippy@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51422
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-23 09:00:17 +01:00
Chris Wilson 9eabe28a40 Tidy version query for i915.ko
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-23 07:33:56 +01:00
Chris Wilson 7ec0378b64 sna: Only open the /dev/dri/cardX device once
Merge the device open in the main driver with the probing so that we can
open the path explicitly passed in by the PlatformProbe and keep that fd
around for the main driver and so avoid a later search.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-23 07:33:56 +01:00
Chris Wilson 41badce186 sna: Add reference counting to drmMaster for Zaphod
With Zaphod enabled, we will try to acquire/release the drmMaster
several times on each enter/leave VT. This obviously flags an error (and
drops the master too early), so track the number of references we still
hold for drmMaster.

References: https://bugs.freedesktop.org/show_bug.cgi?id=66041
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-22 17:39:39 +01:00
Chris Wilson 81b35092c3 2.21.10 release 2013-06-22 13:44:09 +01:00
Chris Wilson 5189ba727f sna: Refine the self-cow copy hack to reduce collateral damage
Sergio Callegari found a case in LibreOffice that copied cloned pixmaps
onto each other and then modified one of the pair. This was triggering
the hack put in to speed up firefox scrolling, unfortunately.

Reported-by: Sergio Callegari <sergio.callegari@gmail.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=65665
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-22 13:42:37 +01:00
Chris Wilson 62e42de300 sna: Determine swizzling once during initialisation and choose memcpy_to_tiled_x
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-21 21:00:23 +01:00
Chris Wilson 53c113c3cc sna: Allow PutImage to write inplace using manual tiling
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-21 19:45:57 +01:00
Chris Wilson 48028a7c92 sna: Inspect availablity of render before prefering to use the GPU
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-21 18:58:38 +01:00
Chris Wilson 71fc83401e sna: Check if we may want to simply upload for a CopyArea
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-21 18:01:21 +01:00
Chris Wilson 7e90e52219 sna: Fix inspection of transfer extents for deciding transport
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-21 15:44:42 +01:00
Chris Wilson 94cbe7bf7b sna: Mark overwriting CopyArea as not needing the dst damage
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-20 19:40:44 +01:00
Chris Wilson b3d1118bbe sna: Promote the CopyArea to the GPU if it subsumes the CPU damage
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-20 19:34:38 +01:00
Chris Wilson 186ac909ad sna: Fix tiled scanout limits for Valleyview
It appears that Valleyview shares the same scanout limits as gen4.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-20 15:32:30 +01:00
Chris Wilson 112fc5f370 sna: Tidy a redundant conditional for CopyArea
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-19 19:53:14 +01:00
Chris Wilson ba642d9ff8 sna: Fix the pitch limits for gen3 scanout
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-19 16:29:02 +01:00
Chris Wilson 06679c1433 Revert "sna: Apply scanout stride limits to tiling selection"
This reverts commit cc08f6e0ef.

Prefer to keep the frontbuffer as tiled, and use an per-crtc pixmap in
case the frontbuffer is not suitable as the framebuffer.
2013-06-19 16:16:14 +01:00
Chris Wilson f165d2e213 sna: Switch to a per-crtc pixmap if the pitch exceeds scanout limitations
References: https://bugs.freedesktop.org/show_bug.cgi?id=65099
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-19 16:15:32 +01:00
Chris Wilson cc08f6e0ef sna: Apply scanout stride limits to tiling selection
gen4 has a restricted DSPSTRIDE limit for tiled surfaces lower than the
maximum supported size of the CRTC. So we need to double check
whether tiling the scanout is supported before attempting to allocate a
tiled scanout.

Reported-by: Paul Donohue <freedesktop-bugs@PaulSD.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=65099
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-19 16:00:26 +01:00
Chris Wilson f95ed64a11 sna: Assert that the scanout fits within the allocated buffer
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-19 14:49:19 +01:00
Jonathan Gray 6132400365 configure: test for librt (clock_gettime)
clock_gettime() is in libc not librt on OpenBSD so check
to see if linking librt is required.

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
2013-06-19 11:30:24 +01:00
Chris Wilson f567f19b37 sna: Allow wedged pixmaps to be accessed via GTT
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-18 22:17:11 +01:00
Chris Wilson c3695c3c6b sna: Specialise mi calls to PolyFillRect
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-18 10:54:16 +01:00
Chris Wilson 40329e34b9 sna: Add extra assertions to sanity check CPU access is coherent
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-18 10:54:16 +01:00
Chris Wilson abb522e07a sna: Do not sync after a failed mapping
The domain update should be a redundant operation, causing needless
extra transitions.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-18 10:54:16 +01:00
Chris Wilson 6086abca13 sna: Try falling back through an upload if inplace mapping fails
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-18 10:54:16 +01:00
Chris Wilson a86b217934 sna: Mark the base bo as unreusable for temporary mappings
Update required after forcing unaligned userptr to use proxies.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-18 10:54:16 +01:00
Chris Wilson ca913e8f1e sna: Unwrap proxies for subpage offset SHM pixmaps during sync
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-17 23:02:19 +01:00
Chris Wilson d54049808d sna: Refactor scanout flushing
In preparation for extending the kernel interface to be more explicit
about when we need to flush a direct write to the scanout.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-17 23:02:19 +01:00
Chris Wilson 7ebcf94736 sna: Be explicit in not marking an upload buffer as being on the cpu
Since the upload buffer is special in that it simultaneously exists on
both the CPU and GPU, we need to be extremely careful in marking the cpu
hint flag and asserting it. In particular, the new stricter assert was
firing in the CompositeTrapezoids fallback path.

Reported-by: Jiri Slaby <jirislaby@gmail.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=47597
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-15 12:27:19 +01:00
Chris Wilson cafa33a522 sna/gen3+: Remove redundant clearing of clear hint in video playback
The clear hint is correctly updated when performing the move-to-gpu and
so it is being superfluously repeated by the callers.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-14 01:07:12 +01:00
Chris Wilson 45ca894bce sna: Tighten a few asserts on pixmap migration
Tracking to track down where the CPU hint may be set to true but the
pixmap remain entirely damaged on the GPU.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-14 01:06:40 +01:00
Chris Wilson 8f340f90f4 sna/gen7: Set sampler swizzle for video sources
Otherwise the sampler on Haswell will just read all zeros when trying to
playback a video.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=65699
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-13 16:10:41 +01:00
Chris Wilson 5f20be8256 sna/gen2+: Promote a conditional dirty into an assertion
If the target bo is not bound when we start to emit the composite state
for the operation, we are screwed.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-13 11:18:42 +01:00
Chris Wilson 6655cc1d97 sna: Do not enlarge the read back region if there is already CPU damage
We enlarge the read back into to minimise the number of times we have to
migrate pixmap data. However, if we then enlarge the read so that it
overwrites CPU dirty data, then we can introduce corruption.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-12 18:44:27 +01:00
Chris Wilson 1f180b89db sna/video: Free the private video (adaptor/port) arrays upon CloseScreen
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-12 14:34:05 +01:00
Chris Wilson 04ea469d4f sna/video: Catch allocation failure whilst setting up the TexturedAdaptor
Missing NULL check for calloc of the port private array.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-12 14:20:10 +01:00
Chris Wilson dc8f2def54 sna: Allow the throttling to be woken by SIGINT
Rather than completely starve X from handling input events and raising
the spectre of miEQ overflow, stop throttling upon SIGINT. We will have
waited a small period of time (~100ms) for the GPU to catch up, and will
do so again in the near future. This also preserves the hang detection.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-12 08:37:17 +01:00
Chris Wilson 15b92c9875 sna: Make sure the source is coherent on the CPU before uploading
Similar to 7d91051c, but along the render path rather than CopyArea.

Makes the presumption that for the upload path the region is stored on
the CPU explicit.

References: https://bugs.freedesktop.org/show_bug.cgi?id=61628
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-11 23:20:15 +01:00
Chris Wilson 1392f296a3 sna: Mollify an assert to allow us to call busy_ioctl on a GTT write
The code was being careful in making sure that only a BO with an
outstanding GPU write was being flushed. We need to relax that
assertion to allow us to call busy_ioctl after only GTT writes.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-11 15:10:06 +01:00
Chris Wilson 7d91051c50 sna: Make sure the source is coherent on the CPU before uploading
Makes the presumption that for the upload path the region is stored on
the CPU explicit.

References: https://bugs.freedesktop.org/show_bug.cgi?id=61628
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-11 14:42:56 +01:00
Chris Wilson 2e2db4b88f sna: Tidy batch submission around CRTC updates
A few places we were redundantly submitting the same bo, and in others
doing more work than necessary.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-11 00:50:23 +01:00
Chris Wilson b9439a5617 sna: Move the GTT dirty tracking from the pixmap to the bo
This allows us to more accurately track when the GTT is dirty. However,
the only danger is that we may prematurely flush the scanout and clear
the dirty bit and not preserve the flush timer.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-10 22:56:20 +01:00
Chris Wilson 5f0c5a4953 sna: s/bo->dirty/bo->gpu_dirty/ to avoid later confusion
The next step is to introduce bo->gtt_dirty.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-10 22:48:03 +01:00
Chris Wilson b443077536 sna: Make sure all sna_write_boxes* flag the GTT is dirty
Better would be to start passing in the sna_pixmap so that we can mark
the GTT as dirty in a single location, and only if we do indeed then do
a GTT update or pwrite.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-10 21:34:52 +01:00
Chris Wilson 005075de9d sna: Keep the cached EDID if it hasn't changed
Rather than reparsing the EDID each time we probe the modes, if the
property hasn't changed keep it.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-10 14:50:47 +01:00
Chris Wilson 3d760c9b32 sna: Streamline connector probing
This is a tidy up in preparation for a more controversial patch. In the
meantime, take advantage of information that remains static over the
lifetime of our connectors.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-09 20:35:48 +01:00
Chris Wilson b584162e38 sna: Set the needs_flush flag on the bo when the scanout is dirty
Since the call to the busy_ioctl is predicated on whether the bo needs
to be flushed by us, therefore when forcing the call to the busy_ioctl
to flush the GTT we need to mark it as requiring needs_flush.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-07 16:36:40 +01:00