Martin Peres
2016-Dec-07 03:32 UTC
[Nouveau] [PATCH] nouveau/led: introduce CONFIG_DRM_NOUVEAU_LEDS
This fixes the auto-magic detection of LEDS_CLASS by fixing the case where nouveau would be built-in and the LEDS_CLASS would be built as as module. Cc: <stable at vger.kernel.org> # 4.9.x- Reported-by: Intel's 0-DAY Signed-off-by: Martin Peres <martin.peres at free.fr> --- drivers/gpu/drm/nouveau/Kbuild | 2 +- drivers/gpu/drm/nouveau/Kconfig | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/Kbuild b/drivers/gpu/drm/nouveau/Kbuild index fde6e36..0935396 100644 --- a/drivers/gpu/drm/nouveau/Kbuild +++ b/drivers/gpu/drm/nouveau/Kbuild @@ -22,7 +22,7 @@ nouveau-$(CONFIG_DEBUG_FS) += nouveau_debugfs.o nouveau-y += nouveau_drm.o nouveau-y += nouveau_hwmon.o nouveau-$(CONFIG_COMPAT) += nouveau_ioc32.o -nouveau-$(CONFIG_LEDS_CLASS) += nouveau_led.o +nouveau-$(CONFIG_DRM_NOUVEAU_LEDS) += nouveau_led.o nouveau-y += nouveau_nvif.o nouveau-$(CONFIG_NOUVEAU_PLATFORM_DRIVER) += nouveau_platform.o nouveau-y += nouveau_usif.o # userspace <-> nvif diff --git a/drivers/gpu/drm/nouveau/Kconfig b/drivers/gpu/drm/nouveau/Kconfig index 2922a82..9dbb816 100644 --- a/drivers/gpu/drm/nouveau/Kconfig +++ b/drivers/gpu/drm/nouveau/Kconfig @@ -16,6 +16,7 @@ config DRM_NOUVEAU select INPUT if ACPI && X86 select THERMAL if ACPI && X86 select ACPI_VIDEO if ACPI && X86 + select LEDS_CLASS if DRM_NOUVEAU_LEDS help Choose this option for open-source NVIDIA support. @@ -62,3 +63,11 @@ config DRM_NOUVEAU_BACKLIGHT help Say Y here if you want to control the backlight of your display (e.g. a laptop panel). + +config DRM_NOUVEAU_LEDS + bool "Support for high-end GPUs' NVIDIA-logo LED control" + depends on DRM_NOUVEAU + default y + help + Say Y here if you want to control the LED behind the NVIDIA logo on + high-end GPUs. -- 2.10.2
Martin Peres
2016-Dec-07 03:53 UTC
[Nouveau] [PATCH] nouveau/led: introduce CONFIG_DRM_NOUVEAU_LEDS
On 07/12/16 05:32, Martin Peres wrote:> This fixes the auto-magic detection of LEDS_CLASS by fixing the case > where nouveau would be built-in and the LEDS_CLASS would be built as > as module. > > Cc: <stable at vger.kernel.org> # 4.9.x- > Reported-by: Intel's 0-DAY > Signed-off-by: Martin Peres <martin.peres at free.fr> > --- > drivers/gpu/drm/nouveau/Kbuild | 2 +- > drivers/gpu/drm/nouveau/Kconfig | 9 +++++++++ > 2 files changed, 10 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/nouveau/Kbuild b/drivers/gpu/drm/nouveau/Kbuild > index fde6e36..0935396 100644 > --- a/drivers/gpu/drm/nouveau/Kbuild > +++ b/drivers/gpu/drm/nouveau/Kbuild > @@ -22,7 +22,7 @@ nouveau-$(CONFIG_DEBUG_FS) += nouveau_debugfs.o > nouveau-y += nouveau_drm.o > nouveau-y += nouveau_hwmon.o > nouveau-$(CONFIG_COMPAT) += nouveau_ioc32.o > -nouveau-$(CONFIG_LEDS_CLASS) += nouveau_led.o > +nouveau-$(CONFIG_DRM_NOUVEAU_LEDS) += nouveau_led.o > nouveau-y += nouveau_nvif.o > nouveau-$(CONFIG_NOUVEAU_PLATFORM_DRIVER) += nouveau_platform.o > nouveau-y += nouveau_usif.o # userspace <-> nvif > diff --git a/drivers/gpu/drm/nouveau/Kconfig b/drivers/gpu/drm/nouveau/Kconfig > index 2922a82..9dbb816 100644 > --- a/drivers/gpu/drm/nouveau/Kconfig > +++ b/drivers/gpu/drm/nouveau/Kconfig > @@ -16,6 +16,7 @@ config DRM_NOUVEAU > select INPUT if ACPI && X86 > select THERMAL if ACPI && X86 > select ACPI_VIDEO if ACPI && X86 > + select LEDS_CLASS if DRM_NOUVEAU_LEDS > help > Choose this option for open-source NVIDIA support. > > @@ -62,3 +63,11 @@ config DRM_NOUVEAU_BACKLIGHT > help > Say Y here if you want to control the backlight of your display > (e.g. a laptop panel). > + > +config DRM_NOUVEAU_LEDS > + bool "Support for high-end GPUs' NVIDIA-logo LED control" > + depends on DRM_NOUVEAU > + default y > + help > + Say Y here if you want to control the LED behind the NVIDIA logo on > + high-end GPUs.Cancel this,the thread "[PATCH] drm/nouveau: fix LEDS_CLASS=m configuration" on DRI-devel explained why it was a bad idea (circular dependencies). Will implement his proposal of using IS_REACHABLE instead of IS_DEFINED. Martin
Martin Peres
2016-Dec-07 04:30 UTC
[Nouveau] [PATCH] nouveau/led: prevent compiling the led-code if nouveau=y and leds=m
The proper fix would have been to select LEDS_CLASS but this can lead to a circular dependency, as found out by Arnd. This patch implements Arnd's suggestion instead, at the cost of some auto-magic for a fringe feature. Cc: <stable at vger.kernel.org> # 4.9.x- Reported-by: Arnd Bergmann <arnd at arndb.de> Reported-by: Intel's 0-DAY Fixes: 8d021d71b324 ("drm/nouveau/drm/nouveau: add a LED driver for the NVIDIA logo") Signed-off-by: Martin Peres <martin.peres at free.fr> --- drivers/gpu/drm/nouveau/nouveau_led.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_led.h b/drivers/gpu/drm/nouveau/nouveau_led.h index 187ecdb..21a5775 100644 --- a/drivers/gpu/drm/nouveau/nouveau_led.h +++ b/drivers/gpu/drm/nouveau/nouveau_led.h @@ -42,7 +42,7 @@ nouveau_led(struct drm_device *dev) } /* nouveau_led.c */ -#if IS_ENABLED(CONFIG_LEDS_CLASS) +#if IS_REACHABLE(CONFIG_LEDS_CLASS) int nouveau_led_init(struct drm_device *dev); void nouveau_led_suspend(struct drm_device *dev); void nouveau_led_resume(struct drm_device *dev); -- 2.10.2
Ilia Mirkin
2017-Jan-10 00:29 UTC
[Nouveau] [PATCH] nouveau/led: prevent compiling the led-code if nouveau=y and leds=m
Ben - ping on this - should definitely be pushed for 4.10. People keep running into it and sending variously broken patches attempting to fix it. On Tue, Dec 6, 2016 at 11:30 PM, Martin Peres <martin.peres at free.fr> wrote:> The proper fix would have been to select LEDS_CLASS but this can lead > to a circular dependency, as found out by Arnd. > > This patch implements Arnd's suggestion instead, at the cost of some > auto-magic for a fringe feature. > > Cc: <stable at vger.kernel.org> # 4.9.x- > Reported-by: Arnd Bergmann <arnd at arndb.de> > Reported-by: Intel's 0-DAY > Fixes: 8d021d71b324 ("drm/nouveau/drm/nouveau: add a LED driver for the NVIDIA logo") > Signed-off-by: Martin Peres <martin.peres at free.fr> > --- > drivers/gpu/drm/nouveau/nouveau_led.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/nouveau/nouveau_led.h b/drivers/gpu/drm/nouveau/nouveau_led.h > index 187ecdb..21a5775 100644 > --- a/drivers/gpu/drm/nouveau/nouveau_led.h > +++ b/drivers/gpu/drm/nouveau/nouveau_led.h > @@ -42,7 +42,7 @@ nouveau_led(struct drm_device *dev) > } > > /* nouveau_led.c */ > -#if IS_ENABLED(CONFIG_LEDS_CLASS) > +#if IS_REACHABLE(CONFIG_LEDS_CLASS) > int nouveau_led_init(struct drm_device *dev); > void nouveau_led_suspend(struct drm_device *dev); > void nouveau_led_resume(struct drm_device *dev); > -- > 2.10.2 > > _______________________________________________ > Nouveau mailing list > Nouveau at lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/nouveau
Reasonably Related Threads
- [PATCH] drm/nouveau: fix LEDS_CLASS=m configuration
- [PATCH] drm/nouveau: fix LEDS_CLASS=m configuration
- [PATCH] nouveau/led: introduce CONFIG_DRM_NOUVEAU_LEDS
- [PATCH] drm/nouveau: add a LED driver for the NVIDIA logo
- [PATCH] drm/nouveau: fix LEDS_CLASS=m configuration