Commit 74b4afad authored by Mikita Lipski's avatar Mikita Lipski Committed by Alex Deucher

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: default avatarMikita Lipski <mikita.lipski@amd.com>
Reviewed-by: default avatarNicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
Acked-by: default avatarStylon Wang <stylon.wang@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 5c69cc55
...@@ -2940,10 +2940,14 @@ void dc_link_get_psr_residency(const struct dc_link *link, uint32_t *residency) ...@@ -2940,10 +2940,14 @@ void dc_link_get_psr_residency(const struct dc_link *link, uint32_t *residency)
{ {
struct dc *dc = link->ctx->dc; struct dc *dc = link->ctx->dc;
struct dmub_psr *psr = dc->res_pool->psr; struct dmub_psr *psr = dc->res_pool->psr;
unsigned int panel_inst;
if (!dc_get_edp_link_panel_inst(dc, link, &panel_inst))
return;
// PSR residency measurements only supported on DMCUB /* PSR residency measurements only supported on DMCUB */
if (psr != NULL && link->psr_settings.psr_feature_enabled) if (psr != NULL && link->psr_settings.psr_feature_enabled)
psr->funcs->psr_get_residency(psr, residency); psr->funcs->psr_get_residency(psr, residency, panel_inst);
else else
*residency = 0; *residency = 0;
} }
......
...@@ -327,12 +327,13 @@ static void dmub_psr_force_static(struct dmub_psr *dmub, uint8_t panel_inst) ...@@ -327,12 +327,13 @@ static void dmub_psr_force_static(struct dmub_psr *dmub, uint8_t panel_inst)
/* /*
* Get PSR residency from firmware. * Get PSR residency from firmware.
*/ */
static void dmub_psr_get_residency(struct dmub_psr *dmub, uint32_t *residency) static void dmub_psr_get_residency(struct dmub_psr *dmub, uint32_t *residency, uint8_t panel_inst)
{ {
struct dmub_srv *srv = dmub->ctx->dmub_srv->dmub; struct dmub_srv *srv = dmub->ctx->dmub_srv->dmub;
uint16_t param = (uint16_t)(panel_inst << 8);
// Send gpint command and wait for ack /* Send gpint command and wait for ack */
dmub_srv_send_gpint_command(srv, DMUB_GPINT__PSR_RESIDENCY, 0, 30); dmub_srv_send_gpint_command(srv, DMUB_GPINT__PSR_RESIDENCY, param, 30);
dmub_srv_get_gpint_response(srv, residency); dmub_srv_get_gpint_response(srv, residency);
} }
......
...@@ -44,7 +44,8 @@ struct dmub_psr_funcs { ...@@ -44,7 +44,8 @@ struct dmub_psr_funcs {
void (*psr_set_level)(struct dmub_psr *dmub, uint16_t psr_level, void (*psr_set_level)(struct dmub_psr *dmub, uint16_t psr_level,
uint8_t panel_inst); uint8_t panel_inst);
void (*psr_force_static)(struct dmub_psr *dmub, uint8_t panel_inst); void (*psr_force_static)(struct dmub_psr *dmub, uint8_t panel_inst);
void (*psr_get_residency)(struct dmub_psr *dmub, uint32_t *residency); void (*psr_get_residency)(struct dmub_psr *dmub, uint32_t *residency,
uint8_t panel_inst);
}; };
struct dmub_psr *dmub_psr_create(struct dc_context *ctx); struct dmub_psr *dmub_psr_create(struct dc_context *ctx);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment