radeonsi: respect pipe_picture_desc::flush_flags

It is not always possible to assume PIPE_FLUSH_ASYNC.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28771>
This commit is contained in:
Chia-I Wu 2024-04-16 10:17:30 -07:00 committed by Marge Bot
parent 08d3b93ce7
commit ae68fa51a4
6 changed files with 7 additions and 7 deletions

View file

@ -1194,7 +1194,7 @@ static void ruvd_end_frame(struct pipe_video_codec *decoder, struct pipe_video_b
FB_BUFFER_OFFSET + dec->fb_size, RADEON_USAGE_READ, RADEON_DOMAIN_GTT);
set_reg(dec, dec->reg.cntl, 1);
flush(dec, PIPE_FLUSH_ASYNC, picture->fence);
flush(dec, picture->flush_flags, picture->fence);
next_buffer(dec);
}

View file

@ -230,7 +230,7 @@ static void radeon_uvd_enc_end_frame(struct pipe_video_codec *encoder,
struct pipe_picture_desc *picture)
{
struct radeon_uvd_encoder *enc = (struct radeon_uvd_encoder *)encoder;
flush(enc, PIPE_FLUSH_ASYNC);
flush(enc, picture->flush_flags);
}
static void radeon_uvd_enc_destroy(struct pipe_video_codec *encoder)

View file

@ -310,7 +310,7 @@ static void rvce_end_frame(struct pipe_video_codec *encoder, struct pipe_video_b
struct rvce_cpb_slot *slot = list_entry(enc->cpb_slots.prev, struct rvce_cpb_slot, list);
if (!enc->dual_inst || enc->bs_idx > 1)
flush(enc, PIPE_FLUSH_ASYNC);
flush(enc, picture->flush_flags);
/* update the CPB backtrack with the just encoded frame */
slot->picture_type = enc->pic.picture_type;

View file

@ -2971,7 +2971,7 @@ static void radeon_dec_end_frame(struct pipe_video_codec *decoder, struct pipe_v
return;
dec->send_cmd(dec, target, picture);
flush(dec, PIPE_FLUSH_ASYNC, picture->fence);
flush(dec, picture->flush_flags, picture->fence);
if (picture->fence)
dec->ws->fence_reference(dec->ws, &dec->prev_fence, *picture->fence);
next_buffer(dec);
@ -3000,7 +3000,7 @@ static void radeon_dec_jpeg_end_frame(struct pipe_video_codec *decoder, struct p
if (dec->jpg.crop_y + dec->jpg.crop_height > pic->picture_parameter.picture_height)
dec->jpg.crop_height = 0;
dec->send_cmd(dec, target, picture);
dec->ws->cs_flush(&dec->jcs[dec->cb_idx], PIPE_FLUSH_ASYNC, NULL);
dec->ws->cs_flush(&dec->jcs[dec->cb_idx], picture->flush_flags, NULL);
next_buffer(dec);
dec->cb_idx = (dec->cb_idx+1) % dec->njctx;
}

View file

@ -1249,7 +1249,7 @@ static void radeon_enc_end_frame(struct pipe_video_codec *encoder, struct pipe_v
struct pipe_picture_desc *picture)
{
struct radeon_encoder *enc = (struct radeon_encoder *)encoder;
flush(enc, PIPE_FLUSH_ASYNC);
flush(enc, picture->flush_flags);
}
static void radeon_enc_destroy(struct pipe_video_codec *encoder)

View file

@ -997,7 +997,7 @@ si_vpe_processor_end_frame(struct pipe_video_codec *codec,
struct pipe_fence_handle *process_fence = NULL;
assert(codec);
vpeproc->ws->cs_flush(&vpeproc->cs, PIPE_FLUSH_ASYNC, &process_fence);
vpeproc->ws->cs_flush(&vpeproc->cs, picture->flush_flags, &process_fence);
next_buffer(vpeproc);
if (picture->fence && process_fence) {