linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] drm: Fix config dependencies for fbdev emulation
@ 2021-04-15 11:00 Thomas Zimmermann
  2021-04-15 11:00 ` [PATCH 1/4] drm/vmwgfx: Make console emulation depend on DRM_FBDEV_EMULATION Thomas Zimmermann
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Thomas Zimmermann @ 2021-04-15 11:00 UTC (permalink / raw)
  To: maarten.lankhorst, mripard, airlied, daniel, marex, stefan,
	shawnguo, s.hauer, kernel, festevam, linux-imx,
	linux-graphics-maintainer, sroland, zackr
  Cc: dri-devel, linux-arm-kernel, Thomas Zimmermann

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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 1/4] drm/vmwgfx: Make console emulation depend on DRM_FBDEV_EMULATION
  2021-04-15 11:00 [PATCH 0/4] drm: Fix config dependencies for fbdev emulation Thomas Zimmermann
@ 2021-04-15 11:00 ` Thomas Zimmermann
  2021-04-15 18:21   ` Zack Rusin
  2021-04-15 11:00 ` [PATCH 2/4] drm/mxsfb: Don't select DRM_KMS_FB_HELPER Thomas Zimmermann
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 13+ messages in thread
From: Thomas Zimmermann @ 2021-04-15 11:00 UTC (permalink / raw)
  To: maarten.lankhorst, mripard, airlied, daniel, marex, stefan,
	shawnguo, s.hauer, kernel, festevam, linux-imx,
	linux-graphics-maintainer, sroland, zackr
  Cc: dri-devel, linux-arm-kernel, 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.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 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(-)

diff --git a/drivers/gpu/drm/vmwgfx/Kconfig b/drivers/gpu/drm/vmwgfx/Kconfig
index 15acdf2a7c0f..b3a34196935b 100644
--- a/drivers/gpu/drm/vmwgfx/Kconfig
+++ b/drivers/gpu/drm/vmwgfx/Kconfig
@@ -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
diff --git a/drivers/gpu/drm/vmwgfx/Makefile b/drivers/gpu/drm/vmwgfx/Makefile
index 8c02fa5852e7..9f5743013cbb 100644
--- a/drivers/gpu/drm/vmwgfx/Makefile
+++ b/drivers/gpu/drm/vmwgfx/Makefile
@@ -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
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
index 7e6518709e14..e7836da190c4 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
@@ -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
-- 
2.31.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 2/4] drm/mxsfb: Don't select DRM_KMS_FB_HELPER
  2021-04-15 11:00 [PATCH 0/4] drm: Fix config dependencies for fbdev emulation Thomas Zimmermann
  2021-04-15 11:00 ` [PATCH 1/4] drm/vmwgfx: Make console emulation depend on DRM_FBDEV_EMULATION Thomas Zimmermann
@ 2021-04-15 11:00 ` Thomas Zimmermann
  2021-04-15 15:03   ` Stefan Agner
  2021-04-15 11:00 ` [PATCH 3/4] drm/zte: " Thomas Zimmermann
  2021-04-15 11:00 ` [PATCH 4/4] drm: Remove DRM_KMS_FB_HELPER Kconfig option Thomas Zimmermann
  3 siblings, 1 reply; 13+ messages in thread
From: Thomas Zimmermann @ 2021-04-15 11:00 UTC (permalink / raw)
  To: maarten.lankhorst, mripard, airlied, daniel, marex, stefan,
	shawnguo, s.hauer, kernel, festevam, linux-imx,
	linux-graphics-maintainer, sroland, zackr
  Cc: dri-devel, linux-arm-kernel, Thomas Zimmermann

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

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/gpu/drm/mxsfb/Kconfig | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/mxsfb/Kconfig b/drivers/gpu/drm/mxsfb/Kconfig
index 0143d539f8f8..ee22cd25d3e3 100644
--- a/drivers/gpu/drm/mxsfb/Kconfig
+++ b/drivers/gpu/drm/mxsfb/Kconfig
@@ -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
-- 
2.31.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 3/4] drm/zte: Don't select DRM_KMS_FB_HELPER
  2021-04-15 11:00 [PATCH 0/4] drm: Fix config dependencies for fbdev emulation Thomas Zimmermann
  2021-04-15 11:00 ` [PATCH 1/4] drm/vmwgfx: Make console emulation depend on DRM_FBDEV_EMULATION Thomas Zimmermann
  2021-04-15 11:00 ` [PATCH 2/4] drm/mxsfb: Don't select DRM_KMS_FB_HELPER Thomas Zimmermann
@ 2021-04-15 11:00 ` Thomas Zimmermann
  2021-04-15 11:00 ` [PATCH 4/4] drm: Remove DRM_KMS_FB_HELPER Kconfig option Thomas Zimmermann
  3 siblings, 0 replies; 13+ messages in thread
From: Thomas Zimmermann @ 2021-04-15 11:00 UTC (permalink / raw)
  To: maarten.lankhorst, mripard, airlied, daniel, marex, stefan,
	shawnguo, s.hauer, kernel, festevam, linux-imx,
	linux-graphics-maintainer, sroland, zackr
  Cc: dri-devel, linux-arm-kernel, Thomas Zimmermann

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

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/gpu/drm/zte/Kconfig | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/zte/Kconfig b/drivers/gpu/drm/zte/Kconfig
index 90ebaedc11fd..aa8594190b50 100644
--- a/drivers/gpu/drm/zte/Kconfig
+++ b/drivers/gpu/drm/zte/Kconfig
@@ -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
-- 
2.31.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 4/4] drm: Remove DRM_KMS_FB_HELPER Kconfig option
  2021-04-15 11:00 [PATCH 0/4] drm: Fix config dependencies for fbdev emulation Thomas Zimmermann
                   ` (2 preceding siblings ...)
  2021-04-15 11:00 ` [PATCH 3/4] drm/zte: " Thomas Zimmermann
@ 2021-04-15 11:00 ` Thomas Zimmermann
  2021-04-15 15:39   ` Daniel Vetter
  2021-05-25  9:28   ` Geert Uytterhoeven
  3 siblings, 2 replies; 13+ messages in thread
