Skip to contentSkip to conversation

drm/nouveau: fix acpi related kbuild warnings

PATCH RESEND In review Marcin Slusarz 1 participant 2 messages Apr 15, 2012 – May 27, 2012 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 drm/nouveau: fix acpi related kbuild warnings

Currently when X86 && ACPI && !X86_PLATFORM_DEVICES kbuild spits:

warning: (DRM_NOUVEAU) selects ACPI_WMI which has unmet direct dependencies (X86 && X86_PLATFORM_DEVICES && ACPI)
warning: (DRM_NOUVEAU) selects MXM_WMI which has unmet direct dependencies (X86 && X86_PLATFORM_DEVICES && ACPI_WMI)

and goes on, which leaves a situation where ACPI_WMI (which depends on X86_PLATFORM_DEVICES) is enabled but X86_PLATFORM_DEVICES is not. Additionally, Nouveau on IA64 would enable these X86-related drivers when ACPI is enabled (doesn't matter but is wrong) and build nouveau_acpi.c which depends on them.

To fix this, introduce hidden DRM_NOUVEAU_ACPI variable which selects all acpi/x86 related configs and select it when both X86 and ACPI are enabled.

---
 drivers/gpu/drm/nouveau/Kconfig       |    9 +++++++--
 drivers/gpu/drm/nouveau/Makefile      |    2 +-
 drivers/gpu/drm/nouveau/nouveau_drv.h |    2 +-
 3 files changed, 9 insertions(+), 4 deletions(-)
drivers/gpu/drm/nouveau/Kconfig +7 -2
index 97a8126..5648640 100644
@@ -11,12 +11,17 @@ config DRM_NOUVEAU
 	select FRAMEBUFFER_CONSOLE if !EXPERT
 	select FB_BACKLIGHT if DRM_NOUVEAU_BACKLIGHT
 	select ACPI_VIDEO if ACPI && X86 && BACKLIGHT_CLASS_DEVICE && VIDEO_OUTPUT_CONTROL && INPUT
-	select ACPI_WMI if ACPI
-	select MXM_WMI if ACPI
+	select DRM_NOUVEAU_ACPI if ACPI && X86
 	select POWER_SUPPLY
 	help
 	  Choose this option for open-source nVidia support.
 
+config DRM_NOUVEAU_ACPI
+	bool
+	select X86_PLATFORM_DEVICES
+	select ACPI_WMI
+	select MXM_WMI
+
 config DRM_NOUVEAU_BACKLIGHT
 	bool "Support for backlight control"
 	depends on DRM_NOUVEAU
drivers/gpu/drm/nouveau/Makefile +1 -1
index 297709e..03860f5 100644
@@ -43,6 +43,6 @@ nouveau-y := nouveau_drv.o nouveau_state.o nouveau_channel.o nouveau_mem.o \
 nouveau-$(CONFIG_DRM_NOUVEAU_DEBUG) += nouveau_debugfs.o nouveau_vram_con.o
 nouveau-$(CONFIG_COMPAT) += nouveau_ioc32.o
 nouveau-$(CONFIG_DRM_NOUVEAU_BACKLIGHT) += nouveau_backlight.o
-nouveau-$(CONFIG_ACPI) += nouveau_acpi.o
+nouveau-$(CONFIG_DRM_NOUVEAU_ACPI) += nouveau_acpi.o
 
 obj-$(CONFIG_DRM_NOUVEAU)+= nouveau.o
drivers/gpu/drm/nouveau/nouveau_drv.h +1 -1
index d72bb1f..fad07cc 100644
@@ -1097,7 +1097,7 @@ extern int  nouveau_dma_wait(struct nouveau_channel *, int slots, int size);
 
 /* nouveau_acpi.c */
 #define ROM_BIOS_PAGE 4096
-#if defined(CONFIG_ACPI)
+#if defined(CONFIG_DRM_NOUVEAU_ACPI)
 void nouveau_register_dsm_handler(void);
 void nouveau_unregister_dsm_handler(void);
 void nouveau_switcheroo_optimus_dsm(void);
Signature · 1 line
1.7.8.5
#2 lore raw
In reply to a message not in the archive
Quoted 13 lines · Marcin Slusarz

Currently when X86 && ACPI && !X86_PLATFORM_DEVICES kbuild spits:

warning: (DRM_NOUVEAU) selects ACPI_WMI which has unmet direct dependencies (X86 && X86_PLATFORM_DEVICES && ACPI)
warning: (DRM_NOUVEAU) selects MXM_WMI which has unmet direct dependencies (X86 && X86_PLATFORM_DEVICES && ACPI_WMI)

and goes on, which leaves a situation where ACPI_WMI (which depends on X86_PLATFORM_DEVICES) is enabled but X86_PLATFORM_DEVICES is not. Additionally, Nouveau on IA64 would enable these X86-related drivers when ACPI is enabled (doesn't matter but is wrong) and build nouveau_acpi.c which depends on them.

Quoted 6 lines

To fix this, introduce hidden DRM_NOUVEAU_ACPI variable which selects all acpi/x86 related configs and select it when both X86 and ACPI are enabled.

---

What's up with this patch?

Marcin