Commit 461c40e0 authored by Veerabadhran Gopalakrishnan's avatar Veerabadhran Gopalakrishnan Committed by Veerabadhran Gopalakrishnan
Browse files

radeon/vce: Move global function pointer si_get_pic_param to local encoder structure


Multi gpu use case broken when the function was global
Reviewed-by: Leo Liu's avatarLeo Liu <leo.liu@amd.com>
Tested-by: Marge Bot <mesa/mesa!3731>
Part-of: <mesa/mesa!3731>
parent 28614119
......@@ -48,10 +48,6 @@
#define FW_52_8_3 ((52 << 24) | (8 << 16) | (3 << 8))
#define FW_53 (53 << 24)
/* version specific function for getting parameters */
static void (*si_get_pic_param)(struct rvce_encoder *enc,
struct pipe_h264_enc_picture_desc *pic) = NULL;
/**
* flush commands to the hardware
*/
......@@ -276,7 +272,7 @@ static void rvce_begin_frame(struct pipe_video_codec *encoder,
enc->pic.rate_ctrl.target_bitrate != pic->rate_ctrl.target_bitrate;
enc->pic = *pic;
si_get_pic_param(enc, pic);
enc->si_get_pic_param(enc, pic);
enc->get_buffer(vid_buf->resources[0], &enc->handle, &enc->luma);
enc->get_buffer(vid_buf->resources[1], NULL, &enc->chroma);
......@@ -494,7 +490,6 @@ struct pipe_video_codec *si_vce_create_encoder(struct pipe_context *context,
switch (sscreen->info.vce_fw_version) {
case FW_40_2_2:
si_vce_40_2_2_init(enc);
si_get_pic_param = si_vce_40_2_2_get_param;
break;
case FW_50_0_1:
......@@ -502,20 +497,17 @@ struct pipe_video_codec *si_vce_create_encoder(struct pipe_context *context,
case FW_50_10_2:
case FW_50_17_3:
si_vce_50_init(enc);
si_get_pic_param = si_vce_50_get_param;
break;
case FW_52_0_3:
case FW_52_4_3:
case FW_52_8_3:
si_vce_52_init(enc);
si_get_pic_param = si_vce_52_get_param;
break;
default:
if ((sscreen->info.vce_fw_version & (0xff << 24)) >= FW_53) {
si_vce_52_init(enc);
si_get_pic_param = si_vce_52_get_param;
} else
goto error;
}
......
......@@ -376,6 +376,8 @@ struct rvce_encoder {
void (*task_info)(struct rvce_encoder *enc, uint32_t op,
uint32_t dep, uint32_t fb_idx,
uint32_t ring_idx);
void (*si_get_pic_param)(struct rvce_encoder *enc,
struct pipe_h264_enc_picture_desc *pic);
unsigned stream_handle;
......
......@@ -443,4 +443,5 @@ void si_vce_40_2_2_init(struct rvce_encoder *enc)
enc->config = config;
enc->encode = encode;
enc->destroy = destroy;
enc->si_get_pic_param = si_vce_40_2_2_get_param;
}
......@@ -238,4 +238,5 @@ void si_vce_50_init(struct rvce_encoder *enc)
/* only the two below are different */
enc->rate_control = rate_control;
enc->encode = encode;
enc->si_get_pic_param = si_vce_50_get_param;
}
......@@ -667,4 +667,5 @@ void si_vce_52_init(struct rvce_encoder *enc)
enc->config = config;
enc->encode = encode;
enc->destroy = destroy;
enc->si_get_pic_param = si_vce_52_get_param;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment