Skip to content

Commit 293fa6e

Browse files
committed
Merge tag 'amd-drm-fixes-7.0-2026-04-02' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes
amd-drm-fixes-7.0-2026-04-02: amdgpu: - Fix audio regression on renoir Signed-off-by: Dave Airlie <airlied@redhat.com> From: Alex Deucher <alexander.deucher@amd.com> Link: https://patch.msgid.link/20260402194409.914769-1-alexander.deucher@amd.com
2 parents 82f5e5b + a498396 commit 293fa6e

17 files changed

Lines changed: 699 additions & 0 deletions

File tree

drivers/gpu/drm/amd/display/dc/resource/dcn10/dcn10_resource.c

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
#include "dce/dce_dmcu.h"
7272
#include "dce/dce_aux.h"
7373
#include "dce/dce_i2c.h"
74+
#include "dio/dcn10/dcn10_dio.h"
7475

7576
#ifndef mmDP0_DP_DPHY_INTERNAL_CTRL
7677
#define mmDP0_DP_DPHY_INTERNAL_CTRL 0x210f
@@ -444,6 +445,33 @@ static const struct dcn_hubbub_mask hubbub_mask = {
444445
HUBBUB_MASK_SH_LIST_DCN10(_MASK)
445446
};
446447

448+
static const struct dcn_dio_registers dio_regs = {
449+
DIO_REG_LIST_DCN10()
450+
};
451+
452+
#define DIO_MASK_SH_LIST(mask_sh)\
453+
HWS_SF(, DIO_MEM_PWR_CTRL, I2C_LIGHT_SLEEP_FORCE, mask_sh)
454+
455+
static const struct dcn_dio_shift dio_shift = {
456+
DIO_MASK_SH_LIST(__SHIFT)
457+
};
458+
459+
static const struct dcn_dio_mask dio_mask = {
460+
DIO_MASK_SH_LIST(_MASK)
461+
};
462+
463+
static struct dio *dcn10_dio_create(struct dc_context *ctx)
464+
{
465+
struct dcn10_dio *dio10 = kzalloc_obj(struct dcn10_dio);
466+
467+
if (!dio10)
468+
return NULL;
469+
470+
dcn10_dio_construct(dio10, ctx, &dio_regs, &dio_shift, &dio_mask);
471+
472+
return &dio10->base;
473+
}
474+
447475
static int map_transmitter_id_to_phy_instance(
448476
enum transmitter transmitter)
449477
{
@@ -917,6 +945,11 @@ static void dcn10_resource_destruct(struct dcn10_resource_pool *pool)
917945
kfree(pool->base.hubbub);
918946
pool->base.hubbub = NULL;
919947

948+
if (pool->base.dio != NULL) {
949+
kfree(TO_DCN10_DIO(pool->base.dio));
950+
pool->base.dio = NULL;
951+
}
952+
920953
for (i = 0; i < pool->base.pipe_count; i++) {
921954
if (pool->base.opps[i] != NULL)
922955
pool->base.opps[i]->funcs->opp_destroy(&pool->base.opps[i]);
@@ -1653,6 +1686,14 @@ static bool dcn10_resource_construct(
16531686
goto fail;
16541687
}
16551688

1689+
/* DIO */
1690+
pool->base.dio = dcn10_dio_create(ctx);
1691+
if (pool->base.dio == NULL) {
1692+
BREAK_TO_DEBUGGER();
1693+
dm_error("DC: failed to create dio!\n");
1694+
goto fail;
1695+
}
1696+
16561697
if (!resource_construct(num_virtual_links, dc, &pool->base,
16571698
&res_create_funcs))
16581699
goto fail;

drivers/gpu/drm/amd/display/dc/resource/dcn20/dcn20_resource.c

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
#include "dce/dce_dmcu.h"
8383
#include "dce/dce_aux.h"
8484
#include "dce/dce_i2c.h"
85+
#include "dio/dcn10/dcn10_dio.h"
8586
#include "vm_helper.h"
8687

8788
#include "link_enc_cfg.h"
@@ -550,6 +551,33 @@ static const struct dcn_hubbub_mask hubbub_mask = {
550551
HUBBUB_MASK_SH_LIST_DCN20(_MASK)
551552
};
552553

554+
static const struct dcn_dio_registers dio_regs = {
555+
DIO_REG_LIST_DCN10()
556+
};
557+
558+
#define DIO_MASK_SH_LIST(mask_sh)\
559+
HWS_SF(, DIO_MEM_PWR_CTRL, I2C_LIGHT_SLEEP_FORCE, mask_sh)
560+
561+
static const struct dcn_dio_shift dio_shift = {
562+
DIO_MASK_SH_LIST(__SHIFT)
563+
};
564+
565+
static const struct dcn_dio_mask dio_mask = {
566+
DIO_MASK_SH_LIST(_MASK)
567+
};
568+
569+
static struct dio *dcn20_dio_create(struct dc_context *ctx)
570+
{
571+
struct dcn10_dio *dio10 = kzalloc_obj(struct dcn10_dio);
572+
573+
if (!dio10)
574+
return NULL;
575+
576+
dcn10_dio_construct(dio10, ctx, &dio_regs, &dio_shift, &dio_mask);
577+
578+
return &dio10->base;
579+
}
580+
553581
#define vmid_regs(id)\
554582
[id] = {\
555583
DCN20_VMID_REG_LIST(id)\
@@ -1104,6 +1132,12 @@ static void dcn20_resource_destruct(struct dcn20_resource_pool *pool)
11041132
kfree(pool->base.hubbub);
11051133
pool->base.hubbub = NULL;
11061134
}
1135+
1136+
if (pool->base.dio != NULL) {
1137+
kfree(TO_DCN10_DIO(pool->base.dio));
1138+
pool->base.dio = NULL;
1139+
}
1140+
11071141
for (i = 0; i < pool->base.pipe_count; i++) {
11081142
if (pool->base.dpps[i] != NULL)
11091143
dcn20_dpp_destroy(&pool->base.dpps[i]);
@@ -2692,6 +2726,14 @@ static bool dcn20_resource_construct(
26922726
goto create_fail;
26932727
}
26942728

2729+
/* DIO */
2730+
pool->base.dio = dcn20_dio_create(ctx);
2731+
if (pool->base.dio == NULL) {
2732+
BREAK_TO_DEBUGGER();
2733+
dm_error("DC: failed to create dio!\n");
2734+
goto create_fail;
2735+
}
2736+
26952737
for (i = 0; i < pool->base.res_cap->num_dsc; i++) {
26962738
pool->base.dscs[i] = dcn20_dsc_create(ctx, i);
26972739
if (pool->base.dscs[i] == NULL) {

drivers/gpu/drm/amd/display/dc/resource/dcn201/dcn201_resource.c

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
#include "dce/dce_aux.h"
5757
#include "dce/dce_i2c.h"
5858
#include "dcn10/dcn10_resource.h"
59+
#include "dio/dcn10/dcn10_dio.h"
5960

6061
#include "cyan_skillfish_ip_offset.h"
6162

@@ -755,6 +756,33 @@ static struct hubbub *dcn201_hubbub_create(struct dc_context *ctx)
755756
return &hubbub->base;
756757
}
757758

759+
static const struct dcn_dio_registers dio_regs = {
760+
DIO_REG_LIST_DCN10()
761+
};
762+
763+
#define DIO_MASK_SH_LIST(mask_sh)\
764+
HWS_SF(, DIO_MEM_PWR_CTRL, I2C_LIGHT_SLEEP_FORCE, mask_sh)
765+
766+
static const struct dcn_dio_shift dio_shift = {
767+
DIO_MASK_SH_LIST(__SHIFT)
768+
};
769+
770+
static const struct dcn_dio_mask dio_mask = {
771+
DIO_MASK_SH_LIST(_MASK)
772+
};
773+
774+
static struct dio *dcn201_dio_create(struct dc_context *ctx)
775+
{
776+
struct dcn10_dio *dio10 = kzalloc_obj(struct dcn10_dio);
777+
778+
if (!dio10)
779+
return NULL;
780+
781+
dcn10_dio_construct(dio10, ctx, &dio_regs, &dio_shift, &dio_mask);
782+
783+
return &dio10->base;
784+
}
785+
758786
static struct timing_generator *dcn201_timing_generator_create(
759787
struct dc_context *ctx,
760788
uint32_t instance)
@@ -930,6 +958,11 @@ static void dcn201_resource_destruct(struct dcn201_resource_pool *pool)
930958
pool->base.hubbub = NULL;
931959
}
932960

961+
if (pool->base.dio != NULL) {
962+
kfree(TO_DCN10_DIO(pool->base.dio));
963+
pool->base.dio = NULL;
964+
}
965+
933966
for (i = 0; i < pool->base.pipe_count; i++) {
934967
if (pool->base.dpps[i] != NULL)
935968
dcn201_dpp_destroy(&pool->base.dpps[i]);
@@ -1276,6 +1309,14 @@ static bool dcn201_resource_construct(
12761309
goto create_fail;
12771310
}
12781311

1312+
/* DIO */
1313+
pool->base.dio = dcn201_dio_create(ctx);
1314+
if (pool->base.dio == NULL) {
1315+
BREAK_TO_DEBUGGER();
1316+
dm_error("DC: failed to create dio!\n");
1317+
goto create_fail;
1318+
}
1319+
12791320
if (!resource_construct(num_virtual_links, dc, &pool->base,
12801321
&res_create_funcs))
12811322
goto create_fail;

drivers/gpu/drm/amd/display/dc/resource/dcn21/dcn21_resource.c

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
#include "dce/dce_dmcu.h"
8585
#include "dce/dce_aux.h"
8686
#include "dce/dce_i2c.h"
87+
#include "dio/dcn10/dcn10_dio.h"
8788
#include "dcn21_resource.h"
8889
#include "vm_helper.h"
8990
#include "dcn20/dcn20_vmid.h"
@@ -329,6 +330,25 @@ static const struct dcn_hubbub_mask hubbub_mask = {
329330
HUBBUB_MASK_SH_LIST_DCN21(_MASK)
330331
};
331332

333+
static const struct dcn_dio_registers dio_regs = {
334+
DIO_REG_LIST_DCN10()
335+
};
336+
337+
static const struct dcn_dio_shift dio_shift = { 0 };
338+
339+
static const struct dcn_dio_mask dio_mask = { 0 };
340+
341+
static struct dio *dcn21_dio_create(struct dc_context *ctx)
342+
{
343+
struct dcn10_dio *dio10 = kzalloc_obj(struct dcn10_dio);
344+
345+
if (!dio10)
346+
return NULL;
347+
348+
dcn10_dio_construct(dio10, ctx, &dio_regs, &dio_shift, &dio_mask);
349+
350+
return &dio10->base;
351+
}
332352

333353
#define vmid_regs(id)\
334354
[id] = {\
@@ -677,6 +697,12 @@ static void dcn21_resource_destruct(struct dcn21_resource_pool *pool)
677697
kfree(pool->base.hubbub);
678698
pool->base.hubbub = NULL;
679699
}
700+
701+
if (pool->base.dio != NULL) {
702+
kfree(TO_DCN10_DIO(pool->base.dio));
703+
pool->base.dio = NULL;
704+
}
705+
680706
for (i = 0; i < pool->base.pipe_count; i++) {
681707
if (pool->base.dpps[i] != NULL)
682708
dcn20_dpp_destroy(&pool->base.dpps[i]);
@@ -1654,6 +1680,14 @@ static bool dcn21_resource_construct(
16541680
goto create_fail;
16551681
}
16561682

1683+
/* DIO */
1684+
pool->base.dio = dcn21_dio_create(ctx);
1685+
if (pool->base.dio == NULL) {
1686+
BREAK_TO_DEBUGGER();
1687+
dm_error("DC: failed to create dio!\n");
1688+
goto create_fail;
1689+
}
1690+
16571691
for (i = 0; i < pool->base.res_cap->num_dsc; i++) {
16581692
pool->base.dscs[i] = dcn21_dsc_create(ctx, i);
16591693
if (pool->base.dscs[i] == NULL) {

drivers/gpu/drm/amd/display/dc/resource/dcn30/dcn30_resource.c

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
#include "dml/display_mode_vba.h"
6161
#include "dcn30/dcn30_dccg.h"
6262
#include "dcn10/dcn10_resource.h"
63+
#include "dio/dcn10/dcn10_dio.h"
6364
#include "link_service.h"
6465
#include "dce/dce_panel_cntl.h"
6566

@@ -886,6 +887,33 @@ static struct hubbub *dcn30_hubbub_create(struct dc_context *ctx)
886887
return &hubbub3->base;
887888
}
888889

890+
static const struct dcn_dio_registers dio_regs = {
891+
DIO_REG_LIST_DCN10()
892+
};
893+
894+
#define DIO_MASK_SH_LIST(mask_sh)\
895+
HWS_SF(, DIO_MEM_PWR_CTRL, I2C_LIGHT_SLEEP_FORCE, mask_sh)
896+
897+
static const struct dcn_dio_shift dio_shift = {
898+
DIO_MASK_SH_LIST(__SHIFT)
899+
};
900+
901+
static const struct dcn_dio_mask dio_mask = {
902+
DIO_MASK_SH_LIST(_MASK)
903+
};
904+
905+
static struct dio *dcn30_dio_create(struct dc_context *ctx)
906+
{
907+
struct dcn10_dio *dio10 = kzalloc_obj(struct dcn10_dio);
908+
909+
if (!dio10)
910+
return NULL;
911+
912+
dcn10_dio_construct(dio10, ctx, &dio_regs, &dio_shift, &dio_mask);
913+
914+
return &dio10->base;
915+
}
916+
889917
static struct timing_generator *dcn30_timing_generator_create(
890918
struct dc_context *ctx,
891919
uint32_t instance)
@@ -1095,6 +1123,12 @@ static void dcn30_resource_destruct(struct dcn30_resource_pool *pool)
10951123
kfree(pool->base.hubbub);
10961124
pool->base.hubbub = NULL;
10971125
}
1126+
1127+
if (pool->base.dio != NULL) {
1128+
kfree(TO_DCN10_DIO(pool->base.dio));
1129+
pool->base.dio = NULL;
1130+
}
1131+
10981132
for (i = 0; i < pool->base.pipe_count; i++) {
10991133
if (pool->base.dpps[i] != NULL)
11001134
dcn30_dpp_destroy(&pool->base.dpps[i]);
@@ -2464,6 +2498,14 @@ static bool dcn30_resource_construct(
24642498
goto create_fail;
24652499
}
24662500

2501+
/* DIO */
2502+
pool->base.dio = dcn30_dio_create(ctx);
2503+
if (pool->base.dio == NULL) {
2504+
BREAK_TO_DEBUGGER();
2505+
dm_error("DC: failed to create dio!\n");
2506+
goto create_fail;
2507+
}
2508+
24672509
/* HUBPs, DPPs, OPPs and TGs */
24682510
for (i = 0; i < pool->base.pipe_count; i++) {
24692511
pool->base.hubps[i] = dcn30_hubp_create(ctx, i);

0 commit comments

Comments
 (0)