Commit 115c7e7f authored by Wyatt Wood's avatar Wyatt Wood Committed by Alex Deucher

drm/amd/display: Add psr get_state call

[Why]
Driver needs to know PSR state.

[How]
Use GPINT to call to firmware and get psr state.
Signed-off-by: default avatarWyatt Wood <wyatt.wood@amd.com>
Reviewed-by: default avatarNicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
Acked-by: default avatarRodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 71bbb1fc
...@@ -2451,7 +2451,7 @@ bool dc_link_get_psr_state(const struct dc_link *link, uint32_t *psr_state) ...@@ -2451,7 +2451,7 @@ bool dc_link_get_psr_state(const struct dc_link *link, uint32_t *psr_state)
struct dmub_psr *psr = dc->res_pool->psr; struct dmub_psr *psr = dc->res_pool->psr;
if (psr != NULL && link->psr_feature_enabled) if (psr != NULL && link->psr_feature_enabled)
psr->funcs->psr_get_state(psr_state); psr->funcs->psr_get_state(psr, psr_state);
else if (dmcu != NULL && link->psr_feature_enabled) else if (dmcu != NULL && link->psr_feature_enabled)
dmcu->funcs->get_psr_state(dmcu, psr_state); dmcu->funcs->get_psr_state(dmcu, psr_state);
......
...@@ -29,17 +29,20 @@ ...@@ -29,17 +29,20 @@
#include "../../dmub/inc/dmub_srv.h" #include "../../dmub/inc/dmub_srv.h"
#include "dmub_fw_state.h" #include "dmub_fw_state.h"
#include "core_types.h" #include "core_types.h"
#include "ipp.h"
#define MAX_PIPES 6 #define MAX_PIPES 6
/** /**
* Get PSR state from firmware. * Get PSR state from firmware.
*/ */
static void dmub_psr_get_state(uint32_t *psr_state) static void dmub_psr_get_state(struct dmub_psr *dmub, uint32_t *psr_state)
{ {
// Not yet implemented struct dmub_srv *srv = dmub->ctx->dmub_srv->dmub;
// Trigger GPINT interrupt from firmware
// Send gpint command and wait for ack
dmub_srv_send_gpint_command(srv, DMUB_GPINT__GET_PSR_STATE, 0, 30);
dmub_srv_get_gpint_response(srv, psr_state);
} }
/** /**
...@@ -100,7 +103,7 @@ static void dmub_psr_set_level(struct dmub_psr *dmub, uint16_t psr_level) ...@@ -100,7 +103,7 @@ static void dmub_psr_set_level(struct dmub_psr *dmub, uint16_t psr_level)
uint32_t psr_state = 0; uint32_t psr_state = 0;
struct dc_context *dc = dmub->ctx; struct dc_context *dc = dmub->ctx;
dmub_psr_get_state(&psr_state); dmub_psr_get_state(dmub, &psr_state);
if (psr_state == 0) if (psr_state == 0)
return; return;
......
...@@ -36,7 +36,7 @@ struct dmub_psr { ...@@ -36,7 +36,7 @@ struct dmub_psr {
struct dmub_psr_funcs { struct dmub_psr_funcs {
bool (*psr_copy_settings)(struct dmub_psr *dmub, struct dc_link *link, struct psr_context *psr_context); bool (*psr_copy_settings)(struct dmub_psr *dmub, struct dc_link *link, struct psr_context *psr_context);
void (*psr_enable)(struct dmub_psr *dmub, bool enable); void (*psr_enable)(struct dmub_psr *dmub, bool enable);
void (*psr_get_state)(uint32_t *psr_state); void (*psr_get_state)(struct dmub_psr *dmub, uint32_t *psr_state);
void (*psr_set_level)(struct dmub_psr *dmub, uint16_t psr_level); void (*psr_set_level)(struct dmub_psr *dmub, uint16_t psr_level);
}; };
......
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