Skip to content

Commit 30fb97b

Browse files
committed
drm/nouveau/kms: Fix backlight registration
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 4a16dd9 ("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: 4a16dd9 ("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 <[email protected]> Reviewed-by: Lyude Paul <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 3422413 commit 30fb97b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/gpu/drm/nouveau/nouveau_backlight.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include <linux/apple-gmux.h>
3434
#include <linux/backlight.h>
3535
#include <linux/idr.h>
36+
#include <drm/drm_probe_helper.h>
3637

3738
#include "nouveau_drv.h"
3839
#include "nouveau_reg.h"
@@ -299,8 +300,12 @@ nv50_backlight_init(struct nouveau_backlight *bl,
299300
struct nouveau_drm *drm = nouveau_drm(nv_encoder->base.base.dev);
300301
struct nvif_object *device = &drm->client.device.object;
301302

303+
/*
304+
* Note when this runs the connectors have not been probed yet,
305+
* so nv_conn->base.status is not set yet.
306+
*/
302307
if (!nvif_rd32(device, NV50_PDISP_SOR_PWM_CTL(ffs(nv_encoder->dcb->or) - 1)) ||
303-
nv_conn->base.status != connector_status_connected)
308+
drm_helper_probe_detect(&nv_conn->base, NULL, false) != connector_status_connected)
304309
return -ENODEV;
305310

306311
if (nv_conn->type == DCB_CONNECTOR_eDP) {

0 commit comments

Comments
 (0)