Skip to content

Commit 74b4afa

Browse files
Mikita Lipskialexdeucher
authored andcommitted
drm/amd/display: Enable PSR Residency for multiple panels
[why] Allow specifying which panel to take PSR Residency measurements from. [how] Pass panel instance to DMUB through GPINT in the upper 8 bits of the parameter. Signed-off-by: Mikita Lipski <[email protected]> Reviewed-by: Nicholas Kazlauskas <[email protected]> Acked-by: Stylon Wang <[email protected]> Tested-by: Daniel Wheeler <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 5c69cc5 commit 74b4afa

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

drivers/gpu/drm/amd/display/dc/core/dc_link.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2940,10 +2940,14 @@ void dc_link_get_psr_residency(const struct dc_link *link, uint32_t *residency)
29402940
{
29412941
struct dc *dc = link->ctx->dc;
29422942
struct dmub_psr *psr = dc->res_pool->psr;
2943+
unsigned int panel_inst;
2944+
2945+
if (!dc_get_edp_link_panel_inst(dc, link, &panel_inst))
2946+
return;
29432947

2944-
// PSR residency measurements only supported on DMCUB
2948+
/* PSR residency measurements only supported on DMCUB */
29452949
if (psr != NULL && link->psr_settings.psr_feature_enabled)
2946-
psr->funcs->psr_get_residency(psr, residency);
2950+
psr->funcs->psr_get_residency(psr, residency, panel_inst);
29472951
else
29482952
*residency = 0;
29492953
}

drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -327,12 +327,13 @@ static void dmub_psr_force_static(struct dmub_psr *dmub, uint8_t panel_inst)
327327
/*
328328
* Get PSR residency from firmware.
329329
*/
330-
static void dmub_psr_get_residency(struct dmub_psr *dmub, uint32_t *residency)
330+
static void dmub_psr_get_residency(struct dmub_psr *dmub, uint32_t *residency, uint8_t panel_inst)
331331
{
332332
struct dmub_srv *srv = dmub->ctx->dmub_srv->dmub;
333+
uint16_t param = (uint16_t)(panel_inst << 8);
333334

334-
// Send gpint command and wait for ack
335-
dmub_srv_send_gpint_command(srv, DMUB_GPINT__PSR_RESIDENCY, 0, 30);
335+
/* Send gpint command and wait for ack */
336+
dmub_srv_send_gpint_command(srv, DMUB_GPINT__PSR_RESIDENCY, param, 30);
336337

337338
dmub_srv_get_gpint_response(srv, residency);
338339
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ struct dmub_psr_funcs {
4444
void (*psr_set_level)(struct dmub_psr *dmub, uint16_t psr_level,
4545
uint8_t panel_inst);
4646
void (*psr_force_static)(struct dmub_psr *dmub, uint8_t panel_inst);
47-
void (*psr_get_residency)(struct dmub_psr *dmub, uint32_t *residency);
47+
void (*psr_get_residency)(struct dmub_psr *dmub, uint32_t *residency,
48+
uint8_t panel_inst);
4849
};
4950

5051
struct dmub_psr *dmub_psr_create(struct dc_context *ctx);

0 commit comments

Comments
 (0)