virgl: video: implement the get_decoder_fence vfunc
Implement the get_decoder_fence vfunc by waiting on the fence previously passed in picture->fence in the end_frame vfunc. Signed-off-by: Daniel Almeida <daniel.almeida@collabora.com> Reviewed-by: Leo Liu <leo.liu@amd.com> Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20133>
This commit is contained in:

committed by
Marge Bot

parent
4246bcfc7a
commit
8187b35fa1
@@ -725,11 +725,21 @@ static void virgl_video_end_frame(struct pipe_video_codec *codec,
|
||||
struct virgl_video_buffer *vbuf = virgl_video_buffer(target);
|
||||
|
||||
virgl_encode_end_frame(vctx, vcdc, vbuf);
|
||||
virgl_flush_eq(vctx, vctx, NULL);
|
||||
virgl_flush_eq(vctx, vctx, picture->fence);
|
||||
|
||||
switch_buffer(vcdc);
|
||||
}
|
||||
|
||||
static int virgl_video_get_decoder_fence(struct pipe_video_codec *decoder,
|
||||
struct pipe_fence_handle *fence,
|
||||
uint64_t timeout) {
|
||||
struct virgl_video_codec *vcdc = virgl_video_codec(decoder);
|
||||
struct virgl_context *vctx = vcdc->vctx;
|
||||
struct virgl_screen *vs = virgl_screen(vctx->base.screen);
|
||||
|
||||
return vs->vws->fence_wait(vs->vws, fence, timeout);
|
||||
}
|
||||
|
||||
static void virgl_video_flush(struct pipe_video_codec *codec)
|
||||
{
|
||||
struct pipe_context *ctx = codec->context;
|
||||
@@ -836,6 +846,7 @@ virgl_video_create_codec(struct pipe_context *ctx,
|
||||
vcdc->base.end_frame = virgl_video_end_frame;
|
||||
vcdc->base.flush = virgl_video_flush;
|
||||
vcdc->base.get_feedback = virgl_video_get_feedback;
|
||||
vcdc->base.get_decoder_fence = virgl_video_get_decoder_fence;
|
||||
|
||||
vcdc->bs_size = 0;
|
||||
vcdc->cur_buffer = 0;
|
||||
|
Reference in New Issue
Block a user