summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/display/dmub/src/dmub_srv_stat.c
diff options
context:
space:
mode:
authorMustapha Ghaddar <mghaddar@amd.com>2022-12-01 13:00:10 -0500
committerAlex Deucher <alexander.deucher@amd.com>2022-12-15 12:18:18 -0500
commit669018a9929c61cb14ea374ee93df24242a7794d (patch)
treee0d3d0dd346a379bc489459fb3562531777745aa /drivers/gpu/drm/amd/display/dmub/src/dmub_srv_stat.c
parent3f6752b4de41896c7f1609b1585db2080e8150d8 (diff)
downloadlinux-669018a9929c61cb14ea374ee93df24242a7794d.tar.gz
linux-669018a9929c61cb14ea374ee93df24242a7794d.tar.bz2
linux-669018a9929c61cb14ea374ee93df24242a7794d.zip
drm/amd/display: Add DPIA NOTIFICATION logic
[WHY] Adding the new DPIA NOTIFY packets from DMUB As per the design with Cruise to account for 250ms response delay otherwise [HOW] Added th DPIA NOTIFY logic as per DMUB logic Reviewed-by: Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com> Acked-by: Jasdeep Dhillon <jdhillon@amd.com> Signed-off-by: Mustapha Ghaddar <mghaddar@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/dmub/src/dmub_srv_stat.c')
-rw-r--r--drivers/gpu/drm/amd/display/dmub/src/dmub_srv_stat.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/display/dmub/src/dmub_srv_stat.c b/drivers/gpu/drm/amd/display/dmub/src/dmub_srv_stat.c
index 44502ec919a2..55a534ec0794 100644
--- a/drivers/gpu/drm/amd/display/dmub/src/dmub_srv_stat.c
+++ b/drivers/gpu/drm/amd/display/dmub/src/dmub_srv_stat.c
@@ -92,6 +92,27 @@ enum dmub_status dmub_srv_stat_get_notification(struct dmub_srv *dmub,
notify->link_index = cmd.set_config_reply.set_config_reply_control.instance;
notify->sc_status = cmd.set_config_reply.set_config_reply_control.status;
break;
+ case DMUB_OUT_CMD__DPIA_NOTIFICATION:
+ notify->type = DMUB_NOTIFICATION_DPIA_NOTIFICATION;
+ notify->link_index = cmd.dpia_notify.payload.header.instance;
+
+ if (cmd.dpia_notify.payload.header.type == DPIA_NOTIFY__BW_ALLOCATION) {
+
+ if (cmd.dpia_notify.payload.data.dpia_bw_alloc.bits.bw_request_failed) {
+ notify->result = DPIA_BW_REQ_FAILED;
+ } else if (cmd.dpia_notify.payload.data.dpia_bw_alloc.bits.bw_request_succeeded) {
+ notify->result = DPIA_BW_REQ_SUCCESS;
+ notify->bw_alloc_reply.allocated_bw =
+ cmd.dpia_notify.payload.data.dpia_bw_alloc.allocated_bw;
+ } else if (cmd.dpia_notify.payload.data.dpia_bw_alloc.bits.est_bw_changed) {
+ notify->result = DPIA_EST_BW_CHANGED;
+ notify->bw_alloc_reply.estimated_bw =
+ cmd.dpia_notify.payload.data.dpia_bw_alloc.estimated_bw;
+ } else if (cmd.dpia_notify.payload.data.dpia_bw_alloc.bits.bw_alloc_cap_changed) {
+ notify->result = DPIA_BW_ALLOC_CAPS_CHANGED;
+ }
+ }
+ break;
default:
notify->type = DMUB_NOTIFICATION_NO_DATA;
break;