Mesa (10.1): vdpau: flush the context before exporting the surface v2

Ian Romanick idr at kemper.freedesktop.org
Mon Feb 24 19:10:36 UTC 2014


Module: Mesa
Branch: 10.1
Commit: 5437d38fac832862f99f60943f19a8d9667db8c7
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=5437d38fac832862f99f60943f19a8d9667db8c7

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Mon Jan 13 14:13:01 2014 +0100

vdpau: flush the context before exporting the surface v2

Bugzilla (bug needs XBMC changes as well):
https://bugs.freedesktop.org/show_bug.cgi?id=73191

When VL uploads vertex buffers, it uses PIPE_TRANSFER_DONTBLOCK, which always
flushes the context in the winsys if the buffer being mapped is busy. Since
I added handling of DISCARD_RANGE, DONTBLOCK has had no effect when combined
with DISCARD_RANGE and I think the context isn't flushed anywhere else,
so no commands are submitted to the GPU until the IB is full, which takes
a lot of frames.

Using DISCARD_RANGE is not the only way to trigger this bug. The other way
is to reallocate the vertex buffer before every upload.

BTW, I'm not sure if this is the right place for flushing, but it does fix
the bug.

v2 (chk): move the flush to the right place.

Signed-off-by: Christian König <christian.koenig at amd.com>
Tested-by: StrangeNoises (rachel at strangenoises.org)
(cherry picked from commit 3f98053fc94a964930c73c43154daddfd7824e7c)

---

 src/gallium/state_trackers/vdpau/output.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/src/gallium/state_trackers/vdpau/output.c b/src/gallium/state_trackers/vdpau/output.c
index aa7e997..1d5fb92 100644
--- a/src/gallium/state_trackers/vdpau/output.c
+++ b/src/gallium/state_trackers/vdpau/output.c
@@ -736,6 +736,7 @@ struct pipe_resource *vlVdpOutputSurfaceGallium(VdpOutputSurface surface)
 
    pipe_mutex_lock(vlsurface->device->mutex);
    vlVdpResolveDelayedRendering(vlsurface->device, NULL, NULL);
+   vlsurface->device->context->flush(vlsurface->device->context, NULL, 0);
    pipe_mutex_unlock(vlsurface->device->mutex);
 
    return vlsurface->surface->texture;




More information about the mesa-commit mailing list