Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

vgacon: dummy implementation for vgacon_text_force

This allows us to ditch a ton of ugly #ifdefs from a bunch of drm modeset
drivers.

v2: Make the dummy function actually return a sane value, spotted by
Ville.

v3: Because the patch is still in limbo there's no more drivers to
convert, noticed by Emil.

v4: Rebase once more, because hooray. I'll just go ahead an apply this
one later on to drm-misc.

Cc: Emil Velikov <emil.l.velikov@gmail.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

+2 -20
-2
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
··· 539 539 540 540 static int __init amdgpu_init(void) 541 541 { 542 - #ifdef CONFIG_VGA_CONSOLE 543 542 if (vgacon_text_force()) { 544 543 DRM_ERROR("VGACON disables amdgpu kernel modesetting.\n"); 545 544 return -EINVAL; 546 545 } 547 - #endif 548 546 DRM_INFO("amdgpu kernel modesetting enabled.\n"); 549 547 driver = &kms_driver; 550 548 pdriver = &amdgpu_kms_pci_driver;
-2
drivers/gpu/drm/ast/ast_drv.c
··· 218 218 219 219 static int __init ast_init(void) 220 220 { 221 - #ifdef CONFIG_VGA_CONSOLE 222 221 if (vgacon_text_force() && ast_modeset == -1) 223 222 return -EINVAL; 224 - #endif 225 223 226 224 if (ast_modeset == 0) 227 225 return -EINVAL;
-2
drivers/gpu/drm/cirrus/cirrus_drv.c
··· 162 162 163 163 static int __init cirrus_init(void) 164 164 { 165 - #ifdef CONFIG_VGA_CONSOLE 166 165 if (vgacon_text_force() && cirrus_modeset == -1) 167 166 return -EINVAL; 168 - #endif 169 167 170 168 if (cirrus_modeset == 0) 171 169 return -EINVAL;
-2
drivers/gpu/drm/i915/i915_drv.c
··· 1750 1750 if (i915.modeset == 0) 1751 1751 driver.driver_features &= ~DRIVER_MODESET; 1752 1752 1753 - #ifdef CONFIG_VGA_CONSOLE 1754 1753 if (vgacon_text_force() && i915.modeset == -1) 1755 1754 driver.driver_features &= ~DRIVER_MODESET; 1756 - #endif 1757 1755 1758 1756 if (!(driver.driver_features & DRIVER_MODESET)) { 1759 1757 /* Silently fail loading to not upset userspace. */
-2
drivers/gpu/drm/mgag200/mgag200_drv.c
··· 116 116 117 117 static int __init mgag200_init(void) 118 118 { 119 - #ifdef CONFIG_VGA_CONSOLE 120 119 if (vgacon_text_force() && mgag200_modeset == -1) 121 120 return -EINVAL; 122 - #endif 123 121 124 122 if (mgag200_modeset == 0) 125 123 return -EINVAL;
-2
drivers/gpu/drm/nouveau/nouveau_drm.c
··· 1082 1082 nouveau_display_options(); 1083 1083 1084 1084 if (nouveau_modeset == -1) { 1085 - #ifdef CONFIG_VGA_CONSOLE 1086 1085 if (vgacon_text_force()) 1087 1086 nouveau_modeset = 0; 1088 - #endif 1089 1087 } 1090 1088 1091 1089 if (!nouveau_modeset)
-2
drivers/gpu/drm/qxl/qxl_drv.c
··· 272 272 273 273 static int __init qxl_init(void) 274 274 { 275 - #ifdef CONFIG_VGA_CONSOLE 276 275 if (vgacon_text_force() && qxl_modeset == -1) 277 276 return -EINVAL; 278 - #endif 279 277 280 278 if (qxl_modeset == 0) 281 279 return -EINVAL;
-2
drivers/gpu/drm/radeon/radeon_drv.c
··· 558 558 559 559 static int __init radeon_init(void) 560 560 { 561 - #ifdef CONFIG_VGA_CONSOLE 562 561 if (vgacon_text_force() && radeon_modeset == -1) { 563 562 DRM_INFO("VGACON disable radeon kernel modesetting.\n"); 564 563 radeon_modeset = 0; 565 564 } 566 - #endif 567 565 /* set to modesetting by default if not nomodeset */ 568 566 if (radeon_modeset == -1) 569 567 radeon_modeset = 1;
-2
drivers/gpu/drm/virtio/virtgpu_drv.c
··· 42 42 43 43 static int virtio_gpu_probe(struct virtio_device *vdev) 44 44 { 45 - #ifdef CONFIG_VGA_CONSOLE 46 45 if (vgacon_text_force() && virtio_gpu_modeset == -1) 47 46 return -EINVAL; 48 - #endif 49 47 50 48 if (virtio_gpu_modeset == 0) 51 49 return -EINVAL;
-2
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
··· 1529 1529 { 1530 1530 int ret; 1531 1531 1532 - #ifdef CONFIG_VGA_CONSOLE 1533 1532 if (vgacon_text_force()) 1534 1533 return -EINVAL; 1535 - #endif 1536 1534 1537 1535 ret = drm_pci_init(&driver, &vmw_pci_driver); 1538 1536 if (ret)
+2
include/linux/console.h
··· 191 191 192 192 #ifdef CONFIG_VGA_CONSOLE 193 193 extern bool vgacon_text_force(void); 194 + #else 195 + static inline bool vgacon_text_force(void) { return false; } 194 196 #endif 195 197 196 198 #endif /* _LINUX_CONSOLE_H */