diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h index a2e24f252e84ff4a0d0aba26fa2d6ddcd9274d02..f5b3cbe7dc80b80265dfc9e6b654fa8c6625e1e1 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drv.h +++ b/drivers/gpu/drm/nouveau/nouveau_drv.h @@ -852,8 +852,13 @@ extern int nouveau_dma_init(struct nouveau_channel *); extern int nouveau_dma_wait(struct nouveau_channel *, int slots, int size); /* nouveau_acpi.c */ +#if defined(CONFIG_VGA_SWITCHEROO) void nouveau_register_dsm_handler(void); void nouveau_unregister_dsm_handler(void); +#else +static inline void nouveau_register_dsm_handler(void) {} +static inline void nouveau_unregister_dsm_handler(void) {} +#endif /* nouveau_backlight.c */ #ifdef CONFIG_DRM_NOUVEAU_BACKLIGHT diff --git a/drivers/gpu/drm/radeon/Makefile b/drivers/gpu/drm/radeon/Makefile index 0a4d526e4f44ae50ea19915f62d92c8fc7dba22f..0adf49eea7fa51de99bb59a53d080bbdd0d63bc9 100644 --- a/drivers/gpu/drm/radeon/Makefile +++ b/drivers/gpu/drm/radeon/Makefile @@ -60,8 +60,9 @@ radeon-y += radeon_device.o radeon_kms.o \ rs400.o rs600.o rs690.o rv515.o r520.o r600.o rv770.o radeon_test.o \ r200.o radeon_legacy_tv.o r600_cs.o r600_blit.o r600_blit_shaders.o \ r600_blit_kms.o radeon_pm.o atombios_dp.o r600_audio.o r600_hdmi.o \ - evergreen.o radeon_atpx_handler.o + evergreen.o radeon-$(CONFIG_COMPAT) += radeon_ioc32.o +radeon-$(CONFIG_VGA_SWITCHEROO) += radone_atpx_handler.o obj-$(CONFIG_DRM_RADEON)+= radeon.o diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h index ad9d55f94398fdf3a47d42c3f433c71efa304d86..829e26e8a4bb877f43dc2b8f12646e5d840753cb 100644 --- a/drivers/gpu/drm/radeon/radeon.h +++ b/drivers/gpu/drm/radeon/radeon.h @@ -121,8 +121,19 @@ struct radeon_device; */ #define ATRM_BIOS_PAGE 4096 +#if defined(CONFIG_VGA_SWITCHEROO) bool radeon_atrm_supported(struct pci_dev *pdev); int radeon_atrm_get_bios_chunk(uint8_t *bios, int offset, int len); +#else +static inline bool radeon_atrm_supported(struct pci_dev *pdev) +{ + return false; +} + +static inline int radeon_atrm_get_bios_chunk(uint8_t *bios, int offset, int len){ + return -EINVAL; +} +#endif bool radeon_get_bios(struct radeon_device *rdev); diff --git a/drivers/gpu/drm/radeon/radeon_atpx_handler.c b/drivers/gpu/drm/radeon/radeon_atpx_handler.c index 0ae52f19071d5a578cec0fb5a852d91fcd4b7cf9..3f557c4151e0bb7fe2af9e9aaa1bdbec7d2da60f 100644 --- a/drivers/gpu/drm/radeon/radeon_atpx_handler.c +++ b/drivers/gpu/drm/radeon/radeon_atpx_handler.c @@ -6,7 +6,6 @@ * * ATPX support for both Intel/ATI */ - #include #include #include diff --git a/drivers/gpu/drm/radeon/radeon_drv.h b/drivers/gpu/drm/radeon/radeon_drv.h index 4fe16461bb1b472401b812f065260685b4e65da0..ec55f2b23c2298f39d7b108d183bf52a59ddad34 100644 --- a/drivers/gpu/drm/radeon/radeon_drv.h +++ b/drivers/gpu/drm/radeon/radeon_drv.h @@ -463,8 +463,14 @@ extern void r600_blit_swap(struct drm_device *dev, int w, int h, int src_pitch, int dst_pitch, int cpp); /* atpx handler */ +#if defined(CONFIG_VGA_SWITCHEROO) void radeon_register_atpx_handler(void); void radeon_unregister_atpx_handler(void); +#else +static inline void radeon_register_atpx_handler(void) {} +static inline void radeon_unregister_atpx_handler(void) {} +#endif + /* Flags for stats.boxes */ #define RADEON_BOX_DMA_IDLE 0x1 diff --git a/drivers/gpu/vga/vga_switcheroo.c b/drivers/gpu/vga/vga_switcheroo.c index a3f587a0aba9da50d8c7a31757733f6a09bd759b..d6d1149d525d65dd1847d391e16840ed1591d7a3 100644 --- a/drivers/gpu/vga/vga_switcheroo.c +++ b/drivers/gpu/vga/vga_switcheroo.c @@ -25,9 +25,6 @@ #include #include -#include -#include - #include #include diff --git a/include/linux/vga_switcheroo.h b/include/linux/vga_switcheroo.h index 4b58ab1e861224a1174eeb457709db84ca06a0b0..ae9ab13b963d53e5de2eef42220c9b61f8ad466b 100644 --- a/include/linux/vga_switcheroo.h +++ b/include/linux/vga_switcheroo.h @@ -7,7 +7,6 @@ * vga_switcheroo.h - Support for laptop with dual GPU using one set of outputs */ -#include #include enum vga_switcheroo_state {