Commit 0db66572 authored by Nicholas Kazlauskas's avatar Nicholas Kazlauskas Committed by Alex Deucher

drm/amd/display: Add outbox notification support for HPD redetect

[Why]
HPD sense changes can occur during low power states and need to be
notified from firmware to driver. Upon notification the hotplug
redetection routines should execute.

[How]
Add Support in DMUB srv and DMUB srv stat for receiving these
notifications. DM can hook them up and process the HPD redetection
once received.
Reviewed-by: default avatarDuncan Ma <duncan.ma@amd.com>
Acked-by: default avatarZaeem Mohamed <zaeem.mohamed@amd.com>
Signed-off-by: default avatarNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent b95fa494
...@@ -137,6 +137,7 @@ enum dmub_notification_type { ...@@ -137,6 +137,7 @@ enum dmub_notification_type {
DMUB_NOTIFICATION_HPD_IRQ, DMUB_NOTIFICATION_HPD_IRQ,
DMUB_NOTIFICATION_SET_CONFIG_REPLY, DMUB_NOTIFICATION_SET_CONFIG_REPLY,
DMUB_NOTIFICATION_DPIA_NOTIFICATION, DMUB_NOTIFICATION_DPIA_NOTIFICATION,
DMUB_NOTIFICATION_HPD_SENSE_NOTIFY,
DMUB_NOTIFICATION_MAX DMUB_NOTIFICATION_MAX
}; };
...@@ -560,6 +561,7 @@ struct dmub_notification { ...@@ -560,6 +561,7 @@ struct dmub_notification {
* DPIA notification command. * DPIA notification command.
*/ */
struct dmub_rb_cmd_dpia_notification dpia_notification; struct dmub_rb_cmd_dpia_notification dpia_notification;
struct dmub_rb_cmd_hpd_sense_notify_data hpd_sense_notify;
}; };
}; };
......
...@@ -1285,6 +1285,10 @@ enum dmub_out_cmd_type { ...@@ -1285,6 +1285,10 @@ enum dmub_out_cmd_type {
* Command type used for USB4 DPIA notification * Command type used for USB4 DPIA notification
*/ */
DMUB_OUT_CMD__DPIA_NOTIFICATION = 5, DMUB_OUT_CMD__DPIA_NOTIFICATION = 5,
/**
* Command type used for HPD redetect notification
*/
DMUB_OUT_CMD__HPD_SENSE_NOTIFY = 6,
}; };
/* DMUB_CMD__DPIA command sub-types. */ /* DMUB_CMD__DPIA command sub-types. */
...@@ -2468,6 +2472,22 @@ struct dmub_rb_cmd_query_hpd_state { ...@@ -2468,6 +2472,22 @@ struct dmub_rb_cmd_query_hpd_state {
struct dmub_cmd_hpd_state_query_data data; struct dmub_cmd_hpd_state_query_data data;
}; };
/**
* struct dmub_rb_cmd_hpd_sense_notify - HPD sense notification data.
*/
struct dmub_rb_cmd_hpd_sense_notify_data {
uint32_t old_hpd_sense_mask; /**< Old HPD sense mask */
uint32_t new_hpd_sense_mask; /**< New HPD sense mask */
};
/**
* struct dmub_rb_cmd_hpd_sense_notify - DMUB_OUT_CMD__HPD_SENSE_NOTIFY command.
*/
struct dmub_rb_cmd_hpd_sense_notify {
struct dmub_cmd_header header; /**< header */
struct dmub_rb_cmd_hpd_sense_notify_data data; /**< payload */
};
/* /*
* Command IDs should be treated as stable ABI. * Command IDs should be treated as stable ABI.
* Do not reuse or modify IDs. * Do not reuse or modify IDs.
...@@ -5204,6 +5224,10 @@ union dmub_rb_out_cmd { ...@@ -5204,6 +5224,10 @@ union dmub_rb_out_cmd {
* DPIA notification command. * DPIA notification command.
*/ */
struct dmub_rb_cmd_dpia_notification dpia_notification; struct dmub_rb_cmd_dpia_notification dpia_notification;
/**
* HPD sense notification command.
*/
struct dmub_rb_cmd_hpd_sense_notify hpd_sense_notify;
}; };
#pragma pack(pop) #pragma pack(pop)
......
...@@ -113,6 +113,12 @@ enum dmub_status dmub_srv_stat_get_notification(struct dmub_srv *dmub, ...@@ -113,6 +113,12 @@ enum dmub_status dmub_srv_stat_get_notification(struct dmub_srv *dmub,
notify->result = DPIA_BW_ALLOC_CAPS_CHANGED; notify->result = DPIA_BW_ALLOC_CAPS_CHANGED;
} }
break; break;
case DMUB_OUT_CMD__HPD_SENSE_NOTIFY:
notify->type = DMUB_NOTIFICATION_HPD_SENSE_NOTIFY;
dmub_memcpy(&notify->hpd_sense_notify,
&cmd.hpd_sense_notify.data,
sizeof(cmd.hpd_sense_notify.data));
break;
default: default:
notify->type = DMUB_NOTIFICATION_NO_DATA; notify->type = DMUB_NOTIFICATION_NO_DATA;
break; break;
......
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