]> git.karo-electronics.de Git - linux-beck.git/commitdiff
vgacon: dummy implementation for vgacon_text_force
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 30 Mar 2016 09:26:35 +0000 (11:26 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 30 Mar 2016 15:37:57 +0000 (17:37 +0200)
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>
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
drivers/gpu/drm/ast/ast_drv.c
drivers/gpu/drm/cirrus/cirrus_drv.c
drivers/gpu/drm/i915/i915_drv.c
drivers/gpu/drm/mgag200/mgag200_drv.c
drivers/gpu/drm/nouveau/nouveau_drm.c
drivers/gpu/drm/qxl/qxl_drv.c
drivers/gpu/drm/radeon/radeon_drv.c
drivers/gpu/drm/virtio/virtgpu_drv.c
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
include/linux/console.h

index ce79a8b605a0664a26ac2b42c56f06538fcaf9b8..fba20bd59cfaa01f883ed71bee5869e9c3b87502 100644 (file)
@@ -539,12 +539,10 @@ static struct pci_driver amdgpu_kms_pci_driver = {
 
 static int __init amdgpu_init(void)
 {
-#ifdef CONFIG_VGA_CONSOLE
        if (vgacon_text_force()) {
                DRM_ERROR("VGACON disables amdgpu kernel modesetting.\n");
                return -EINVAL;
        }
-#endif
        DRM_INFO("amdgpu kernel modesetting enabled.\n");
        driver = &kms_driver;
        pdriver = &amdgpu_kms_pci_driver;
index 9a32d9dfdd269aaa1918e4340b660b5b9567ef4d..fcd9c0714836cdd2175c956d78226930846c0aca 100644 (file)
@@ -218,10 +218,8 @@ static struct drm_driver driver = {
 
 static int __init ast_init(void)
 {
-#ifdef CONFIG_VGA_CONSOLE
        if (vgacon_text_force() && ast_modeset == -1)
                return -EINVAL;
-#endif
 
        if (ast_modeset == 0)
                return -EINVAL;
index b1619e29a564db97ef626fd2c32bceaa3a18cadc..b394e6d8f01e9713f8d8982e76439a01301fbdcf 100644 (file)
@@ -162,10 +162,8 @@ static struct pci_driver cirrus_pci_driver = {
 
 static int __init cirrus_init(void)
 {
-#ifdef CONFIG_VGA_CONSOLE
        if (vgacon_text_force() && cirrus_modeset == -1)
                return -EINVAL;
-#endif
 
        if (cirrus_modeset == 0)
                return -EINVAL;
index 44912ecebc1a287b93bfb2ac6294304fc1c81b5a..8a62690e65135c3078cfcaa0c92c52b8bc141fa5 100644 (file)
@@ -1750,10 +1750,8 @@ static int __init i915_init(void)
        if (i915.modeset == 0)
                driver.driver_features &= ~DRIVER_MODESET;
 
-#ifdef CONFIG_VGA_CONSOLE
        if (vgacon_text_force() && i915.modeset == -1)
                driver.driver_features &= ~DRIVER_MODESET;
-#endif
 
        if (!(driver.driver_features & DRIVER_MODESET)) {
                /* Silently fail loading to not upset userspace. */
index b0af77454d523cf99e2c2c9fb52287c6341491d9..ebb470ff7200c800a44f1db3d66a72bc416cdb0f 100644 (file)
@@ -116,10 +116,8 @@ static struct pci_driver mgag200_pci_driver = {
 
 static int __init mgag200_init(void)
 {
-#ifdef CONFIG_VGA_CONSOLE
        if (vgacon_text_force() && mgag200_modeset == -1)
                return -EINVAL;
-#endif
 
        if (mgag200_modeset == 0)
                return -EINVAL;
index bb8498c9b13ed2873b757c7bb913975ac39a7dfe..731c5c2a89333df20686d03d3214374bc535e94e 100644 (file)
@@ -1082,10 +1082,8 @@ nouveau_drm_init(void)
        nouveau_display_options();
 
        if (nouveau_modeset == -1) {
-#ifdef CONFIG_VGA_CONSOLE
                if (vgacon_text_force())
                        nouveau_modeset = 0;
-#endif
        }
 
        if (!nouveau_modeset)
index 7307b07fe06ba6f3aab0e60914de0a998bdbe7b0..dc9df5fe50baae2929d53a6ba0d5dc271618d218 100644 (file)
@@ -272,10 +272,8 @@ static struct drm_driver qxl_driver = {
 
 static int __init qxl_init(void)
 {
-#ifdef CONFIG_VGA_CONSOLE
        if (vgacon_text_force() && qxl_modeset == -1)
                return -EINVAL;
-#endif
 
        if (qxl_modeset == 0)
                return -EINVAL;
index cad25557650f054746b957bc04ea8a69f3a83e01..ad136fc081c833aaf1dcead3bf43932279ec49e1 100644 (file)
@@ -558,12 +558,10 @@ static struct pci_driver radeon_kms_pci_driver = {
 
 static int __init radeon_init(void)
 {
-#ifdef CONFIG_VGA_CONSOLE
        if (vgacon_text_force() && radeon_modeset == -1) {
                DRM_INFO("VGACON disable radeon kernel modesetting.\n");
                radeon_modeset = 0;
        }
-#endif
        /* set to modesetting by default if not nomodeset */
        if (radeon_modeset == -1)
                radeon_modeset = 1;
index 7f898cfdc7468c6697a50ede409749f3e89fa08b..3cc7afa77a35c1b40f7bc7836f4580126a9194af 100644 (file)
@@ -42,10 +42,8 @@ module_param_named(modeset, virtio_gpu_modeset, int, 0400);
 
 static int virtio_gpu_probe(struct virtio_device *vdev)
 {
-#ifdef CONFIG_VGA_CONSOLE
        if (vgacon_text_force() && virtio_gpu_modeset == -1)
                return -EINVAL;
-#endif
 
        if (virtio_gpu_modeset == 0)
                return -EINVAL;
index 0ee76e523a902ac0905502fc838216903d8af83b..fa10395e2a18c6928fa80e03d3491b285e159438 100644 (file)
@@ -1529,10 +1529,8 @@ static int __init vmwgfx_init(void)
 {
        int ret;
 
-#ifdef CONFIG_VGA_CONSOLE
        if (vgacon_text_force())
                return -EINVAL;
-#endif
 
        ret = drm_pci_init(&driver, &vmw_pci_driver);
        if (ret)
index ea731af2451ee3607c16fda14d50fa684a54f03b..e49cc1ef19be14fbfe4db94614461f9875b64610 100644 (file)
@@ -191,6 +191,8 @@ void vcs_remove_sysfs(int index);
 
 #ifdef CONFIG_VGA_CONSOLE
 extern bool vgacon_text_force(void);
+#else
+static inline bool vgacon_text_force(void) { return false; }
 #endif
 
 #endif /* _LINUX_CONSOLE_H */