Commit 8f38b66c authored by Hersen Wu's avatar Hersen Wu Committed by Alex Deucher
Browse files

drm/amd/display: USB-C to HDMI dongle not light



RV1 support only USB-C active DP-2-HDMI dongle. HPD short pulse is
generated only for DP signal.

When processing HPD short pulse, it must be DP active dongle. No need
for I2C-Over-AUX detection.

v2: Add description

Signed-off-by: default avatarHersen Wu <hersenxs.wu@amd.com>
Reviewed-by: default avatarTony Cheng <Tony.Cheng@amd.com>
Acked-by: default avatarHarry Wentland <Harry.Wentland@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 4451a255
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -639,7 +639,7 @@ int amdgpu_dm_display_resume(struct amdgpu_device *adev )
			continue;

		mutex_lock(&aconnector->hpd_lock);
		dc_link_detect(aconnector->dc_link, false);
		dc_link_detect(aconnector->dc_link, DETECT_REASON_HPD);
		aconnector->dc_sink = NULL;
		amdgpu_dm_update_connector_after_detect(aconnector);
		mutex_unlock(&aconnector->hpd_lock);
@@ -855,7 +855,7 @@ static void handle_hpd_irq(void *param)
	 * since (for MST case) MST does this in it's own context.
	 */
	mutex_lock(&aconnector->hpd_lock);
	if (dc_link_detect(aconnector->dc_link, false)) {
	if (dc_link_detect(aconnector->dc_link, DETECT_REASON_HPD)) {
		amdgpu_dm_update_connector_after_detect(aconnector);


@@ -965,7 +965,7 @@ static void handle_hpd_rx_irq(void *param)
	if (dc_link_handle_hpd_rx_irq(aconnector->dc_link, NULL) &&
			!is_mst_root_connector) {
		/* Downstream Port status changed. */
		if (dc_link_detect(aconnector->dc_link, false)) {
		if (dc_link_detect(aconnector->dc_link, DETECT_REASON_HPDRX)) {
			amdgpu_dm_update_connector_after_detect(aconnector);


@@ -1353,7 +1353,8 @@ int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)
			goto fail_free_encoder;
		}

		if (dc_link_detect(dc_get_link_at_index(dm->dc, i), true))
		if (dc_link_detect(dc_get_link_at_index(dm->dc, i),
				DETECT_REASON_BOOT))
			amdgpu_dm_update_connector_after_detect(aconnector);
	}

+21 −11
Original line number Diff line number Diff line
@@ -355,7 +355,9 @@ static bool is_dp_sink_present(struct dc_link *link)
 * @brief
 * Detect output sink type
 */
static enum signal_type link_detect_sink(struct dc_link *link)
static enum signal_type link_detect_sink(
	struct dc_link *link,
	enum dc_detect_reason reason)
{
	enum signal_type result = get_basic_signal_type(
		link->link_enc->id, link->link_id);
@@ -388,13 +390,18 @@ static enum signal_type link_detect_sink(struct dc_link *link)
	}
	break;
	case CONNECTOR_ID_DISPLAY_PORT: {

		/* DP HPD short pulse. Passive DP dongle will not
		 * have short pulse
		 */
		if (reason != DETECT_REASON_HPDRX) {
			/* Check whether DP signal detected: if not -
			 * we assume signal is DVI; it could be corrected
		 * to HDMI after dongle detection */
			 * to HDMI after dongle detection
			 */
			if (!is_dp_sink_present(link))
				result = SIGNAL_TYPE_DVI_SINGLE_LINK;
		}
	}
	break;
	default:
	break;
@@ -460,9 +467,10 @@ static void detect_dp(
	struct display_sink_capability *sink_caps,
	bool *converter_disable_audio,
	struct audio_support *audio_support,
	bool boot)
	enum dc_detect_reason reason)
{
	sink_caps->signal = link_detect_sink(link);
	bool boot = false;
	sink_caps->signal = link_detect_sink(link, reason);
	sink_caps->transaction_type =
		get_ddc_transaction_type(sink_caps->signal);

@@ -513,6 +521,8 @@ static void detect_dp(
			 * Need check ->sink usages in case ->sink = NULL
			 * TODO: s3 resume check
			 */
			if (reason == DETECT_REASON_BOOT)
				boot = true;

			if (dm_helpers_dp_mst_start_top_mgr(
				link->ctx,
@@ -531,7 +541,7 @@ static void detect_dp(
	}
}

bool dc_link_detect(struct dc_link *link, bool boot)
bool dc_link_detect(struct dc_link *link, enum dc_detect_reason reason)
{
	struct dc_sink_init_data sink_init_data = { 0 };
	struct display_sink_capability sink_caps = { 0 };
@@ -596,7 +606,7 @@ bool dc_link_detect(struct dc_link *link, bool boot)
				link,
				&sink_caps,
				&converter_disable_audio,
				aud_support, boot);
				aud_support, reason);

			/* Active dongle downstream unplug */
			if (link->type == dc_connection_active_dongle
+7 −1
Original line number Diff line number Diff line
@@ -885,7 +885,13 @@ bool dc_link_setup_psr(struct dc_link *dc_link,
 * true otherwise. True meaning further action is required (status update
 * and OS notification).
 */
bool dc_link_detect(struct dc_link *dc_link, bool boot);
enum dc_detect_reason {
	DETECT_REASON_BOOT,
	DETECT_REASON_HPD,
	DETECT_REASON_HPDRX,
};

bool dc_link_detect(struct dc_link *dc_link, enum dc_detect_reason reason);

/* Notify DC about DP RX Interrupt (aka Short Pulse Interrupt).
 * Return: