drm/nouveau/nvkm/dp: Add workaround to fix DP 1.3+ DPCD issues
authorLyude Paul <lyude@redhat.com>
Fri, 28 Jul 2023 22:58:57 +0000 (18:58 -0400)
committerKarol Herbst <kherbst@redhat.com>
Thu, 3 Aug 2023 09:52:48 +0000 (11:52 +0200)
commite4060dad253352382b20420d8ef98daab24dbc17
treedbf5d22c8d5e7ff2b66a15be8a82258954a1c53e
parent1cb9e2ef66d53b020842b18762e30d0eb4384de8
drm/nouveau/nvkm/dp: Add workaround to fix DP 1.3+ DPCD issues

Currently we use the drm_dp_dpcd_read_caps() helper in the DRM side of
nouveau in order to read the DPCD of a DP connector, which makes sure we do
the right thing and also check for extended DPCD caps. However, it turns
out we're not currently doing this on the nvkm side since we don't have
access to the drm_dp_aux structure there - which means that the DRM side of
the driver and the NVKM side can end up with different DPCD capabilities
for the same connector.

Ideally in order to fix this, we just want to use the
drm_dp_read_dpcd_caps() helper in nouveau. That's not currently possible
though, and is going to depend on having a bunch of the DP code moved out
of nvkm and into the DRM side of things as part of the GSP enablement work.

Until then however, let's workaround this problem by porting a copy of
drm_dp_read_dpcd_caps() into NVKM - which should fix this issue.

Signed-off-by: Lyude Paul <lyude@redhat.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Link: https://gitlab.freedesktop.org/drm/nouveau/-/issues/211
Link: https://patchwork.freedesktop.org/patch/msgid/20230728225858.350581-1-lyude@redhat.com
(cherry picked from commit cc4adf3a7323212f303bc9ff0f96346c44fcba06 in drm-misc-next)
Cc: <stable@vger.kernel.org> # 6.3+
Signed-off-by: Karol Herbst <kherbst@redhat.com>
drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.c