radeonsi/vcn: Remove encode op_preset overrides

The only difference is HIGH_QUALITY on VCN4+ and forcing BALANCE
with sao on VCN2+.

Reviewed-by: Benjamin Cheng <benjamin.cheng@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40766>
This commit is contained in:
David Rosca 2026-04-02 18:03:57 +02:00 committed by Marge Bot
parent 2e340d63d2
commit e8bce7ec47
4 changed files with 10 additions and 44 deletions

View file

@ -27,10 +27,16 @@ static void radeon_vcn_enc_quality_modes(struct radeon_encoder *enc,
? RENCODE_PRESET_MODE_HIGH_QUALITY
: in->preset_mode;
if (u_reduce_video_profile(enc->base.profile) != PIPE_VIDEO_FORMAT_AV1 &&
if (sscreen->info.vcn_ip_version < VCN_4_0_0 &&
p->preset_mode == RENCODE_PRESET_MODE_HIGH_QUALITY)
p->preset_mode = RENCODE_PRESET_MODE_QUALITY;
if (sscreen->info.vcn_ip_version >= VCN_2_0_0 &&
p->preset_mode == RENCODE_PRESET_MODE_SPEED &&
!enc->enc_pic.hevc_deblock.disable_sao &&
u_reduce_video_profile(enc->base.profile) == PIPE_VIDEO_FORMAT_HEVC)
p->preset_mode = RENCODE_PRESET_MODE_BALANCE;
if (enc->first_frame) {
p->pre_encode_mode = in->pre_encode_mode ? RENCODE_PREENCODE_MODE_4X
: RENCODE_PREENCODE_MODE_NONE;

View file

@ -871,7 +871,9 @@ static void radeon_enc_op_preset(struct radeon_encoder *enc)
{
uint32_t preset_mode;
if (enc->enc_pic.quality_modes.preset_mode == RENCODE_PRESET_MODE_QUALITY)
if (enc->enc_pic.quality_modes.preset_mode == RENCODE_PRESET_MODE_HIGH_QUALITY)
preset_mode = RENCODE_IB_OP_SET_HIGH_QUALITY_ENCODING_MODE;
else if (enc->enc_pic.quality_modes.preset_mode == RENCODE_PRESET_MODE_QUALITY)
preset_mode = RENCODE_IB_OP_SET_QUALITY_ENCODING_MODE;
else if (enc->enc_pic.quality_modes.preset_mode == RENCODE_PRESET_MODE_BALANCE)
preset_mode = RENCODE_IB_OP_SET_BALANCE_ENCODING_MODE;

View file

@ -17,25 +17,6 @@
#define RENCODE_FW_INTERFACE_MAJOR_VERSION 1
#define RENCODE_FW_INTERFACE_MINOR_VERSION 20
static void radeon_enc_op_preset(struct radeon_encoder *enc)
{
uint32_t preset_mode;
if (enc->enc_pic.quality_modes.preset_mode == RENCODE_PRESET_MODE_SPEED &&
(!enc->enc_pic.hevc_deblock.disable_sao &&
(u_reduce_video_profile(enc->base.profile) == PIPE_VIDEO_FORMAT_HEVC)))
preset_mode = RENCODE_IB_OP_SET_BALANCE_ENCODING_MODE;
else if (enc->enc_pic.quality_modes.preset_mode == RENCODE_PRESET_MODE_QUALITY)
preset_mode = RENCODE_IB_OP_SET_QUALITY_ENCODING_MODE;
else if (enc->enc_pic.quality_modes.preset_mode == RENCODE_PRESET_MODE_BALANCE)
preset_mode = RENCODE_IB_OP_SET_BALANCE_ENCODING_MODE;
else
preset_mode = RENCODE_IB_OP_SET_SPEED_ENCODING_MODE;
RADEON_ENC_BEGIN(preset_mode);
RADEON_ENC_END();
}
static void radeon_enc_quality_params(struct radeon_encoder *enc)
{
RADEON_ENC_BEGIN(enc->cmd.quality_params);
@ -150,7 +131,6 @@ void radeon_enc_2_0_init(struct radeon_encoder *enc)
enc->input_format = radeon_enc_input_format;
enc->output_format = radeon_enc_output_format;
enc->ctx = radeon_enc_ctx;
enc->op_preset = radeon_enc_op_preset;
enc->quality_params = radeon_enc_quality_params;
if (u_reduce_video_profile(enc->base.profile) == PIPE_VIDEO_FORMAT_HEVC) {

View file

@ -37,27 +37,6 @@ static void radeon_enc_sq_destroy(struct radeon_encoder *enc)
rvcn_sq_tail(&enc->cs, &enc->sq);
}
static void radeon_enc_op_preset(struct radeon_encoder *enc)
{
uint32_t preset_mode;
if (enc->enc_pic.quality_modes.preset_mode == RENCODE_PRESET_MODE_SPEED &&
(!enc->enc_pic.hevc_deblock.disable_sao &&
(u_reduce_video_profile(enc->base.profile) == PIPE_VIDEO_FORMAT_HEVC)))
preset_mode = RENCODE_IB_OP_SET_BALANCE_ENCODING_MODE;
else if (enc->enc_pic.quality_modes.preset_mode == RENCODE_PRESET_MODE_QUALITY)
preset_mode = RENCODE_IB_OP_SET_QUALITY_ENCODING_MODE;
else if (enc->enc_pic.quality_modes.preset_mode == RENCODE_PRESET_MODE_HIGH_QUALITY)
preset_mode = RENCODE_IB_OP_SET_HIGH_QUALITY_ENCODING_MODE;
else if (enc->enc_pic.quality_modes.preset_mode == RENCODE_PRESET_MODE_BALANCE)
preset_mode = RENCODE_IB_OP_SET_BALANCE_ENCODING_MODE;
else
preset_mode = RENCODE_IB_OP_SET_SPEED_ENCODING_MODE;
RADEON_ENC_BEGIN(preset_mode);
RADEON_ENC_END();
}
static void radeon_enc_session_init(struct radeon_encoder *enc)
{
enc->enc_pic.session_init.slice_output_enabled = 0;
@ -533,7 +512,6 @@ void radeon_enc_4_0_init(struct radeon_encoder *enc)
enc->begin = radeon_enc_sq_begin;
enc->encode = radeon_enc_sq_encode;
enc->destroy = radeon_enc_sq_destroy;
enc->op_preset = radeon_enc_op_preset;
if (u_reduce_video_profile(enc->base.profile) == PIPE_VIDEO_FORMAT_AV1) {
/* begin function need to set these functions to dummy */