diff mbox series

[v2,03/12] drm/exynos: Use regular fbdev I/O helpers

Message ID 20230515094033.2133-4-tzimmermann@suse.de
State New
Headers show
Series drm/fbdev: Remove DRM's helpers for fbdev I/O | expand

Commit Message

Thomas Zimmermann May 15, 2023, 9:40 a.m. UTC
Use the regular fbdev helpers for framebuffer I/O instead of DRM's
helpers. Exynos does not use damage handling, so DRM's fbdev helpers
are mere wrappers around the fbdev code.

By using fbdev helpers directly within each DRM fbdev emulation,
we can eventually remove DRM's wrapper functions entirely.

v2:
	* use FB_IO_HELPERS option

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Inki Dae <inki.dae@samsung.com>
Cc: Seung-Woo Kim <sw0312.kim@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: Alim Akhtar <alim.akhtar@samsung.com>
---
 drivers/gpu/drm/exynos/Kconfig            |  1 +
 drivers/gpu/drm/exynos/Makefile           |  2 +-
 drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 10 +++++-----
 3 files changed, 7 insertions(+), 6 deletions(-)

Comments

Thomas Zimmermann May 16, 2023, 1:14 p.m. UTC | #1
Hi Sam

Am 15.05.23 um 19:43 schrieb Sam Ravnborg:
> Hi Thomas,
> 
> On Mon, May 15, 2023 at 11:40:24AM +0200, Thomas Zimmermann wrote:
>> Use the regular fbdev helpers for framebuffer I/O instead of DRM's
>> helpers. Exynos does not use damage handling, so DRM's fbdev helpers
>> are mere wrappers around the fbdev code.
>>
>> By using fbdev helpers directly within each DRM fbdev emulation,
>> we can eventually remove DRM's wrapper functions entirely.
>>
>> v2:
>> 	* use FB_IO_HELPERS option
>>
>> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
>> Cc: Inki Dae <inki.dae@samsung.com>
>> Cc: Seung-Woo Kim <sw0312.kim@samsung.com>
>> Cc: Kyungmin Park <kyungmin.park@samsung.com>
>> Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>> Cc: Alim Akhtar <alim.akhtar@samsung.com>
>> ---
>>   drivers/gpu/drm/exynos/Kconfig            |  1 +
>>   drivers/gpu/drm/exynos/Makefile           |  2 +-
>>   drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 10 +++++-----
>>   3 files changed, 7 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/exynos/Kconfig b/drivers/gpu/drm/exynos/Kconfig
>> index 0cb92d651ff1..7ca7e1dab52c 100644
>> --- a/drivers/gpu/drm/exynos/Kconfig
>> +++ b/drivers/gpu/drm/exynos/Kconfig
>> @@ -7,6 +7,7 @@ config DRM_EXYNOS
>>   	select DRM_DISPLAY_HELPER if DRM_EXYNOS_DP
>>   	select DRM_KMS_HELPER
>>   	select VIDEOMODE_HELPERS
>> +	select FB_IO_HELPERS if DRM_FBDEV_EMULATION
>>   	select SND_SOC_HDMI_CODEC if SND_SOC
>>   	help
>>   	  Choose this option if you have a Samsung SoC Exynos chipset.
>> diff --git a/drivers/gpu/drm/exynos/Makefile b/drivers/gpu/drm/exynos/Makefile
>> index 2fd2f3ee4fcf..233a66036584 100644
>> --- a/drivers/gpu/drm/exynos/Makefile
>> +++ b/drivers/gpu/drm/exynos/Makefile
>> @@ -6,7 +6,6 @@
>>   exynosdrm-y := exynos_drm_drv.o exynos_drm_crtc.o exynos_drm_fb.o \
>>   		exynos_drm_gem.o exynos_drm_plane.o exynos_drm_dma.o
>>   
>> -exynosdrm-$(CONFIG_DRM_FBDEV_EMULATION) += exynos_drm_fbdev.o
>>   exynosdrm-$(CONFIG_DRM_EXYNOS_FIMD)	+= exynos_drm_fimd.o
>>   exynosdrm-$(CONFIG_DRM_EXYNOS5433_DECON)	+= exynos5433_drm_decon.o
>>   exynosdrm-$(CONFIG_DRM_EXYNOS7_DECON)	+= exynos7_drm_decon.o
>> @@ -23,5 +22,6 @@ exynosdrm-$(CONFIG_DRM_EXYNOS_ROTATOR)	+= exynos_drm_rotator.o
>>   exynosdrm-$(CONFIG_DRM_EXYNOS_SCALER)	+= exynos_drm_scaler.o
>>   exynosdrm-$(CONFIG_DRM_EXYNOS_GSC)	+= exynos_drm_gsc.o
>>   exynosdrm-$(CONFIG_DRM_EXYNOS_MIC)     += exynos_drm_mic.o
>> +exynosdrm-$(CONFIG_DRM_FBDEV_EMULATION)	+= exynos_drm_fbdev.o
> What does this change do?
> Maybe something that was left by accident?

It reorders the statements alphabetically. I can remove this, if unwanted.

Best regards
Thomas

