Arnd Bergmann
2021-Jul-24 14:58 UTC
[Nouveau] [PATCH] nouveau: make backlight support non optional
On Sat, Jul 24, 2021 at 4:14 PM Karol Herbst <kherbst at redhat.com> wrote:> > we use the MXM_WMI in code. We also have to keep arm in mind and not > break stuff there. So I will try to play around with your changes and > see how that goes.Ok, should find any randconfig build failures for arm, arm64 or x86 over the weekend. I also this on linux-next today ld: drivers/gpu/drm/i915/display/intel_panel.o: in function `intel_backlight_device_register': intel_panel.c:(.text+0x2804): undefined reference to `backlight_device_register' ld: intel_panel.c:(.text+0x284e): undefined reference to `backlight_device_register' ld: drivers/gpu/drm/i915/display/intel_panel.o: in function `intel_backlight_device_unregister': intel_panel.c:(.text+0x28b1): undefined reference to `backlight_device_unregister' and I added this same thing there to see how it goes: diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig index 87825d36335b..69c6b7aec49e 100644 --- a/drivers/gpu/drm/i915/Kconfig +++ b/drivers/gpu/drm/i915/Kconfig @@ -3,6 +3,8 @@ config DRM_I915 tristate "Intel 8xx/9xx/G3x/G4x/HD Graphics" depends on DRM depends on X86 && PCI + depends on ACPI_VIDEO || !ACPI + depends on BACKLIGHT_CLASS_DEVICE select INTEL_GTT select INTERVAL_TREE # we need shmfs for the swappable backing store, and in particular @@ -16,10 +18,6 @@ config DRM_I915 select IRQ_WORK # i915 depends on ACPI_VIDEO when ACPI is enabled # but for select to work, need to select ACPI_VIDEO's dependencies, ick - select DRM_I915_BACKLIGHT if ACPI - select INPUT if ACPI - select ACPI_VIDEO if ACPI - select ACPI_BUTTON if ACPI select SYNC_FILE select IOSF_MBI select CRC32 @@ -64,13 +62,7 @@ config DRM_I915_FORCE_PROBE Use "*" to force probe the driver for all known devices. config DRM_I915_BACKLIGHT - tristate "Control backlight support" - depends on DRM_I915 - default DRM_I915 - select BACKLIGHT_CLASS_DEVICE - help - Say Y here if you want to control the backlight of your display - (e.g. a laptop panel). + def_tristate DRM_I915 config DRM_I915_CAPTURE_ERROR bool "Enable capturing GPU state following a hang"
Karol Herbst
2021-Aug-04 14:10 UTC
[Nouveau] [PATCH] depend on BACKLIGHT_CLASS_DEVICE for more devices
playing around a little bit with this, I think the original "select BACKLIGHT_CLASS_DEVICE" is fine. Atm we kind of have this weird mix of drivers selecting and others depending on it. We could of course convert everything over to depend, and break those cycling dependency issues with this. Anyway this change on top of my initial patch is enough to make Kconfig happy and has the advantage of not having to mess with the deps of nouveau too much. Cc: Arnd Bergmann <arnd at kernel.org> Cc: Lyude Paul <lyude at redhat.com> Cc: Ben Skeggs <bskeggs at redhat.com> Cc: Randy Dunlap <rdunlap at infradead.org> Cc: Daniel Vetter <daniel at ffwll.ch> Cc: nouveau at lists.freedesktop.org Cc: dri-devel at lists.freedesktop.org --- drivers/gpu/drm/bridge/Kconfig | 2 +- drivers/gpu/drm/fsl-dcu/Kconfig | 2 +- drivers/gpu/drm/gud/Kconfig | 2 +- drivers/gpu/drm/nouveau/Kconfig | 2 +- drivers/platform/x86/Kconfig | 4 ++-- drivers/staging/olpc_dcon/Kconfig | 2 +- drivers/usb/misc/Kconfig | 2 +- drivers/video/fbdev/Kconfig | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kconfig index 431b6e12a81f..dc68532ede38 100644 --- a/drivers/gpu/drm/bridge/Kconfig +++ b/drivers/gpu/drm/bridge/Kconfig @@ -173,9 +173,9 @@ config DRM_NXP_PTN3460 config DRM_PARADE_PS8622 tristate "Parade eDP/LVDS bridge" depends on OF + depends on BACKLIGHT_CLASS_DEVICE select DRM_PANEL select DRM_KMS_HELPER - select BACKLIGHT_CLASS_DEVICE help Parade eDP-LVDS bridge chip driver. diff --git a/drivers/gpu/drm/fsl-dcu/Kconfig b/drivers/gpu/drm/fsl-dcu/Kconfig index d7dd8ba90e3a..79bfd7e6f6dc 100644 --- a/drivers/gpu/drm/fsl-dcu/Kconfig +++ b/drivers/gpu/drm/fsl-dcu/Kconfig @@ -2,7 +2,7 @@ config DRM_FSL_DCU tristate "DRM Support for Freescale DCU" depends on DRM && OF && ARM && COMMON_CLK - select BACKLIGHT_CLASS_DEVICE + depends on BACKLIGHT_CLASS_DEVICE select DRM_KMS_HELPER select DRM_KMS_CMA_HELPER select DRM_PANEL diff --git a/drivers/gpu/drm/gud/Kconfig b/drivers/gpu/drm/gud/Kconfig index 1c8601bf4d91..91a118928af7 100644 --- a/drivers/gpu/drm/gud/Kconfig +++ b/drivers/gpu/drm/gud/Kconfig @@ -3,10 +3,10 @@ config DRM_GUD tristate "GUD USB Display" depends on DRM && USB + depends on BACKLIGHT_CLASS_DEVICE select LZ4_COMPRESS select DRM_KMS_HELPER select DRM_GEM_SHMEM_HELPER - select BACKLIGHT_CLASS_DEVICE help This is a DRM display driver for GUD USB Displays or display adapters. diff --git a/drivers/gpu/drm/nouveau/Kconfig b/drivers/gpu/drm/nouveau/Kconfig index 2e159b0ea7fb..afb3eede8e2b 100644 --- a/drivers/gpu/drm/nouveau/Kconfig +++ b/drivers/gpu/drm/nouveau/Kconfig @@ -2,12 +2,12 @@ config DRM_NOUVEAU tristate "Nouveau (NVIDIA) cards" depends on DRM && PCI && MMU + depends on BACKLIGHT_CLASS_DEVICE select IOMMU_API select FW_LOADER select DRM_KMS_HELPER select DRM_TTM select DRM_TTM_HELPER - select BACKLIGHT_CLASS_DEVICE select ACPI_VIDEO if ACPI && X86 && INPUT select X86_PLATFORM_DEVICES if ACPI && X86 select ACPI_WMI if ACPI && X86 diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig index 7d385c3b2239..278368985fb2 100644 --- a/drivers/platform/x86/Kconfig +++ b/drivers/platform/x86/Kconfig @@ -838,7 +838,7 @@ config SAMSUNG_LAPTOP config SAMSUNG_Q10 tristate "Samsung Q10 Extras" depends on ACPI - select BACKLIGHT_CLASS_DEVICE + depends on BACKLIGHT_CLASS_DEVICE help This driver provides support for backlight control on Samsung Q10 and related laptops, including Dell Latitude X200. @@ -935,7 +935,7 @@ config ACPI_CMPC tristate "CMPC Laptop Extras" depends on ACPI && INPUT depends on RFKILL || RFKILL=n - select BACKLIGHT_CLASS_DEVICE + depends on BACKLIGHT_CLASS_DEVICE help Support for Intel Classmate PC ACPI devices, including some keys as input device, backlight device, tablet and accelerometer diff --git a/drivers/staging/olpc_dcon/Kconfig b/drivers/staging/olpc_dcon/Kconfig index d1a0dea09ef0..a9f36538d7ab 100644 --- a/drivers/staging/olpc_dcon/Kconfig +++ b/drivers/staging/olpc_dcon/Kconfig @@ -4,7 +4,7 @@ config FB_OLPC_DCON depends on OLPC && FB depends on I2C depends on GPIO_CS5535 && ACPI - select BACKLIGHT_CLASS_DEVICE + depends on BACKLIGHT_CLASS_DEVICE help In order to support very low power operation, the XO laptop uses a secondary Display CONtroller, or DCON. This secondary controller diff --git a/drivers/usb/misc/Kconfig b/drivers/usb/misc/Kconfig index 8f1144359012..6f769a1616f0 100644 --- a/drivers/usb/misc/Kconfig +++ b/drivers/usb/misc/Kconfig @@ -132,7 +132,7 @@ config USB_FTDI_ELAN config USB_APPLEDISPLAY tristate "Apple Cinema Display support" - select BACKLIGHT_CLASS_DEVICE + depends on BACKLIGHT_CLASS_DEVICE help Say Y here if you want to control the backlight of Apple Cinema Displays over USB. This driver provides a sysfs interface. diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig index d33c5cd684c0..b4d5837b61de 100644 --- a/drivers/video/fbdev/Kconfig +++ b/drivers/video/fbdev/Kconfig @@ -187,7 +187,7 @@ config FB_MACMODES config FB_BACKLIGHT tristate depends on FB - select BACKLIGHT_CLASS_DEVICE + depends on BACKLIGHT_CLASS_DEVICE config FB_MODE_HELPERS bool "Enable Video Mode Handling Helpers" -- 2.31.1
Jani Nikula
2021-Aug-09 13:20 UTC
[Nouveau] [PATCH] nouveau: make backlight support non optional
On Sat, 24 Jul 2021, Arnd Bergmann <arnd at kernel.org> wrote:> On Sat, Jul 24, 2021 at 4:14 PM Karol Herbst <kherbst at redhat.com> wrote: >> >> we use the MXM_WMI in code. We also have to keep arm in mind and not >> break stuff there. So I will try to play around with your changes and >> see how that goes. > > Ok, should find any randconfig build failures for arm, arm64 or x86 over the > weekend. I also this on linux-next today > > ld: drivers/gpu/drm/i915/display/intel_panel.o: in function > `intel_backlight_device_register': > intel_panel.c:(.text+0x2804): undefined reference to `backlight_device_register' > ld: intel_panel.c:(.text+0x284e): undefined reference to > `backlight_device_register' > ld: drivers/gpu/drm/i915/display/intel_panel.o: in function > `intel_backlight_device_unregister': > intel_panel.c:(.text+0x28b1): undefined reference to > `backlight_device_unregister' > > and I added this same thing there to see how it goes:Last I checked (and it was a while a go) you really had to make all users of BACKLIGHT_CLASS_DEVICE depend not select it, otherwise you end up with recursive dependencies. BR, Jani.> > diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig > index 87825d36335b..69c6b7aec49e 100644 > --- a/drivers/gpu/drm/i915/Kconfig > +++ b/drivers/gpu/drm/i915/Kconfig > @@ -3,6 +3,8 @@ config DRM_I915 > tristate "Intel 8xx/9xx/G3x/G4x/HD Graphics" > depends on DRM > depends on X86 && PCI > + depends on ACPI_VIDEO || !ACPI > + depends on BACKLIGHT_CLASS_DEVICE > select INTEL_GTT > select INTERVAL_TREE > # we need shmfs for the swappable backing store, and in particular > @@ -16,10 +18,6 @@ config DRM_I915 > select IRQ_WORK > # i915 depends on ACPI_VIDEO when ACPI is enabled > # but for select to work, need to select ACPI_VIDEO's dependencies, ick > - select DRM_I915_BACKLIGHT if ACPI > - select INPUT if ACPI > - select ACPI_VIDEO if ACPI > - select ACPI_BUTTON if ACPI > select SYNC_FILE > select IOSF_MBI > select CRC32 > @@ -64,13 +62,7 @@ config DRM_I915_FORCE_PROBE > Use "*" to force probe the driver for all known devices. > > config DRM_I915_BACKLIGHT > - tristate "Control backlight support" > - depends on DRM_I915 > - default DRM_I915 > - select BACKLIGHT_CLASS_DEVICE > - help > - Say Y here if you want to control the backlight of your display > - (e.g. a laptop panel). > + def_tristate DRM_I915 > > config DRM_I915_CAPTURE_ERROR > bool "Enable capturing GPU state following a hang"-- Jani Nikula, Intel Open Source Graphics Center