[Mesa-dev] [PATCH 1/6] vdpau: flush the context after resolving delayed rendering
Marek Olšák
maraeo at gmail.com
Mon Jan 13 05:13:01 PST 2014
From: Marek Olšák <marek.olsak at amd.com>
Bugzilla:
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.
---
src/gallium/state_trackers/vdpau/device.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/gallium/state_trackers/vdpau/device.c b/src/gallium/state_trackers/vdpau/device.c
index fb9c68c..4fd6041 100644
--- a/src/gallium/state_trackers/vdpau/device.c
+++ b/src/gallium/state_trackers/vdpau/device.c
@@ -266,6 +266,7 @@ vlVdpResolveDelayedRendering(vlVdpDevice *dev, struct pipe_surface *surface, str
{
struct vl_compositor_state *cstate;
vlVdpOutputSurface *vlsurface;
+ struct pipe_context *pipe = dev->context;
assert(dev);
@@ -283,6 +284,7 @@ vlVdpResolveDelayedRendering(vlVdpDevice *dev, struct pipe_surface *surface, str
}
vl_compositor_render(cstate, &dev->compositor, surface, dirty_area, true);
+ pipe->flush(pipe, NULL, 0);
dev->delayed_rendering.surface = VDP_INVALID_HANDLE;
dev->delayed_rendering.cstate = NULL;
--
1.8.3.2
More information about the mesa-dev
mailing list