aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c
diff options
context:
space:
mode:
authorWyatt Wood <wyatt.wood@amd.com>2020-10-21 08:36:51 -0400
committerAlex Deucher <alexander.deucher@amd.com>2020-11-16 12:18:38 -0500
commitb8e0b3d611e3388361d86a19f27bf2a6d7366111 (patch)
tree3520e4e0a4bcbe68537cf025233ea66ba7d09671 /drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c
parent58cae8ac6b87c11917e58f3f4bbe4cd1c6d86352 (diff)
downloadlinux-b8e0b3d611e3388361d86a19f27bf2a6d7366111.tar.gz
drm/amd/display: Hook up PSR residency command to DSAT
[Why] Use GPINT command to get PSR residency from FW. [How] Hook up PSR residency command to DSAT. Since PSR Count Request is deprecated, we will use this. Signed-off-by: Wyatt Wood <wyatt.wood@amd.com> Acked-by: Bindu Ramamurthy <bindu.r@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c')
-rw-r--r--drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c b/drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c
index df3879c713c5..0d6fe7c29c20 100644
--- a/drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c
+++ b/drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c
@@ -293,12 +293,26 @@ static void dmub_psr_force_static(struct dmub_psr *dmub)
dc_dmub_srv_wait_idle(dc->dmub_srv);
}
+/**
+ * Get PSR residency from firmware.
+ */
+static void dmub_psr_get_residency(struct dmub_psr *dmub, uint32_t *residency)
+{
+ struct dmub_srv *srv = dmub->ctx->dmub_srv->dmub;
+
+ // Send gpint command and wait for ack
+ dmub_srv_send_gpint_command(srv, DMUB_GPINT__PSR_RESIDENCY, 0, 30);
+
+ dmub_srv_get_gpint_response(srv, residency);
+}
+
static const struct dmub_psr_funcs psr_funcs = {
.psr_copy_settings = dmub_psr_copy_settings,
.psr_enable = dmub_psr_enable,
.psr_get_state = dmub_psr_get_state,
.psr_set_level = dmub_psr_set_level,
.psr_force_static = dmub_psr_force_static,
+ .psr_get_residency = dmub_psr_get_residency,
};
/**