Skip to content

Commit 32f1d0c

Browse files
Eric Yangalexdeucher
authored andcommitted
drm/amd/display: implement workaround for riommu related hang
[Why] During S4/S5/reboot, sometimes riommu invalidation request arrive too early, DCN may be unable to respond to the invalidation request resulting in pstate hang. [How] VBIOS will force allow pstate for riommu invalidation and driver will clear it after powering down display pipes. Acked-by: Rodrigo Siqueira <[email protected]> Signed-off-by: Eric Yang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent ec3102d commit 32f1d0c

File tree

6 files changed

+27
-2
lines changed

6 files changed

+27
-2
lines changed

drivers/gpu/drm/amd/display/dc/dce/dce_hwseq.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,7 @@ struct dce_hwseq_registers {
636636
uint32_t ODM_MEM_PWR_CTRL3;
637637
uint32_t DMU_MEM_PWR_CNTL;
638638
uint32_t MMHUBBUB_MEM_PWR_CNTL;
639+
uint32_t DCHUBBUB_ARB_HOSTVM_CNTL;
639640
};
640641
/* set field name */
641642
#define HWS_SF(blk_name, reg_name, field_name, post_fix)\
@@ -1110,7 +1111,8 @@ struct dce_hwseq_registers {
11101111
type DOMAIN_POWER_FORCEON;\
11111112
type DOMAIN_POWER_GATE;\
11121113
type DOMAIN_PGFSM_PWR_STATUS;\
1113-
type HPO_HDMISTREAMCLK_G_GATE_DIS;
1114+
type HPO_HDMISTREAMCLK_G_GATE_DIS;\
1115+
type DISABLE_HOSTVM_FORCE_ALLOW_PSTATE;
11141116

11151117
struct dce_hwseq_shift {
11161118
HWSEQ_REG_FIELD_LIST(uint8_t)

drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hwseq.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
#include "dce/dmub_outbox.h"
4848
#include "dc_link_dp.h"
4949
#include "inc/link_dpcd.h"
50+
#include "dcn10/dcn10_hw_sequencer.h"
5051

5152
#define DC_LOGGER_INIT(logger)
5253

@@ -594,3 +595,20 @@ bool dcn31_is_abm_supported(struct dc *dc,
594595
}
595596
return false;
596597
}
598+
599+
static void apply_riommu_invalidation_wa(struct dc *dc)
600+
{
601+
struct dce_hwseq *hws = dc->hwseq;
602+
603+
if (!hws->wa.early_riommu_invalidation)
604+
return;
605+
606+
REG_UPDATE(DCHUBBUB_ARB_HOSTVM_CNTL, DISABLE_HOSTVM_FORCE_ALLOW_PSTATE, 0);
607+
}
608+
609+
void dcn31_init_pipes(struct dc *dc, struct dc_state *context)
610+
{
611+
dcn10_init_pipes(dc, context);
612+
apply_riommu_invalidation_wa(dc);
613+
614+
}

drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hwseq.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,6 @@ void dcn31_reset_hw_ctx_wrap(
5252
struct dc_state *context);
5353
bool dcn31_is_abm_supported(struct dc *dc,
5454
struct dc_state *context, struct dc_stream_state *stream);
55+
void dcn31_init_pipes(struct dc *dc, struct dc_state *context);
5556

5657
#endif /* __DC_HWSS_DCN31_H__ */

drivers/gpu/drm/amd/display/dc/dcn31/dcn31_init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ static const struct hw_sequencer_funcs dcn31_funcs = {
104104
};
105105

106106
static const struct hwseq_private_funcs dcn31_private_funcs = {
107-
.init_pipes = dcn10_init_pipes,
107+
.init_pipes = dcn31_init_pipes,
108108
.update_plane_addr = dcn20_update_plane_addr,
109109
.plane_atomic_disconnect = dcn10_plane_atomic_disconnect,
110110
.update_mpcc = dcn20_update_mpcc,

drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,7 @@ static const struct dccg_mask dccg_mask = {
741741

742742
#define HWSEQ_DCN31_REG_LIST()\
743743
SR(DCHUBBUB_GLOBAL_TIMER_CNTL), \
744+
SR(DCHUBBUB_ARB_HOSTVM_CNTL), \
744745
SR(DIO_MEM_PWR_CTRL), \
745746
SR(ODM_MEM_PWR_CTRL3), \
746747
SR(DMU_MEM_PWR_CNTL), \
@@ -801,6 +802,7 @@ static const struct dce_hwseq_registers hwseq_reg = {
801802
#define HWSEQ_DCN31_MASK_SH_LIST(mask_sh)\
802803
HWSEQ_DCN_MASK_SH_LIST(mask_sh), \
803804
HWS_SF(, DCHUBBUB_GLOBAL_TIMER_CNTL, DCHUBBUB_GLOBAL_TIMER_REFDIV, mask_sh), \
805+
HWS_SF(, DCHUBBUB_ARB_HOSTVM_CNTL, DISABLE_HOSTVM_FORCE_ALLOW_PSTATE, mask_sh), \
804806
HWS_SF(, DOMAIN0_PG_CONFIG, DOMAIN_POWER_FORCEON, mask_sh), \
805807
HWS_SF(, DOMAIN0_PG_CONFIG, DOMAIN_POWER_GATE, mask_sh), \
806808
HWS_SF(, DOMAIN1_PG_CONFIG, DOMAIN_POWER_FORCEON, mask_sh), \
@@ -1299,6 +1301,7 @@ static struct dce_hwseq *dcn31_hwseq_create(
12991301
hws->regs = &hwseq_reg;
13001302
hws->shifts = &hwseq_shift;
13011303
hws->masks = &hwseq_mask;
1304+
hws->wa.early_riommu_invalidation = true;
13021305
}
13031306
return hws;
13041307
}

drivers/gpu/drm/amd/display/dc/inc/hw_sequencer_private.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ struct dce_hwseq_wa {
4141
bool DEGVIDCN10_254;
4242
bool DEGVIDCN21;
4343
bool disallow_self_refresh_during_multi_plane_transition;
44+
bool early_riommu_invalidation;
4445
};
4546

4647
struct hwseq_wa_state {

0 commit comments

Comments
 (0)