summaryrefslogtreecommitdiff
path: root/src/sna/sna_dri2.c
AgeCommit message (Collapse)Author
2015-06-11sna/dri2: Be wary of interactions with DRI3 and sna_pixmap->flushChris Wilson
Since both DRI2 and DRI3 manipulate the sna_pixmap->flush flag, we have to relaxation assertions that it is wholly owned by DRI2. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-06-05sna: Only add the COW to the flush write if exported for writingChris Wilson
If the source is only being exported for reading, we can skip adding it to the flush list only to perform a no-op. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-06-05sna/dri2: Flag APPLY_DAMAGE for stable distrosChris Wilson
commit d1bf75f155f87d3a14d647316a0ba1f40d3957a6 Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Mon Jun 1 08:56:43 2015 +0000 sna: Compilation fixes for stable distros set the flag incorrectly - only future Xorg will do the damage application itself. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-06-01sna/dri2: Only attempt to change tiling when requiredChris Wilson
If we have no fence, we then try to discard the tiling. However, the change_tiling routine assumes that it is only called when a change is actually required. Make it so for dri2. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-06-01sna: Compilation fixes for stable distrosChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-06-01sna/dri2+: The DRI2/DRI3 protocol requires fenced tilingChris Wilson
If we export a surface over DRI2/DRI3, we have to use explicit tiling via the kernel. :( Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-27sna/dri2: Refine ring selection with multiple active ringsChris Wilson
The preference given multiple rings is to the previous writer, or if none, to the render ring if active. References: https://bugs.freedesktop.org/show_bug.cgi?id=90671 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-21sna/dri2: Don't convert from Y-to-X when exporting pixmapsChris Wilson
If the pixmap's GPU bo is already allocated with Y, expect Mesa to deal with it rather than convert to X. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-18sna/present: Reuse last cached swap msc/ust during a flip chainChris Wilson
Querying the known swap values is much slower than not! Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-05sna/dri2: Prevent the sw cursor from copyig to a buffer as we discard itChris Wilson
During swapbuffers, the sw cursor tries to write to the old buffer. Ordinary this is not an issue as we are discarding it, but under TearFree that write causes us to instantiate the shadow buffer with a possible recursion into set_bo and mayhem. v2: commit 226a58bc592d4ed305b7ad0e460f1ee2548e0ddf Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Sat Apr 4 20:58:24 2015 +0100 sna/dri2: Prevent the sw cursor from copyig to a buffer as we discard it Tried to fix it by disabling SourceValidate. However, it a direct hook into the Damage code by miSprite that triggers the copy. Since there appears to be no way to intervene, we just mark that copy as internal and ignore it. Reported-by: Chris Bainbridge <chris.bainbridge@gmail.com> References: https://bugs.freedesktop.org/show_bug.cgi?id=89903 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-04sna/dri2: Prevent the sw cursor from copyig to a buffer as we discard itChris Wilson
During swapbuffers, the sw cursor tries to write to the old buffer. Ordinary this is not an issue as we are discarding it, but under TearFree that write causes us to instantiate the shadow buffer with a possible recursion into set_bo and mayhem. Reported-by: Chris Bainbridge <chris.bainbridge@gmail.com> References: https://bugs.freedesktop.org/show_bug.cgi?id=89903 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-04sna: Add DBG for why we fallback to sw cursorChris Wilson
References: https://bugs.freedesktop.org/show_bug.cgi?id=89903 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-02sna/dri2: Fix multimonitor swap elisionChris Wilson
We were not updating the window->crtc for the immediate swaps with the result that after switching CRTCs, we were requesting a vblank on the wrong pipe and triggering an error path (forcing the blit and negating the elision). Testcase: test/dri2-speed Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-01sna/dri: Avoid using the BLT for DRI2CopyRegion if no semaphoresChris Wilson
We expect mesa nowadays to preferentially use the render pipeline for doing its clears and so want to avoid handing it back an active BLT bo if we don't have semaphores (as that would cause a sync). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-05sna/dri2: Don't dereference a NULL drawable on client shutdown whilst flippingChris Wilson
A dropped if(!NULL) check from the previous patch. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-05sna/dri2: Perform swap elision on windows for swap-interval==0Chris Wilson
In order to be more like Windows and inflate benchmark results. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-03sna/dri2: Remove limiting pending swaps on redirection changesChris Wilson
If we limit the swaps, then doing xrandr --output -off causes unity to misrender. Not quite sure why, but the revert is easy. Fixes regression from commit 88e84320a3a8b3faf20941d666ab846fe12b7a67 Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Tue Feb 24 12:44:19 2015 +0000 sna/dri2: Flush triple buffer swap on [un]redirection but we still keep the async-swap fixes. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89371#c14 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-03sna/dri2: Pre-fill new backbuffersChris Wilson
When we enable buffer-age and Clients start taking advantage of that by only submitting trimmed flips (SwapBuffersWithDamage) we don't want to then lose that by randomly injecting new buffers into the mix (thereby forcing the client to repaint the entire buffer and us to damage all outputs). As new buffers are relatively rare, especially in a steady-state game scenario, spend a few cycles to initialise the new buffer with the current back buffer contents. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-03sna/dri2: Disable backend application of damageChris Wilson
In the future, I anticipate moving the application of damage into the core dri2 (so that clients can specify the damage region for flips). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-02sna/dri2: Fix format comparisonChris Wilson
If multiple Clients intermix DRI2GetBuffers and DRI2GetBuffersWithFormat we can end up with format mismatches. Rectify this by checking the bitsPerPixel of the buffer instead. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-24sna/dri2: Flush triple buffer swap on [un]redirectionChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-16sna/present: Try exchanging the Pixmap with a scanout-ready boChris Wilson
Try to avoid more clflushing on the current Pixmap if we have a scanout-ready bo in the cache. We also note that since we unflip before any other drawing takes place, we do not need to mark the flipped Pixmap as being pinned to the scanout. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-11sna/dri2: Refactor immediate swap schedulingChris Wilson
Allow a request to swap on the next frame to be considered by the immediate handling code by refactoring the target msc computation. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-11sna/dri2: Queue a flip via a vblank event if we have outstanding flipsChris Wilson
If we swap between Clients, or even Windows, then we may have a flip still pending completion in hardware but no longer tracked in order to release the freed state. In this scenario, queue the flip via a vblank event. Testcase: dri2-race with non-immediate flips Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-10dri2: Disable integration with render-nodesChris Wilson
The executive decision has been made to render DRI2 inoperable with render-nodes, so keep on passing the master device path to clients. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-08sna/present: Fallback to first available CRTC if none overlap WindowChris Wilson
In order to handle PRIME offscreen Windows nicely, tie their presentation into the Primary CRTC (if available). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-31Unify Option "DRI" parsingChris Wilson
Allow Option "DRI" "[23]" to also work with UXA. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-31sna/dri2: Rearrange asserts for greater coverageChris Wilson
Always check that the reused DRI2Buffer matches the associated name, and not just for back buffers of a window. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-29sna/dri2: Smooth out delivery of triple buffer SwapCompletionsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-29sna/dri2: Fix use of stale flip_pending after removing windowChris Wilson
Testcase: dri2-race Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-29sna/dri2: Fix interoperation between keepalive and fake-triple-bufferingChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-29sna/dri2: Keep the per-drawable swap cache alive for 50msChris Wilson
The purpose is to keep the recent history of buffers for a DRI client for tracking the relevant age. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-27sna/dri2: Check for comparable back/front pitches more carefullyChris Wilson
Suppose for a moment that we don't have a DRI2Buffer associated with the Drawable just yet... This could happen after a Composite redirect as the front buffer may created (and so associated with the new Pixmap) after the back buffer is recreated. Reported-by: Tomas Pruzina <pruzinat@gmail.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88814 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-26sna/dri2: Use existing busy state if semaphores are disabledChris Wilson
Undo d16ac1f30bb (sna/dri2: Prefer to use normal selection criteria for CopyRegion on small GT) to keep on the current ring as the external bo if semaphores are disabled. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-22sna/dri2: Only preserve back buffers with the same pitchChris Wilson
We can only pageflip if we don't change the pitch, otherwise we simulate the pageflip with modeset. The idea is that once we have exchanged the buffers, we will quickly settle down to a steady state scenario where each buffer has the same pitch. We can encourage this further by only keeping those buffers around that do have the same pitch as the current front. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-21sna/dri2: Prefer to use normal selection criteria for CopyRegion on small GTChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-21sna: Keep front_active consistent across DPMS eventsChris Wilson
When disabling outputs with DPMS, make sure we update front_active for consistency. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-19Set the vdpau driver to va_glAdel Gadllah
This at least works when the wrapper is installed, there is no i9xx vdpau driver. This should for example improve flash which only supports vdpau. The expectation is that most software will use vaapi in preference for -intel, for example kodi which supports both vdpau and vaapi video acceleration methods. [A quick discussion with Peter Frühberger clarified that kodi should indeed continue to work fine and will not be confused if we expose an actual vdpau driver.]
2015-01-16sna/dri2: Exchange flags when exchanging DRI2Buffers after SwapBuffersChris Wilson
Along with the name, pitch, bo, we should also preserve the flags. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-16sna/dri2: Track tracking of active-scanout for back buffer replacementChris Wilson
In the end it turned out to a small typo, s/scanout/active_scanout/ in consideration of reusing the cache. Though there are a number of very useful debug improvements along the way. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-15sna/dri2: Add a DBG message for when Xorg triple buffering is availableChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-09sna/dri2: Fix build with DRI2INFOREC version 5Chris Wilson
Reported-by: Patrick Welche <prlw1@cam.ac.uk> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88252 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-20sna/dri2: Check for implicit flushing after updating a Pixmap bufferChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-19sna/dri2: Preserve the shadow CRTCs when copying to other areasChris Wilson
In the Composite setup, if we are doing a DRI2 copy onto the front buffer, we are fully cognizant that the copy will not go onto the unredirected Windows of another Client. So we can preserve the shadow CRTC mapping for those Clients, and prevent ping-ponging between CRTC modes. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-19sna/dri2: Report changes in pitch when swapping boChris Wilson
As we have relaxed the pitch restriction between front/back buffers when swapping, we need to make sure that any change is also reported back along with the change in front/back names. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-19sna/dri2: Look for preferred CRTC for visible portion of the windowChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-19sna/dri2: Prevent NULL pointer dereference of Window privateChris Wilson
In case we receive quick successive calls to DRI2GetBuffers on the same Window, we need to check that the private exists before dereferencing it. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-19sna/dri2: Decouple Window cache on Pixmap changesChris Wilson
If the Pixmap for a Window is changed (i.e. Composite redirection/unredirection), we also need to decouple any associated DRI2 front buffer for the Pixmap (e.g. used for single CRTC flipping). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-11-20sna/dri2: Improve precision of completion event for no-op swapsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-11-20sna/dri2: Add more DBG to explain invalid framesChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>