]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm/amd/display: set link->dongle_max_pix_clk to 0 on a disconnect
authorSamson Tam <Samson.Tam@amd.com>
Tue, 28 May 2019 18:44:40 +0000 (14:44 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 31 Jul 2019 05:24:39 +0000 (07:24 +0200)
[ Upstream commit 233d87a579b8adcc6da5823fa507ecb6675e7562 ]

[Why]
Found issue in EDID Emulation where if we connect a display using
 a passive HDMI-DP dongle, disconnect it and then try to emulate
 a display using DP, we could not see 4K modes.  This was because
 on a disconnect, dongle_max_pix_clk was still set so when we
 emulate using DP, in dc_link_validate_mode_timing(), it would
 think we were still using a dongle and limit the modes we support.

[How]
In dc_link_detect(), set dongle_max_pix_clk to 0 when we detect
 a hotplug out ( if new_connection_type = dc_connection_none ).

Signed-off-by: Samson Tam <Samson.Tam@amd.com>
Reviewed-by: Jun Lei <Jun.Lei@amd.com>
Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/display/dc/core/dc_link.c

index b37ecc3ede619f4ccd9004e9a75c9aa66999748a..a3ff33ff6da16c5cbf203eff1d51bdd8f4606359 100644 (file)
@@ -960,6 +960,12 @@ bool dc_link_detect(struct dc_link *link, enum dc_detect_reason reason)
 
                link->type = dc_connection_none;
                sink_caps.signal = SIGNAL_TYPE_NONE;
+               /* When we unplug a passive DP-HDMI dongle connection, dongle_max_pix_clk
+                *  is not cleared. If we emulate a DP signal on this connection, it thinks
+                *  the dongle is still there and limits the number of modes we can emulate.
+                *  Clear dongle_max_pix_clk on disconnect to fix this
+                */
+               link->dongle_max_pix_clk = 0;
        }
 
        LINK_INFO("link=%d, dc_sink_in=%p is now %s prev_sink=%p dpcd same=%d edid same=%d\n",