diff options
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r-- | src/gallium/state_trackers/xorg/xvmc/surface.c | 20 | ||||
-rw-r--r-- | src/gallium/state_trackers/xorg/xvmc/xvmc_private.h | 4 |
2 files changed, 18 insertions, 6 deletions
diff --git a/src/gallium/state_trackers/xorg/xvmc/surface.c b/src/gallium/state_trackers/xorg/xvmc/surface.c index cfa15e120d9..fc4593dbc5f 100644 --- a/src/gallium/state_trackers/xorg/xvmc/surface.c +++ b/src/gallium/state_trackers/xorg/xvmc/surface.c @@ -275,8 +275,7 @@ unmap_and_flush_surface(XvMCSurfacePrivate *surface) context_priv->decoder->flush_buffer(surface->decode_buffer, num_ycbcr_blocks, ref_frames, - surface->video_buffer, - &surface->flush_fence); + surface->video_buffer); surface->mapped = 0; } } @@ -537,7 +536,10 @@ Status XvMCPutSurface(Display *dpy, XvMCSurface *surface, Drawable drawable, subpicture_priv->surface = NULL; } - compositor->render_picture(compositor, PictureToPipe(flags), drawable_surface, &dst_rect, &surface_priv->disp_fence); + // Workaround for r600g, there seems to be a bug in the fence refcounting code + vpipe->screen->fence_reference(vpipe->screen, &surface_priv->fence, NULL); + + compositor->render_picture(compositor, PictureToPipe(flags), drawable_surface, &dst_rect, &surface_priv->fence); XVMC_MSG(XVMC_TRACE, "[XvMC] Submitted surface %p for display. Pushing to front buffer.\n", surface); @@ -572,6 +574,10 @@ Status XvMCPutSurface(Display *dpy, XvMCSurface *surface, Drawable drawable, PUBLIC Status XvMCGetSurfaceStatus(Display *dpy, XvMCSurface *surface, int *status) { + struct pipe_video_context *vpipe; + XvMCSurfacePrivate *surface_priv; + XvMCContextPrivate *context_priv; + assert(dpy); if (!surface) @@ -579,8 +585,16 @@ Status XvMCGetSurfaceStatus(Display *dpy, XvMCSurface *surface, int *status) assert(status); + surface_priv = surface->privData; + context_priv = surface_priv->context->privData; + vpipe = context_priv->vctx->vpipe; + *status = 0; + if (surface_priv->fence) + if (!vpipe->screen->fence_signalled(vpipe->screen, surface_priv->fence)) + *status |= XVMC_RENDERING; + return Success; } diff --git a/src/gallium/state_trackers/xorg/xvmc/xvmc_private.h b/src/gallium/state_trackers/xorg/xvmc/xvmc_private.h index bdcda3bb56f..262adac7ab6 100644 --- a/src/gallium/state_trackers/xorg/xvmc/xvmc_private.h +++ b/src/gallium/state_trackers/xorg/xvmc/xvmc_private.h @@ -83,9 +83,7 @@ typedef struct struct pipe_motionvector *mv; } ref[2]; - struct pipe_fence_handle *flush_fence; - struct pipe_fence_handle *render_fence; - struct pipe_fence_handle *disp_fence; + struct pipe_fence_handle *fence; /* The subpicture associated with this surface, if any. */ XvMCSubpicture *subpicture; |