mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-06-09 10:08:17 +02:00
radeonsi/video: Drop offsets parameter for si_vid_resize_buffer
Not used anymore. Reviewed-by: Ruijing Dong <ruijing.dong@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39627>
This commit is contained in:
parent
af5b9d7a4e
commit
2130df7c2a
6 changed files with 13 additions and 41 deletions
|
|
@ -933,7 +933,7 @@ static void radeon_uvd_enc_begin_frame(struct pipe_video_codec *encoder,
|
|||
RVID_ERR("Can't create DPB buffer.\n");
|
||||
return;
|
||||
}
|
||||
} else if (!si_vid_resize_buffer(enc->base.context, &enc->dpb, dpb_size, NULL)) {
|
||||
} else if (!si_vid_resize_buffer(enc->base.context, &enc->dpb, dpb_size)) {
|
||||
RVID_ERR("Can't resize DPB buffer.\n");
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -803,7 +803,7 @@ static void rvce_begin_frame(struct pipe_video_codec *encoder, struct pipe_video
|
|||
RVID_ERR("Can't create DPB buffer.\n");
|
||||
return;
|
||||
}
|
||||
} else if (!si_vid_resize_buffer(enc->base.context, &enc->dpb, dpb_size, NULL)) {
|
||||
} else if (!si_vid_resize_buffer(enc->base.context, &enc->dpb, dpb_size)) {
|
||||
RVID_ERR("Can't resize DPB buffer.\n");
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1627,12 +1627,12 @@ static void radeon_enc_begin_frame(struct pipe_video_codec *encoder,
|
|||
|
||||
if (dpb_slots > enc->dpb_slots) {
|
||||
setup_dpb(enc, dpb_slots);
|
||||
if (!si_vid_resize_buffer(enc->base.context, &enc->dpb, enc->dpb_size, NULL)) {
|
||||
if (!si_vid_resize_buffer(enc->base.context, &enc->dpb, enc->dpb_size)) {
|
||||
RADEON_ENC_ERR("Can't resize DPB buffer.\n");
|
||||
goto error;
|
||||
}
|
||||
if (sscreen->info.vcn_ip_version >= VCN_5_0_0 && enc->metadata_size &&
|
||||
!si_vid_resize_buffer(enc->base.context, &enc->meta, enc->metadata_size, NULL)) {
|
||||
!si_vid_resize_buffer(enc->base.context, &enc->meta, enc->metadata_size)) {
|
||||
RADEON_ENC_ERR("Can't resize meta buffer.\n");
|
||||
goto error;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,8 +27,7 @@ unsigned si_vid_alloc_stream_handle()
|
|||
}
|
||||
|
||||
bool si_vid_resize_buffer(struct pipe_context *context,
|
||||
struct si_resource **buf, unsigned new_size,
|
||||
struct rvid_buf_offset_info *buf_ofst_info)
|
||||
struct si_resource **buf, unsigned new_size)
|
||||
{
|
||||
struct si_context *sctx = (struct si_context *)context;
|
||||
struct si_screen *sscreen = (struct si_screen *)context->screen;
|
||||
|
|
@ -51,37 +50,18 @@ bool si_vid_resize_buffer(struct pipe_context *context,
|
|||
if (!dst)
|
||||
goto error;
|
||||
|
||||
if (buf_ofst_info) {
|
||||
memcpy(dst, src, bytes);
|
||||
if (new_size > bytes) {
|
||||
new_size -= bytes;
|
||||
dst += bytes;
|
||||
memset(dst, 0, new_size);
|
||||
for(int i =0; i < buf_ofst_info->num_units; i++) {
|
||||
memcpy(dst, src, buf_ofst_info->old_offset);
|
||||
dst += buf_ofst_info->new_offset;
|
||||
src += buf_ofst_info->old_offset;
|
||||
}
|
||||
} else {
|
||||
memcpy(dst, src, bytes);
|
||||
if (new_size > bytes) {
|
||||
new_size -= bytes;
|
||||
dst += bytes;
|
||||
memset(dst, 0, new_size);
|
||||
}
|
||||
}
|
||||
ws->buffer_unmap(ws, new_buf->buf);
|
||||
ws->buffer_unmap(ws, old_buf->buf);
|
||||
} else {
|
||||
si_barrier_before_simple_buffer_op(sctx, 0, &new_buf->b.b, &old_buf->b.b);
|
||||
if (buf_ofst_info) {
|
||||
uint64_t dst_offset = 0, src_offset = 0;
|
||||
for (int i = 0; i < buf_ofst_info->num_units; i++) {
|
||||
si_copy_buffer(sctx, &new_buf->b.b, &old_buf->b.b,
|
||||
dst_offset, src_offset, buf_ofst_info->old_offset);
|
||||
dst_offset += buf_ofst_info->new_offset;
|
||||
src_offset += buf_ofst_info->old_offset;
|
||||
}
|
||||
} else {
|
||||
bytes = MIN2(new_buf->b.b.width0, old_buf->b.b.width0);
|
||||
si_copy_buffer(sctx, &new_buf->b.b, &old_buf->b.b, 0, 0, bytes);
|
||||
}
|
||||
bytes = MIN2(new_buf->b.b.width0, old_buf->b.b.width0);
|
||||
si_copy_buffer(sctx, &new_buf->b.b, &old_buf->b.b, 0, 0, bytes);
|
||||
context->flush(context, NULL, 0);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,20 +15,12 @@
|
|||
|
||||
#define UVD_FW_1_66_16 ((1 << 24) | (66 << 16) | (16 << 8))
|
||||
|
||||
/* video buffer offset info representation */
|
||||
struct rvid_buf_offset_info {
|
||||
unsigned num_units;
|
||||
unsigned old_offset;
|
||||
unsigned new_offset;
|
||||
};
|
||||
|
||||
/* generate a stream handle */
|
||||
unsigned si_vid_alloc_stream_handle(void);
|
||||
|
||||
/* reallocate a buffer, preserving its content */
|
||||
bool si_vid_resize_buffer(struct pipe_context *context,
|
||||
struct si_resource **buf, unsigned new_size,
|
||||
struct rvid_buf_offset_info *buf_ofst_info);
|
||||
struct si_resource **buf, unsigned new_size);
|
||||
|
||||
struct pipe_video_buffer *si_video_buffer_create(struct pipe_context *pipe,
|
||||
const struct pipe_video_buffer *tmpl);
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ static void si_dec_decode_bitstream(struct pipe_video_codec *decoder, struct pip
|
|||
}
|
||||
si_resource_reference(&vid->bs_buffers[vid->cur_buffer], NULL);
|
||||
vid->bs_buffers[vid->cur_buffer] = buf;
|
||||
} else if (!si_vid_resize_buffer(vid->base.context, &vid->bs_buffers[vid->cur_buffer], total_bs_size, NULL)) {
|
||||
} else if (!si_vid_resize_buffer(vid->base.context, &vid->bs_buffers[vid->cur_buffer], total_bs_size)) {
|
||||
ERROR("Can't resize bitstream buffer!");
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue