Skip to content

Commit

Permalink
drm/amd/display: Add additional pstate registers to HW state query
Browse files Browse the repository at this point in the history
[WHY]
These registers would be useful to know when debugging pstate issues.

[HOW]
Add additional registers to hw state query.

Reviewed-by: Aric Cyr <Aric.Cyr@amd.com>
Reviewed-by: Jun Lei <Jun.Lei@amd.com>
Acked-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Sung Lee <sunglee@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
  • Loading branch information
Sung Lee authored and Alex Deucher committed Jun 9, 2023
1 parent 1ffbc89 commit 738b346
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.h
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,8 @@ struct dcn_hubp_state {
uint32_t primary_surface_addr_hi;
uint32_t primary_meta_addr_lo;
uint32_t primary_meta_addr_hi;
uint32_t uclk_pstate_force;
uint32_t hubp_cntl;
};

struct dcn10_hubp {
Expand Down
6 changes: 6 additions & 0 deletions drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubbub.c
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,12 @@ void hubbub2_read_state(struct hubbub *hubbub, struct dcn_hubbub_state *hubbub_s
REG_WRITE(DCHUBBUB_TEST_DEBUG_INDEX, 0x6);
hubbub_state->test_debug_data = REG_READ(DCHUBBUB_TEST_DEBUG_DATA);
}

if (REG(DCHUBBUB_ARB_WATERMARK_CHANGE_CNTL))
hubbub_state->watermark_change_cntl = REG_READ(DCHUBBUB_ARB_WATERMARK_CHANGE_CNTL);

if (REG(DCHUBBUB_ARB_DRAM_STATE_CNTL))
hubbub_state->dram_state_cntl = REG_READ(DCHUBBUB_ARB_DRAM_STATE_CNTL);
}

static const struct hubbub_funcs hubbub2_funcs = {
Expand Down
6 changes: 6 additions & 0 deletions drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hubp.c
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,12 @@ void hubp3_read_state(struct hubp *hubp)
SWATH_HEIGHT_C, &rq_regs->rq_regs_c.swath_height,
PTE_ROW_HEIGHT_LINEAR_C, &rq_regs->rq_regs_c.pte_row_height_linear);

if (REG(UCLK_PSTATE_FORCE))
s->uclk_pstate_force = REG_READ(UCLK_PSTATE_FORCE);

if (REG(DCHUBP_CNTL))
s->hubp_cntl = REG_READ(DCHUBP_CNTL);

}

void hubp3_setup(
Expand Down
2 changes: 2 additions & 0 deletions drivers/gpu/drm/amd/display/dc/inc/hw/dchubbub.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ struct dcn_hubbub_state {
uint32_t vm_error_pipe;
uint32_t vm_error_mode;
uint32_t test_debug_data;
uint32_t watermark_change_cntl;
uint32_t dram_state_cntl;
};

struct hubbub_funcs {
Expand Down

0 comments on commit 738b346

Please sign in to comment.