[RESEND,1/2] vgacon: dummy implementation for vgacon_text_force

Submitted by Daniel Vetter on Nov. 27, 2015, 3:10 p.m.

Details

Message ID 1448637005-3847-1-git-send-email-daniel.vetter@ffwll.ch
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in Intel GFX

Not browsing as part of any series.

Commit Message

Daniel Vetter Nov. 27, 2015, 3:10 p.m.
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.

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/ast/ast_drv.c         | 2 --
 drivers/gpu/drm/cirrus/cirrus_drv.c   | 2 --
 drivers/gpu/drm/i915/i915_drv.c       | 2 --
 drivers/gpu/drm/mgag200/mgag200_drv.c | 2 --
 drivers/gpu/drm/nouveau/nouveau_drm.c | 2 --
 drivers/gpu/drm/qxl/qxl_drv.c         | 2 --
 drivers/gpu/drm/radeon/radeon_drv.c   | 2 --
 include/linux/console.h               | 2 ++
 8 files changed, 2 insertions(+), 14 deletions(-)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/ast/ast_drv.c b/drivers/gpu/drm/ast/ast_drv.c
index 9a32d9dfdd26..fcd9c0714836 100644
--- a/drivers/gpu/drm/ast/ast_drv.c
+++ b/drivers/gpu/drm/ast/ast_drv.c
@@ -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;
diff --git a/drivers/gpu/drm/cirrus/cirrus_drv.c b/drivers/gpu/drm/cirrus/cirrus_drv.c
index b1619e29a564..b394e6d8f01e 100644
--- a/drivers/gpu/drm/cirrus/cirrus_drv.c
+++ b/drivers/gpu/drm/cirrus/cirrus_drv.c
@@ -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;
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 90faa8e03fca..79681b328e9f 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -1767,10 +1767,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. */
diff --git a/drivers/gpu/drm/mgag200/mgag200_drv.c b/drivers/gpu/drm/mgag200/mgag200_drv.c
index b0af77454d52..ebb470ff7200 100644
--- a/drivers/gpu/drm/mgag200/mgag200_drv.c
+++ b/drivers/gpu/drm/mgag200/mgag200_drv.c
@@ -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;
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c
index 1d3ee5179ab8..14fb49c6c76c 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
@@ -1072,10 +1072,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)
diff --git a/drivers/gpu/drm/qxl/qxl_drv.c b/drivers/gpu/drm/qxl/qxl_drv.c
index 7307b07fe06b..dc9df5fe50ba 100644
--- a/drivers/gpu/drm/qxl/qxl_drv.c
+++ b/drivers/gpu/drm/qxl/qxl_drv.c
@@ -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;
diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c
index 5b6a6f5b3619..502973b819b6 100644
--- a/drivers/gpu/drm/radeon/radeon_drv.c
+++ b/drivers/gpu/drm/radeon/radeon_drv.c
@@ -636,12 +636,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;
diff --git a/include/linux/console.h b/include/linux/console.h
index bd194343c346..44b7fe8a2dbb 100644
--- a/include/linux/console.h
+++ b/include/linux/console.h
@@ -190,6 +190,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 */

Comments

On 27 November 2015 at 15:10, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> 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.
>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
>  drivers/gpu/drm/ast/ast_drv.c         | 2 --
>  drivers/gpu/drm/cirrus/cirrus_drv.c   | 2 --
>  drivers/gpu/drm/i915/i915_drv.c       | 2 --
>  drivers/gpu/drm/mgag200/mgag200_drv.c | 2 --
>  drivers/gpu/drm/nouveau/nouveau_drm.c | 2 --
>  drivers/gpu/drm/qxl/qxl_drv.c         | 2 --
>  drivers/gpu/drm/radeon/radeon_drv.c   | 2 --
>  include/linux/console.h               | 2 ++

The new drivers seems to be missing the conversion. Namely amdgpu and
virtio_gpu.

> --- a/drivers/gpu/drm/nouveau/nouveau_drm.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
> @@ -1072,10 +1072,8 @@ nouveau_drm_init(void)
>         nouveau_display_options();
>
>         if (nouveau_modeset == -1) {
> -#ifdef CONFIG_VGA_CONSOLE
>                 if (vgacon_text_force())
>                         nouveau_modeset = 0;
> -#endif
It's kind of interesting how nouveau differs from everyone else. The
force toggle has lower priority than the nouveau specific one :-)
Obviously not something you should address or anything.

Another interesting fact is how none of the SoC honour the modeset fla :-\

Regards,
Emil
On Fri, Nov 27, 2015 at 03:29:52PM +0000, Emil Velikov wrote:
> On 27 November 2015 at 15:10, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> > 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.
> >
> > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > Cc: Andrew Morton <akpm@linux-foundation.org>
> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> > ---
> >  drivers/gpu/drm/ast/ast_drv.c         | 2 --
> >  drivers/gpu/drm/cirrus/cirrus_drv.c   | 2 --
> >  drivers/gpu/drm/i915/i915_drv.c       | 2 --
> >  drivers/gpu/drm/mgag200/mgag200_drv.c | 2 --
> >  drivers/gpu/drm/nouveau/nouveau_drm.c | 2 --
> >  drivers/gpu/drm/qxl/qxl_drv.c         | 2 --
> >  drivers/gpu/drm/radeon/radeon_drv.c   | 2 --
> >  include/linux/console.h               | 2 ++
> 
> The new drivers seems to be missing the conversion. Namely amdgpu and
> virtio_gpu.

Just shows how old this patch is ;-) And it's not going to cause a
problem since this patch simply makes the #ifdef redundant.

Greg, do you prefer a respin or a fixup patch?

Thanks, Daniel