Skip to contentSkip to conversation

drm: Fix config dependencies for fbdev emulation

PATCH In review Thomas Zimmermann 5 participants 13 messages Apr 15, 2021 – May 25, 2021

Subsystems (5)
lore
Share & tools
lore

Thomas Zimmermann

author maintainer
#0 lore raw

cover drm: Fix config dependencies for fbdev emulation

While working on the recent aperture helpers, I found it hard to disable fbdev because drivers keep on selecting it automatically.

Cleanup the config dependencies. Fbdev support should be configured by users. DRM drivers should check for DRM_FBDEV_EMULATION to enable fbdev support.

Thomas Zimmermann (4):
drm/vmwgfx: Make console emulation depend on DRM_FBDEV_EMULATION drm/mxsfb: Don't select DRM_KMS_FB_HELPER
drm/zte: Don't select DRM_KMS_FB_HELPER
drm: Remove DRM_KMS_FB_HELPER Kconfig option

 drivers/gpu/drm/Kconfig             | 28 +++++++++++-----------------
 drivers/gpu/drm/mxsfb/Kconfig       |  1 -
 drivers/gpu/drm/vmwgfx/Kconfig      |  7 +------
 drivers/gpu/drm/vmwgfx/Makefile     |  4 +++-
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 19 +++++++++++++++++++
 drivers/gpu/drm/zte/Kconfig         |  1 -
 6 files changed, 34 insertions(+), 26 deletions(-)

--
2.31.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

author maintainer
#1 lore raw

PATCH 1/4 drm/vmwgfx: Make console emulation depend on DRM_FBDEV_EMULATION

Respect DRM's kconfig setting for fbdev console emulation. If enabled, it will select all required config options. So remove them from vmwgfx's Kconfig file.

---
 drivers/gpu/drm/vmwgfx/Kconfig      |  7 +------
 drivers/gpu/drm/vmwgfx/Makefile     |  4 +++-
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 19 +++++++++++++++++++
 3 files changed, 23 insertions(+), 7 deletions(-)
drivers/gpu/drm/vmwgfx/Kconfig +1 -6
index 15acdf2a7c0f..b3a34196935b 100644
@@ -2,12 +2,7 @@
 config DRM_VMWGFX
 	tristate "DRM driver for VMware Virtual GPU"
 	depends on DRM && PCI && X86 && MMU
-	select FB_DEFERRED_IO
-	select FB_CFB_FILLRECT
-	select FB_CFB_COPYAREA
-	select FB_CFB_IMAGEBLIT
 	select DRM_TTM
-	select FB
 	select MAPPING_DIRTY_HELPERS
 	# Only needed for the transitional use of drm_crtc_init - can be removed
 	# again once vmwgfx sets up the primary plane itself.
@@ -20,7 +15,7 @@ config DRM_VMWGFX
 	  The compiled module will be called "vmwgfx.ko".
 
 config DRM_VMWGFX_FBCON
-	depends on DRM_VMWGFX && FB
+	depends on DRM_VMWGFX && DRM_FBDEV_EMULATION
 	bool "Enable framebuffer console under vmwgfx by default"
 	help
 	   Choose this option if you are shipping a new vmwgfx
drivers/gpu/drm/vmwgfx/Makefile +3 -1
index 8c02fa5852e7..9f5743013cbb 100644
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 vmwgfx-y := vmwgfx_execbuf.o vmwgfx_gmr.o vmwgfx_kms.o vmwgfx_drv.o \
-	    vmwgfx_fb.o vmwgfx_ioctl.o vmwgfx_resource.o vmwgfx_ttm_buffer.o \
+	    vmwgfx_ioctl.o vmwgfx_resource.o vmwgfx_ttm_buffer.o \
 	    vmwgfx_cmd.o vmwgfx_irq.o vmwgfx_ldu.o vmwgfx_ttm_glue.o \
 	    vmwgfx_overlay.o vmwgfx_gmrid_manager.o vmwgfx_fence.o \
 	    vmwgfx_bo.o vmwgfx_scrn.o vmwgfx_context.o \
@@ -11,5 +11,7 @@ vmwgfx-y := vmwgfx_execbuf.o vmwgfx_gmr.o vmwgfx_kms.o vmwgfx_drv.o \
 	    vmwgfx_validation.o vmwgfx_page_dirty.o vmwgfx_streamoutput.o \
 	    ttm_object.o ttm_lock.o ttm_memory.o
 
+vmwgfx-$(CONFIG_DRM_FBDEV_EMULATION) += vmwgfx_fb.o
 vmwgfx-$(CONFIG_TRANSPARENT_HUGEPAGE) += vmwgfx_thp.o
