Patch "drm/nouveau/kms: Fix backlight registration" has been added to the 6.2-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    drm/nouveau/kms: Fix backlight registration

to the 6.2-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     drm-nouveau-kms-fix-backlight-registration.patch
and it can be found in the queue-6.2 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit fe80389cdc027953ad4e246895a76d9e6336567e
Author: Hans de Goede <hdegoede@xxxxxxxxxx>
Date:   Sun Mar 26 22:54:33 2023 +0200

    drm/nouveau/kms: Fix backlight registration
    
    [ Upstream commit 30fb97ba4a8e082ba0a5432479d6995472edbd7b ]
    
    The nouveau code used to call drm_fb_helper_initial_config() from
    nouveau_fbcon_init() before calling drm_dev_register(). This would
    probe all connectors so that drm_connector->status could be used during
    backlight registration which runs from nouveau_connector_late_register().
    
    After commit 4a16dd9d18a0 ("drm/nouveau/kms: switch to drm fbdev helpers")
    the fbdev emulation code, which now is a drm-client, can only run after
    drm_dev_register(). So during backlight registration the connectors are
    not probed yet and the drm_connector->status == connected check in
    nv50_backlight_init() would now always fail.
    
    Replace the drm_connector->status == connected check with
    a drm_helper_probe_detect() == connected check to fix nv_backlight
    no longer getting registered because of this.
    
    Fixes: 4a16dd9d18a0 ("drm/nouveau/kms: switch to drm fbdev helpers")
    Link: https://gitlab.freedesktop.org/drm/nouveau/-/issues/202
    Link: https://bugzilla.redhat.com/show_bug.cgi?id=2181941
    Signed-off-by: Hans de Goede <hdegoede@xxxxxxxxxx>
    Reviewed-by: Lyude Paul <lyude@xxxxxxxxxx>
    Link: https://patchwork.freedesktop.org/patch/msgid/20230326205433.36485-1-hdegoede@xxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/gpu/drm/nouveau/nouveau_backlight.c b/drivers/gpu/drm/nouveau/nouveau_backlight.c
index 40409a29f5b69..91b5ecc575380 100644
--- a/drivers/gpu/drm/nouveau/nouveau_backlight.c
+++ b/drivers/gpu/drm/nouveau/nouveau_backlight.c
@@ -33,6 +33,7 @@
 #include <linux/apple-gmux.h>
 #include <linux/backlight.h>
 #include <linux/idr.h>
+#include <drm/drm_probe_helper.h>
 
 #include "nouveau_drv.h"
 #include "nouveau_reg.h"
@@ -299,8 +300,12 @@ nv50_backlight_init(struct nouveau_backlight *bl,
 	struct nouveau_drm *drm = nouveau_drm(nv_encoder->base.base.dev);
 	struct nvif_object *device = &drm->client.device.object;
 
+	/*
+	 * Note when this runs the connectors have not been probed yet,
+	 * so nv_conn->base.status is not set yet.
+	 */
 	if (!nvif_rd32(device, NV50_PDISP_SOR_PWM_CTL(ffs(nv_encoder->dcb->or) - 1)) ||
-	    nv_conn->base.status != connector_status_connected)
+	    drm_helper_probe_detect(&nv_conn->base, NULL, false) != connector_status_connected)
 		return -ENODEV;
 
 	if (nv_conn->type == DCB_CONNECTOR_eDP) {



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux