Skip to content

Commit ebb20fc

Browse files
effective-lightalexdeucher
authored andcommitted
drm/amd/display: add DMUB source files and changes for DCN351
DMUB support is required to light-up displays. Signed-off-by: Hamza Mahfooz <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 3a80fe5 commit ebb20fc

File tree

4 files changed

+52
-0
lines changed

4 files changed

+52
-0
lines changed

drivers/gpu/drm/amd/display/dmub/src/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ DMUB += dmub_dcn30.o dmub_dcn301.o dmub_dcn302.o dmub_dcn303.o
2525
DMUB += dmub_dcn31.o dmub_dcn314.o dmub_dcn315.o dmub_dcn316.o
2626
DMUB += dmub_dcn32.o
2727
DMUB += dmub_dcn35.o
28+
DMUB += dmub_dcn351.o
2829

2930
AMD_DAL_DMUB = $(addprefix $(AMDDALPATH)/dmub/src/,$(DMUB))
3031

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/* SPDX-License-Identifier: MIT */
2+
/* Copyright 2024 Advanced Micro Devices, Inc. */
3+
4+
#include "../dmub_srv.h"
5+
#include "dmub_reg.h"
6+
#include "dmub_dcn351.h"
7+
8+
#include "dcn/dcn_3_5_1_offset.h"
9+
#include "dcn/dcn_3_5_1_sh_mask.h"
10+
11+
#define BASE_INNER(seg) ctx->dcn_reg_offsets[seg]
12+
#define CTX dmub
13+
#define REGS dmub->regs_dcn35
14+
#define REG_OFFSET_EXP(reg_name) BASE(reg##reg_name##_BASE_IDX) + reg##reg_name
15+
16+
void dmub_srv_dcn351_regs_init(struct dmub_srv *dmub, struct dc_context *ctx)
17+
{
18+
struct dmub_srv_dcn35_regs *regs = dmub->regs_dcn35;
19+
#define REG_STRUCT regs
20+
21+
#define DMUB_SR(reg) REG_STRUCT->offset.reg = REG_OFFSET_EXP(reg);
22+
DMUB_DCN35_REGS()
23+
DMCUB_INTERNAL_REGS()
24+
#undef DMUB_SR
25+
26+
#define DMUB_SF(reg, field) REG_STRUCT->mask.reg##__##field = FD_MASK(reg, field);
27+
DMUB_DCN35_FIELDS()
28+
#undef DMUB_SF
29+
30+
#define DMUB_SF(reg, field) REG_STRUCT->shift.reg##__##field = FD_SHIFT(reg, field);
31+
DMUB_DCN35_FIELDS()
32+
#undef DMUB_SF
33+
#undef REG_STRUCT
34+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/* SPDX-License-Identifier: MIT */
2+
/* Copyright 2024 Advanced Micro Devices, Inc. */
3+
4+
#ifndef _DMUB_DCN351_H_
5+
#define _DMUB_DCN351_H_
6+
7+
#include "dmub_dcn35.h"
8+
9+
struct dmub_srv;
10+
11+
void dmub_srv_dcn351_regs_init(struct dmub_srv *dmub, struct dc_context *ctx);
12+
13+
#endif /* _DMUB_DCN351_H_ */

drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
#include "dmub_dcn316.h"
3838
#include "dmub_dcn32.h"
3939
#include "dmub_dcn35.h"
40+
#include "dmub_dcn351.h"
4041
#include "os_types.h"
4142
/*
4243
* Note: the DMUB service is standalone. No additional headers should be
@@ -315,6 +316,7 @@ static bool dmub_srv_hw_setup(struct dmub_srv *dmub, enum dmub_asic asic)
315316
break;
316317

317318
case DMUB_ASIC_DCN35:
319+
case DMUB_ASIC_DCN351:
318320
dmub->regs_dcn35 = &dmub_srv_dcn35_regs;
319321
funcs->configure_dmub_in_system_memory = dmub_dcn35_configure_dmub_in_system_memory;
320322
funcs->send_inbox0_cmd = dmub_dcn35_send_inbox0_cmd;
@@ -351,6 +353,8 @@ static bool dmub_srv_hw_setup(struct dmub_srv *dmub, enum dmub_asic asic)
351353
funcs->get_diagnostic_data = dmub_dcn35_get_diagnostic_data;
352354

353355
funcs->init_reg_offsets = dmub_srv_dcn35_regs_init;
356+
if (asic == DMUB_ASIC_DCN351)
357+
funcs->init_reg_offsets = dmub_srv_dcn351_regs_init;
354358

355359
funcs->is_hw_powered_up = dmub_dcn35_is_hw_powered_up;
356360
funcs->should_detect = dmub_dcn35_should_detect;

0 commit comments

Comments
 (0)