drm/amd/display: Query DPIA HPD status.
[Why] Driver needs up to date DPIA HPD status. [How] Use HPD query command to get DPIA HPD status. Reviewed-by: Meenakshikumar Somasundaram <Meenakshikumar.Somasundaram@amd.com> Reviewed-by: Jun Lei <Jun.Lei@amd.com> Acked-by: Qingqing Zhuo <qingqing.zhuo@amd.com> Signed-off-by: Jimmy Kizito <Jimmy.Kizito@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
d84c4d194e
commit
fc0b067df7
@ -33,6 +33,7 @@
|
||||
#include "gpio_service_interface.h"
|
||||
#include "core_status.h"
|
||||
#include "dc_link_dp.h"
|
||||
#include "dc_link_dpia.h"
|
||||
#include "dc_link_ddc.h"
|
||||
#include "link_hwss.h"
|
||||
#include "opp.h"
|
||||
@ -240,7 +241,7 @@ bool dc_link_detect_sink(struct dc_link *link, enum dc_connection_type *type)
|
||||
|
||||
/* Link may not have physical HPD pin. */
|
||||
if (link->ep_type != DISPLAY_ENDPOINT_PHY) {
|
||||
if (link->is_hpd_pending || !link->hpd_status)
|
||||
if (link->is_hpd_pending || !dc_link_dpia_query_hpd_status(link))
|
||||
*type = dc_connection_none;
|
||||
else
|
||||
*type = dc_connection_single;
|
||||
|
@ -34,6 +34,7 @@
|
||||
#include "dm_helpers.h"
|
||||
#include "dmub/inc/dmub_cmd.h"
|
||||
#include "inc/link_dpcd.h"
|
||||
#include "dc_dmub_srv.h"
|
||||
|
||||
#define DC_LOGGER \
|
||||
link->ctx->logger
|
||||
@ -69,6 +70,24 @@ enum dc_status dpcd_get_tunneling_device_data(struct dc_link *link)
|
||||
return status;
|
||||
}
|
||||
|
||||
bool dc_link_dpia_query_hpd_status(struct dc_link *link)
|
||||
{
|
||||
union dmub_rb_cmd cmd = {0};
|
||||
struct dc_dmub_srv *dmub_srv = link->ctx->dmub_srv;
|
||||
bool is_hpd_high = false;
|
||||
|
||||
/* prepare QUERY_HPD command */
|
||||
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.ch_type = AUX_CHANNEL_DPIA;
|
||||
|
||||
/* Return HPD status reported by DMUB if query successfully executed. */
|
||||
if (dc_dmub_srv_cmd_with_reply_data(dmub_srv, &cmd) && cmd.query_hpd.data.status == AUX_RET_SUCCESS)
|
||||
is_hpd_high = cmd.query_hpd.data.result;
|
||||
|
||||
return is_hpd_high;
|
||||
}
|
||||
|
||||
/* Configure link as prescribed in link_setting; set LTTPR mode; and
|
||||
* Initialize link training settings.
|
||||
* Abort link training if sink unplug detected.
|
||||
|
@ -87,6 +87,11 @@ union dpia_set_config_data {
|
||||
*/
|
||||
enum dc_status dpcd_get_tunneling_device_data(struct dc_link *link);
|
||||
|
||||
/* Query hot plug status of USB4 DP tunnel.
|
||||
* Returns true if HPD high.
|
||||
*/
|
||||
bool dc_link_dpia_query_hpd_status(struct dc_link *link);
|
||||
|
||||
/* Train DP tunneling link for USB4 DPIA display endpoint.
|
||||
* DPIA equivalent of dc_link_dp_perfrorm_link_training.
|
||||
* Aborts link training upon detection of sink unplug.
|
||||
|
Loading…
Reference in New Issue
Block a user