From 9d583719e913b1ec9e5bc4d2f7606bdb27fe3f67 Mon Sep 17 00:00:00 2001 From: Daniel Almeida Date: Sun, 4 Dec 2022 09:12:09 -0300 Subject: [PATCH] gallium: pipe: add get_decoder_fence vfunc Add a get_decoder_fence vfunc that can be used to query the status of the previous decode job denoted by 'fence' given 'timeout'. A pointer to a fence pointer can be passed to the codecs before the end_frame vfunc and the codec should then be responsible for allocating a fence on command stream submission. Signed-off-by: Daniel Almeida Reviewed-by: Leo Liu Reviewed-by: Boyuan Zhang Part-of: --- src/gallium/include/pipe/p_video_codec.h | 14 ++++++++++++++ src/gallium/include/pipe/p_video_state.h | 2 ++ 2 files changed, 16 insertions(+) diff --git a/src/gallium/include/pipe/p_video_codec.h b/src/gallium/include/pipe/p_video_codec.h index e13dc5d..c68d8fd 100644 --- a/src/gallium/include/pipe/p_video_codec.h +++ b/src/gallium/include/pipe/p_video_codec.h @@ -119,6 +119,20 @@ struct pipe_video_codec * get encoder feedback */ void (*get_feedback)(struct pipe_video_codec *codec, void *feedback, unsigned *size); + + /** + * Get decoder fence. + * + * Can be used to query the status of the previous decode job denoted by + * 'fence' given 'timeout'. + * + * A pointer to a fence pointer can be passed to the codecs before the + * end_frame vfunc and the codec should then be responsible for allocating a + * fence on command stream submission. + */ + int (*get_decoder_fence)(struct pipe_video_codec *codec, + struct pipe_fence_handle *fence, + uint64_t timeout); }; /** diff --git a/src/gallium/include/pipe/p_video_state.h b/src/gallium/include/pipe/p_video_state.h index 84d70f7..784d846 100644 --- a/src/gallium/include/pipe/p_video_state.h +++ b/src/gallium/include/pipe/p_video_state.h @@ -166,6 +166,8 @@ struct pipe_picture_desc uint32_t key_size; enum pipe_format input_format; enum pipe_format output_format; + /* A fence used on PIPE_VIDEO_ENTRYPOINT_DECODE to signal job completion */ + struct pipe_fence_handle **fence; }; struct pipe_quant_matrix -- 2.7.4