drm/amd/display: correct encoder minimal creation

[WHY]
shift and mask are not correctly initialized in create_minimal functions.

[HOW]
Correct initialize necessary variables.

Reviewed-by: Cruise Hung <cruise.hung@amd.com>
Signed-off-by: Peichen Huang <PeiChen.Huang@amd.com>
Signed-off-by: George Zhang <george.zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Peichen Huang 2026-06-16 10:37:02 +08:00 committed by Alex Deucher
parent dcce6246e6
commit e14fcf9e5d
11 changed files with 33 additions and 9 deletions

View File

@ -516,6 +516,8 @@ void dcn31_link_encoder_construct_minimal(
struct dc_context *ctx,
const struct encoder_feature_support *enc_features,
const struct dcn10_link_enc_registers *link_regs,
const struct dcn10_link_enc_shift *link_shift,
const struct dcn10_link_enc_mask *link_mask,
enum engine_id eng_id)
{
struct dcn10_link_encoder *enc10 = &enc20->enc10;
@ -529,6 +531,8 @@ void dcn31_link_encoder_construct_minimal(
enc10->base.features = *enc_features;
enc10->base.transmitter = TRANSMITTER_UNKNOWN;
enc10->link_regs = link_regs;
enc10->link_shift = link_shift;
enc10->link_mask = link_mask;
enc10->base.output_signals =
SIGNAL_TYPE_DISPLAY_PORT |

View File

@ -246,6 +246,8 @@ void dcn31_link_encoder_construct_minimal(
struct dc_context *ctx,
const struct encoder_feature_support *enc_features,
const struct dcn10_link_enc_registers *link_regs,
const struct dcn10_link_enc_shift *link_shift,
const struct dcn10_link_enc_mask *link_mask,
enum engine_id eng_id);
void dcn31_link_encoder_set_dio_phy_mux(

View File

@ -1189,7 +1189,7 @@ static struct link_encoder *dcn31_link_enc_create_minimal(
{
struct dcn20_link_encoder *enc20;
if (((unsigned int)eng_id - ENGINE_ID_DIGA) > ctx->dc->res_pool->res_cap->num_dig_link_enc)
if (((unsigned int)eng_id - ENGINE_ID_DIGA) >= ctx->dc->res_pool->res_cap->num_dig_link_enc)
return NULL;
enc20 = kzalloc_obj(struct dcn20_link_encoder);
@ -1201,6 +1201,8 @@ static struct link_encoder *dcn31_link_enc_create_minimal(
ctx,
&link_enc_feature,
&link_enc_regs[eng_id - ENGINE_ID_DIGA],
&le_shift,
&le_mask,
eng_id);
return &enc20->enc10.base;

View File

@ -1246,7 +1246,7 @@ static struct link_encoder *dcn31_link_enc_create_minimal(
{
struct dcn20_link_encoder *enc20;
if (((unsigned int)eng_id - ENGINE_ID_DIGA) > ctx->dc->res_pool->res_cap->num_dig_link_enc)
if (((unsigned int)eng_id - ENGINE_ID_DIGA) >= ctx->dc->res_pool->res_cap->num_dig_link_enc)
return NULL;
enc20 = kzalloc_obj(struct dcn20_link_encoder);
@ -1258,6 +1258,8 @@ static struct link_encoder *dcn31_link_enc_create_minimal(
ctx,
&link_enc_feature,
&link_enc_regs[eng_id - ENGINE_ID_DIGA],
&le_shift,
&le_mask,
eng_id);
return &enc20->enc10.base;

View File

@ -1188,7 +1188,7 @@ static struct link_encoder *dcn31_link_enc_create_minimal(
{
struct dcn20_link_encoder *enc20;
if (((unsigned int)eng_id - ENGINE_ID_DIGA) > ctx->dc->res_pool->res_cap->num_dig_link_enc)
if (((unsigned int)eng_id - ENGINE_ID_DIGA) >= ctx->dc->res_pool->res_cap->num_dig_link_enc)
return NULL;
enc20 = kzalloc_obj(struct dcn20_link_encoder);
@ -1200,6 +1200,8 @@ static struct link_encoder *dcn31_link_enc_create_minimal(
ctx,
&link_enc_feature,
&link_enc_regs[eng_id - ENGINE_ID_DIGA],
&le_shift,
&le_mask,
eng_id);
return &enc20->enc10.base;

View File

@ -1181,7 +1181,7 @@ static struct link_encoder *dcn31_link_enc_create_minimal(
{
struct dcn20_link_encoder *enc20;
if (((unsigned int)eng_id - ENGINE_ID_DIGA) > ctx->dc->res_pool->res_cap->num_dig_link_enc)
if (((unsigned int)eng_id - ENGINE_ID_DIGA) >= ctx->dc->res_pool->res_cap->num_dig_link_enc)
return NULL;
enc20 = kzalloc_obj(struct dcn20_link_encoder);
@ -1193,6 +1193,8 @@ static struct link_encoder *dcn31_link_enc_create_minimal(
ctx,
&link_enc_feature,
&link_enc_regs[eng_id - ENGINE_ID_DIGA],
&le_shift,
&le_mask,
eng_id);
return &enc20->enc10.base;

View File

@ -1188,7 +1188,7 @@ static struct link_encoder *dcn31_link_enc_create_minimal(
{
struct dcn20_link_encoder *enc20;
if (((unsigned int)eng_id - ENGINE_ID_DIGA) > ctx->dc->res_pool->res_cap->num_dig_link_enc)
if (((unsigned int)eng_id - ENGINE_ID_DIGA) >= ctx->dc->res_pool->res_cap->num_dig_link_enc)
return NULL;
enc20 = kzalloc_obj(struct dcn20_link_encoder);
@ -1200,6 +1200,8 @@ static struct link_encoder *dcn31_link_enc_create_minimal(
ctx,
&link_enc_feature,
&link_enc_regs[eng_id - ENGINE_ID_DIGA],
&le_shift,
&le_mask,
eng_id);
return &enc20->enc10.base;

View File

@ -1168,7 +1168,7 @@ static struct link_encoder *dcn31_link_enc_create_minimal(
{
struct dcn20_link_encoder *enc20;
if (((unsigned int)eng_id - ENGINE_ID_DIGA) > ctx->dc->res_pool->res_cap->num_dig_link_enc)
if (((unsigned int)eng_id - ENGINE_ID_DIGA) >= ctx->dc->res_pool->res_cap->num_dig_link_enc)
return NULL;
enc20 = kzalloc_obj(struct dcn20_link_encoder);
@ -1180,6 +1180,8 @@ static struct link_encoder *dcn31_link_enc_create_minimal(
ctx,
&link_enc_feature,
&link_enc_regs[eng_id - ENGINE_ID_DIGA],
&le_shift,
&le_mask,
eng_id);
return &enc20->enc10.base;

View File

@ -1175,7 +1175,7 @@ static struct link_encoder *dcn31_link_enc_create_minimal(
{
struct dcn20_link_encoder *enc20;
if (((unsigned int)eng_id - ENGINE_ID_DIGA) > ctx->dc->res_pool->res_cap->num_dig_link_enc)
if (((unsigned int)eng_id - ENGINE_ID_DIGA) >= ctx->dc->res_pool->res_cap->num_dig_link_enc)
return NULL;
enc20 = kzalloc_obj(struct dcn20_link_encoder);
@ -1187,6 +1187,8 @@ static struct link_encoder *dcn31_link_enc_create_minimal(
ctx,
&link_enc_feature,
&link_enc_regs[eng_id - ENGINE_ID_DIGA],
&le_shift,
&le_mask,
eng_id);
return &enc20->enc10.base;

View File

@ -1882,7 +1882,7 @@ static struct link_encoder *dcn42_link_enc_create_minimal(
{
struct dcn20_link_encoder *enc20;
if ((unsigned int)(eng_id - ENGINE_ID_DIGA) > ctx->dc->res_pool->res_cap->num_dig_link_enc)
if ((unsigned int)(eng_id - ENGINE_ID_DIGA) >= ctx->dc->res_pool->res_cap->num_dig_link_enc)
return NULL;
enc20 = kzalloc(sizeof(struct dcn20_link_encoder), GFP_KERNEL);
@ -1894,6 +1894,8 @@ static struct link_encoder *dcn42_link_enc_create_minimal(
ctx,
&link_enc_feature,
&link_enc_regs[eng_id - ENGINE_ID_DIGA],
&le_shift,
&le_mask,
eng_id);
return &enc20->enc10.base;

View File

@ -1824,7 +1824,7 @@ static struct link_encoder *dcn42b_link_enc_create_minimal(
{
struct dcn20_link_encoder *enc20;
if ((unsigned int)(eng_id - ENGINE_ID_DIGA) > ctx->dc->res_pool->res_cap->num_dig_link_enc)
if ((unsigned int)(eng_id - ENGINE_ID_DIGA) >= ctx->dc->res_pool->res_cap->num_dig_link_enc)
return NULL;
enc20 = kzalloc(sizeof(struct dcn20_link_encoder), GFP_KERNEL);
@ -1836,6 +1836,8 @@ static struct link_encoder *dcn42b_link_enc_create_minimal(
ctx,
&link_enc_feature,
&link_enc_regs[eng_id - ENGINE_ID_DIGA],
&le_shift,
&le_mask,
eng_id);
return &enc20->enc10.base;