> 
> 	Sam
> 
>>   
>>   obj-$(CONFIG_DRM_EXYNOS)		+= exynosdrm.o
>> diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
>> index ea4b3d248aac..b3333dd1d087 100644
>> --- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
>> +++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
>> @@ -8,6 +8,8 @@
>>    *	Seung-Woo Kim <sw0312.kim@samsung.com>
>>    */
>>   
>> +#include <linux/fb.h>
>> +
>>   #include <drm/drm_crtc_helper.h>
>>   #include <drm/drm_drv.h>
>>   #include <drm/drm_fb_helper.h>
>> @@ -49,11 +51,9 @@ static const struct fb_ops exynos_drm_fb_ops = {
>>   	.owner		= THIS_MODULE,
>>   	DRM_FB_HELPER_DEFAULT_OPS,
>>   	.fb_mmap        = exynos_drm_fb_mmap,
>> -	.fb_read	= drm_fb_helper_cfb_read,
>> -	.fb_write	= drm_fb_helper_cfb_write,
>> -	.fb_fillrect	= drm_fb_helper_cfb_fillrect,
>> -	.fb_copyarea	= drm_fb_helper_cfb_copyarea,
>> -	.fb_imageblit	= drm_fb_helper_cfb_imageblit,
>> +	.fb_fillrect	= cfb_fillrect,
>> +	.fb_copyarea	= cfb_copyarea,
>> +	.fb_imageblit	= cfb_imageblit,
>>   	.fb_destroy	= exynos_drm_fb_destroy,
>>   };
>>   
>> -- 
>> 2.40.1
diff mbox series

Patch

diff --git a/drivers/gpu/drm/exynos/Kconfig b/drivers/gpu/drm/exynos/Kconfig
index 0cb92d651ff1..7ca7e1dab52c 100644
--- a/drivers/gpu/drm/exynos/Kconfig
+++ b/drivers/gpu/drm/exynos/Kconfig
@@ -7,6 +7,7 @@  config DRM_EXYNOS
 	select DRM_DISPLAY_HELPER if DRM_EXYNOS_DP
 	select DRM_KMS_HELPER
 	select VIDEOMODE_HELPERS
+	select FB_IO_HELPERS if DRM_FBDEV_EMULATION
 	select SND_SOC_HDMI_CODEC if SND_SOC
 	help
 	  Choose this option if you have a Samsung SoC Exynos chipset.
diff --git a/drivers/gpu/drm/exynos/Makefile b/drivers/gpu/drm/exynos/Makefile
index 2fd2f3ee4fcf..233a66036584 100644
--- a/drivers/gpu/drm/exynos/Makefile
+++ b/drivers/gpu/drm/exynos/Makefile
@@ -6,7 +6,6 @@ 
 exynosdrm-y := exynos_drm_drv.o exynos_drm_crtc.o exynos_drm_fb.o \
 		exynos_drm_gem.o exynos_drm_plane.o exynos_drm_dma.o
 
-exynosdrm-$(CONFIG_DRM_FBDEV_EMULATION) += exynos_drm_fbdev.o
 exynosdrm-$(CONFIG_DRM_EXYNOS_FIMD)	+= exynos_drm_fimd.o
 exynosdrm-$(CONFIG_DRM_EXYNOS5433_DECON)	+= exynos5433_drm_decon.o
 exynosdrm-$(CONFIG_DRM_EXYNOS7_DECON)	+= exynos7_drm_decon.o
@@ -23,5 +22,6 @@  exynosdrm-$(CONFIG_DRM_EXYNOS_ROTATOR)	+= exynos_drm_rotator.o
 exynosdrm-$(CONFIG_DRM_EXYNOS_SCALER)	+= exynos_drm_scaler.o
 exynosdrm-$(CONFIG_DRM_EXYNOS_GSC)	+= exynos_drm_gsc.o
 exynosdrm-$(CONFIG_DRM_EXYNOS_MIC)     += exynos_drm_mic.o
+exynosdrm-$(CONFIG_DRM_FBDEV_EMULATION)	+= exynos_drm_fbdev.o
 
 obj-$(CONFIG_DRM_EXYNOS)		+= exynosdrm.o
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
index ea4b3d248aac..b3333dd1d087 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
@@ -8,6 +8,8 @@ 
  *	Seung-Woo Kim <sw0312.kim@samsung.com>
  */
 
+#include <linux/fb.h>
+
 #include <drm/drm_crtc_helper.h>
 #include <drm/drm_drv.h>
 #include <drm/drm_fb_helper.h>
@@ -49,11 +51,9 @@  static const struct fb_ops exynos_drm_fb_ops = {
 	.owner		= THIS_MODULE,
 	DRM_FB_HELPER_DEFAULT_OPS,
 	.fb_mmap        = exynos_drm_fb_mmap,
-	.fb_read	= drm_fb_helper_cfb_read,
-	.fb_write	= drm_fb_helper_cfb_write,
-	.fb_fillrect	= drm_fb_helper_cfb_fillrect,
-	.fb_copyarea	= drm_fb_helper_cfb_copyarea,
-	.fb_imageblit	= drm_fb_helper_cfb_imageblit,
+	.fb_fillrect	= cfb_fillrect,
+	.fb_copyarea	= cfb_copyarea,
+	.fb_imageblit	= cfb_imageblit,
 	.fb_destroy	= exynos_drm_fb_destroy,
 };