Commit ab76bd72 authored by Meenakshikumar Somasundaram's avatar Meenakshikumar Somasundaram Committed by Alex Deucher

drm/amd/display: Dpia hpd status not in sync after S4

[Why]
Dpia hpd status not in sync causing driver not enabling BW Alloc after
S4.

[How]
Update hpd_status of the link when querying hpd state from dmub in
dpia_query_hpd_status().
Reviewed-by: default avatarNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Acked-by: default avatarRodrigo Siqueira <rodrigo.siqueira@amd.com>
Signed-off-by: default avatarMeenakshikumar Somasundaram <meenakshikumar.somasundaram@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 2476bf43
...@@ -82,25 +82,33 @@ bool dpia_query_hpd_status(struct dc_link *link) ...@@ -82,25 +82,33 @@ bool dpia_query_hpd_status(struct dc_link *link)
{ {
union dmub_rb_cmd cmd = {0}; union dmub_rb_cmd cmd = {0};
struct dc_dmub_srv *dmub_srv = link->ctx->dmub_srv; struct dc_dmub_srv *dmub_srv = link->ctx->dmub_srv;
bool is_hpd_high = false;
/* prepare QUERY_HPD command */ /* prepare QUERY_HPD command */
cmd.query_hpd.header.type = DMUB_CMD__QUERY_HPD_STATE; cmd.query_hpd.header.type = DMUB_CMD__QUERY_HPD_STATE;
cmd.query_hpd.data.instance = link->link_id.enum_id - ENUM_ID_1; cmd.query_hpd.data.instance = link->link_id.enum_id - ENUM_ID_1;
cmd.query_hpd.data.ch_type = AUX_CHANNEL_DPIA; cmd.query_hpd.data.ch_type = AUX_CHANNEL_DPIA;
/* Return HPD status reported by DMUB if query successfully executed. */ /* Query dpia hpd status from dmub */
if (dc_wake_and_execute_dmub_cmd(dmub_srv->ctx, &cmd, DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY) && if (dc_wake_and_execute_dmub_cmd(dmub_srv->ctx, &cmd,
cmd.query_hpd.data.status == AUX_RET_SUCCESS) DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY) &&
is_hpd_high = cmd.query_hpd.data.result; cmd.query_hpd.data.status == AUX_RET_SUCCESS) {
DC_LOG_DEBUG("%s: for link(%d) dpia(%d) success, current_hpd_status(%d) new_hpd_status(%d)\n",
DC_LOG_DEBUG("%s: link(%d) dpia(%d) cmd_status(%d) result(%d)\n", __func__,
__func__, link->link_index,
link->link_index, link->link_id.enum_id - ENUM_ID_1,
link->link_id.enum_id - ENUM_ID_1, link->hpd_status,
cmd.query_hpd.data.status, cmd.query_hpd.data.result);
cmd.query_hpd.data.result); link->hpd_status = cmd.query_hpd.data.result;
} else {
return is_hpd_high; DC_LOG_ERROR("%s: for link(%d) dpia(%d) failed with status(%d), current_hpd_status(%d) new_hpd_status(0)\n",
__func__,
link->link_index,
link->link_id.enum_id - ENUM_ID_1,
cmd.query_hpd.data.status,
link->hpd_status);
link->hpd_status = false;
}
return link->hpd_status;
} }
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