From: Thomas Zimmermann @ 2021-04-15 11:00 UTC (permalink / raw)
  To: maarten.lankhorst, mripard, airlied, daniel, marex, stefan,
	shawnguo, s.hauer, kernel, festevam, linux-imx,
	linux-graphics-maintainer, sroland, zackr
  Cc: dri-devel, linux-arm-kernel, Thomas Zimmermann

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

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/gpu/drm/Kconfig | 28 +++++++++++-----------------
 1 file changed, 11 insertions(+), 17 deletions(-)

diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index 3c16bd1afd87..d3a9ca4b1cec 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -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
-- 
2.31.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH 2/4] drm/mxsfb: Don't select DRM_KMS_FB_HELPER
  2021-04-15 11:00 ` [PATCH 2/4] drm/mxsfb: Don't select DRM_KMS_FB_HELPER Thomas Zimmermann
@ 2021-04-15 15:03   ` Stefan Agner
  0 siblings, 0 replies; 13+ messages in thread
From: Stefan Agner @ 2021-04-15 15:03 UTC (permalink / raw)
  To: Thomas Zimmermann
  Cc: maarten.lankhorst, mripard, airlied, daniel, marex, shawnguo,
	s.hauer, kernel, festevam, linux-imx, linux-graphics-maintainer,
	sroland, zackr, dri-devel, linux-arm-kernel

On 2021-04-15 13:00, Thomas Zimmermann wrote:
> Selecting DRM_FBDEV_EMULATION will include the correct secttings for
> fbdev emulation. Drivers should not override this.
> 
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>

Acked-by: Stefan Agner <stefan@agner.ch>

--
Stefan

> ---
>  drivers/gpu/drm/mxsfb/Kconfig | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/mxsfb/Kconfig b/drivers/gpu/drm/mxsfb/Kconfig
> index 0143d539f8f8..ee22cd25d3e3 100644
> --- a/drivers/gpu/drm/mxsfb/Kconfig
> +++ b/drivers/gpu/drm/mxsfb/Kconfig
> @@ -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
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 4/4] drm: Remove DRM_KMS_FB_HELPER Kconfig option
  2021-04-15 11:00 ` [PATCH 4/4] drm: Remove DRM_KMS_FB_HELPER Kconfig option Thomas Zimmermann
@ 2021-04-15 15:39   ` Daniel Vetter
  2021-05-25  9:28   ` Geert Uytterhoeven
  1 sibling, 0 replies; 13+ messages in thread
From: Daniel Vetter @ 2021-04-15 15:39 UTC (permalink / raw)
  To: Thomas Zimmermann
  Cc: maarten.lankhorst, mripard, airlied, daniel, marex, stefan,
	shawnguo, s.hauer, kernel, festevam, linux-imx,
	linux-graphics-maintainer, sroland, zackr, dri-devel,
	linux-arm-kernel

On Thu, Apr 15, 2021 at 01:00:40PM +0200, Thomas Zimmermann wrote:
> It's only used by DRM_FBDEV_EMULATION, so inline it there.
> 
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>

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

Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>

> ---
>  drivers/gpu/drm/Kconfig | 28 +++++++++++-----------------
>  1 file changed, 11 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
> index 3c16bd1afd87..d3a9ca4b1cec 100644
> --- a/drivers/gpu/drm/Kconfig
> +++ b/drivers/gpu/drm/Kconfig
> @@ -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
> -- 
> 2.31.1
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 1/4] drm/vmwgfx: Make console emulation depend on DRM_FBDEV_EMULATION
  2021-04-15 11:00 ` [PATCH 1/4] drm/vmwgfx: Make console emulation depend on DRM_FBDEV_EMULATION Thomas Zimmermann
