Commit d18a56b2 authored by Daniel Sa's avatar Daniel Sa Committed by Alex Deucher
Browse files

drm/amd/display: Emulate Display Hotplug Hang



[WHY]
Driver reports 0 display when the virtual display is still present, and
causes P-state hang in FW.

[HOW]
When enumerating through streams, check for active planes and use that
to indicate number of displays.

Reviewed-by: default avatarDillon Varone <dillon.varone@amd.com>
Signed-off-by: default avatarDaniel Sa <Daniel.Sa@amd.com>
Signed-off-by: default avatarAlex Hung <alex.hung@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent f588da30
Loading
Loading
Loading
Loading
+2 −7
Original line number Diff line number Diff line
@@ -59,6 +59,7 @@ int clk_mgr_helper_get_active_display_cnt(
	display_count = 0;
	for (i = 0; i < context->stream_count; i++) {
		const struct dc_stream_state *stream = context->streams[i];
		const struct dc_stream_status *stream_status = &context->stream_status[i];

		/* Don't count SubVP phantom pipes as part of active
		 * display count
@@ -66,13 +67,7 @@ int clk_mgr_helper_get_active_display_cnt(
		if (dc_state_get_stream_subvp_type(context, stream) == SUBVP_PHANTOM)
			continue;

		/*
		 * Only notify active stream or virtual stream.
		 * Need to notify virtual stream to work around
		 * headless case. HPD does not fire when system is in
		 * S0i2.
		 */
		if (!stream->dpms_off || stream->signal == SIGNAL_TYPE_VIRTUAL)
		if (!stream->dpms_off || (stream_status && stream_status->plane_count))
			display_count++;
	}