diff options
Diffstat (limited to 'src/gallium/state_trackers/g3dvl/vl_surface.c')
-rw-r--r-- | src/gallium/state_trackers/g3dvl/vl_surface.c | 59 |
1 files changed, 57 insertions, 2 deletions
diff --git a/src/gallium/state_trackers/g3dvl/vl_surface.c b/src/gallium/state_trackers/g3dvl/vl_surface.c index 07a9be2a990..6648133ef83 100644 --- a/src/gallium/state_trackers/g3dvl/vl_surface.c +++ b/src/gallium/state_trackers/g3dvl/vl_surface.c @@ -77,6 +77,7 @@ int vlRenderMacroBlocksMpeg2 { assert(batch); assert(surface); + assert(surface->context); surface->context->render->vlBegin(surface->context->render); @@ -141,9 +142,10 @@ int vlPutPicture csc->vlEnd(csc); - pipe->flush(pipe, PIPE_FLUSH_RENDER_CACHE, NULL); + pipe->flush(pipe, PIPE_FLUSH_RENDER_CACHE, &surface->disp_fence); + bind_pipe_drawable(pipe, drawable); - /* TODO: Need to take destx, desty into consideration */ + pipe->winsys->flush_frontbuffer ( pipe->winsys, @@ -154,6 +156,59 @@ int vlPutPicture return 0; } +int vlSurfaceGetStatus +( + struct vlSurface *surface, + enum vlResourceStatus *status +) +{ + assert(surface); + assert(surface->context); + assert(status); + + if (surface->render_fence && !surface->context->pipe->winsys->fence_signalled(surface->context->pipe->winsys, surface->render_fence, 0)) + { + *status = vlResourceStatusRendering; + return 0; + } + + if (surface->disp_fence && !surface->context->pipe->winsys->fence_signalled(surface->context->pipe->winsys, surface->disp_fence, 0)) + { + *status = vlResourceStatusDisplaying; + return 0; + } + + *status = vlResourceStatusFree; + return 0; +} + +int vlSurfaceFlush +( + struct vlSurface *surface +) +{ + assert(surface); + assert(surface->context); + + surface->context->render->vlFlush(surface->context->render); + + return 0; +} + +int vlSurfaceSync +( + struct vlSurface *surface +) +{ + assert(surface); + assert(surface->context); + assert(surface->render_fence); + + surface->context->pipe->winsys->fence_finish(surface->context->pipe->winsys, surface->render_fence, 0); + + return 0; +} + struct vlScreen* vlSurfaceGetScreen ( struct vlSurface *surface |