@ 2021-04-15 18:21   ` Zack Rusin
  2021-04-15 18:49     ` Daniel Vetter
  2021-04-15 18:50     ` Thomas Zimmermann
  0 siblings, 2 replies; 13+ messages in thread
From: Zack Rusin @ 2021-04-15 18:21 UTC (permalink / raw)
  To: Thomas Zimmermann, maarten.lankhorst, mripard, airlied, daniel,
	marex, stefan, shawnguo, s.hauer, kernel, festevam, linux-imx,
	linux-graphics-maintainer, sroland
  Cc: dri-devel, linux-arm-kernel

On 4/15/21 7:00 AM, Thomas Zimmermann wrote:
> 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.
> 
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> ---
>   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(-)
> 
> diff --git a/drivers/gpu/drm/vmwgfx/Kconfig b/drivers/gpu/drm/vmwgfx/Kconfig
> index 15acdf2a7c0f..b3a34196935b 100644
> --- a/drivers/gpu/drm/vmwgfx/Kconfig
> +++ b/drivers/gpu/drm/vmwgfx/Kconfig
> @@ -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
> diff --git a/drivers/gpu/drm/vmwgfx/Makefile b/drivers/gpu/drm/vmwgfx/Makefile
> index 8c02fa5852e7..9f5743013cbb 100644
> --- a/drivers/gpu/drm/vmwgfx/Makefile
> +++ b/drivers/gpu/drm/vmwgfx/Makefile
> @@ -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
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
> index 7e6518709e14..e7836da190c4 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
> @@ -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
> 

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:

Reviewed-by: Zack Rusin <zackr@vmware.com>

z

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 1/4] drm/vmwgfx: Make console emulation depend on DRM_FBDEV_EMULATION
  2021-04-15 18:21   ` Zack Rusin
@ 2021-04-15 18:49     ` Daniel Vetter
  2021-04-15 19:14       ` Zack Rusin
  2021-04-15 18:50     ` Thomas Zimmermann
  1 sibling, 1 reply; 13+ messages in thread
From: Daniel Vetter @ 2021-04-15 18:49 UTC (permalink / raw)
  To: Zack Rusin
  Cc: Thomas Zimmermann, Maarten Lankhorst, Maxime Ripard, Dave Airlie,
	Marek Vasut, Stefan Agner, Shawn Guo, Sascha Hauer, Sascha Hauer,
	Fabio Estevam, dl-linux-imx, VMware Graphics, Roland Scheidegger,
	dri-devel, Linux ARM

On Thu, Apr 15, 2021 at 8:21 PM Zack Rusin <zackr@vmware.com> wrote:
>
> On 4/15/21 7:00 AM, Thomas Zimmermann wrote:
> > 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.
> >
> > Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> > ---
> >   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(-)
> >
> > diff --git a/drivers/gpu/drm/vmwgfx/Kconfig b/drivers/gpu/drm/vmwgfx/Kconfig
> > index 15acdf2a7c0f..b3a34196935b 100644
> > --- a/drivers/gpu/drm/vmwgfx/Kconfig
> > +++ b/drivers/gpu/drm/vmwgfx/Kconfig
> > @@ -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
> > diff --git a/drivers/gpu/drm/vmwgfx/Makefile b/drivers/gpu/drm/vmwgfx/Makefile
> > index 8c02fa5852e7..9f5743013cbb 100644
> > --- a/drivers/gpu/drm/vmwgfx/Makefile
> > +++ b/drivers/gpu/drm/vmwgfx/Makefile
> > @@ -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
> > diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
> > index 7e6518709e14..e7836da190c4 100644
> > --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
> > +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
> > @@ -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
> >
>
> 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

> Reviewed-by: Zack Rusin <zackr@vmware.com>
>
> z



-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 1/4] drm/vmwgfx: Make console emulation depend on DRM_FBDEV_EMULATION
  2021-04-15 18:21   ` Zack Rusin
  2021-04-15 18:49     ` Daniel Vetter
@ 2021-04-15 18:50     ` Thomas Zimmermann
  2021-04-16 10:48       ` Thomas Zimmermann
  1 sibling, 1 reply; 13+ messages in thread
From: Thomas Zimmermann @ 2021-04-15 18:50 UTC (permalink / raw)
  To: Zack Rusin, maarten.lankhorst, mripard, airlied, daniel, marex,
	stefan, shawnguo, s.hauer, kernel, festevam, linux-imx,
	linux-graphics-maintainer, sroland
  Cc: dri-devel, linux-arm-kernel


[-- Attachment #1.1.1: Type: text/plain, Size: 5106 bytes --]

Hi

Am 15.04.21 um 20:21 schrieb Zack Rusin:
> On 4/15/21 7:00 AM, Thomas Zimmermann wrote:
>> 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.
>>
>> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
>> ---
>>   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(-)
>>
>> diff --git a/drivers/gpu/drm/vmwgfx/Kconfig 
>> b/drivers/gpu/drm/vmwgfx/Kconfig
>> index 15acdf2a7c0f..b3a34196935b 100644
>> --- a/drivers/gpu/drm/vmwgfx/Kconfig
>> +++ b/drivers/gpu/drm/vmwgfx/Kconfig
>> @@ -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
>> diff --git a/drivers/gpu/drm/vmwgfx/Makefile 
>> b/drivers/gpu/drm/vmwgfx/Makefile
>> index 8c02fa5852e7..9f5743013cbb 100644
>> --- a/drivers/gpu/drm/vmwgfx/Makefile
>> +++ b/drivers/gpu/drm/vmwgfx/Makefile
>> @@ -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
>> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h 
>> b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
>> index 7e6518709e14..e7836da190c4 100644
>> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
>> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
>> @@ -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
>>
> 
> 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:
> 
> Reviewed-by: Zack Rusin <zackr@vmware.com>
> 

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

> z

-- 
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


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 1/4] drm/vmwgfx: Make console emulation depend on DRM_FBDEV_EMULATION
  2021-04-15 18:49     ` Daniel Vetter
@ 2021-04-15 19:14       ` Zack Rusin
  0 siblings, 0 replies; 13+ messages in thread
From: Zack Rusin @ 2021-04-15 19:14 UTC (permalink / raw)
  To: Daniel Vetter
  Cc: Thomas Zimmermann, Maarten Lankhorst, Maxime Ripard, Dave Airlie,
	Marek Vasut, Stefan Agner, Shawn Guo, Sascha Hauer, Sascha Hauer,
	Fabio Estevam, dl-linux-imx, VMware Graphics, Roland Scheidegger,
	dri-devel, Linux ARM

On 4/15/21 2:49 PM, Daniel Vetter wrote:
> On Thu, Apr 15, 2021 at 8:21 PM Zack Rusin <zackr@vmware.com> wrote:
>>
>> On 4/15/21 7:00 AM, Thomas Zimmermann wrote:
>>> 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.
>>>
>>> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
>>> ---
>>>    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(-)
>>>
>>> diff --git a/drivers/gpu/drm/vmwgfx/Kconfig b/drivers/gpu/drm/vmwgfx/Kconfig
>>> index 15acdf2a7c0f..b3a34196935b 100644
>>> --- a/drivers/gpu/drm/vmwgfx/Kconfig
>>> +++ b/drivers/gpu/drm/vmwgfx/Kconfig
>>> @@ -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
>>> diff --git a/drivers/gpu/drm/vmwgfx/Makefile b/drivers/gpu/drm/vmwgfx/Makefile
>>> index 8c02fa5852e7..9f5743013cbb 100644
>>> --- a/drivers/gpu/drm/vmwgfx/Makefile
>>> +++ b/drivers/gpu/drm/vmwgfx/Makefile
>>> @@ -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
>>> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
>>> index 7e6518709e14..e7836da190c4 100644
>>> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
>>> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
>>> @@ -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
>>>
>>
>> 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.

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 1/4] drm/vmwgfx: Make console emulation depend on DRM_FBDEV_EMULATION
  2021-04-15 18:50     ` Thomas Zimmermann
