pipe: Add int return value to video end_frame
Make it possible to report errors to frontend. Reviewed-By: Sil Vilerino <sivileri@microsoft.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30780>
This commit is contained in:
@@ -221,7 +221,7 @@ trace_video_codec_process_frame(struct pipe_video_codec *_codec,
|
|||||||
codec->process_frame(codec, source, process_properties);
|
codec->process_frame(codec, source, process_properties);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static int
|
||||||
trace_video_codec_end_frame(struct pipe_video_codec *_codec,
|
trace_video_codec_end_frame(struct pipe_video_codec *_codec,
|
||||||
struct pipe_video_buffer *_target,
|
struct pipe_video_buffer *_target,
|
||||||
struct pipe_picture_desc *picture)
|
struct pipe_picture_desc *picture)
|
||||||
@@ -241,6 +241,7 @@ trace_video_codec_end_frame(struct pipe_video_codec *_codec,
|
|||||||
codec->end_frame(codec, target, picture);
|
codec->end_frame(codec, target, picture);
|
||||||
if (copied)
|
if (copied)
|
||||||
FREE(picture);
|
FREE(picture);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@@ -746,7 +746,7 @@ vl_mpeg12_decode_bitstream(struct pipe_video_codec *decoder,
|
|||||||
vl_mpg12_bs_decode(&buf->bs, target, desc, num_buffers, buffers, sizes);
|
vl_mpg12_bs_decode(&buf->bs, target, desc, num_buffers, buffers, sizes);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static int
|
||||||
vl_mpeg12_end_frame(struct pipe_video_codec *decoder,
|
vl_mpeg12_end_frame(struct pipe_video_codec *decoder,
|
||||||
struct pipe_video_buffer *target,
|
struct pipe_video_buffer *target,
|
||||||
struct pipe_picture_desc *picture)
|
struct pipe_picture_desc *picture)
|
||||||
@@ -843,6 +843,7 @@ vl_mpeg12_end_frame(struct pipe_video_codec *decoder,
|
|||||||
dec->context->flush(dec->context, NULL, 0);
|
dec->context->flush(dec->context, NULL, 0);
|
||||||
++dec->current_buffer;
|
++dec->current_buffer;
|
||||||
dec->current_buffer %= 4;
|
dec->current_buffer %= 4;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@@ -396,7 +396,7 @@ d3d12_video_decoder_store_upper_layer_references(struct d3d12_video_decoder *pD3
|
|||||||
/**
|
/**
|
||||||
* end decoding of the current frame
|
* end decoding of the current frame
|
||||||
*/
|
*/
|
||||||
void
|
int
|
||||||
d3d12_video_decoder_end_frame(struct pipe_video_codec *codec,
|
d3d12_video_decoder_end_frame(struct pipe_video_codec *codec,
|
||||||
struct pipe_video_buffer *target,
|
struct pipe_video_buffer *target,
|
||||||
struct pipe_picture_desc *picture)
|
struct pipe_picture_desc *picture)
|
||||||
@@ -449,7 +449,7 @@ d3d12_video_decoder_end_frame(struct pipe_video_codec *codec,
|
|||||||
debug_printf("[d3d12_video_decoder] d3d12_video_decoder_end_frame failed for fenceValue: %d\n",
|
debug_printf("[d3d12_video_decoder] d3d12_video_decoder_end_frame failed for fenceValue: %d\n",
|
||||||
pD3D12Dec->m_fenceValue);
|
pD3D12Dec->m_fenceValue);
|
||||||
assert(false);
|
assert(false);
|
||||||
return;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -545,7 +545,7 @@ d3d12_video_decoder_end_frame(struct pipe_video_codec *codec,
|
|||||||
debug_printf("[d3d12_video_decoder] d3d12_video_decoder_end_frame failed for fenceValue: %d\n",
|
debug_printf("[d3d12_video_decoder] d3d12_video_decoder_end_frame failed for fenceValue: %d\n",
|
||||||
pD3D12Dec->m_fenceValue);
|
pD3D12Dec->m_fenceValue);
|
||||||
assert(false);
|
assert(false);
|
||||||
return;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -728,6 +728,7 @@ d3d12_video_decoder_end_frame(struct pipe_video_codec *codec,
|
|||||||
// The output surface fence is the graphics queue that will signal after the copy ends
|
// The output surface fence is the graphics queue that will signal after the copy ends
|
||||||
pD3D12Dec->base.context->flush(pD3D12Dec->base.context, picture->fence, PIPE_FLUSH_ASYNC | PIPE_FLUSH_HINT_FINISH);
|
pD3D12Dec->base.context->flush(pD3D12Dec->base.context, picture->fence, PIPE_FLUSH_ASYNC | PIPE_FLUSH_HINT_FINISH);
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -65,7 +65,7 @@ d3d12_video_decoder_decode_bitstream(struct pipe_video_codec * codec,
|
|||||||
/**
|
/**
|
||||||
* end decoding of the current frame
|
* end decoding of the current frame
|
||||||
*/
|
*/
|
||||||
void
|
int
|
||||||
d3d12_video_decoder_end_frame(struct pipe_video_codec * codec,
|
d3d12_video_decoder_end_frame(struct pipe_video_codec * codec,
|
||||||
struct pipe_video_buffer *target,
|
struct pipe_video_buffer *target,
|
||||||
struct pipe_picture_desc *picture);
|
struct pipe_picture_desc *picture);
|
||||||
|
@@ -2579,7 +2579,7 @@ d3d12_video_encoder_extract_encode_metadata(
|
|||||||
/**
|
/**
|
||||||
* end encoding of the current frame
|
* end encoding of the current frame
|
||||||
*/
|
*/
|
||||||
void
|
int
|
||||||
d3d12_video_encoder_end_frame(struct pipe_video_codec * codec,
|
d3d12_video_encoder_end_frame(struct pipe_video_codec * codec,
|
||||||
struct pipe_video_buffer *target,
|
struct pipe_video_buffer *target,
|
||||||
struct pipe_picture_desc *picture)
|
struct pipe_picture_desc *picture)
|
||||||
@@ -2592,7 +2592,7 @@ d3d12_video_encoder_end_frame(struct pipe_video_codec * codec,
|
|||||||
if (pD3D12Enc->m_inflightResourcesPool[d3d12_video_encoder_pool_current_index(pD3D12Enc)].encode_result != PIPE_VIDEO_FEEDBACK_METADATA_ENCODE_FLAG_OK) {
|
if (pD3D12Enc->m_inflightResourcesPool[d3d12_video_encoder_pool_current_index(pD3D12Enc)].encode_result != PIPE_VIDEO_FEEDBACK_METADATA_ENCODE_FLAG_OK) {
|
||||||
debug_printf("WARNING: [d3d12_video_encoder] d3d12_video_encoder_end_frame - Frame submission %" PRIu64 " failed. Encoder lost, please recreate pipe_video_codec object\n", pD3D12Enc->m_fenceValue);
|
debug_printf("WARNING: [d3d12_video_encoder] d3d12_video_encoder_end_frame - Frame submission %" PRIu64 " failed. Encoder lost, please recreate pipe_video_codec object\n", pD3D12Enc->m_fenceValue);
|
||||||
assert(false);
|
assert(false);
|
||||||
return;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Signal finish of current frame encoding to the picture management tracker
|
// Signal finish of current frame encoding to the picture management tracker
|
||||||
@@ -2608,6 +2608,7 @@ d3d12_video_encoder_end_frame(struct pipe_video_codec * codec,
|
|||||||
pD3D12Enc->m_fenceValue);
|
pD3D12Enc->m_fenceValue);
|
||||||
|
|
||||||
pD3D12Enc->m_bPendingWorkNotFlushed = true;
|
pD3D12Enc->m_bPendingWorkNotFlushed = true;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@@ -82,7 +82,7 @@ d3d12_video_encoder_get_feedback(struct pipe_video_codec *codec,
|
|||||||
/**
|
/**
|
||||||
* end encoding of the current frame
|
* end encoding of the current frame
|
||||||
*/
|
*/
|
||||||
void
|
int
|
||||||
d3d12_video_encoder_end_frame(struct pipe_video_codec * codec,
|
d3d12_video_encoder_end_frame(struct pipe_video_codec * codec,
|
||||||
struct pipe_video_buffer *target,
|
struct pipe_video_buffer *target,
|
||||||
struct pipe_picture_desc *picture);
|
struct pipe_picture_desc *picture);
|
||||||
|
@@ -86,7 +86,7 @@ d3d12_video_processor_begin_frame(struct pipe_video_codec * codec,
|
|||||||
debug_printf("d3d12_video_processor_begin_frame: Beginning new scene with Output ID3D12Resource: %p (%d %d)\n", pDstD3D12Res, (int) dstDesc.Width, (int) dstDesc.Height);
|
debug_printf("d3d12_video_processor_begin_frame: Beginning new scene with Output ID3D12Resource: %p (%d %d)\n", pDstD3D12Res, (int) dstDesc.Width, (int) dstDesc.Height);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
int
|
||||||
d3d12_video_processor_end_frame(struct pipe_video_codec * codec,
|
d3d12_video_processor_end_frame(struct pipe_video_codec * codec,
|
||||||
struct pipe_video_buffer *target,
|
struct pipe_video_buffer *target,
|
||||||
struct pipe_picture_desc *picture)
|
struct pipe_picture_desc *picture)
|
||||||
@@ -182,6 +182,7 @@ d3d12_video_processor_end_frame(struct pipe_video_codec * codec,
|
|||||||
pD3D12Proc->m_PendingFences[d3d12_video_processor_pool_current_index(pD3D12Proc)].value = pD3D12Proc->m_fenceValue;
|
pD3D12Proc->m_PendingFences[d3d12_video_processor_pool_current_index(pD3D12Proc)].value = pD3D12Proc->m_fenceValue;
|
||||||
pD3D12Proc->m_PendingFences[d3d12_video_processor_pool_current_index(pD3D12Proc)].cmdqueue_fence = pD3D12Proc->m_spFence.Get();
|
pD3D12Proc->m_PendingFences[d3d12_video_processor_pool_current_index(pD3D12Proc)].cmdqueue_fence = pD3D12Proc->m_spFence.Get();
|
||||||
*picture->fence = (pipe_fence_handle*) &pD3D12Proc->m_PendingFences[d3d12_video_processor_pool_current_index(pD3D12Proc)];
|
*picture->fence = (pipe_fence_handle*) &pD3D12Proc->m_PendingFences[d3d12_video_processor_pool_current_index(pD3D12Proc)];
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@@ -60,7 +60,7 @@ d3d12_video_processor_process_frame(struct pipe_video_codec *codec,
|
|||||||
/**
|
/**
|
||||||
* end processing of the current frame
|
* end processing of the current frame
|
||||||
*/
|
*/
|
||||||
void
|
int
|
||||||
d3d12_video_processor_end_frame(struct pipe_video_codec * codec,
|
d3d12_video_processor_end_frame(struct pipe_video_codec * codec,
|
||||||
struct pipe_video_buffer *target,
|
struct pipe_video_buffer *target,
|
||||||
struct pipe_picture_desc *picture);
|
struct pipe_picture_desc *picture);
|
||||||
|
@@ -454,11 +454,12 @@ nouveau_decoder_decode_macroblock(struct pipe_video_codec *decoder,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static int
|
||||||
nouveau_decoder_end_frame(struct pipe_video_codec *decoder,
|
nouveau_decoder_end_frame(struct pipe_video_codec *decoder,
|
||||||
struct pipe_video_buffer *target,
|
struct pipe_video_buffer *target,
|
||||||
struct pipe_picture_desc *picture)
|
struct pipe_picture_desc *picture)
|
||||||
{
|
{
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@@ -198,11 +198,12 @@ nouveau_vp3_decoder_begin_frame(struct pipe_video_codec *decoder,
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static int
|
||||||
nouveau_vp3_decoder_end_frame(struct pipe_video_codec *decoder,
|
nouveau_vp3_decoder_end_frame(struct pipe_video_codec *decoder,
|
||||||
struct pipe_video_buffer *target,
|
struct pipe_video_buffer *target,
|
||||||
struct pipe_picture_desc *picture)
|
struct pipe_picture_desc *picture)
|
||||||
{
|
{
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@@ -152,11 +152,12 @@ nv84_decoder_begin_frame_h264(struct pipe_video_codec *decoder,
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static int
|
||||||
nv84_decoder_end_frame_h264(struct pipe_video_codec *decoder,
|
nv84_decoder_end_frame_h264(struct pipe_video_codec *decoder,
|
||||||
struct pipe_video_buffer *target,
|
struct pipe_video_buffer *target,
|
||||||
struct pipe_picture_desc *picture)
|
struct pipe_picture_desc *picture)
|
||||||
{
|
{
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -203,7 +204,7 @@ nv84_decoder_begin_frame_mpeg12(struct pipe_video_codec *decoder,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static int
|
||||||
nv84_decoder_end_frame_mpeg12(struct pipe_video_codec *decoder,
|
nv84_decoder_end_frame_mpeg12(struct pipe_video_codec *decoder,
|
||||||
struct pipe_video_buffer *target,
|
struct pipe_video_buffer *target,
|
||||||
struct pipe_picture_desc *picture)
|
struct pipe_picture_desc *picture)
|
||||||
@@ -212,6 +213,7 @@ nv84_decoder_end_frame_mpeg12(struct pipe_video_codec *decoder,
|
|||||||
(struct nv84_decoder *)decoder,
|
(struct nv84_decoder *)decoder,
|
||||||
(struct pipe_mpeg12_picture_desc *)picture,
|
(struct pipe_mpeg12_picture_desc *)picture,
|
||||||
(struct nv84_video_buffer *)target);
|
(struct nv84_video_buffer *)target);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@@ -62,7 +62,7 @@ nvc0_decoder_decode_bitstream(struct pipe_video_codec *decoder,
|
|||||||
assert(ret == 2);
|
assert(ret == 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static int
|
||||||
nvc0_decoder_end_frame(struct pipe_video_codec *decoder,
|
nvc0_decoder_end_frame(struct pipe_video_codec *decoder,
|
||||||
struct pipe_video_buffer *video_target,
|
struct pipe_video_buffer *video_target,
|
||||||
struct pipe_picture_desc *picture)
|
struct pipe_picture_desc *picture)
|
||||||
@@ -85,6 +85,7 @@ nvc0_decoder_end_frame(struct pipe_video_codec *decoder,
|
|||||||
|
|
||||||
nvc0_decoder_vp(dec, desc, target, comm_seq, vp_caps, is_ref, refs);
|
nvc0_decoder_vp(dec, desc, target, comm_seq, vp_caps, is_ref, refs);
|
||||||
nvc0_decoder_ppp(dec, desc, target, comm_seq);
|
nvc0_decoder_ppp(dec, desc, target, comm_seq);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct pipe_video_codec *
|
struct pipe_video_codec *
|
||||||
|
@@ -897,7 +897,7 @@ static void ruvd_decode_bitstream(struct pipe_video_codec *decoder,
|
|||||||
/**
|
/**
|
||||||
* end decoding of the current frame
|
* end decoding of the current frame
|
||||||
*/
|
*/
|
||||||
static void ruvd_end_frame(struct pipe_video_codec *decoder,
|
static int ruvd_end_frame(struct pipe_video_codec *decoder,
|
||||||
struct pipe_video_buffer *target,
|
struct pipe_video_buffer *target,
|
||||||
struct pipe_picture_desc *picture)
|
struct pipe_picture_desc *picture)
|
||||||
{
|
{
|
||||||
@@ -909,7 +909,7 @@ static void ruvd_end_frame(struct pipe_video_codec *decoder,
|
|||||||
assert(decoder);
|
assert(decoder);
|
||||||
|
|
||||||
if (!dec->bs_ptr)
|
if (!dec->bs_ptr)
|
||||||
return;
|
return 1;
|
||||||
|
|
||||||
msg_fb_it_buf = &dec->msg_fb_it_buffers[dec->cur_buffer];
|
msg_fb_it_buf = &dec->msg_fb_it_buffers[dec->cur_buffer];
|
||||||
bs_buf = &dec->bs_buffers[dec->cur_buffer];
|
bs_buf = &dec->bs_buffers[dec->cur_buffer];
|
||||||
@@ -965,7 +965,7 @@ static void ruvd_end_frame(struct pipe_video_codec *decoder,
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
assert(0);
|
assert(0);
|
||||||
return;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
dec->msg->body.decode.db_surf_tile_config = dec->msg->body.decode.dt_surf_tile_config;
|
dec->msg->body.decode.db_surf_tile_config = dec->msg->body.decode.dt_surf_tile_config;
|
||||||
@@ -996,6 +996,7 @@ static void ruvd_end_frame(struct pipe_video_codec *decoder,
|
|||||||
|
|
||||||
flush(dec, PIPE_FLUSH_ASYNC, picture->fence);
|
flush(dec, PIPE_FLUSH_ASYNC, picture->fence);
|
||||||
next_buffer(dec);
|
next_buffer(dec);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -303,7 +303,7 @@ static void rvce_encode_bitstream(struct pipe_video_codec *encoder,
|
|||||||
enc->feedback(enc);
|
enc->feedback(enc);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rvce_end_frame(struct pipe_video_codec *encoder,
|
static int rvce_end_frame(struct pipe_video_codec *encoder,
|
||||||
struct pipe_video_buffer *source,
|
struct pipe_video_buffer *source,
|
||||||
struct pipe_picture_desc *picture)
|
struct pipe_picture_desc *picture)
|
||||||
{
|
{
|
||||||
@@ -323,6 +323,7 @@ static void rvce_end_frame(struct pipe_video_codec *encoder,
|
|||||||
list_del(&slot->list);
|
list_del(&slot->list);
|
||||||
list_add(&slot->list, &enc->cpb_slots);
|
list_add(&slot->list, &enc->cpb_slots);
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rvce_get_feedback(struct pipe_video_codec *encoder,
|
static void rvce_get_feedback(struct pipe_video_codec *encoder,
|
||||||
|
@@ -1073,7 +1073,7 @@ static void ruvd_decode_bitstream(struct pipe_video_codec *decoder,
|
|||||||
/**
|
/**
|
||||||
* end decoding of the current frame
|
* end decoding of the current frame
|
||||||
*/
|
*/
|
||||||
static void ruvd_end_frame(struct pipe_video_codec *decoder, struct pipe_video_buffer *target,
|
static int ruvd_end_frame(struct pipe_video_codec *decoder, struct pipe_video_buffer *target,
|
||||||
struct pipe_picture_desc *picture)
|
struct pipe_picture_desc *picture)
|
||||||
{
|
{
|
||||||
struct ruvd_decoder *dec = (struct ruvd_decoder *)decoder;
|
struct ruvd_decoder *dec = (struct ruvd_decoder *)decoder;
|
||||||
@@ -1084,7 +1084,7 @@ static void ruvd_end_frame(struct pipe_video_codec *decoder, struct pipe_video_b
|
|||||||
assert(decoder);
|
assert(decoder);
|
||||||
|
|
||||||
if (!dec->bs_ptr)
|
if (!dec->bs_ptr)
|
||||||
return;
|
return 1;
|
||||||
|
|
||||||
msg_fb_it_buf = &dec->msg_fb_it_buffers[dec->cur_buffer];
|
msg_fb_it_buf = &dec->msg_fb_it_buffers[dec->cur_buffer];
|
||||||
bs_buf = &dec->bs_buffers[dec->cur_buffer];
|
bs_buf = &dec->bs_buffers[dec->cur_buffer];
|
||||||
@@ -1169,7 +1169,7 @@ static void ruvd_end_frame(struct pipe_video_codec *decoder, struct pipe_video_b
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
assert(0);
|
assert(0);
|
||||||
return;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
dec->msg->body.decode.db_surf_tile_config = dec->msg->body.decode.dt_surf_tile_config;
|
dec->msg->body.decode.db_surf_tile_config = dec->msg->body.decode.dt_surf_tile_config;
|
||||||
@@ -1199,6 +1199,7 @@ static void ruvd_end_frame(struct pipe_video_codec *decoder, struct pipe_video_b
|
|||||||
|
|
||||||
flush(dec, picture->flush_flags, picture->fence);
|
flush(dec, picture->flush_flags, picture->fence);
|
||||||
next_buffer(dec);
|
next_buffer(dec);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -114,9 +114,9 @@ static void radeon_uvd_enc_get_param(struct radeon_uvd_encoder *enc,
|
|||||||
radeon_uvd_enc_get_vui_param(enc, pic);
|
radeon_uvd_enc_get_vui_param(enc, pic);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void flush(struct radeon_uvd_encoder *enc, unsigned flags)
|
static int flush(struct radeon_uvd_encoder *enc, unsigned flags)
|
||||||
{
|
{
|
||||||
enc->ws->cs_flush(&enc->cs, flags, NULL);
|
return enc->ws->cs_flush(&enc->cs, flags, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void radeon_uvd_enc_flush(struct pipe_video_codec *encoder)
|
static void radeon_uvd_enc_flush(struct pipe_video_codec *encoder)
|
||||||
@@ -225,12 +225,12 @@ static void radeon_uvd_enc_encode_bitstream(struct pipe_video_codec *encoder,
|
|||||||
enc->encode(enc);
|
enc->encode(enc);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void radeon_uvd_enc_end_frame(struct pipe_video_codec *encoder,
|
static int radeon_uvd_enc_end_frame(struct pipe_video_codec *encoder,
|
||||||
struct pipe_video_buffer *source,
|
struct pipe_video_buffer *source,
|
||||||
struct pipe_picture_desc *picture)
|
struct pipe_picture_desc *picture)
|
||||||
{
|
{
|
||||||
struct radeon_uvd_encoder *enc = (struct radeon_uvd_encoder *)encoder;
|
struct radeon_uvd_encoder *enc = (struct radeon_uvd_encoder *)encoder;
|
||||||
flush(enc, picture->flush_flags);
|
return flush(enc, picture->flush_flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void radeon_uvd_enc_destroy(struct pipe_video_codec *encoder)
|
static void radeon_uvd_enc_destroy(struct pipe_video_codec *encoder)
|
||||||
|
@@ -303,7 +303,7 @@ static void rvce_encode_bitstream(struct pipe_video_codec *encoder,
|
|||||||
enc->feedback(enc);
|
enc->feedback(enc);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rvce_end_frame(struct pipe_video_codec *encoder, struct pipe_video_buffer *source,
|
static int rvce_end_frame(struct pipe_video_codec *encoder, struct pipe_video_buffer *source,
|
||||||
struct pipe_picture_desc *picture)
|
struct pipe_picture_desc *picture)
|
||||||
{
|
{
|
||||||
struct rvce_encoder *enc = (struct rvce_encoder *)encoder;
|
struct rvce_encoder *enc = (struct rvce_encoder *)encoder;
|
||||||
@@ -320,6 +320,7 @@ static void rvce_end_frame(struct pipe_video_codec *encoder, struct pipe_video_b
|
|||||||
list_del(&slot->list);
|
list_del(&slot->list);
|
||||||
list_add(&slot->list, &enc->cpb_slots);
|
list_add(&slot->list, &enc->cpb_slots);
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rvce_get_feedback(struct pipe_video_codec *encoder, void *feedback, unsigned *size,
|
static void rvce_get_feedback(struct pipe_video_codec *encoder, void *feedback, unsigned *size,
|
||||||
|
@@ -2569,7 +2569,7 @@ void send_cmd_dec(struct radeon_decoder *dec, struct pipe_video_buffer *target,
|
|||||||
/**
|
/**
|
||||||
* end decoding of the current frame
|
* end decoding of the current frame
|
||||||
*/
|
*/
|
||||||
static void radeon_dec_end_frame(struct pipe_video_codec *decoder, struct pipe_video_buffer *target,
|
static int radeon_dec_end_frame(struct pipe_video_codec *decoder, struct pipe_video_buffer *target,
|
||||||
struct pipe_picture_desc *picture)
|
struct pipe_picture_desc *picture)
|
||||||
{
|
{
|
||||||
struct radeon_decoder *dec = (struct radeon_decoder *)decoder;
|
struct radeon_decoder *dec = (struct radeon_decoder *)decoder;
|
||||||
@@ -2577,7 +2577,7 @@ static void radeon_dec_end_frame(struct pipe_video_codec *decoder, struct pipe_v
|
|||||||
assert(decoder);
|
assert(decoder);
|
||||||
|
|
||||||
if (!dec->bs_ptr)
|
if (!dec->bs_ptr)
|
||||||
return;
|
return 1;
|
||||||
|
|
||||||
dec->send_cmd(dec, target, picture);
|
dec->send_cmd(dec, target, picture);
|
||||||
flush(dec, picture->flush_flags, picture->fence);
|
flush(dec, picture->flush_flags, picture->fence);
|
||||||
@@ -2585,12 +2585,13 @@ static void radeon_dec_end_frame(struct pipe_video_codec *decoder, struct pipe_v
|
|||||||
dec->ws->fence_reference(dec->ws, &dec->prev_fence, *picture->fence);
|
dec->ws->fence_reference(dec->ws, &dec->prev_fence, *picture->fence);
|
||||||
|
|
||||||
next_buffer(dec);
|
next_buffer(dec);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* end decoding of the current jpeg frame
|
* end decoding of the current jpeg frame
|
||||||
*/
|
*/
|
||||||
static void radeon_dec_jpeg_end_frame(struct pipe_video_codec *decoder, struct pipe_video_buffer *target,
|
static int radeon_dec_jpeg_end_frame(struct pipe_video_codec *decoder, struct pipe_video_buffer *target,
|
||||||
struct pipe_picture_desc *picture)
|
struct pipe_picture_desc *picture)
|
||||||
{
|
{
|
||||||
struct radeon_decoder *dec = (struct radeon_decoder *)decoder;
|
struct radeon_decoder *dec = (struct radeon_decoder *)decoder;
|
||||||
@@ -2599,7 +2600,7 @@ static void radeon_dec_jpeg_end_frame(struct pipe_video_codec *decoder, struct p
|
|||||||
assert(decoder);
|
assert(decoder);
|
||||||
|
|
||||||
if (!dec->bs_ptr)
|
if (!dec->bs_ptr)
|
||||||
return;
|
return 1;
|
||||||
|
|
||||||
dec->jpg.crop_x = ROUND_DOWN_TO(pic->picture_parameter.crop_x, VL_MACROBLOCK_WIDTH);
|
dec->jpg.crop_x = ROUND_DOWN_TO(pic->picture_parameter.crop_x, VL_MACROBLOCK_WIDTH);
|
||||||
dec->jpg.crop_y = ROUND_DOWN_TO(pic->picture_parameter.crop_y, VL_MACROBLOCK_HEIGHT);
|
dec->jpg.crop_y = ROUND_DOWN_TO(pic->picture_parameter.crop_y, VL_MACROBLOCK_HEIGHT);
|
||||||
@@ -2613,6 +2614,7 @@ static void radeon_dec_jpeg_end_frame(struct pipe_video_codec *decoder, struct p
|
|||||||
dec->ws->cs_flush(&dec->jcs[dec->cb_idx], picture->flush_flags, NULL);
|
dec->ws->cs_flush(&dec->jcs[dec->cb_idx], picture->flush_flags, NULL);
|
||||||
next_buffer(dec);
|
next_buffer(dec);
|
||||||
dec->cb_idx = (dec->cb_idx+1) % dec->njctx;
|
dec->cb_idx = (dec->cb_idx+1) % dec->njctx;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -992,9 +992,9 @@ static void radeon_vcn_enc_get_param(struct radeon_encoder *enc, struct pipe_pic
|
|||||||
radeon_vcn_enc_av1_get_param(enc, (struct pipe_av1_enc_picture_desc *)picture);
|
radeon_vcn_enc_av1_get_param(enc, (struct pipe_av1_enc_picture_desc *)picture);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void flush(struct radeon_encoder *enc, unsigned flags)
|
static int flush(struct radeon_encoder *enc, unsigned flags)
|
||||||
{
|
{
|
||||||
enc->ws->cs_flush(&enc->cs, flags, NULL);
|
return enc->ws->cs_flush(&enc->cs, flags, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void radeon_enc_flush(struct pipe_video_codec *encoder)
|
static void radeon_enc_flush(struct pipe_video_codec *encoder)
|
||||||
@@ -1546,11 +1546,11 @@ static void radeon_enc_encode_bitstream(struct pipe_video_codec *encoder,
|
|||||||
enc->encode(enc);
|
enc->encode(enc);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void radeon_enc_end_frame(struct pipe_video_codec *encoder, struct pipe_video_buffer *source,
|
static int radeon_enc_end_frame(struct pipe_video_codec *encoder, struct pipe_video_buffer *source,
|
||||||
struct pipe_picture_desc *picture)
|
struct pipe_picture_desc *picture)
|
||||||
{
|
{
|
||||||
struct radeon_encoder *enc = (struct radeon_encoder *)encoder;
|
struct radeon_encoder *enc = (struct radeon_encoder *)encoder;
|
||||||
flush(enc, picture->flush_flags);
|
return flush(enc, picture->flush_flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void radeon_enc_destroy(struct pipe_video_codec *encoder)
|
static void radeon_enc_destroy(struct pipe_video_codec *encoder)
|
||||||
|
@@ -988,7 +988,7 @@ fail:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static int
|
||||||
si_vpe_processor_end_frame(struct pipe_video_codec *codec,
|
si_vpe_processor_end_frame(struct pipe_video_codec *codec,
|
||||||
struct pipe_video_buffer *target,
|
struct pipe_video_buffer *target,
|
||||||
struct pipe_picture_desc *picture)
|
struct pipe_picture_desc *picture)
|
||||||
@@ -1007,6 +1007,7 @@ si_vpe_processor_end_frame(struct pipe_video_codec *codec,
|
|||||||
SIVPE_WARN(vpeproc->log_level, "Fence may have problem!\n");
|
SIVPE_WARN(vpeproc->log_level, "Fence may have problem!\n");
|
||||||
|
|
||||||
SIVPE_INFO(vpeproc->log_level, "Success\n");
|
SIVPE_INFO(vpeproc->log_level, "Success\n");
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@@ -1106,7 +1106,7 @@ static void virgl_video_encode_bitstream(struct pipe_video_codec *codec,
|
|||||||
virgl_resource(target));
|
virgl_resource(target));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void virgl_video_end_frame(struct pipe_video_codec *codec,
|
static int virgl_video_end_frame(struct pipe_video_codec *codec,
|
||||||
struct pipe_video_buffer *target,
|
struct pipe_video_buffer *target,
|
||||||
struct pipe_picture_desc *picture)
|
struct pipe_picture_desc *picture)
|
||||||
{
|
{
|
||||||
@@ -1118,6 +1118,7 @@ static void virgl_video_end_frame(struct pipe_video_codec *codec,
|
|||||||
virgl_flush_eq(vctx, vctx, NULL);
|
virgl_flush_eq(vctx, vctx, NULL);
|
||||||
|
|
||||||
switch_buffer(vcdc);
|
switch_buffer(vcdc);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int virgl_video_get_decoder_fence(struct pipe_video_codec *decoder,
|
static int virgl_video_get_decoder_fence(struct pipe_video_codec *decoder,
|
||||||
|
@@ -104,8 +104,9 @@ struct pipe_video_codec
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* end decoding of the current frame
|
* end decoding of the current frame
|
||||||
|
* returns 0 on success
|
||||||
*/
|
*/
|
||||||
void (*end_frame)(struct pipe_video_codec *codec,
|
int (*end_frame)(struct pipe_video_codec *codec,
|
||||||
struct pipe_video_buffer *target,
|
struct pipe_video_buffer *target,
|
||||||
struct pipe_picture_desc *picture);
|
struct pipe_picture_desc *picture);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user