+
 obj-$(CONFIG_DRM_VMWGFX) := vmwgfx.o
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +19 -0
index 7e6518709e14..e7836da190c4 100644
@@ -1116,10 +1116,29 @@ extern void vmw_generic_waiter_remove(struct vmw_private *dev_priv,
  * Kernel framebuffer - vmwgfx_fb.c
  */
 
+#ifdef CONFIG_DRM_FBDEV_EMULATION
 int vmw_fb_init(struct vmw_private *vmw_priv);
 int vmw_fb_close(struct vmw_private *dev_priv);
 int vmw_fb_off(struct vmw_private *vmw_priv);
 int vmw_fb_on(struct vmw_private *vmw_priv);
+#else
+static inline int vmw_fb_init(struct vmw_private *vmw_priv)
+{
+	return 0;
+}
+static inline int vmw_fb_close(struct vmw_private *dev_priv)
+{
+	return 0;
+}
+static inline int vmw_fb_off(struct vmw_private *vmw_priv)
+{
+	return 0;
+}
+static inline int vmw_fb_on(struct vmw_private *vmw_priv)
+{
+	return 0;
+}
+#endif
 
 /**
  * Kernel modesetting - vmwgfx_kms.c
Signature · 6 lines
2.31.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/4
#2 lore raw

Re: [PATCH 1/4] drm/vmwgfx: Make console emulation depend on DRM_FBDEV_EMULATION

Quoted 82 lines · Thomas Zimmermann

Respect DRM's kconfig setting for fbdev console emulation. If enabled, it will select all required config options. So remove them from vmwgfx's Kconfig file.

---
  drivers/gpu/drm/vmwgfx/Kconfig      |  7 +------
  drivers/gpu/drm/vmwgfx/Makefile     |  4 +++-
  drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 19 +++++++++++++++++++
  3 files changed, 23 insertions(+), 7 deletions(-)
drivers/gpu/drm/vmwgfx/Kconfig +1 -6
index 15acdf2a7c0f..b3a34196935b 100644
@@ -2,12 +2,7 @@
  config DRM_VMWGFX
  	tristate "DRM driver for VMware Virtual GPU"
  	depends on DRM && PCI && X86 && MMU
-	select FB_DEFERRED_IO
-	select FB_CFB_FILLRECT
-	select FB_CFB_COPYAREA
-	select FB_CFB_IMAGEBLIT
  	select DRM_TTM
-	select FB
  	select MAPPING_DIRTY_HELPERS
  	# Only needed for the transitional use of drm_crtc_init - can be removed
  	# again once vmwgfx sets up the primary plane itself.
@@ -20,7 +15,7 @@ config DRM_VMWGFX
  	  The compiled module will be called "vmwgfx.ko".
 
  config DRM_VMWGFX_FBCON
-	depends on DRM_VMWGFX && FB
+	depends on DRM_VMWGFX && DRM_FBDEV_EMULATION
  	bool "Enable framebuffer console under vmwgfx by default"
  	help
  	   Choose this option if you are shipping a new vmwgfx
drivers/gpu/drm/vmwgfx/Makefile +3 -1
index 8c02fa5852e7..9f5743013cbb 100644
@@ -1,6 +1,6 @@
  # SPDX-License-Identifier: GPL-2.0
  vmwgfx-y := vmwgfx_execbuf.o vmwgfx_gmr.o vmwgfx_kms.o vmwgfx_drv.o \
-	    vmwgfx_fb.o vmwgfx_ioctl.o vmwgfx_resource.o vmwgfx_ttm_buffer.o \
+	    vmwgfx_ioctl.o vmwgfx_resource.o vmwgfx_ttm_buffer.o \
  	    vmwgfx_cmd.o vmwgfx_irq.o vmwgfx_ldu.o vmwgfx_ttm_glue.o \
  	    vmwgfx_overlay.o vmwgfx_gmrid_manager.o vmwgfx_fence.o \
  	    vmwgfx_bo.o vmwgfx_scrn.o vmwgfx_context.o \
@@ -11,5 +11,7 @@ vmwgfx-y := vmwgfx_execbuf.o vmwgfx_gmr.o vmwgfx_kms.o vmwgfx_drv.o \
  	    vmwgfx_validation.o vmwgfx_page_dirty.o vmwgfx_streamoutput.o \
  	    ttm_object.o ttm_lock.o ttm_memory.o
 
+vmwgfx-$(CONFIG_DRM_FBDEV_EMULATION) += vmwgfx_fb.o
  vmwgfx-$(CONFIG_TRANSPARENT_HUGEPAGE) += vmwgfx_thp.o
+
  obj-$(CONFIG_DRM_VMWGFX) := vmwgfx.o
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +12 -0
index 7e6518709e14..e7836da190c4 100644
@@ -1116,10 +1116,29 @@ extern void vmw_generic_waiter_remove(struct vmw_private *dev_priv,
   * Kernel framebuffer - vmwgfx_fb.c
   */
 
+#ifdef CONFIG_DRM_FBDEV_EMULATION
  int vmw_fb_init(struct vmw_private *vmw_priv);
  int vmw_fb_close(struct vmw_private *dev_priv);
  int vmw_fb_off(struct vmw_private *vmw_priv);
  int vmw_fb_on(struct vmw_private *vmw_priv);
+#else
+static inline int vmw_fb_init(struct vmw_private *vmw_priv)
+{
+	return 0;
+}
+static inline int vmw_fb_close(struct vmw_private *dev_priv)
+{
+	return 0;
+}
+static inline int vmw_fb_off(struct vmw_private *vmw_priv)
+{

drivers/gpu/drm/vmwgfx/vmwgfx_drv.h extern void vmw_generic_waiter_remove(struct vmw_private *dev_priv, · line 1144

Quoted 10 lines
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +7 -0
+	return 0;
+}
+static inline int vmw_fb_on(struct vmw_private *vmw_priv)
+{
+	return 0;
+}
+#endif
 
  /**
   * Kernel modesetting - vmwgfx_kms.c

This changes the behavior a bit, I guess DRM_VMWGFX (or at least DRM_VMWGFX_FBCON) would need to select DRM_FBDEV_EMULATION to preserve the old behavior, but that's largely due to the fact that given how those options were setup we never run without FB set. In general it should be ok and looks more reasonable than the current setup. I'll try it out on Monday just in case, but for now:

z
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw

Re: [PATCH 1/4] drm/vmwgfx: Make console emulation depend on DRM_FBDEV_EMULATION

Quoted 91 lines · Zack Rusin
Quoted 89 lines · Thomas Zimmermann

Respect DRM's kconfig setting for fbdev console emulation. If enabled, it will select all required config options. So remove them from vmwgfx's Kconfig file.

---
  drivers/gpu/drm/vmwgfx/Kconfig      |  7 +------
  drivers/gpu/drm/vmwgfx/Makefile     |  4 +++-
  drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 19 +++++++++++++++++++
  3 files changed, 23 insertions(+), 7 deletions(-)
drivers/gpu/drm/vmwgfx/Kconfig +1 -6
index 15acdf2a7c0f..b3a34196935b 100644
@@ -2,12 +2,7 @@
  config DRM_VMWGFX
      tristate "DRM driver for VMware Virtual GPU"
      depends on DRM && PCI && X86 && MMU
-     select FB_DEFERRED_IO
-     select FB_CFB_FILLRECT
-     select FB_CFB_COPYAREA
-     select FB_CFB_IMAGEBLIT
      select DRM_TTM
-     select FB
      select MAPPING_DIRTY_HELPERS
      # Only needed for the transitional use of drm_crtc_init - can be removed
      # again once vmwgfx sets up the primary plane itself.
@@ -20,7 +15,7 @@ config DRM_VMWGFX
        The compiled module will be called "vmwgfx.ko".
 
  config DRM_VMWGFX_FBCON
-     depends on DRM_VMWGFX && FB
+     depends on DRM_VMWGFX && DRM_FBDEV_EMULATION
      bool "Enable framebuffer console under vmwgfx by default"
      help
         Choose this option if you are shipping a new vmwgfx
drivers/gpu/drm/vmwgfx/Makefile +3 -1
index 8c02fa5852e7..9f5743013cbb 100644
@@ -1,6 +1,6 @@
  # SPDX-License-Identifier: GPL-2.0
  vmwgfx-y := vmwgfx_execbuf.o vmwgfx_gmr.o vmwgfx_kms.o vmwgfx_drv.o \
-         vmwgfx_fb.o vmwgfx_ioctl.o vmwgfx_resource.o vmwgfx_ttm_buffer.o \
+         vmwgfx_ioctl.o vmwgfx_resource.o vmwgfx_ttm_buffer.o \
          vmwgfx_cmd.o vmwgfx_irq.o vmwgfx_ldu.o vmwgfx_ttm_glue.o \
          vmwgfx_overlay.o vmwgfx_gmrid_manager.o vmwgfx_fence.o \
          vmwgfx_bo.o vmwgfx_scrn.o vmwgfx_context.o \
@@ -11,5 +11,7 @@ vmwgfx-y := vmwgfx_execbuf.o vmwgfx_gmr.o vmwgfx_kms.o vmwgfx_drv.o \
          vmwgfx_validation.o vmwgfx_page_dirty.o vmwgfx_streamoutput.o \
          ttm_object.o ttm_lock.o ttm_memory.o
 
+vmwgfx-$(CONFIG_DRM_FBDEV_EMULATION) += vmwgfx_fb.o
  vmwgfx-$(CONFIG_TRANSPARENT_HUGEPAGE) += vmwgfx_thp.o
+
  obj-$(CONFIG_DRM_VMWGFX) := vmwgfx.o
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +19 -0
index 7e6518709e14..e7836da190c4 100644
@@ -1116,10 +1116,29 @@ extern void vmw_generic_waiter_remove(struct vmw_private *dev_priv,
   * Kernel framebuffer - vmwgfx_fb.c
   */
 
+#ifdef CONFIG_DRM_FBDEV_EMULATION
  int vmw_fb_init(struct vmw_private *vmw_priv);
  int vmw_fb_close(struct vmw_private *dev_priv);
  int vmw_fb_off(struct vmw_private *vmw_priv);
  int vmw_fb_on(struct vmw_private *vmw_priv);
+#else
+static inline int vmw_fb_init(struct vmw_private *vmw_priv)
+{
+     return 0;
+}
+static inline int vmw_fb_close(struct vmw_private *dev_priv)
+{
+     return 0;
+}
+static inline int vmw_fb_off(struct vmw_private *vmw_priv)
+{
+     return 0;
+}
+static inline int vmw_fb_on(struct vmw_private *vmw_priv)
+{
+     return 0;
+}
+#endif
 
Quoted 5 lines

drivers/gpu/drm/vmwgfx/vmwgfx_drv.h extern void vmw_generic_waiter_remove(struct vmw_private *dev_priv, · line 1144

Quoted 3 lines
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +0 -0
  /**
   * Kernel modesetting - vmwgfx_kms.c

This changes the behavior a bit, I guess DRM_VMWGFX (or at least DRM_VMWGFX_FBCON) would need to select DRM_FBDEV_EMULATION to preserve the old behavior, but that's largely due to the fact that given how those options were setup we never run without FB set. In general it should be ok and looks more reasonable than the current setup. I'll try it out on Monday just in case, but for now:

The issue is that select in Kconfig is pretty annoying (hard to disable, and it's not recursive), so there's a bit a push to retire it. Especially for user-facing config knobs like whether you want fbdev emulation or not. Hence the change.
-Daniel

Quoted 3 lines

z

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#4 lore raw

Re: [PATCH 1/4] drm/vmwgfx: Make console emulation depend on DRM_FBDEV_EMULATION

Quoted 98 lines · Daniel Vetter
Quoted 91 lines · Zack Rusin
Quoted 89 lines · Thomas Zimmermann

Respect DRM's kconfig setting for fbdev console emulation. If enabled, it will select all required config options. So remove them from vmwgfx's Kconfig file.

---
   drivers/gpu/drm/vmwgfx/Kconfig      |  7 +------
   drivers/gpu/drm/vmwgfx/Makefile     |  4 +++-
   drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 19 +++++++++++++++++++
   3 files changed, 23 insertions(+), 7 deletions(-)
drivers/gpu/drm/vmwgfx/Kconfig +1 -6
index 15acdf2a7c0f..b3a34196935b 100644
@@ -2,12 +2,7 @@
   config DRM_VMWGFX
       tristate "DRM driver for VMware Virtual GPU"
       depends on DRM && PCI && X86 && MMU
-     select FB_DEFERRED_IO
-     select FB_CFB_FILLRECT
-     select FB_CFB_COPYAREA
-     select FB_CFB_IMAGEBLIT
       select DRM_TTM
-     select FB
       select MAPPING_DIRTY_HELPERS
       # Only needed for the transitional use of drm_crtc_init - can be removed
       # again once vmwgfx sets up the primary plane itself.
@@ -20,7 +15,7 @@ config DRM_VMWGFX
         The compiled module will be called "vmwgfx.ko".
 
   config DRM_VMWGFX_FBCON
-     depends on DRM_VMWGFX && FB
+     depends on DRM_VMWGFX && DRM_FBDEV_EMULATION
       bool "Enable framebuffer console under vmwgfx by default"
       help
          Choose this option if you are shipping a new vmwgfx
drivers/gpu/drm/vmwgfx/Makefile +3 -1
index 8c02fa5852e7..9f5743013cbb 100644
@@ -1,6 +1,6 @@
   # SPDX-License-Identifier: GPL-2.0
   vmwgfx-y := vmwgfx_execbuf.o vmwgfx_gmr.o vmwgfx_kms.o vmwgfx_drv.o \
-         vmwgfx_fb.o vmwgfx_ioctl.o vmwgfx_resource.o vmwgfx_ttm_buffer.o \
+         vmwgfx_ioctl.o vmwgfx_resource.o vmwgfx_ttm_buffer.o \
           vmwgfx_cmd.o vmwgfx_irq.o vmwgfx_ldu.o vmwgfx_ttm_glue.o \
           vmwgfx_overlay.o vmwgfx_gmrid_manager.o vmwgfx_fence.o \
           vmwgfx_bo.o vmwgfx_scrn.o vmwgfx_context.o \
@@ -11,5 +11,7 @@ vmwgfx-y := vmwgfx_execbuf.o vmwgfx_gmr.o vmwgfx_kms.o vmwgfx_drv.o \
           vmwgfx_validation.o vmwgfx_page_dirty.o vmwgfx_streamoutput.o \
           ttm_object.o ttm_lock.o ttm_memory.o
 
+vmwgfx-$(CONFIG_DRM_FBDEV_EMULATION) += vmwgfx_fb.o
   vmwgfx-$(CONFIG_TRANSPARENT_HUGEPAGE) += vmwgfx_thp.o
+
   obj-$(CONFIG_DRM_VMWGFX) := vmwgfx.o
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +19 -0
index 7e6518709e14..e7836da190c4 100644
@@ -1116,10 +1116,29 @@ extern void vmw_generic_waiter_remove(struct vmw_private *dev_priv,
    * Kernel framebuffer - vmwgfx_fb.c
    */
 
+#ifdef CONFIG_DRM_FBDEV_EMULATION
   int vmw_fb_init(struct vmw_private *vmw_priv);
   int vmw_fb_close(struct vmw_private *dev_priv);
   int vmw_fb_off(struct vmw_private *vmw_priv);
   int vmw_fb_on(struct vmw_private *vmw_priv);
+#else
+static inline int vmw_fb_init(struct vmw_private *vmw_priv)
+{
+     return 0;
+}
+static inline int vmw_fb_close(struct vmw_private *dev_priv)
+{
+     return 0;
+}
+static inline int vmw_fb_off(struct vmw_private *vmw_priv)
+{
+     return 0;
+}
+static inline int vmw_fb_on(struct vmw_private *vmw_priv)
+{
+     return 0;
+}
+#endif
 
Quoted 5 lines

drivers/gpu/drm/vmwgfx/vmwgfx_drv.h extern void vmw_generic_waiter_remove(struct vmw_private *dev_priv, · line 1144

Quoted 3 lines
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +0 -0
   /**
    * Kernel modesetting - vmwgfx_kms.c

This changes the behavior a bit, I guess DRM_VMWGFX (or at least DRM_VMWGFX_FBCON) would need to select DRM_FBDEV_EMULATION to preserve the old behavior, but that's largely due to the fact that given how those options were setup we never run without FB set. In general it should be ok and looks more reasonable than the current setup. I'll try it out on Monday just in case, but for now:

Quoted 4 lines

The issue is that select in Kconfig is pretty annoying (hard to disable, and it's not recursive), so there's a bit a push to retire it. Especially for user-facing config knobs like whether you want fbdev emulation or not. Hence the change.

Yes, I understand the change. It makes sense. I'm just saying that given how hard it was to even build vmwgfx without FB, it's likely it's never been used/tested in this configuration so it might be broken without FB config set. But like I said, it should be fine (it's basically only if we had some generic init code for the rest of the codebase tied to fb initialization).

z
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

author maintainer
#5 lore raw

Re: [PATCH 1/4] drm/vmwgfx: Make console emulation depend on DRM_FBDEV_EMULATION

In reply to Zack Rusin

Hi

Am 15.04.21 um 20:21 schrieb Zack Rusin:

Quoted 9 lines · Thomas Zimmermann
Quoted 8 lines

Respect DRM's kconfig setting for fbdev console emulation. If enabled, it will select all required config options. So remove them from vmwgfx's Kconfig file.

---
  drivers/gpu/drm/vmwgfx/Kconfig      |  7 +------ drivers/gpu/drm/vmwgfx/Makefile     |

4 +++-

Quoted 10 lines
Quoted 10 lines

  drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 19 +++++++++++++++++++

  3 files changed, 23 insertions(+), 7 deletions(-)
drivers/gpu/drm/vmwgfx/Kconfig +0 -0
index 15acdf2a7c0f..b3a34196935b 100644
@@ -2,12 +2,7 @@

  config DRM_VMWGFX
      tristate "DRM driver for VMware Virtual

GPU"

Quoted 10 lines
Quoted 10 lines

      depends on DRM && PCI && X86 && MMU
-    select FB_DEFERRED_IO
-    select FB_CFB_FILLRECT
-    select FB_CFB_COPYAREA
-    select FB_CFB_IMAGEBLIT
      select DRM_TTM
-    select FB
      select MAPPING_DIRTY_HELPERS
      # Only needed for the transitional use of drm_crtc_init - can be removed

      # again once vmwgfx sets up the primary 

plane itself.

Quoted 2 lines
Quoted 2 lines
drivers/gpu/drm/vmwgfx/Kconfig +0 -0
@@ -20,7 +15,7 @@ config DRM_VMWGFX

        The compiled module will be

called "vmwgfx.ko".

Quoted 6 lines
Quoted 6 lines

  config DRM_VMWGFX_FBCON
-    depends on DRM_VMWGFX && FB
+    depends on DRM_VMWGFX && DRM_FBDEV_EMULATION bool "Enable framebuffer console under vmwgfx by default" help
         Choose this option if

you are shipping a new vmwgfx

Quoted 8 lines

drivers/gpu/drm/vmwgfx/Makefile line 3

Quoted 8 lines
drivers/gpu/drm/vmwgfx/Makefile +0 -1
index 8c02fa5852e7..9f5743013cbb 100644
@@ -1,6 +1,6 @@
   # SPDX-License-Identifier: GPL-2.0
   vmwgfx-y := vmwgfx_execbuf.o vmwgfx_gmr.o vmwgfx_kms.o vmwgfx_drv.o \
-        vmwgfx_fb.o vmwgfx_ioctl.o 

vmwgfx_resource.o

Quoted 50 lines
Quoted 37 lines
drivers/gpu/drm/vmwgfx/Makefile +1 -0
 vmwgfx_ttm_buffer.o \
+        vmwgfx_ioctl.o vmwgfx_resource.o vmwgfx_ttm_buffer.o \
           vmwgfx_cmd.o vmwgfx_irq.o vmwgfx_ldu.o vmwgfx_ttm_glue.o \
           vmwgfx_overlay.o vmwgfx_gmrid_manager.o vmwgfx_fence.o \

          vmwgfx_bo.o vmwgfx_scrn.o vmwgfx_context.o \

drivers/gpu/drm/vmwgfx/Makefile +0 -0
@@ -11,5 +11,7 @@ vmwgfx-y := vmwgfx_execbuf.o vmwgfx_gmr.o 
 vmwgfx_kms.o vmwgfx_drv.o \
           vmwgfx_validation.o vmwgfx_page_dirty.o vmwgfx_streamoutput.o \

          ttm_object.o ttm_lock.o ttm_memory.o +vmwgfx-$(CONFIG_DRM_FBDEV_EMULATION) += vmwgfx_fb.o vmwgfx-$(CONFIG_TRANSPARENT_HUGEPAGE) += vmwgfx_thp.o +
  obj-$(CONFIG_DRM_VMWGFX) := vmwgfx.o

drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +12 -0
index 7e6518709e14..e7836da190c4 100644
@@ -1116,10 +1116,29 @@ extern void vmw_generic_waiter_remove(struct 
 vmw_private *dev_priv,
    * Kernel framebuffer - vmwgfx_fb.c
    */
+#ifdef CONFIG_DRM_FBDEV_EMULATION
   int vmw_fb_init(struct vmw_private *vmw_priv);
   int vmw_fb_close(struct vmw_private *dev_priv);
   int vmw_fb_off(struct vmw_private *vmw_priv);
   int vmw_fb_on(struct vmw_private *vmw_priv);
+#else
+static inline int vmw_fb_init(struct vmw_private *vmw_priv)
+{
+    return 0;
+}
+static inline int vmw_fb_close(struct vmw_private *dev_priv)
+{
+    return 0;
+}
+static inline int vmw_fb_off(struct vmw_private *vmw_priv)
+{

drivers/gpu/drm/vmwgfx/vmwgfx_drv.h extern void vmw_generic_waiter_remove(struct · line 1144

Quoted 10 lines
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +7 -0
+    return 0;
+}
+static inline int vmw_fb_on(struct vmw_private *vmw_priv)
+{
+    return 0;
+}
+#endif
   /**
    * Kernel modesetting - vmwgfx_kms.c
 

This changes the behavior a bit, I guess DRM_VMWGFX (or at least DRM_VMWGFX_FBCON) would need to select DRM_FBDEV_EMULATION to preserve the old behavior, but that's largely due to the fact that given how those options were setup we never run without FB set. In general it should be ok and looks more reasonable than the current setup. I'll try

Quoted 4 lines

it out on Monday just in case, but for now:

All other drivers use DRM_FBDEV_EMULATION, so vmwgfx would follow common conventions.

AFAICT DRM_VMWGFX_FBCON is just the default on/off setting. How about making DRM_VMWGFX_FBCON depend on DRM_FBDEV_EMULATION? Users would be able to enable fbdev emulation in general and, if needed, still pick a separate default on/off for vmwgfx.

Best regards
Thomas

Quoted 1 line

z

Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

author maintainer
#6 lore raw

Re: [PATCH 1/4] drm/vmwgfx: Make console emulation depend on DRM_FBDEV_EMULATION

Am 15.04.21 um 20:50 schrieb Thomas Zimmermann:

Quoted 16 lines

Hi

Am 15.04.21 um 20:21 schrieb Zack Rusin:

Quoted 9 lines · Thomas Zimmermann
Quoted 8 lines

Respect DRM's kconfig setting for fbdev console emulation. If enabled, it will select all required config options. So remove them from vmwgfx's Kconfig file.

---
  drivers/gpu/drm/vmwgfx/Kconfig      |  7 +------ drivers/gpu/drm/vmwgfx/Makefile     |

4 +++-

Quoted 3 lines
Quoted 3 lines

  drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 19 +++++++++++++++++++

  3 files changed, 23 insertions(+), 7 deletions(-)
Quoted 17 lines
Quoted 7 lines
Quoted 7 lines
drivers/gpu/drm/vmwgfx/Kconfig +0 -0
index 15acdf2a7c0f..b3a34196935b 100644
@@ -2,12 +2,7 @@

  config DRM_VMWGFX
      tristate "DRM driver for VMware Virtual

GPU"

Quoted 9 lines
Quoted 9 lines

      depends on DRM && PCI && X86 && MMU
-    select FB_DEFERRED_IO
-    select FB_CFB_FILLRECT
-    select FB_CFB_COPYAREA
-    select FB_CFB_IMAGEBLIT
      select DRM_TTM
-    select FB
      select MAPPING_DIRTY_HELPERS
      # Only needed for the transitional use

of drm_crtc_init - can

Quoted 10 lines
Quoted 2 lines
Quoted 2 lines

be removed

      # again once vmwgfx sets up the primary 

plane itself.

Quoted 2 lines
Quoted 2 lines
drivers/gpu/drm/vmwgfx/Kconfig +0 -0
@@ -20,7 +15,7 @@ config DRM_VMWGFX

        The compiled module will be

called "vmwgfx.ko".

Quoted 4 lines
Quoted 4 lines

  config DRM_VMWGFX_FBCON
-    depends on DRM_VMWGFX && FB
+    depends on DRM_VMWGFX && DRM_FBDEV_EMULATION
      bool "Enable framebuffer console under

vmwgfx by default"

Quoted 64 lines
Quoted 2 lines
Quoted 2 lines

      help
         Choose this option if

you are shipping a new vmwgfx

Quoted 8 lines

drivers/gpu/drm/vmwgfx/Makefile line 3

Quoted 8 lines
drivers/gpu/drm/vmwgfx/Makefile +0 -1
index 8c02fa5852e7..9f5743013cbb 100644
@@ -1,6 +1,6 @@
   # SPDX-License-Identifier: GPL-2.0
   vmwgfx-y := vmwgfx_execbuf.o vmwgfx_gmr.o vmwgfx_kms.o vmwgfx_drv.o \
-        vmwgfx_fb.o vmwgfx_ioctl.o 

vmwgfx_resource.o

Quoted 51 lines
Quoted 37 lines
drivers/gpu/drm/vmwgfx/Makefile +1 -0
 vmwgfx_ttm_buffer.o \
+        vmwgfx_ioctl.o vmwgfx_resource.o vmwgfx_ttm_buffer.o \
           vmwgfx_cmd.o vmwgfx_irq.o vmwgfx_ldu.o vmwgfx_ttm_glue.o \
           vmwgfx_overlay.o vmwgfx_gmrid_manager.o vmwgfx_fence.o \

          vmwgfx_bo.o vmwgfx_scrn.o vmwgfx_context.o \

drivers/gpu/drm/vmwgfx/Makefile +0 -0
@@ -11,5 +11,7 @@ vmwgfx-y := vmwgfx_execbuf.o vmwgfx_gmr.o 
 vmwgfx_kms.o vmwgfx_drv.o \
           vmwgfx_validation.o vmwgfx_page_dirty.o vmwgfx_streamoutput.o \

          ttm_object.o ttm_lock.o ttm_memory.o +vmwgfx-$(CONFIG_DRM_FBDEV_EMULATION) += vmwgfx_fb.o vmwgfx-$(CONFIG_TRANSPARENT_HUGEPAGE) += vmwgfx_thp.o +
  obj-$(CONFIG_DRM_VMWGFX) := vmwgfx.o

drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +12 -0
index 7e6518709e14..e7836da190c4 100644
@@ -1116,10 +1116,29 @@ extern void vmw_generic_waiter_remove(struct 
 vmw_private *dev_priv,
    * Kernel framebuffer - vmwgfx_fb.c
    */
+#ifdef CONFIG_DRM_FBDEV_EMULATION
   int vmw_fb_init(struct vmw_private *vmw_priv);
   int vmw_fb_close(struct vmw_private *dev_priv);
   int vmw_fb_off(struct vmw_private *vmw_priv);
   int vmw_fb_on(struct vmw_private *vmw_priv);
+#else
+static inline int vmw_fb_init(struct vmw_private *vmw_priv)
+{
+    return 0;
+}
+static inline int vmw_fb_close(struct vmw_private *dev_priv)
+{
+    return 0;
+}
+static inline int vmw_fb_off(struct vmw_private *vmw_priv)
+{

drivers/gpu/drm/vmwgfx/vmwgfx_drv.h extern void vmw_generic_waiter_remove(struct · line 1144

Quoted 10 lines
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +7 -0
+    return 0;
+}
+static inline int vmw_fb_on(struct vmw_private *vmw_priv)
+{
+    return 0;
+}
+#endif
   /**
    * Kernel modesetting - vmwgfx_kms.c
 

This changes the behavior a bit, I guess DRM_VMWGFX (or at least DRM_VMWGFX_FBCON) would need to select DRM_FBDEV_EMULATION to preserve

the old behavior, but that's largely due to the fact that given how those options were setup we never run without FB set. In general it should be ok and looks more reasonable than the current setup. I'll try

Quoted 8 lines
Quoted 4 lines

it out on Monday just in case, but for now:

All other drivers use DRM_FBDEV_EMULATION, so vmwgfx would follow common conventions.

AFAICT DRM_VMWGFX_FBCON is just the default on/off setting. How about making DRM_VMWGFX_FBCON depend on DRM_FBDEV_EMULATION? Users would be able to enable fbdev emulation in general and, if needed, still pick a separate default on/off for vmwgfx.

Oh, lol. That's already in the patchset.

Quoted 12 lines

Best regards
Thomas

Quoted 1 line

z

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

author maintainer
#7 lore raw

PATCH 2/4 drm/mxsfb: Don't select DRM_KMS_FB_HELPER

In reply to Thomas Zimmermann

Selecting DRM_FBDEV_EMULATION will include the correct secttings for fbdev emulation. Drivers should not override this.

---
 drivers/gpu/drm/mxsfb/Kconfig | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/mxsfb/Kconfig +0 -1
index 0143d539f8f8..ee22cd25d3e3 100644
@@ -10,7 +10,6 @@ config DRM_MXSFB
 	depends on COMMON_CLK
 	select DRM_MXS
 	select DRM_KMS_HELPER
-	select DRM_KMS_FB_HELPER
 	select DRM_KMS_CMA_HELPER
 	select DRM_PANEL
 	select DRM_PANEL_BRIDGE
Signature · 6 lines
2.31.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer Acked-by on v1 2/4
#8 lore raw

Re: [PATCH 2/4] drm/mxsfb: Don't select DRM_KMS_FB_HELPER

Quoted 4 lines · Thomas Zimmermann

Selecting DRM_FBDEV_EMULATION will include the correct secttings for fbdev emulation. Drivers should not override this.

--
Stefan

Quoted 9 lines
---
 drivers/gpu/drm/mxsfb/Kconfig | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/mxsfb/Kconfig +0 -0
index 0143d539f8f8..ee22cd25d3e3 100644

drivers/gpu/drm/mxsfb/Kconfig config DRM_MXSFB · line 15

Quoted 7 lines
drivers/gpu/drm/mxsfb/Kconfig +0 -1
@@ -10,7 +10,6 @@ config DRM_MXSFB
 	depends on COMMON_CLK
 	select DRM_MXS
 	select DRM_KMS_HELPER
-	select DRM_KMS_FB_HELPER
 	select DRM_KMS_CMA_HELPER
 	select DRM_PANEL
 	select DRM_PANEL_BRIDGE

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

author maintainer
#9 lore raw

PATCH 3/4 drm/zte: Don't select DRM_KMS_FB_HELPER

In reply to Thomas Zimmermann

Selecting DRM_FBDEV_EMULATION will include the correct secttings for fbdev emulation. Drivers should not override this.

---
 drivers/gpu/drm/zte/Kconfig | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/zte/Kconfig +0 -1
index 90ebaedc11fd..aa8594190b50 100644
@@ -3,7 +3,6 @@ config DRM_ZTE
 	tristate "DRM Support for ZTE SoCs"
 	depends on DRM && ARCH_ZX
 	select DRM_KMS_CMA_HELPER
-	select DRM_KMS_FB_HELPER
 	select DRM_KMS_HELPER
 	select SND_SOC_HDMI_CODEC if SND_SOC
 	select VIDEOMODE_HELPERS
Signature · 6 lines
2.31.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author maintainer
#10 lore raw

PATCH 4/4 drm: Remove DRM_KMS_FB_HELPER Kconfig option

In reply to Thomas Zimmermann

It's only used by DRM_FBDEV_EMULATION, so inline it there.

---
 drivers/gpu/drm/Kconfig | 28 +++++++++++-----------------
 1 file changed, 11 insertions(+), 17 deletions(-)
drivers/gpu/drm/Kconfig +11 -17
index 3c16bd1afd87..d3a9ca4b1cec 100644
@@ -80,23 +80,6 @@ config DRM_KMS_HELPER
 	help
 	  CRTC helpers for KMS drivers.
 
-config DRM_KMS_FB_HELPER
-	bool
-	depends on DRM_KMS_HELPER
-	select FB
-	select FRAMEBUFFER_CONSOLE if !EXPERT
-	select FRAMEBUFFER_CONSOLE_DETECT_PRIMARY if FRAMEBUFFER_CONSOLE
-	select FB_SYS_FOPS
-	select FB_SYS_FILLRECT
-	select FB_SYS_COPYAREA
-	select FB_SYS_IMAGEBLIT
-	select FB_CFB_FILLRECT
-	select FB_CFB_COPYAREA
-	select FB_CFB_IMAGEBLIT
-	select FB_DEFERRED_IO
-	help
-	  FBDEV helpers for KMS drivers.
-
 config DRM_DEBUG_DP_MST_TOPOLOGY_REFS
         bool "Enable refcount backtrace history in the DP MST helpers"
 	depends on STACKTRACE_SUPPORT
@@ -117,6 +100,17 @@ config DRM_FBDEV_EMULATION
 	depends on DRM
 	select DRM_KMS_HELPER
 	select DRM_KMS_FB_HELPER
+	select FB
+	select FB_CFB_FILLRECT
+	select FB_CFB_COPYAREA
+	select FB_CFB_IMAGEBLIT
+	select FB_DEFERRED_IO
+	select FB_SYS_FOPS
+	select FB_SYS_FILLRECT
+	select FB_SYS_COPYAREA
+	select FB_SYS_IMAGEBLIT
+	select FRAMEBUFFER_CONSOLE if !EXPERT
+	select FRAMEBUFFER_CONSOLE_DETECT_PRIMARY if FRAMEBUFFER_CONSOLE
 	default y
 	help
 	  Choose this option if you have a need for the legacy fbdev
Signature · 6 lines
2.31.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Acked-by on v1 4/4
#11 lore raw

Re: [PATCH 4/4] drm: Remove DRM_KMS_FB_HELPER Kconfig option

Quoted 3 lines · Thomas Zimmermann

It's only used by DRM_FBDEV_EMULATION, so inline it there.

I'm not sure on patch 1, I'll leave that to Zack, but I think 2-4 would work alone too. On those:

Quoted 53 lines
---
 drivers/gpu/drm/Kconfig | 28 +++++++++++-----------------
 1 file changed, 11 insertions(+), 17 deletions(-)
drivers/gpu/drm/Kconfig +11 -17
index 3c16bd1afd87..d3a9ca4b1cec 100644
@@ -80,23 +80,6 @@ config DRM_KMS_HELPER
 	help
 	  CRTC helpers for KMS drivers.
 
-config DRM_KMS_FB_HELPER
-	bool
-	depends on DRM_KMS_HELPER
-	select FB
-	select FRAMEBUFFER_CONSOLE if !EXPERT
-	select FRAMEBUFFER_CONSOLE_DETECT_PRIMARY if FRAMEBUFFER_CONSOLE
-	select FB_SYS_FOPS
-	select FB_SYS_FILLRECT
-	select FB_SYS_COPYAREA
-	select FB_SYS_IMAGEBLIT
-	select FB_CFB_FILLRECT
-	select FB_CFB_COPYAREA
-	select FB_CFB_IMAGEBLIT
-	select FB_DEFERRED_IO
-	help
-	  FBDEV helpers for KMS drivers.
-
 config DRM_DEBUG_DP_MST_TOPOLOGY_REFS
         bool "Enable refcount backtrace history in the DP MST helpers"
 	depends on STACKTRACE_SUPPORT
@@ -117,6 +100,17 @@ config DRM_FBDEV_EMULATION
 	depends on DRM
 	select DRM_KMS_HELPER
 	select DRM_KMS_FB_HELPER
+	select FB
+	select FB_CFB_FILLRECT
+	select FB_CFB_COPYAREA
+	select FB_CFB_IMAGEBLIT
+	select FB_DEFERRED_IO
+	select FB_SYS_FOPS
+	select FB_SYS_FILLRECT
+	select FB_SYS_COPYAREA
+	select FB_SYS_IMAGEBLIT
+	select FRAMEBUFFER_CONSOLE if !EXPERT
+	select FRAMEBUFFER_CONSOLE_DETECT_PRIMARY if FRAMEBUFFER_CONSOLE
 	default y
 	help
 	  Choose this option if you have a need for the legacy fbdev
Signature · 1 line
2.31.1
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#12 lore raw

Re: [PATCH 4/4] drm: Remove DRM_KMS_FB_HELPER Kconfig option

In reply to Thomas Zimmermann

Hi Thomas,

Quoted 36 lines · Thomas Zimmermann

It's only used by DRM_FBDEV_EMULATION, so inline it there.

---
 drivers/gpu/drm/Kconfig | 28 +++++++++++-----------------
 1 file changed, 11 insertions(+), 17 deletions(-)
drivers/gpu/drm/Kconfig +0 -17
index 3c16bd1afd87..d3a9ca4b1cec 100644
@@ -80,23 +80,6 @@ config DRM_KMS_HELPER
        help
          CRTC helpers for KMS drivers.
 
-config DRM_KMS_FB_HELPER
-       bool
-       depends on DRM_KMS_HELPER
-       select FB
-       select FRAMEBUFFER_CONSOLE if !EXPERT
-       select FRAMEBUFFER_CONSOLE_DETECT_PRIMARY if FRAMEBUFFER_CONSOLE
-       select FB_SYS_FOPS
-       select FB_SYS_FILLRECT
-       select FB_SYS_COPYAREA
-       select FB_SYS_IMAGEBLIT
-       select FB_CFB_FILLRECT
-       select FB_CFB_COPYAREA
-       select FB_CFB_IMAGEBLIT
-       select FB_DEFERRED_IO
-       help
-         FBDEV helpers for KMS drivers.
-
 config DRM_DEBUG_DP_MST_TOPOLOGY_REFS
         bool "Enable refcount backtrace history in the DP MST helpers"
        depends on STACKTRACE_SUPPORT

drivers/gpu/drm/Kconfig config DRM_FBDEV_EMULATION · line 102

Quoted 3 lines
drivers/gpu/drm/Kconfig +0 -0
@@ -117,6 +100,17 @@ config DRM_FBDEV_EMULATION
        depends on DRM
        select DRM_KMS_HELPER
        select DRM_KMS_FB_HELPER

It's still selected here ^

Quoted 4 lines
drivers/gpu/drm/Kconfig +4 -0
+       select FB
+       select FB_CFB_FILLRECT
+       select FB_CFB_COPYAREA
+       select FB_CFB_IMAGEBLIT

drivers/gpu/drm/Kconfig config DRM_FBDEV_EMULATION · line 116

Quoted 10 lines
drivers/gpu/drm/Kconfig +7 -0
+       select FB_DEFERRED_IO
+       select FB_SYS_FOPS
+       select FB_SYS_FILLRECT
+       select FB_SYS_COPYAREA
+       select FB_SYS_IMAGEBLIT
+       select FRAMEBUFFER_CONSOLE if !EXPERT
+       select FRAMEBUFFER_CONSOLE_DETECT_PRIMARY if FRAMEBUFFER_CONSOLE
        default y
        help
          Choose this option if you have a need for the legacy fbdev

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds