drm/nouveau/backlight: Fix LVDS backlight detection on some laptops
authorLyude Paul <lyude@redhat.com>
Fri, 4 Feb 2022 18:05:04 +0000 (13:05 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 12:23:03 +0000 (14:23 +0200)
commit80de94c4ab4e0e0db2775cf6b0c7f9c54b4bf330
treea3e3400eaff74f68fa21caacc3bde22671576aa2
parent7585d0f56f29b5a7900ba21ff9a1a9d48cbe9860
drm/nouveau/backlight: Fix LVDS backlight detection on some laptops

commit 6b0076540faffd47f5a899bf12f3528c4f0e726b upstream.

It seems that some laptops will report having both an eDP and LVDS
connector, even though only the LVDS connector is actually hooked up. This
can lead to issues with backlight registration if the eDP connector ends up
getting registered before the LVDS connector, as the backlight device will
then be registered to the eDP connector instead of the LVDS connector.

So, fix this by only registering the backlight on connectors that are
reported as being connected.

Signed-off-by: Lyude Paul <lyude@redhat.com>
Fixes: 6eca310e8924 ("drm/nouveau/kms/nv50-: Add basic DPCD backlight support for nouveau")
Bugzilla: https://gitlab.freedesktop.org/drm/nouveau/-/issues/137
Cc: <stable@vger.kernel.org> # v5.15+
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220204180504.328999-1-lyude@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/nouveau/nouveau_backlight.c