]> git.dujemihanovic.xyz Git - linux.git/commitdiff
drm/amd/display: Emulate Display Hotplug Hang
authorDaniel Sa <Daniel.Sa@amd.com>
Fri, 23 Aug 2024 15:29:23 +0000 (11:29 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 18 Sep 2024 20:15:06 +0000 (16:15 -0400)
[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: Dillon Varone <dillon.varone@amd.com>
Signed-off-by: Daniel Sa <Daniel.Sa@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/clk_mgr/clk_mgr.c

index f770828df14937136a0dec2ec5b76be8aab48078..0e243f4344d050e9199c36a837dea9ca038021e1 100644 (file)
@@ -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++;
        }