@ 2021-04-16 10:48       ` Thomas Zimmermann
  0 siblings, 0 replies; 13+ messages in thread
From: Thomas Zimmermann @ 2021-04-16 10:48 UTC (permalink / raw)
  To: Zack Rusin, maarten.lankhorst, mripard, airlied, daniel, marex,
	stefan, shawnguo, s.hauer, kernel, festevam, linux-imx,
	linux-graphics-maintainer, sroland
  Cc: linux-arm-kernel, dri-devel


[-- Attachment #1.1.1: Type: text/plain, Size: 5546 bytes --]



Am 15.04.21 um 20:50 schrieb Thomas Zimmermann:
> Hi
> 
> Am 15.04.21 um 20:21 schrieb Zack Rusin:
>> On 4/15/21 7:00 AM, Thomas Zimmermann wrote:
>>> 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.
>>>
>>> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
>>> ---
>>>   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(-)
>>>
>>> diff --git a/drivers/gpu/drm/vmwgfx/Kconfig 
>>> b/drivers/gpu/drm/vmwgfx/Kconfig
>>> index 15acdf2a7c0f..b3a34196935b 100644
>>> --- a/drivers/gpu/drm/vmwgfx/Kconfig
>>> +++ b/drivers/gpu/drm/vmwgfx/Kconfig
>>> @@ -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
>>> diff --git a/drivers/gpu/drm/vmwgfx/Makefile 
>>> b/drivers/gpu/drm/vmwgfx/Makefile
>>> index 8c02fa5852e7..9f5743013cbb 100644
>>> --- a/drivers/gpu/drm/vmwgfx/Makefile
>>> +++ b/drivers/gpu/drm/vmwgfx/Makefile
>>> @@ -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
>>> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h 
>>> b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
>>> index 7e6518709e14..e7836da190c4 100644
>>> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
>>> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
>>> @@ -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
>>>
>>
>> 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:
>>
>> Reviewed-by: Zack Rusin <zackr@vmware.com>
>>
> 
> 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.

> 
> Best regards
> Thomas
> 
>> z
> 
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
> 

-- 
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


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 4/4] drm: Remove DRM_KMS_FB_HELPER Kconfig option
  2021-04-15 11:00 ` [PATCH 4/4] drm: Remove DRM_KMS_FB_HELPER Kconfig option Thomas Zimmermann
  2021-04-15 15:39   ` Daniel Vetter
@ 2021-05-25  9:28   ` Geert Uytterhoeven
  1 sibling, 0 replies; 13+ messages in thread
From: Geert Uytterhoeven @ 2021-05-25  9:28 UTC (permalink / raw)
  To: Thomas Zimmermann
  Cc: Maarten Lankhorst, Maxime Ripard, David Airlie, Daniel Vetter,
	Marek Vasut, Stefan Agner, Shawn Guo, Sascha Hauer, Sascha Hauer,
	Fabio Estevam, NXP Linux Team, VMware Graphics, sroland, zackr,
	DRI Development, Linux ARM

Hi Thomas,

On Thu, Apr 15, 2021 at 1:15 PM Thomas Zimmermann <tzimmermann@suse.de> wrote:
> It's only used by DRM_FBDEV_EMULATION, so inline it there.
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> ---
>  drivers/gpu/drm/Kconfig | 28 +++++++++++-----------------
>  1 file changed, 11 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
> index 3c16bd1afd87..d3a9ca4b1cec 100644
> --- a/drivers/gpu/drm/Kconfig
> +++ b/drivers/gpu/drm/Kconfig
> @@ -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

It's still selected here ^

> +       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

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2021-05-25  9:30 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-15 11:00 [PATCH 0/4] drm: Fix config dependencies for fbdev emulation Thomas Zimmermann
2021-04-15 11:00 ` [PATCH 1/4] drm/vmwgfx: Make console emulation depend on DRM_FBDEV_EMULATION Thomas Zimmermann
2021-04-15 18:21   ` Zack Rusin
2021-04-15 18:49     ` Daniel Vetter
2021-04-15 19:14       ` Zack Rusin
2021-04-15 18:50     ` Thomas Zimmermann
2021-04-16 10:48       ` Thomas Zimmermann
2021-04-15 11:00 ` [PATCH 2/4] drm/mxsfb: Don't select DRM_KMS_FB_HELPER Thomas Zimmermann
2021-04-15 15:03   ` Stefan Agner
2021-04-15 11:00 ` [PATCH 3/4] drm/zte: " Thomas Zimmermann
2021-04-15 11:00 ` [PATCH 4/4] drm: Remove DRM_KMS_FB_HELPER Kconfig option Thomas Zimmermann
2021-04-15 15:39   ` Daniel Vetter
2021-05-25  9:28   ` Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).