drm/fbdev: Remove DRM's helpers for fbdev I/O
Subsystems (15)
Thomas Zimmermann
maintainerv2 cover drm/fbdev: Remove DRM's helpers for fbdev I/O
DRM provides a number of wrappers around fbdev cfb_() sys_(), fb_io_() and fb_sys_() helpers. The DRM functions don't provide any additional functionality for most DRM drivers. So remove them and call the fbdev I/O helpers directly.
The DRM fbdev I/O wrappers were originally added because <linux/fb.h> does not protect its content with CONFIG_FB. DRM fbdev emulation did not build if the config option had been disabled. This has been fixed. For fbdev-generic and i915, the wrappers added support for damage handling. But this is better handled within the two callers, as each is special in its damage handling.
Patch 1 adds several internal Kconfig otpions that DRM drivers (and possibly other fbdev code) will use to select the correct set of I/O helpers.
Patches 2 to 9 replace the DRM wrappers in a number of fbdev emulations. Patch 10 exports two helpers for damage handling. Patches 11 and 12 update fbdev-generic and i915 with the help of the exported functions. The patches also remove DRM's fbdev I/O helpers, which are now unused.
DRM's fbdev helpers had to select fbdev I/O helpers for I/O and for system memory. Each fbdev emulation now selects the correct helpers for itself. Depending on the selected DRM drivers, kernel builds will now only contain the necessary fbdev I/O helpers and might be slightly smaller in size.
v2:
* simplify Kconfig handling (Sam)
Thomas Zimmermann (12):
fbdev: Add Kconfig options to select different fb_ops helpers drm/armada: Use regular fbdev I/O helpers drm/exynos: Use regular fbdev I/O helpers drm/gma500: Use regular fbdev I/O helpers drm/radeon: Use regular fbdev I/O helpers drm/fbdev-dma: Use regular fbdev I/O helpers drm/msm: Use regular fbdev I/O helpers
drm/omapdrm: Use regular fbdev I/O helpers drm/tegra: Use regular fbdev I/O helpers drm/fb-helper: Export helpers for marking damage areas drm/fbdev-generic: Implement dedicated fbdev I/O helpers drm/i915: Implement dedicated fbdev I/O helpers
drivers/gpu/drm/Kconfig | 10 +- drivers/gpu/drm/armada/Kconfig | 1 + drivers/gpu/drm/armada/armada_fbdev.c | 9 +- drivers/gpu/drm/drm_fb_helper.c | 233 ++------------------- drivers/gpu/drm/drm_fbdev_dma.c | 12 +- drivers/gpu/drm/drm_fbdev_generic.c | 47 ++++- drivers/gpu/drm/exynos/Kconfig | 1 + drivers/gpu/drm/exynos/Makefile | 2 +- drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 10 +- drivers/gpu/drm/gma500/Kconfig | 1 + drivers/gpu/drm/gma500/fbdev.c | 9 +- drivers/gpu/drm/i915/Kconfig | 1 + drivers/gpu/drm/i915/display/intel_fbdev.c | 51 ++++- drivers/gpu/drm/msm/Kconfig | 1 + drivers/gpu/drm/msm/msm_fbdev.c | 12 +- drivers/gpu/drm/omapdrm/Kconfig | 1 + drivers/gpu/drm/omapdrm/omap_fbdev.c | 12 +- drivers/gpu/drm/radeon/Kconfig | 1 + drivers/gpu/drm/radeon/radeon_fbdev.c | 9 +- drivers/gpu/drm/tegra/Kconfig | 1 + drivers/gpu/drm/tegra/fbdev.c | 11 +- drivers/video/fbdev/Kconfig | 21 ++ include/drm/drm_fb_helper.h | 84 +------- 23 files changed, 184 insertions(+), 356 deletions(-)
base-commit: 451e49cfbaa90720149e63f4fa9c7824013c783d
Signature · 1 line
2.40.1
Thomas Zimmermann
maintainerPATCH v2 1/12 fbdev: Add Kconfig options to select different fb_ops helpers
Many fbdev drivers use the same set of fb_ops helpers. Add Kconfig options to select them at once. This will help with making DRM's fbdev emulation code more modular, but can also be used to simplify fbdev's driver configs.
--- drivers/video/fbdev/Kconfig | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
drivers/video/fbdev/Kconfig +21 -0
@@ -158,6 +158,27 @@ config FB_DEFERRED_IO bool depends on FB +config FB_IO_HELPERS + bool + depends on FB + select FB_CFB_COPYAREA + select FB_CFB_FILLRECT + select FB_CFB_IMAGEBLIT + +config FB_SYS_HELPERS + bool + depends on FB + select FB_SYS_COPYAREA + select FB_SYS_FILLRECT + select FB_SYS_FOPS + select FB_SYS_IMAGEBLIT + +config FB_SYS_HELPERS_DEFERRED + bool + depends on FB + select FB_DEFERRED_IO + select FB_SYS_HELPER + config FB_HECUBA tristate depends on FB
Signature · 1 line
2.40.1
Thomas Zimmermann
maintainerPATCH v2 2/12 drm/armada: Use regular fbdev I/O helpers
In reply to Thomas ZimmermannUse the regular fbdev helpers for framebuffer I/O instead of DRM's helpers. Armada 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
--- drivers/gpu/drm/armada/Kconfig | 1 + drivers/gpu/drm/armada/armada_fbdev.c | 9 ++++----- 2 files changed, 5 insertions(+), 5 deletions(-)
drivers/gpu/drm/armada/Kconfig +1 -0
@@ -3,6 +3,7 @@ config DRM_ARMADA tristate "DRM support for Marvell Armada SoCs" depends on DRM && HAVE_CLK && ARM && MMU select DRM_KMS_HELPER + select FB_IO_HELPERS if DRM_FBDEV_EMULATION help Support the "LCD" controllers found on the Marvell Armada 510 devices. There are two controllers on the device, each controller
drivers/gpu/drm/armada/armada_fbdev.c +4 -5
@@ -5,6 +5,7 @@*/ #include <linux/errno.h> +#include <linux/fb.h> #include <linux/kernel.h> #include <linux/module.h>
@@ -34,11 +35,9 @@ static void armada_fbdev_fb_destroy(struct fb_info *info)static const struct fb_ops armada_fb_ops = { .owner =THIS_MODULE ,DRM_FB_HELPER_DEFAULT_OPS , - .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 = armada_fbdev_fb_destroy, };
Signature · 1 line
2.40.1
Re: [PATCH v2 02/12] drm/armada: Use regular fbdev I/O helpers
Hi Thomas,
Quoted 42 lines · Thomas Zimmermann
Use the regular fbdev helpers for framebuffer I/O instead of DRM's helpers. Armada 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:
* useFB_IO_HELPERSoptionSigned-off-by Thomas Zimmermann <[email protected]>Cc Russell King <[email protected]>--- drivers/gpu/drm/armada/Kconfig | 1 + drivers/gpu/drm/armada/armada_fbdev.c | 9 ++++----- 2 files changed, 5 insertions(+), 5 deletions(-)drivers/gpu/drm/armada/Kconfig +1
-0@@ -3,6 +3,7 @@ config DRM_ARMADA tristate "DRM support for Marvell Armada SoCs" depends on DRM && HAVE_CLK && ARM && MMU select DRM_KMS_HELPER + select FB_IO_HELPERS if DRM_FBDEV_EMULATION help Support the "LCD" controllers found on the Marvell Armada 510 devices. There are two controllers on the device, each controllerdrivers/gpu/drm/armada/armada_fbdev.c +1
-0@@ -5,6 +5,7 @@*/ #include <linux/errno.h> +#include <linux/fb.h> #include <linux/kernel.h> #include <linux/module.h>
drivers/gpu/drm/armada/armada_fbdev.c static void armada_fbdev_fb_destroy(struct fb_info *info) · line 38
Quoted 5 lines
drivers/gpu/drm/armada/armada_fbdev.c +0
-2@@ -34,11 +35,9 @@ static void armada_fbdev_fb_destroy(struct fb_info *info)static const struct fb_ops armada_fb_ops = { .owner =THIS_MODULE ,DRM_FB_HELPER_DEFAULT_OPS , - .fb_read = drm_fb_helper_cfb_read, - .fb_write = drm_fb_helper_cfb_write,
I had expected to see
.fb_read = fb_io_read,
But maybe this only used when using damage handling?
Likewise for drm_fb_helper_cfb_write.
??
drivers/gpu/drm/armada/armada_fbdev.c static void armada_fbdev_fb_destroy(struct fb_info *info) · line 40
Quoted 6 lines
drivers/gpu/drm/armada/armada_fbdev.c +3
-3- .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,
This part is as expected.
Sam
Quoted 5 lines
drivers/gpu/drm/armada/armada_fbdev.c +0
-0.fb_destroy = armada_fbdev_fb_destroy, };Signature · 1 line
2.40.1
Russell King (Oracle)
maintainerRe: [PATCH v2 02/12] drm/armada: Use regular fbdev I/O helpers
Quoted 59 lines · Sam Ravnborg
Hi Thomas,
Quoted 42 lines · Thomas Zimmermann
Use the regular fbdev helpers for framebuffer I/O instead of DRM's helpers. Armada 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:
* useFB_IO_HELPERSoptionSigned-off-by Thomas Zimmermann <[email protected]>Cc Russell King <[email protected]>--- drivers/gpu/drm/armada/Kconfig | 1 + drivers/gpu/drm/armada/armada_fbdev.c | 9 ++++----- 2 files changed, 5 insertions(+), 5 deletions(-)drivers/gpu/drm/armada/Kconfig +1
-0@@ -3,6 +3,7 @@ config DRM_ARMADA tristate "DRM support for Marvell Armada SoCs" depends on DRM && HAVE_CLK && ARM && MMU select DRM_KMS_HELPER + select FB_IO_HELPERS if DRM_FBDEV_EMULATION help Support the "LCD" controllers found on the Marvell Armada 510 devices. There are two controllers on the device, each controllerdrivers/gpu/drm/armada/armada_fbdev.c +1
-0@@ -5,6 +5,7 @@*/ #include <linux/errno.h> +#include <linux/fb.h> #include <linux/kernel.h> #include <linux/module.h> drivers/gpu/drm/armada/armada_fbdev.c static void armada_fbdev_fb_destroy(struct fb_info *info) · line 38
Quoted 5 lines
drivers/gpu/drm/armada/armada_fbdev.c +0
-2@@ -34,11 +35,9 @@ static void armada_fbdev_fb_destroy(struct fb_info *info)static const struct fb_ops armada_fb_ops = { .owner =THIS_MODULE ,DRM_FB_HELPER_DEFAULT_OPS , - .fb_read = drm_fb_helper_cfb_read, - .fb_write = drm_fb_helper_cfb_write,I had expected to see
.fb_read =fb_io_read,But maybe this only used when using damage handling?
Likewise for
drm_fb_helper_cfb_write.??
Quoted 8 lines
drivers/gpu/drm/armada/armada_fbdev.c static void armada_fbdev_fb_destroy(struct fb_info *info) · line 40
Quoted 6 lines
drivers/gpu/drm/armada/armada_fbdev.c +3
-3- .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,This part is as expected.
Well, to me it looks like this has gone through an entire circular set of revisions:
commit e8b70e4dd7b5dad7c2379de6e0851587bf86bfd6
Author: Archit Taneja <[email protected]> Date: Wed Jul 22 14:58:04 2015 +0530
drm/armada: Use new drm_fb_helper functions
- .fb_fillrect = cfb_fillrect, - .fb_copyarea = cfb_copyarea, - .fb_imageblit = cfb_imageblit, + .fb_fillrect = drm_fb_helper_cfb_fillrect, + .fb_copyarea = drm_fb_helper_cfb_copyarea, + .fb_imageblit = drm_fb_helper_cfb_imageblit,
commit 983780918c759fdbbf0bf033e701bbff75d2af23
Author: Thomas Zimmermann <[email protected]> Date: Thu Nov 3 16:14:40 2022 +0100
drm/fb-helper: Perform all fbdev I/O with the same implementation
+ .fb_read = drm_fb_helper_cfb_read, + .fb_write = drm_fb_helper_cfb_write,
and now effectively those two changes are being reverted, so we'd now be back to the pre-July 2015 state of affairs. As I believe the fbdev layer has been stable, this change merely reverts the driver back to what it once was.
Signature · 7 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Thomas Zimmermann
maintainerRe: [PATCH v2 02/12] drm/armada: Use regular fbdev I/O helpers
Hi
Am 15.05.23 um 20:04 schrieb Russell King (Oracle):
Quoted 94 lines · Sam Ravnborg
Quoted 59 lines
Hi Thomas,
Quoted 42 lines · Thomas Zimmermann
Use the regular fbdev helpers for framebuffer I/O instead of DRM's helpers. Armada 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:
* useFB_IO_HELPERSoptionSigned-off-by Thomas Zimmermann <[email protected]>Cc Russell King <[email protected]>--- drivers/gpu/drm/armada/Kconfig | 1 + drivers/gpu/drm/armada/armada_fbdev.c | 9 ++++----- 2 files changed, 5 insertions(+), 5 deletions(-)drivers/gpu/drm/armada/Kconfig +1
-0@@ -3,6 +3,7 @@ config DRM_ARMADA tristate "DRM support for Marvell Armada SoCs" depends on DRM && HAVE_CLK && ARM && MMU select DRM_KMS_HELPER + select FB_IO_HELPERS if DRM_FBDEV_EMULATION help Support the "LCD" controllers found on the Marvell Armada 510 devices. There are two controllers on the device, each controllerdrivers/gpu/drm/armada/armada_fbdev.c +1
-0@@ -5,6 +5,7 @@*/ #include <linux/errno.h> +#include <linux/fb.h> #include <linux/kernel.h> #include <linux/module.h> drivers/gpu/drm/armada/armada_fbdev.c static void armada_fbdev_fb_destroy(struct fb_info *info) · line 38
Quoted 5 lines
drivers/gpu/drm/armada/armada_fbdev.c +0
-2@@ -34,11 +35,9 @@ static void armada_fbdev_fb_destroy(struct fb_info *info)static const struct fb_ops armada_fb_ops = { .owner =THIS_MODULE ,DRM_FB_HELPER_DEFAULT_OPS , - .fb_read = drm_fb_helper_cfb_read, - .fb_write = drm_fb_helper_cfb_write,I had expected to see
.fb_read =fb_io_read,But maybe this only used when using damage handling?
Likewise for
drm_fb_helper_cfb_write.??
Quoted 8 lines
drivers/gpu/drm/armada/armada_fbdev.c static void armada_fbdev_fb_destroy(struct fb_info *info) · line 40
Quoted 6 lines
drivers/gpu/drm/armada/armada_fbdev.c +3
-3- .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,This part is as expected.
Well, to me it looks like this has gone through an entire circular set of revisions:
commit
e8b70e4dd7b5dad7c2379de6e0851587bf86bfd6Author: Archit Taneja <[email protected]> Date: Wed Jul 22 14:58:04 2015 +0530drm/armada: Use new
drm_fb_helperfunctions(quoted diff) +3
-3- .fb_fillrect = cfb_fillrect, - .fb_copyarea = cfb_copyarea, - .fb_imageblit = cfb_imageblit, + .fb_fillrect = drm_fb_helper_cfb_fillrect, + .fb_copyarea = drm_fb_helper_cfb_copyarea, + .fb_imageblit = drm_fb_helper_cfb_imageblit,commit
983780918c759fdbbf0bf033e701bbff75d2af23Author: Thomas Zimmermann <[email protected]> Date: Thu Nov 3 16:14:40 2022 +0100drm/fb-helper: Perform all fbdev I/O with the same implementation
(quoted diff) +2
-0+ .fb_read = drm_fb_helper_cfb_read, + .fb_write = drm_fb_helper_cfb_write,
Quoted 4 lines
and now effectively those two changes are being reverted, so we'd now be back to the pre-July 2015 state of affairs. As I believe the fbdev layer has been stable, this change merely reverts the driver back to what it once was.
Not quite. One long-standing problem has been that fbdev does not protect its public interfaces with CONFIG_FB. If fbdev had been disabled, DRM drivers could no longer be linked/loaded. DRM wrappers solved this. The issue has recently been fixed for all of DRM. DRM does not build it's fbdev emulation if CONFIG_FB has been disabled.
Another thing was that the original DRM wrappers might have been different from fbdev's I/O helpers in subtle ways. But now they are simple wrappers around their fbdev counterparts; plus the option of additional damage handling. But such damage handling is better implemented by the driver itself. The two cases that require it, i915 and fbdev-generic, are different enough that each should probably have it's own code.
Best regards
Thomas
Quoted 1 line
Signature · 6 lines
Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Frankenstrasse 146, 90461 Nuernberg, Germany GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman HRB 36809 (AG Nuernberg)
Thomas Zimmermann
maintainerRe: [PATCH v2 02/12] drm/armada: Use regular fbdev I/O helpers
In reply to Sam RavnborgHi
Am 15.05.23 um 19:55 schrieb Sam Ravnborg:
Quoted 53 lines
Hi Thomas,
Quoted 42 lines · Thomas Zimmermann
Use the regular fbdev helpers for framebuffer I/O instead of DRM's helpers. Armada 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:
* useFB_IO_HELPERSoptionSigned-off-by Thomas Zimmermann <[email protected]>Cc Russell King <[email protected]>--- drivers/gpu/drm/armada/Kconfig | 1 + drivers/gpu/drm/armada/armada_fbdev.c | 9 ++++----- 2 files changed, 5 insertions(+), 5 deletions(-)drivers/gpu/drm/armada/Kconfig +1
-0@@ -3,6 +3,7 @@ config DRM_ARMADA tristate "DRM support for Marvell Armada SoCs" depends on DRM && HAVE_CLK && ARM && MMU select DRM_KMS_HELPER + select FB_IO_HELPERS if DRM_FBDEV_EMULATION help Support the "LCD" controllers found on the Marvell Armada 510 devices. There are two controllers on the device, each controllerdrivers/gpu/drm/armada/armada_fbdev.c +1
-0@@ -5,6 +5,7 @@*/ #include <linux/errno.h> +#include <linux/fb.h> #include <linux/kernel.h> #include <linux/module.h> drivers/gpu/drm/armada/armada_fbdev.c static void armada_fbdev_fb_destroy(struct fb_info *info) · line 38
Quoted 5 lines
drivers/gpu/drm/armada/armada_fbdev.c +0
-2@@ -34,11 +35,9 @@ static void armada_fbdev_fb_destroy(struct fb_info *info)static const struct fb_ops armada_fb_ops = { .owner =THIS_MODULE ,DRM_FB_HELPER_DEFAULT_OPS , - .fb_read = drm_fb_helper_cfb_read, - .fb_write = drm_fb_helper_cfb_write,I had expected to see
.fb_read =fb_io_read,
Quoted 1 line
But maybe this only used when using damage handling?
fb_io_read() and fb_io_write() are the default implementations. They are called when no callback has been set. All the other fbdev drivers leave them out, so I kept this pattern for the DRM side as well.
Best regards
Thomas
Quoted 21 lines
Likewise for
drm_fb_helper_cfb_write.??
drivers/gpu/drm/armada/armada_fbdev.c static void armada_fbdev_fb_destroy(struct fb_info *info) · line 40
Quoted 6 lines
drivers/gpu/drm/armada/armada_fbdev.c +3
-3- .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,This part is as expected.
Sam
Quoted 5 lines
drivers/gpu/drm/armada/armada_fbdev.c +0
-0.fb_destroy = armada_fbdev_fb_destroy, };Signature · 1 line
2.40.1
Signature · 6 lines
Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Frankenstrasse 146, 90461 Nuernberg, Germany GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman HRB 36809 (AG Nuernberg)
Thomas Zimmermann
maintainerPATCH v2 3/12 drm/exynos: Use regular fbdev I/O helpers
In reply to Thomas ZimmermannUse 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
--- 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(-)
drivers/gpu/drm/exynos/Kconfig +1 -0
@@ -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.
drivers/gpu/drm/exynos/Makefile +1 -1
@@ -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
drivers/gpu/drm/exynos/exynos_drm_fbdev.c +5 -5
@@ -8,6 +8,8 @@* Seung-Woo Kim <[email protected]> */ +#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, };
Signature · 1 line
2.40.1
Re: [PATCH v2 03/12] drm/exynos: Use regular fbdev I/O helpers
Hi Thomas,
Quoted 47 lines · Thomas Zimmermann
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:
* useFB_IO_HELPERSoptionSigned-off-by Thomas Zimmermann <[email protected]>Cc Inki Dae <[email protected]>Cc Seung-Woo Kim <[email protected]>Cc Kyungmin Park <[email protected]>Cc Krzysztof Kozlowski <[email protected]>Cc Alim Akhtar <[email protected]>--- 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(-)drivers/gpu/drm/exynos/Kconfig +1
-0@@ -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.drivers/gpu/drm/exynos/Makefile +0
-1@@ -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
drivers/gpu/drm/exynos/Makefile exynosdrm-$(CONFIG_DRM_EXYNOS_ROTATOR) += exynos_drm_rotator.o · line 25
Quoted 4 lines
drivers/gpu/drm/exynos/Makefile +1
-0@@ -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?
Sam
Quoted 32 lines
drivers/gpu/drm/exynos/Makefile +0
-0obj-$(CONFIG_DRM_EXYNOS) += exynosdrm.odrivers/gpu/drm/exynos/exynos_drm_fbdev.c +5
-5@@ -8,6 +8,8 @@* Seung-Woo Kim <[email protected]> */ +#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, };Signature · 1 line
2.40.1
Thomas Zimmermann
maintainerRe: [PATCH v2 03/12] drm/exynos: Use regular fbdev I/O helpers
Hi Sam
Am 15.05.23 um 19:43 schrieb Sam Ravnborg:
Quoted 45 lines
Hi Thomas,
Quoted 42 lines · Thomas Zimmermann
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:
* useFB_IO_HELPERSoptionSigned-off-by Thomas Zimmermann <[email protected]>Cc Inki Dae <[email protected]>Cc Seung-Woo Kim <[email protected]>Cc Kyungmin Park <[email protected]>Cc Krzysztof Kozlowski <[email protected]>Cc Alim Akhtar <[email protected]>--- 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(-)drivers/gpu/drm/exynos/Kconfig +1
-0@@ -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.drivers/gpu/drm/exynos/Makefile +0
-0@@ -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
Quoted 11 lines
drivers/gpu/drm/exynos/Makefile exynosdrm-$(CONFIG_DRM_EXYNOS_ROTATOR) += exynos_drm_rotator.o · line 25
Quoted 9 lines
drivers/gpu/drm/exynos/Makefile +1
-1-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.oWhat 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
Quoted 35 lines
Sam
Quoted 32 lines
drivers/gpu/drm/exynos/Makefile +0
-0obj-$(CONFIG_DRM_EXYNOS) += exynosdrm.odrivers/gpu/drm/exynos/exynos_drm_fbdev.c +5
-5@@ -8,6 +8,8 @@* Seung-Woo Kim <[email protected]> */ +#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, };Signature · 1 line
2.40.1
Signature · 6 lines
Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Frankenstrasse 146, 90461 Nuernberg, Germany GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman HRB 36809 (AG Nuernberg)
Thomas Zimmermann
maintainerPATCH v2 4/12 drm/gma500: Use regular fbdev I/O helpers
In reply to Thomas ZimmermannUse the regular fbdev helpers for framebuffer I/O instead of DRM's helpers. Gma500 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
--- drivers/gpu/drm/gma500/Kconfig | 1 + drivers/gpu/drm/gma500/fbdev.c | 9 ++++----- 2 files changed, 5 insertions(+), 5 deletions(-)
drivers/gpu/drm/gma500/Kconfig +1 -0
@@ -3,6 +3,7 @@ config DRM_GMA500 tristate "Intel GMA500/600/3600/3650 KMS Framebuffer" depends on DRM && PCI && X86 && MMU select DRM_KMS_HELPER + select FB_IO_HELPERS if DRM_FBDEV_EMULATION select I2C select I2C_ALGOBIT # GMA500 depends on ACPI_VIDEO when ACPI is enabled, just like i915
drivers/gpu/drm/gma500/fbdev.c +4 -5
@@ -5,6 +5,7 @@* **************************************************************************/ +#include <linux/fb.h> #include <linux/pfn_t.h> #include <drm/drm_crtc_helper.h>
@@ -136,11 +137,9 @@ static const struct fb_ops psb_fbdev_fb_ops = { .owner = THIS_MODULE,DRM_FB_HELPER_DEFAULT_OPS , .fb_setcolreg = psb_fbdev_fb_setcolreg, - .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_mmap = psb_fbdev_fb_mmap, .fb_destroy = psb_fbdev_fb_destroy, };
Signature · 7 lines
2.40.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Thomas Zimmermann
maintainerPATCH v2 5/12 drm/radeon: Use regular fbdev I/O helpers
In reply to Thomas ZimmermannUse the regular fbdev helpers for framebuffer I/O instead of DRM's helpers. Radeon 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
--- drivers/gpu/drm/radeon/Kconfig | 1 + drivers/gpu/drm/radeon/radeon_fbdev.c | 9 ++++----- 2 files changed, 5 insertions(+), 5 deletions(-)
drivers/gpu/drm/radeon/Kconfig +1 -0
@@ -11,6 +11,7 @@ config DRM_RADEON select DRM_SUBALLOC_HELPER select DRM_TTM select DRM_TTM_HELPER + select FB_IO_HELPERS if DRM_FBDEV_EMULATION select SND_HDA_COMPONENT if SND_HDA_CORE select POWER_SUPPLY select HWMON
drivers/gpu/drm/radeon/radeon_fbdev.c +4 -5
@@ -24,6 +24,7 @@* David Airlie */ +#include <linux/fb.h> #include <linux/pci.h> #include <linux/pm_runtime.h> #include <linux/vga_switcheroo.h>
@@ -193,11 +194,9 @@ static const struct fb_ops radeon_fbdev_fb_ops = { DRM_FB_HELPER_DEFAULT_OPS, .fb_open = radeon_fbdev_fb_open, .fb_release = radeon_fbdev_fb_release, - .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 = radeon_fbdev_fb_destroy, };
Signature · 1 line
2.40.1
Thomas Zimmermann
maintainerPATCH v2 6/12 drm/fbdev-dma: Use regular fbdev I/O helpers
In reply to Thomas ZimmermannUse the regular fbdev helpers for framebuffer I/O instead of DRM's helpers. Fbdev-dma 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_SYS_HELPERS option
--- drivers/gpu/drm/Kconfig | 1 + drivers/gpu/drm/drm_fbdev_dma.c | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-)
drivers/gpu/drm/Kconfig +1 -0
@@ -223,6 +223,7 @@ config DRM_TTM_HELPER config DRM_GEM_DMA_HELPER tristate depends on DRM + select FB_SYS_HELPERS if DRM_FBDEV_EMULATION help Choose this if you need the GEM DMA helper functions
drivers/gpu/drm/drm_fbdev_dma.c +7 -5
@@ -1,5 +1,7 @@// SPDX-License-Identifier: MIT +#include <linux/fb.h> +#include <drm/drm_crtc_helper.h> #include <drm/drm_drv.h> #include <drm/drm_fb_helper.h>
@@ -64,12 +66,12 @@ static const struct fb_ops drm_fbdev_dma_fb_ops = { .owner = THIS_MODULE, .fb_open = drm_fbdev_dma_fb_open, .fb_release = drm_fbdev_dma_fb_release, - .fb_read = drm_fb_helper_sys_read, - .fb_write = drm_fb_helper_sys_write, + .fb_read = fb_sys_read, + .fb_write = fb_sys_write,DRM_FB_HELPER_DEFAULT_OPS , - .fb_fillrect = drm_fb_helper_sys_fillrect, - .fb_copyarea = drm_fb_helper_sys_copyarea, - .fb_imageblit = drm_fb_helper_sys_imageblit, + .fb_fillrect = sys_fillrect, + .fb_copyarea = sys_copyarea, + .fb_imageblit = sys_imageblit, .fb_destroy = drm_fbdev_dma_fb_destroy, .fb_mmap = drm_fbdev_dma_fb_mmap, };
Signature · 1 line
2.40.1
Thomas Zimmermann
maintainerPATCH v2 7/12 drm/msm: Use regular fbdev I/O helpers
In reply to Thomas ZimmermannUse the regular fbdev helpers for framebuffer I/O instead of DRM's helpers. Msm 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_SYS_HELPERS option
--- drivers/gpu/drm/msm/Kconfig | 1 + drivers/gpu/drm/msm/msm_fbdev.c | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-)
drivers/gpu/drm/msm/Kconfig +1 -0
@@ -21,6 +21,7 @@ config DRM_MSM select DRM_BRIDGE select DRM_PANEL_BRIDGE select DRM_SCHED + select FB_SYS_HELPERS if DRM_FBDEV_EMULATION select SHMEM select TMPFS select QCOM_SCM
drivers/gpu/drm/msm/msm_fbdev.c +7 -5
@@ -4,6 +4,8 @@* Author: Rob Clark <[email protected]> */ +#include <linux/fb.h> +#include <drm/drm_drv.h> #include <drm/drm_crtc_helper.h> #include <drm/drm_fb_helper.h>
@@ -57,11 +59,11 @@ static const struct fb_ops msm_fb_ops = {/* Note: to properly handle manual update displays, we wrap the * basic fbdev ops which write to the framebuffer */ - .fb_read = drm_fb_helper_sys_read, - .fb_write = drm_fb_helper_sys_write, - .fb_fillrect = drm_fb_helper_sys_fillrect, - .fb_copyarea = drm_fb_helper_sys_copyarea, - .fb_imageblit = drm_fb_helper_sys_imageblit, + .fb_read = fb_sys_read, + .fb_write = fb_sys_write, + .fb_fillrect = sys_fillrect, + .fb_copyarea = sys_copyarea, + .fb_imageblit = sys_imageblit, .fb_mmap = msm_fbdev_mmap, .fb_destroy = msm_fbdev_fb_destroy, };
Signature · 7 lines
2.40.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Thomas Zimmermann
maintainerPATCH v2 8/12 drm/omapdrm: Use regular fbdev I/O helpers
In reply to Thomas ZimmermannUse the regular fbdev helpers for framebuffer I/O instead of DRM's helpers. Omapdrm 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_SYS_HELPERS option
--- drivers/gpu/drm/omapdrm/Kconfig | 1 + drivers/gpu/drm/omapdrm/omap_fbdev.c | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-)
drivers/gpu/drm/omapdrm/Kconfig +1 -0
@@ -4,6 +4,7 @@ config DRM_OMAP depends on DRM && OF depends on ARCH_OMAP2PLUS select DRM_KMS_HELPER + select FB_SYS_HELPERS if DRM_FBDEV_EMULATION select VIDEOMODE_HELPERS select HDMI default n
drivers/gpu/drm/omapdrm/omap_fbdev.c +7 -5
@@ -4,6 +4,8 @@* Author: Rob Clark <[email protected]> */ +#include <linux/fb.h> +#include <drm/drm_drv.h> #include <drm/drm_crtc_helper.h> #include <drm/drm_fb_helper.h>
@@ -103,11 +105,11 @@ static const struct fb_ops omap_fb_ops = { .fb_pan_display = omap_fbdev_pan_display, .fb_ioctl = drm_fb_helper_ioctl, - .fb_read = drm_fb_helper_sys_read, - .fb_write = drm_fb_helper_sys_write, - .fb_fillrect = drm_fb_helper_sys_fillrect, - .fb_copyarea = drm_fb_helper_sys_copyarea, - .fb_imageblit = drm_fb_helper_sys_imageblit, + .fb_read = fb_sys_read, + .fb_write = fb_sys_write, + .fb_fillrect = sys_fillrect, + .fb_copyarea = sys_copyarea, + .fb_imageblit = sys_imageblit, .fb_destroy = omap_fbdev_fb_destroy, };
Signature · 1 line
2.40.1
Thomas Zimmermann
maintainerPATCH v2 9/12 drm/tegra: Use regular fbdev I/O helpers
In reply to Thomas ZimmermannUse the regular fbdev helpers for framebuffer I/O instead of DRM's helpers. Tegra 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_SYS_HELPERS option
--- drivers/gpu/drm/tegra/Kconfig | 1 + drivers/gpu/drm/tegra/fbdev.c | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-)
drivers/gpu/drm/tegra/Kconfig +1 -0
@@ -12,6 +12,7 @@ config DRM_TEGRA select DRM_KMS_HELPER select DRM_MIPI_DSI select DRM_PANEL + select FB_SYS_HELPERS if DRM_FBDEV_EMULATION select TEGRA_HOST1X select INTERCONNECT select IOMMU_IOVA
drivers/gpu/drm/tegra/fbdev.c +6 -5
@@ -8,6 +8,7 @@*/ #include <linux/console.h> +#include <linux/fb.h> #include <linux/vmalloc.h> #include <drm/drm_drv.h>
@@ -59,11 +60,11 @@ static void tegra_fbdev_fb_destroy(struct fb_info *info)static const struct fb_ops tegra_fb_ops = { .owner =THIS_MODULE ,DRM_FB_HELPER_DEFAULT_OPS , - .fb_read = drm_fb_helper_sys_read, - .fb_write = drm_fb_helper_sys_write, - .fb_fillrect = drm_fb_helper_sys_fillrect, - .fb_copyarea = drm_fb_helper_sys_copyarea, - .fb_imageblit = drm_fb_helper_sys_imageblit, + .fb_read = fb_sys_read, + .fb_write = fb_sys_write, + .fb_fillrect = sys_fillrect, + .fb_copyarea = sys_copyarea, + .fb_imageblit = sys_imageblit, .fb_mmap = tegra_fb_mmap, .fb_destroy = tegra_fbdev_fb_destroy, };
Signature · 1 line
2.40.1
Thomas Zimmermann
maintainerPATCH v2 10/12 drm/fb-helper: Export helpers for marking damage areas
In reply to Thomas ZimmermannExport drm_fb_helper_damage() and drm_fb_helper_damage_range(), which handle damage areas for fbdev emulation. This is a temporary export that allows to move the DRM I/O helpers for fbdev into drivers. Only fbdev-generic and i915 need them. Both will be updated to implement damage handling by themselves and the exported functions will be removed.
--- drivers/gpu/drm/drm_fb_helper.c | 19 +++++++++++++++++-- include/drm/drm_fb_helper.h | 4 ++++ 2 files changed, 21 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_fb_helper.c +17 -2
@@ -625,13 +625,15 @@ static void drm_fb_helper_add_damage_clip(struct drm_fb_helper *helper, u32 x, uspin_unlock_irqrestore (&helper->damage_lock, flags); } -static void drm_fb_helper_damage (struct drm_fb_helper *helper,u32 x,u32 y, -u32 width,u32 height) +/* Don't use in new code. */ +void drm_fb_helper_damage (struct drm_fb_helper *helper,u32 x,u32 y, +u32 width,u32 height) {drm_fb_helper_add_damage_clip (helper, x, y, width, height);schedule_work (&helper->damage_work); } +EXPORT_SYMBOL (drm_fb_helper_damage);/* * Convert memory region into area of scanlines and pixels per
@@ -670,6 +672,19 @@ static void drm_fb_helper_memory_range_to_clip(struct fb_info *info, off_t off,drm_rect_init (clip, x1, y1, x2 - x1, y2 - y1); } +/* Don't use in new code. */ +void drm_fb_helper_damage_range (struct drm_fb_helper *fb_helper,off_t off,size_t len) +{ +struct fb_info *info = fb_helper->info; +struct drm_rect damage_area; + +drm_fb_helper_memory_range_to_clip (info, off, len, &damage_area); +drm_fb_helper_damage (fb_helper, damage_area.x1, damage_area.y1, +drm_rect_width (&damage_area), +drm_rect_height (&damage_area)); +} +EXPORT_SYMBOL (drm_fb_helper_damage_range); +/** * drm_fb_helper_deferred_io() - fbdev deferred_io callback function * @info: fb_info struct pointer
include/drm/drm_fb_helper.h +4 -0
@@ -253,6 +253,10 @@ void drm_fb_helper_fill_info(struct fb_info *info,struct drm_fb_helper *fb_helper, struct drm_fb_helper_surface_size *sizes); +void drm_fb_helper_damage (struct drm_fb_helper *helper,u32 x,u32 y, +u32 width,u32 height); +void drm_fb_helper_damage_range (struct drm_fb_helper *helper,off_t off,size_t len); +void drm_fb_helper_deferred_io (struct fb_info *info,struct list_head *pagereflist); ssize_t drm_fb_helper_sys_read(struct fb_info *info, char __user *buf,
Signature · 1 line
2.40.1
Thomas Zimmermann
maintainerPATCH v2 11/12 drm/fbdev-generic: Implement dedicated fbdev I/O helpers
In reply to Thomas ZimmermannImplement dedicated fbdev helpers for framebuffer I/O instead of using DRM's helpers. Fbdev-generic was the only caller of the DRM helpers, so remove them from the helper module.
v2:
* use FB_SYS_HELPERS_DEFERRED option
--- drivers/gpu/drm/Kconfig | 6 +- drivers/gpu/drm/drm_fb_helper.c | 107 ---------------------------- drivers/gpu/drm/drm_fbdev_generic.c | 47 ++++++++++-- include/drm/drm_fb_helper.h | 41 ----------- 4 files changed, 43 insertions(+), 158 deletions(-)
drivers/gpu/drm/Kconfig +1 -5
@@ -95,6 +95,7 @@ config DRM_KUNIT_TEST config DRM_KMS_HELPER tristate depends on DRM + select FB_SYS_HELPERS_DEFERRED if DRM_FBDEV_EMULATION help CRTC helpers for KMS drivers.
@@ -135,11 +136,6 @@ config DRM_FBDEV_EMULATION 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
drivers/gpu/drm/drm_fb_helper.c +0 -107
113 lines not on this page · raw message
drivers/gpu/drm/drm_fbdev_generic.c +42 -5
60 lines not on this page · raw message
include/drm/drm_fb_helper.h +0 -41
53 lines not on this page · raw message
Signature · 1 line
2.40.1
Re: [v2,11/12] drm/fbdev-generic: Implement dedicated fbdev I/O helpers
Hi, Thomas
After apply your patch set, the kernel with arch/loongarch/configs/loongson3_defconfig
can not finish compile anymore. gcc complains:
AR drivers/gpu/built-in.a
AR drivers/built-in.a
AR built-in.a
AR vmlinux.a
LD vmlinux.o
OBJCOPY modules.builtin.modinfo
GEN modules.builtin
GEN .vmlinux.objs
MODPOST Module.symvers
ERROR: modpost: "fb_sys_write" [drivers/gpu/drm/drm_kms_helper.ko] undefined!
ERROR: modpost: "sys_imageblit" [drivers/gpu/drm/drm_kms_helper.ko] undefined!
ERROR: modpost: "sys_fillrect" [drivers/gpu/drm/drm_kms_helper.ko] undefined!
ERROR: modpost: "sys_copyarea" [drivers/gpu/drm/drm_kms_helper.ko] undefined!
ERROR: modpost: "fb_sys_read" [drivers/gpu/drm/drm_kms_helper.ko] undefined! make[1]: *** [scripts/Makefile.modpost:136: Module.symvers] Error 1
make: *** [Makefile:1978: modpost] Error 2
Quoted 20 lines · Thomas Zimmermann
Implement dedicated fbdev helpers for framebuffer I/O instead of using DRM's helpers. Fbdev-generic was the only caller of the DRM helpers, so remove them from the helper module.
v2:
* useFB_SYS_HELPERS_DEFERREDoptionSigned-off-by Thomas Zimmermann <[email protected]>--- drivers/gpu/drm/Kconfig | 6 +- drivers/gpu/drm/drm_fb_helper.c | 107 ---------------------------- drivers/gpu/drm/drm_fbdev_generic.c | 47 ++++++++++-- include/drm/drm_fb_helper.h | 41 ----------- 4 files changed, 43 insertions(+), 158 deletions(-)drivers/gpu/drm/Kconfig +0
-0
drivers/gpu/drm/Kconfig config DRM_KUNIT_TEST · line 98
Quoted 4 lines
drivers/gpu/drm/Kconfig +1
-0@@ -95,6 +95,7 @@ config DRM_KUNIT_TEST config DRM_KMS_HELPER tristate depends on DRM + select FB_SYS_HELPERS_DEFERRED if DRM_FBDEV_EMULATION
Here, select FB_SYS_HELPERS helps resolve the above issue mentioned.
Quoted 258 lines
drivers/gpu/drm/Kconfig +0
-5help CRTC helpers for KMS drivers.@@ -135,11 +136,6 @@ config DRM_FBDEV_EMULATION 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 ydrivers/gpu/drm/drm_fb_helper.c +0
-107@@ -729,113 +729,6 @@ void drm_fb_helper_deferred_io(struct fb_info *info, struct list_head *pagerefli }EXPORT_SYMBOL (drm_fb_helper_deferred_io); -/** -* drm_fb_helper_sys_read - Implements struct &fb_ops.fb_read for system memory -* @info: fb_info struct pointer -* @buf: userspace buffer to read from framebuffer memory -* @count: number of bytes to read from framebuffer memory -* @ppos: read offset within framebuffer memory -* -* Returns: -* The number of bytes read on success, or an error code otherwise. -*/ -ssize_t drm_fb_helper_sys_read (struct fb_info *info,char __user *buf, -size_t count,loff_t *ppos) -{ -return fb_sys_read (info, buf, count, ppos); -} -EXPORT_SYMBOL (drm_fb_helper_sys_read); - -/** -* drm_fb_helper_sys_write - Implements struct &fb_ops.fb_write for system memory -* @info: fb_info struct pointer -* @buf: userspace buffer to write to framebuffer memory -* @count: number of bytes to write to framebuffer memory -* @ppos: write offset within framebuffer memory -* -* Returns: -* The number of bytes written on success, or an error code otherwise. -*/ -ssize_t drm_fb_helper_sys_write (struct fb_info *info,const char __user *buf, -size_t count,loff_t *ppos) -{ -struct drm_fb_helper *helper = info->par; -loff_t pos = *ppos; -ssize_t ret; -struct drm_rect damage_area; - - ret =fb_sys_write (info, buf, count, ppos); -if (ret <=0 ) -return ret; - -if (helper->funcs->fb_dirty) { -drm_fb_helper_memory_range_to_clip (info, pos, ret, &damage_area); -drm_fb_helper_damage (helper, damage_area.x1, damage_area.y1, -drm_rect_width (&damage_area), -drm_rect_height (&damage_area)); - } - -return ret; -} -EXPORT_SYMBOL (drm_fb_helper_sys_write); - -/** -* drm_fb_helper_sys_fillrect - wrapper around sys_fillrect -* @info: fbdev registered by the helper -* @rect: info about rectangle to fill -* -* A wrapper around sys_fillrect implemented by fbdev core -*/ -void drm_fb_helper_sys_fillrect (struct fb_info *info, -const struct fb_fillrect *rect) -{ -struct drm_fb_helper *helper = info->par; - -sys_fillrect (info, rect); - -if (helper->funcs->fb_dirty) -drm_fb_helper_damage (helper, rect->dx, rect->dy, rect->width, rect->height); -} -EXPORT_SYMBOL (drm_fb_helper_sys_fillrect); - -/** -* drm_fb_helper_sys_copyarea - wrapper around sys_copyarea -* @info: fbdev registered by the helper -* @area: info about area to copy -* -* A wrapper around sys_copyarea implemented by fbdev core -*/ -void drm_fb_helper_sys_copyarea (struct fb_info *info, -const struct fb_copyarea *area) -{ -struct drm_fb_helper *helper = info->par; - -sys_copyarea (info, area); - -if (helper->funcs->fb_dirty) -drm_fb_helper_damage (helper, area->dx, area->dy, area->width, area->height); -} -EXPORT_SYMBOL (drm_fb_helper_sys_copyarea); - -/** -* drm_fb_helper_sys_imageblit - wrapper around sys_imageblit -* @info: fbdev registered by the helper -* @image: info about image to blit -* -* A wrapper around sys_imageblit implemented by fbdev core -*/ -void drm_fb_helper_sys_imageblit (struct fb_info *info, -const struct fb_image *image) -{ -struct drm_fb_helper *helper = info->par; - -sys_imageblit (info, image); - -if (helper->funcs->fb_dirty) -drm_fb_helper_damage (helper, image->dx, image->dy, image->width, image->height); -} -EXPORT_SYMBOL (drm_fb_helper_sys_imageblit); -/** * drm_fb_helper_cfb_read - Implements struct &fb_ops.fb_read for I/O memory * @info: fb_info struct pointer drivers/gpu/drm/drm_fbdev_generic.c +42
-5@@ -34,6 +34,43 @@ static int drm_fbdev_generic_fb_release(struct fb_info *info, int user)return 0 ; } +static ssize_t drm_fbdev_generic_fb_write (struct fb_info *info,const char __user *buf, +size_t count,loff_t *ppos) +{ +struct drm_fb_helper *helper = info->par; +loff_t pos = *ppos; +ssize_t ret; + + ret =fb_sys_write (info, buf, count, ppos); +if (ret >0 ) +drm_fb_helper_damage_range (helper, pos, ret); +return ret; +} + +static void drm_fbdev_generic_fb_fillrect (struct fb_info *info,const struct fb_fillrect *rect) +{ +struct drm_fb_helper *helper = info->par; + +sys_fillrect (info, rect); +drm_fb_helper_damage (helper, rect->dx, rect->dy, rect->width, rect->height); +} + +static void drm_fbdev_generic_fb_copyarea (struct fb_info *info,const struct fb_copyarea *area) +{ +struct drm_fb_helper *helper = info->par; + +sys_copyarea (info, area); +drm_fb_helper_damage (helper, area->dx, area->dy, area->width, area->height); +} + +static void drm_fbdev_generic_fb_imageblit (struct fb_info *info,const struct fb_image *image) +{ +struct drm_fb_helper *helper = info->par; + +sys_imageblit (info, image); +drm_fb_helper_damage (helper, image->dx, image->dy, image->width, image->height); +} +static void drm_fbdev_generic_fb_destroy (struct fb_info *info) {struct drm_fb_helper *fb_helper = info->par;@@ -56,12 +93,12 @@ static const struct fb_ops drm_fbdev_generic_fb_ops = { .owner = THIS_MODULE, .fb_open = drm_fbdev_generic_fb_open, .fb_release = drm_fbdev_generic_fb_release, - .fb_read = drm_fb_helper_sys_read, - .fb_write = drm_fb_helper_sys_write, + .fb_read = fb_sys_read, + .fb_write = drm_fbdev_generic_fb_write,DRM_FB_HELPER_DEFAULT_OPS , - .fb_fillrect = drm_fb_helper_sys_fillrect, - .fb_copyarea = drm_fb_helper_sys_copyarea, - .fb_imageblit = drm_fb_helper_sys_imageblit, + .fb_fillrect = drm_fbdev_generic_fb_fillrect, + .fb_copyarea = drm_fbdev_generic_fb_copyarea, + .fb_imageblit = drm_fbdev_generic_fb_imageblit, .fb_mmap = fb_deferred_io_mmap, .fb_destroy = drm_fbdev_generic_fb_destroy, };include/drm/drm_fb_helper.h +0
-41@@ -259,18 +259,6 @@ void drm_fb_helper_damage_range(struct drm_fb_helper *helper, off_t off, size_tvoid drm_fb_helper_deferred_io (struct fb_info *info,struct list_head *pagereflist); -ssize_t drm_fb_helper_sys_read (struct fb_info *info,char __user *buf, -size_t count,loff_t *ppos); -ssize_t drm_fb_helper_sys_write (struct fb_info *info,const char __user *buf, -size_t count,loff_t *ppos); - -void drm_fb_helper_sys_fillrect (struct fb_info *info, -const struct fb_fillrect *rect); -void drm_fb_helper_sys_copyarea (struct fb_info *info, -const struct fb_copyarea *area); -void drm_fb_helper_sys_imageblit (struct fb_info *info, -const struct fb_image *image); -ssize_t drm_fb_helper_cfb_read (struct fb_info *info,char __user *buf,size_t count,loff_t *ppos); ssize_t drm_fb_helper_cfb_write(struct fb_info *info, const char __user *buf,@@ -398,35 +386,6 @@ static inline int drm_fb_helper_defio_init(struct drm_fb_helper *fb_helper)return -ENODEV ; } -static inline ssize_t drm_fb_helper_sys_read (struct fb_info *info, -char __user *buf,size_t count, -loff_t *ppos) -{ -return -ENODEV ; -} - -static inline ssize_t drm_fb_helper_sys_write (struct fb_info *info, -const char __user *buf, -size_t count,loff_t *ppos) -{ -return -ENODEV ; -} - -static inline void drm_fb_helper_sys_fillrect (struct fb_info *info, -const struct fb_fillrect *rect) -{ -} - -static inline void drm_fb_helper_sys_copyarea (struct fb_info *info, -const struct fb_copyarea *area) -{ -} - -static inline void drm_fb_helper_sys_imageblit (struct fb_info *info, -const struct fb_image *image) -{ -} -static inline ssize_t drm_fb_helper_cfb_read (struct fb_info *info,char __user *buf,size_t count,loff_t *ppos) {
Thomas Zimmermann
maintainerRe: [v2,11/12] drm/fbdev-generic: Implement dedicated fbdev I/O helpers
Hi
Am 17.05.23 um 03:58 schrieb Sui Jingfeng:
Quoted 8 lines
Hi, Thomas
After apply your patch set, the kernel with
arch/loongarch/configs/loongson3_defconfigcan not finish compile anymore. gcc complains:
Quoted 16 lines
AR
drivers/gpu/built-in.a
ARdrivers/built-in.a
AR built-in.a
AR vmlinux.a
LD vmlinux.o
OBJCOPY modules.builtin.modinfo
GEN modules.builtin
GEN .vmlinux.objs
MODPOST Module.symvers
ERROR: modpost: "fb_sys_write" [drivers/gpu/drm/drm_kms_helper.ko] undefined!
ERROR: modpost: "sys_imageblit" [drivers/gpu/drm/drm_kms_helper.ko] undefined!
ERROR: modpost: "sys_fillrect" [drivers/gpu/drm/drm_kms_helper.ko] undefined!
ERROR: modpost: "sys_copyarea" [drivers/gpu/drm/drm_kms_helper.ko] undefined!
ERROR: modpost: "fb_sys_read" [drivers/gpu/drm/drm_kms_helper.ko] undefined! make[1]: *** [scripts/Makefile.modpost:136: Module.symvers] Error 1
make: *** [Makefile:1978: modpost] Error 2
Thanks for reporting this problem. I found that it's caused by a typo in the very first patch 1/7, where these helpers are not selected correctly. Will be fixed in the next round.
Best regards
Thomas
Quoted 302 lines · Thomas Zimmermann
Quoted 20 lines
Implement dedicated fbdev helpers for framebuffer I/O instead of using DRM's helpers. Fbdev-generic was the only caller of the DRM helpers, so remove them from the helper module.
v2:
* useFB_SYS_HELPERS_DEFERREDoptionSigned-off-by Thomas Zimmermann <[email protected]>---
drivers/gpu/drm/Kconfig | 6 +- drivers/gpu/drm/drm_fb_helper.c | 107 ----------------------------drivers/gpu/drm/drm_fbdev_generic.c| 47 ++++++++++-- include/drm/drm_fb_helper.h | 41 -----------4 files changed, 43 insertions(+), 158 deletions(-)drivers/gpu/drm/Kconfig +0
-0@@ -95,6 +95,7 @@ config DRM_KUNIT_TESTQuoted 4 lines
config
DRM_KMS_HELPER
tristate
depends on DRM
+ selectFB_SYS_HELPERS_DEFERREDifDRM_FBDEV_EMULATIONHere, select
FB_SYS_HELPERShelps resolve the above issue mentioned.Quoted 272 lines
help
CRTC helpers for KMS drivers.drivers/gpu/drm/Kconfig +0
-0@@ -135,11 +136,6 @@ config DRM_FBDEV_EMULATIONselect
FB_CFB_FILLRECT
selectFB_CFB_COPYAREA
selectFB_CFB_IMAGEBLIT
- selectFB_DEFERRED_IO
- selectFB_SYS_FOPS
- selectFB_SYS_FILLRECT
- selectFB_SYS_COPYAREA
- selectFB_SYS_IMAGEBLIT
selectFRAMEBUFFER_CONSOLEif !EXPERT
selectFRAMEBUFFER_CONSOLE_DETECT_PRIMARYifFRAMEBUFFER_CONSOLEdefault ydrivers/gpu/drm/drm_fb_helper.c +0
-2@@ -729,113 +729,6 @@ void drm_fb_helper_deferred_io(struct fb_info *info, struct list_head *pagerefli } EXPORT_SYMBOL(drm_fb_helper_deferred_io); -/** -* drm_fb_helper_sys_read - Implements struct &fb_ops.fb_read for system memory
- * @info:fb_infostruct pointer
- * @buf: userspace buffer to read from framebuffer memory
- * @count: number of bytes to read from framebuffer memory
- * @ppos: read offset within framebuffer memory
- *
- * Returns:
- * The number of bytes read on success, or an error code otherwise.
- */drivers/gpu/drm/drm_fb_helper.c +0
-9-ssize_t drm_fb_helper_sys_read (struct fb_info *info,char __user *buf, - size_t count, loff_t *ppos) -{ - return fb_sys_read(info, buf, count, ppos); -} -EXPORT_SYMBOL (drm_fb_helper_sys_read); - -/** -* drm_fb_helper_sys_write - Implements struct &fb_ops.fb_write for system memory
- * @info:fb_infostruct pointer
- * @buf: userspace buffer to write to framebuffer memory
- * @count: number of bytes to write to framebuffer memory
- * @ppos: write offset within framebuffer memory
- *
- * Returns:
- * The number of bytes written on success, or an error code otherwise.
- */
-ssize_t drm_fb_helper_sys_write(structfb_info*info, const char__user*buf,
-size_tcount,loff_t*ppos)drivers/gpu/drm/drm_fb_helper.c +0
-12-{ - struct drm_fb_helper *helper = info->par; - loff_t pos = *ppos; - ssize_t ret; - struct drm_rect damage_area; - - ret = fb_sys_write(info, buf, count, ppos); - if (ret <= 0) - return ret; - - if (helper->funcs->fb_dirty) { - drm_fb_helper_memory_range_to_clip(info, pos, ret,
&damage_area);
- drm_fb_helper_damage(helper, damage_area.x1, damage_area.y1, -drm_rect_width(&damage_area),
-drm_rect_height(&damage_area));
- }drivers/gpu/drm/drm_fb_helper.c +0
-21- - return ret; -} -EXPORT_SYMBOL (drm_fb_helper_sys_write); - -/** -* drm_fb_helper_sys_fillrect - wrapper around sys_fillrect -* @info: fbdev registered by the helper -* @rect: info about rectangle to fill -* -* A wrapper around sys_fillrect implemented by fbdev core -*/ -void drm_fb_helper_sys_fillrect (struct fb_info *info, - const struct fb_fillrect *rect) -{ - struct drm_fb_helper *helper = info->par; - - sys_fillrect(info, rect); - - if (helper->funcs->fb_dirty) - drm_fb_helper_damage(helper, rect->dx, rect->dy, rect->width,
rect->height);drivers/gpu/drm/drm_fb_helper.c +0
-19-} -EXPORT_SYMBOL (drm_fb_helper_sys_fillrect); - -/** -* drm_fb_helper_sys_copyarea - wrapper around sys_copyarea -* @info: fbdev registered by the helper -* @area: info about area to copy -* -* A wrapper around sys_copyarea implemented by fbdev core -*/ -void drm_fb_helper_sys_copyarea (struct fb_info *info, - const struct fb_copyarea *area) -{ - struct drm_fb_helper *helper = info->par; - - sys_copyarea(info, area); - - if (helper->funcs->fb_dirty) - drm_fb_helper_damage(helper, area->dx, area->dy, area->width,
area->height);drivers/gpu/drm/drm_fb_helper.c +0
-19-} -EXPORT_SYMBOL (drm_fb_helper_sys_copyarea); - -/** -* drm_fb_helper_sys_imageblit - wrapper around sys_imageblit -* @info: fbdev registered by the helper -* @image: info about image to blit -* -* A wrapper around sys_imageblit implemented by fbdev core -*/ -void drm_fb_helper_sys_imageblit (struct fb_info *info, - const struct fb_image *image) -{ - struct drm_fb_helper *helper = info->par; - - sys_imageblit(info, image); - - if (helper->funcs->fb_dirty) - drm_fb_helper_damage(helper, image->dx, image->dy,
image->width,image->height);drivers/gpu/drm/drm_fb_helper.c +0
-3-} -EXPORT_SYMBOL (drm_fb_helper_sys_imageblit); -/**
*drm_fb_helper_cfb_read- Implements struct &fb_ops.fb_read for I/O memory
* @info:fb_infostruct pointerdrivers/gpu/drm/drm_fbdev_generic.c +22
-0@@ -34,6 +34,43 @@ static int drm_fbdev_generic_fb_release(struct fb_info *info, int user) return 0; } +static ssize_t drm_fbdev_generic_fb_write (struct fb_info *info,const char __user *buf, + size_t count, loff_t *ppos) +{ + struct drm_fb_helper *helper = info->par; + loff_t pos = *ppos; + ssize_t ret; + + ret = fb_sys_write(info, buf, count, ppos); + if (ret > 0) + drm_fb_helper_damage_range(helper, pos, ret); + return ret; +} + +static void drm_fbdev_generic_fb_fillrect (struct fb_info *info,const struct fb_fillrect *rect) +{ + struct drm_fb_helper *helper = info->par; + + sys_fillrect(info, rect); + drm_fb_helper_damage(helper, rect->dx, rect->dy, rect->width, rect->height); +} + +static void drm_fbdev_generic_fb_copyarea(struct fb_info *info, conststruct
fb_copyarea*area)drivers/gpu/drm/drm_fbdev_generic.c +5
-0+{ + struct drm_fb_helper *helper = info->par; + + sys_copyarea(info, area); + drm_fb_helper_damage(helper, area->dx, area->dy, area->width,
area->height);drivers/gpu/drm/drm_fbdev_generic.c +3
-0+} + +static void drm_fbdev_generic_fb_imageblit(struct fb_info *info,const struct
fb_image*image)drivers/gpu/drm/drm_fbdev_generic.c +5
-0+{ + struct drm_fb_helper *helper = info->par; + + sys_imageblit(info, image); + drm_fb_helper_damage(helper, image->dx, image->dy, image->width,
image->height);drivers/gpu/drm/drm_fbdev_generic.c +2
-0+} +static void
drm_fbdev_generic_fb_destroy(struct fb_info *info){
structdrm_fb_helper*fb_helper=info->par;drivers/gpu/drm/drm_fbdev_generic.c +5
-5@@ -56,12 +93,12 @@ static const struct fb_ops drm_fbdev_generic_fb_ops = { .owner = THIS_MODULE, .fb_open = drm_fbdev_generic_fb_open, .fb_release = drm_fbdev_generic_fb_release, - .fb_read = drm_fb_helper_sys_read, - .fb_write = drm_fb_helper_sys_write, + .fb_read = fb_sys_read, + .fb_write = drm_fbdev_generic_fb_write, DRM_FB_HELPER_DEFAULT_OPS, - .fb_fillrect = drm_fb_helper_sys_fillrect, - .fb_copyarea = drm_fb_helper_sys_copyarea, - .fb_imageblit = drm_fb_helper_sys_imageblit, + .fb_fillrect = drm_fbdev_generic_fb_fillrect, + .fb_copyarea = drm_fbdev_generic_fb_copyarea, + .fb_imageblit = drm_fbdev_generic_fb_imageblit, .fb_mmap = fb_deferred_io_mmap, .fb_destroy = drm_fbdev_generic_fb_destroy,};
include/drm/drm_fb_helper.h +0
-0@@ -259,18 +259,6 @@ void drm_fb_helper_damage_range(struct
drm_fb_helper*helper,off_toff,size_t
voiddrm_fb_helper_deferred_io(struct fb_info *info, struct list_head *pagereflist);include/drm/drm_fb_helper.h +0
-3-ssize_t drm_fb_helper_sys_read (struct fb_info *info,char __user *buf, - size_t count, loff_t *ppos); -ssize_t drm_fb_helper_sys_write(struct fb_info *info, const char
__user*buf,
-size_tcount,loff_t*ppos);include/drm/drm_fb_helper.h +0
-8- -void drm_fb_helper_sys_fillrect (struct fb_info *info, - const struct fb_fillrect *rect); -void drm_fb_helper_sys_copyarea (struct fb_info *info, - const struct fb_copyarea *area); -void drm_fb_helper_sys_imageblit (struct fb_info *info, - const struct fb_image *image); -
ssize_tdrm_fb_helper_cfb_read(struct fb_info *info, char __user *buf, size_t count, loff_t *ppos);
ssize_tdrm_fb_helper_cfb_write(structfb_info*info, const char__user*buf,include/drm/drm_fb_helper.h +0
-29@@ -398,35 +386,6 @@ static inline int drm_fb_helper_defio_init(struct drm_fb_helper *fb_helper) return -ENODEV; } -static inline ssize_t drm_fb_helper_sys_read (struct fb_info *info, - char __user *buf, size_t count, - loff_t *ppos) -{ - return -ENODEV; -} - -static inline ssize_t drm_fb_helper_sys_write (struct fb_info *info, - const char __user *buf, - size_t count, loff_t *ppos) -{ - return -ENODEV; -} - -static inline void drm_fb_helper_sys_fillrect (struct fb_info *info, - const struct fb_fillrect *rect) -{ -} - -static inline void drm_fb_helper_sys_copyarea (struct fb_info *info, - const struct fb_copyarea *area) -{ -} - -static inline void drm_fb_helper_sys_imageblit (struct fb_info *info, - const struct fb_image *image) -{ -} - static inline ssize_t drm_fb_helper_cfb_read(struct fb_info *info, char __user *buf, size_t count, loff_t *ppos) {
Signature · 6 lines
Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Frankenstrasse 146, 90461 Nuernberg, Germany GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman HRB 36809 (AG Nuernberg)
Re: [v2,11/12] drm/fbdev-generic: Implement dedicated fbdev I/O helpers
Hi,
Quoted 28 lines · Thomas Zimmermann
Hi
Am 17.05.23 um 03:58 schrieb Sui Jingfeng:
Quoted 8 lines
Hi, Thomas
After apply your patch set, the kernel with
arch/loongarch/configs/loongson3_defconfigcan not finish compile anymore. gcc complains:
Quoted 16 lines
AR
drivers/gpu/built-in.a
ARdrivers/built-in.a
AR built-in.a
AR vmlinux.a
LD vmlinux.o
OBJCOPY modules.builtin.modinfo
GEN modules.builtin
GEN .vmlinux.objs
MODPOST Module.symvers
ERROR: modpost: "fb_sys_write" [drivers/gpu/drm/drm_kms_helper.ko] undefined!
ERROR: modpost: "sys_imageblit" [drivers/gpu/drm/drm_kms_helper.ko] undefined!
ERROR: modpost: "sys_fillrect" [drivers/gpu/drm/drm_kms_helper.ko] undefined!
ERROR: modpost: "sys_copyarea" [drivers/gpu/drm/drm_kms_helper.ko] undefined!
ERROR: modpost: "fb_sys_read" [drivers/gpu/drm/drm_kms_helper.ko] undefined! make[1]: *** [scripts/Makefile.modpost:136: Module.symvers] Error 1
make: *** [Makefile:1978: modpost] Error 2
Quoted 2 lines
Thanks for reporting this problem. I found that it's caused by a typo in the very first patch 1/7, where these helpers are not selected correctly. Will be fixed in the next round.
Yeah, this is just a typo.
Should replace 'FB_SYS_HELPER' with 'FB_SYS_HELPERS' on the first patch of this series.
Quoted 34 lines
Best regards
ThomasQuoted 31 lines · Thomas Zimmermann
Quoted 21 lines
Implement dedicated fbdev helpers for framebuffer I/O instead of using DRM's helpers. Fbdev-generic was the only caller of the DRM helpers, so remove them from the helper module.
v2:
* useFB_SYS_HELPERS_DEFERREDoptionSigned-off-by Thomas Zimmermann <[email protected]>---
drivers/gpu/drm/Kconfig | 6 +- drivers/gpu/drm/drm_fb_helper.c | 107
----------------------------
drivers/gpu/drm/drm_fbdev_generic.c| 47 ++++++++++-- include/drm/drm_fb_helper.h | 41 -----------4 files changed, 43 insertions(+), 158 deletions(-)drivers/gpu/drm/Kconfig +0
-0@@ -95,6 +95,7 @@ config DRM_KUNIT_TESTQuoted 4 lines
config
DRM_KMS_HELPER
tristate
depends on DRM
+ selectFB_SYS_HELPERS_DEFERREDifDRM_FBDEV_EMULATIONHere, select
FB_SYS_HELPERShelps resolve the above issue mentioned.
But select FB_SYS_HELPERS here is more better, I think. Because it show the nature that
DRM_KMS_HELPER is depend on FB_SYS_HELPERS, I think you may want isolate
those dependency with DRM_FBDEV_EMULATION guard.
at least, you should guarantee that drm itself could built and run standalone.
Fbdev emulation is a client of drm, not reverse.
By the way, does Denial happy about this,
maybe, he want the fbdev emulation 100% made in drm?
Quoted 273 lines
Quoted 272 lines
Quoted 272 lines
help
CRTC helpers for KMS drivers.drivers/gpu/drm/Kconfig +0
-0@@ -135,11 +136,6 @@ config DRM_FBDEV_EMULATIONselect
FB_CFB_FILLRECT
selectFB_CFB_COPYAREA
selectFB_CFB_IMAGEBLIT
- selectFB_DEFERRED_IO
- selectFB_SYS_FOPS
- selectFB_SYS_FILLRECT
- selectFB_SYS_COPYAREA
- selectFB_SYS_IMAGEBLIT
selectFRAMEBUFFER_CONSOLEif !EXPERT
selectFRAMEBUFFER_CONSOLE_DETECT_PRIMARYifFRAMEBUFFER_CONSOLEdefault ydrivers/gpu/drm/drm_fb_helper.c +0
-2@@ -729,113 +729,6 @@ void drm_fb_helper_deferred_io(struct fb_info *info, struct list_head *pagerefli } EXPORT_SYMBOL(drm_fb_helper_deferred_io); -/** -* drm_fb_helper_sys_read - Implements struct &fb_ops.fb_read for system memory
- * @info:fb_infostruct pointer
- * @buf: userspace buffer to read from framebuffer memory
- * @count: number of bytes to read from framebuffer memory
- * @ppos: read offset within framebuffer memory
- *
- * Returns:
- * The number of bytes read on success, or an error code otherwise.
- */drivers/gpu/drm/drm_fb_helper.c +0
-9-ssize_t drm_fb_helper_sys_read (struct fb_info *info,char __user *buf, - size_t count, loff_t *ppos) -{ - return fb_sys_read(info, buf, count, ppos); -} -EXPORT_SYMBOL (drm_fb_helper_sys_read); - -/** -* drm_fb_helper_sys_write - Implements struct &fb_ops.fb_write for system memory
- * @info:fb_infostruct pointer
- * @buf: userspace buffer to write to framebuffer memory
- * @count: number of bytes to write to framebuffer memory
- * @ppos: write offset within framebuffer memory
- *
- * Returns:
- * The number of bytes written on success, or an error code otherwise.
- */
-ssize_t drm_fb_helper_sys_write(structfb_info*info, const char__user*buf,
-size_tcount,loff_t*ppos)drivers/gpu/drm/drm_fb_helper.c +0
-12-{ - struct drm_fb_helper *helper = info->par; - loff_t pos = *ppos; - ssize_t ret; - struct drm_rect damage_area; - - ret = fb_sys_write(info, buf, count, ppos); - if (ret <= 0) - return ret; - - if (helper->funcs->fb_dirty) { - drm_fb_helper_memory_range_to_clip(info, pos, ret,
&damage_area);
- drm_fb_helper_damage(helper, damage_area.x1, damage_area.y1, -drm_rect_width(&damage_area),
-drm_rect_height(&damage_area));
- }drivers/gpu/drm/drm_fb_helper.c +0
-21- - return ret; -} -EXPORT_SYMBOL (drm_fb_helper_sys_write); - -/** -* drm_fb_helper_sys_fillrect - wrapper around sys_fillrect -* @info: fbdev registered by the helper -* @rect: info about rectangle to fill -* -* A wrapper around sys_fillrect implemented by fbdev core -*/ -void drm_fb_helper_sys_fillrect (struct fb_info *info, - const struct fb_fillrect *rect) -{ - struct drm_fb_helper *helper = info->par; - - sys_fillrect(info, rect); - - if (helper->funcs->fb_dirty) - drm_fb_helper_damage(helper, rect->dx, rect->dy,
rect->width,rect->height);drivers/gpu/drm/drm_fb_helper.c +0
-19-} -EXPORT_SYMBOL (drm_fb_helper_sys_fillrect); - -/** -* drm_fb_helper_sys_copyarea - wrapper around sys_copyarea -* @info: fbdev registered by the helper -* @area: info about area to copy -* -* A wrapper around sys_copyarea implemented by fbdev core -*/ -void drm_fb_helper_sys_copyarea (struct fb_info *info, - const struct fb_copyarea *area) -{ - struct drm_fb_helper *helper = info->par; - - sys_copyarea(info, area); - - if (helper->funcs->fb_dirty) - drm_fb_helper_damage(helper, area->dx, area->dy,
area->width,area->height);drivers/gpu/drm/drm_fb_helper.c +0
-19-} -EXPORT_SYMBOL (drm_fb_helper_sys_copyarea); - -/** -* drm_fb_helper_sys_imageblit - wrapper around sys_imageblit -* @info: fbdev registered by the helper -* @image: info about image to blit -* -* A wrapper around sys_imageblit implemented by fbdev core -*/ -void drm_fb_helper_sys_imageblit (struct fb_info *info, - const struct fb_image *image) -{ - struct drm_fb_helper *helper = info->par; - - sys_imageblit(info, image); - - if (helper->funcs->fb_dirty) - drm_fb_helper_damage(helper, image->dx, image->dy,
image->width,image->height);drivers/gpu/drm/drm_fb_helper.c +0
-3-} -EXPORT_SYMBOL (drm_fb_helper_sys_imageblit); -/**
*drm_fb_helper_cfb_read- Implements struct &fb_ops.fb_read for I/O memory
* @info:fb_infostruct pointerdrivers/gpu/drm/drm_fbdev_generic.c +22
-0@@ -34,6 +34,43 @@ static int drm_fbdev_generic_fb_release(struct fb_info *info, int user) return 0; } +static ssize_t drm_fbdev_generic_fb_write (struct fb_info *info,const char __user *buf, + size_t count, loff_t *ppos) +{ + struct drm_fb_helper *helper = info->par; + loff_t pos = *ppos; + ssize_t ret; + + ret = fb_sys_write(info, buf, count, ppos); + if (ret > 0) + drm_fb_helper_damage_range(helper, pos, ret); + return ret; +} + +static void drm_fbdev_generic_fb_fillrect (struct fb_info *info,const struct fb_fillrect *rect) +{ + struct drm_fb_helper *helper = info->par; + + sys_fillrect(info, rect); + drm_fb_helper_damage(helper, rect->dx, rect->dy, rect->width, rect->height); +} + +static void drm_fbdev_generic_fb_copyarea(struct fb_info *info,const struct
fb_copyarea*area)drivers/gpu/drm/drm_fbdev_generic.c +5
-0+{ + struct drm_fb_helper *helper = info->par; + + sys_copyarea(info, area); + drm_fb_helper_damage(helper, area->dx, area->dy, area->width,
area->height);drivers/gpu/drm/drm_fbdev_generic.c +3
-0+} + +static void drm_fbdev_generic_fb_imageblit(struct fb_info *info,const struct
fb_image*image)drivers/gpu/drm/drm_fbdev_generic.c +5
-0+{ + struct drm_fb_helper *helper = info->par; + + sys_imageblit(info, image); + drm_fb_helper_damage(helper, image->dx, image->dy,
image->width,image->height);drivers/gpu/drm/drm_fbdev_generic.c +2
-0+} +static void
drm_fbdev_generic_fb_destroy(struct fb_info *info){
structdrm_fb_helper*fb_helper=info->par;drivers/gpu/drm/drm_fbdev_generic.c +5
-5@@ -56,12 +93,12 @@ static const struct fb_ops drm_fbdev_generic_fb_ops = { .owner = THIS_MODULE, .fb_open = drm_fbdev_generic_fb_open, .fb_release = drm_fbdev_generic_fb_release, - .fb_read = drm_fb_helper_sys_read, - .fb_write = drm_fb_helper_sys_write, + .fb_read = fb_sys_read, + .fb_write = drm_fbdev_generic_fb_write, DRM_FB_HELPER_DEFAULT_OPS, - .fb_fillrect = drm_fb_helper_sys_fillrect, - .fb_copyarea = drm_fb_helper_sys_copyarea, - .fb_imageblit = drm_fb_helper_sys_imageblit, + .fb_fillrect = drm_fbdev_generic_fb_fillrect, + .fb_copyarea = drm_fbdev_generic_fb_copyarea, + .fb_imageblit = drm_fbdev_generic_fb_imageblit, .fb_mmap = fb_deferred_io_mmap, .fb_destroy = drm_fbdev_generic_fb_destroy,};
include/drm/drm_fb_helper.h +0
-0@@ -259,18 +259,6 @@ void drm_fb_helper_damage_range(struct
drm_fb_helper*helper,off_toff,size_t
voiddrm_fb_helper_deferred_io(struct fb_info *info, struct list_head *pagereflist);include/drm/drm_fb_helper.h +0
-3-ssize_t drm_fb_helper_sys_read (struct fb_info *info,char __user *buf, - size_t count, loff_t *ppos); -ssize_t drm_fb_helper_sys_write(struct fb_info *info, const char
__user*buf,
-size_tcount,loff_t*ppos);include/drm/drm_fb_helper.h +0
-8- -void drm_fb_helper_sys_fillrect (struct fb_info *info, - const struct fb_fillrect *rect); -void drm_fb_helper_sys_copyarea (struct fb_info *info, - const struct fb_copyarea *area); -void drm_fb_helper_sys_imageblit (struct fb_info *info, - const struct fb_image *image); -
ssize_tdrm_fb_helper_cfb_read(struct fb_info *info, char __user *buf, size_t count, loff_t *ppos);
ssize_tdrm_fb_helper_cfb_write(structfb_info*info, const char__user*buf,include/drm/drm_fb_helper.h +0
-29@@ -398,35 +386,6 @@ static inline int drm_fb_helper_defio_init(struct drm_fb_helper *fb_helper) return -ENODEV; } -static inline ssize_t drm_fb_helper_sys_read (struct fb_info *info, - char __user *buf, size_t count, - loff_t *ppos) -{ - return -ENODEV; -} - -static inline ssize_t drm_fb_helper_sys_write (struct fb_info *info, - const char __user *buf, - size_t count, loff_t *ppos) -{ - return -ENODEV; -} - -static inline void drm_fb_helper_sys_fillrect (struct fb_info *info, - const struct fb_fillrect *rect) -{ -} - -static inline void drm_fb_helper_sys_copyarea (struct fb_info *info, - const struct fb_copyarea *area) -{ -} - -static inline void drm_fb_helper_sys_imageblit (struct fb_info *info, - const struct fb_image *image) -{ -} - static inline ssize_t drm_fb_helper_cfb_read(struct fb_info *info, char __user *buf, size_t count, loff_t *ppos) {
Thomas Zimmermann
maintainerRe: [v2,11/12] drm/fbdev-generic: Implement dedicated fbdev I/O helpers
Hi
Am 18.05.23 um 14:46 schrieb Sui Jingfeng:
Quoted 72 lines
Hi,
Quoted 28 lines · Thomas Zimmermann
Hi
Am 17.05.23 um 03:58 schrieb Sui Jingfeng:
Quoted 8 lines
Hi, Thomas
After apply your patch set, the kernel with
arch/loongarch/configs/loongson3_defconfigcan not finish compile anymore. gcc complains:
Quoted 16 lines
AR
drivers/gpu/built-in.a
ARdrivers/built-in.a
AR built-in.a
AR vmlinux.a
LD vmlinux.o
OBJCOPY modules.builtin.modinfo
GEN modules.builtin
GEN .vmlinux.objs
MODPOST Module.symvers
ERROR: modpost: "fb_sys_write" [drivers/gpu/drm/drm_kms_helper.ko] undefined!
ERROR: modpost: "sys_imageblit" [drivers/gpu/drm/drm_kms_helper.ko] undefined!
ERROR: modpost: "sys_fillrect" [drivers/gpu/drm/drm_kms_helper.ko] undefined!
ERROR: modpost: "sys_copyarea" [drivers/gpu/drm/drm_kms_helper.ko] undefined!
ERROR: modpost: "fb_sys_read" [drivers/gpu/drm/drm_kms_helper.ko] undefined! make[1]: *** [scripts/Makefile.modpost:136: Module.symvers] Error 1
make: *** [Makefile:1978: modpost] Error 2Quoted 2 lines
Thanks for reporting this problem. I found that it's caused by a typo in the very first patch 1/7, where these helpers are not selected correctly. Will be fixed in the next round.
Yeah, this is just a typo.
Should replace '
FB_SYS_HELPER' with 'FB_SYS_HELPERS' on the first patch of this series.Quoted 34 lines
Best regards
ThomasQuoted 31 lines · Thomas Zimmermann
Quoted 21 lines
Implement dedicated fbdev helpers for framebuffer I/O instead of using DRM's helpers. Fbdev-generic was the only caller of the DRM helpers, so remove them from the helper module.
v2:
* useFB_SYS_HELPERS_DEFERREDoptionSigned-off-by Thomas Zimmermann <[email protected]>---
drivers/gpu/drm/Kconfig | 6 +- drivers/gpu/drm/drm_fb_helper.c | 107
----------------------------
drivers/gpu/drm/drm_fbdev_generic.c| 47 ++++++++++-- include/drm/drm_fb_helper.h | 41 -----------4 files changed, 43 insertions(+), 158 deletions(-)drivers/gpu/drm/Kconfig +0
-0@@ -95,6 +95,7 @@ config DRM_KUNIT_TESTQuoted 4 lines
config
DRM_KMS_HELPER
tristate
depends on DRM
+ selectFB_SYS_HELPERS_DEFERREDifDRM_FBDEV_EMULATIONHere, select
FB_SYS_HELPERShelps resolve the above issue mentioned.
Quoted 7 lines
But select
FB_SYS_HELPERShere is more better, I think. Because it show the nature that
DRM_KMS_HELPERis depend onFB_SYS_HELPERS, I think you may want isolatethose dependency with
DRM_FBDEV_EMULATIONguard.at least, you should guarantee that drm itself could built and run standalone.
Indeed, it would be better to select this from DRM_FBDEV_EMULATION. Thanks for the remark. I'll update this in the next version.
Best regards
Thomas
Quoted 281 lines
Fbdev emulation is a client of drm, not reverse.
By the way, does Denial happy about this,
maybe, he want the fbdev emulation 100% made in drm?
Quoted 273 lines
Quoted 272 lines
Quoted 272 lines
help
CRTC helpers for KMS drivers.drivers/gpu/drm/Kconfig +0
-0@@ -135,11 +136,6 @@ config DRM_FBDEV_EMULATIONselect
FB_CFB_FILLRECT
selectFB_CFB_COPYAREA
selectFB_CFB_IMAGEBLIT
- selectFB_DEFERRED_IO
- selectFB_SYS_FOPS
- selectFB_SYS_FILLRECT
- selectFB_SYS_COPYAREA
- selectFB_SYS_IMAGEBLIT
selectFRAMEBUFFER_CONSOLEif !EXPERT
selectFRAMEBUFFER_CONSOLE_DETECT_PRIMARYifFRAMEBUFFER_CONSOLEdefault ydrivers/gpu/drm/drm_fb_helper.c +0
-2@@ -729,113 +729,6 @@ void drm_fb_helper_deferred_io(struct fb_info *info, struct list_head *pagerefli } EXPORT_SYMBOL(drm_fb_helper_deferred_io); -/** -* drm_fb_helper_sys_read - Implements struct &fb_ops.fb_read for system memory
- * @info:fb_infostruct pointer
- * @buf: userspace buffer to read from framebuffer memory
- * @count: number of bytes to read from framebuffer memory
- * @ppos: read offset within framebuffer memory
- *
- * Returns:
- * The number of bytes read on success, or an error code otherwise.
- */drivers/gpu/drm/drm_fb_helper.c +0
-9-ssize_t drm_fb_helper_sys_read (struct fb_info *info,char __user *buf, - size_t count, loff_t *ppos) -{ - return fb_sys_read(info, buf, count, ppos); -} -EXPORT_SYMBOL (drm_fb_helper_sys_read); - -/** -* drm_fb_helper_sys_write - Implements struct &fb_ops.fb_write for system memory
- * @info:fb_infostruct pointer
- * @buf: userspace buffer to write to framebuffer memory
- * @count: number of bytes to write to framebuffer memory
- * @ppos: write offset within framebuffer memory
- *
- * Returns:
- * The number of bytes written on success, or an error code otherwise.
- */
-ssize_t drm_fb_helper_sys_write(structfb_info*info, const char__user*buf,
-size_tcount,loff_t*ppos)drivers/gpu/drm/drm_fb_helper.c +0
-12-{ - struct drm_fb_helper *helper = info->par; - loff_t pos = *ppos; - ssize_t ret; - struct drm_rect damage_area; - - ret = fb_sys_write(info, buf, count, ppos); - if (ret <= 0) - return ret; - - if (helper->funcs->fb_dirty) { - drm_fb_helper_memory_range_to_clip(info, pos, ret,
&damage_area);
- drm_fb_helper_damage(helper, damage_area.x1, damage_area.y1, -drm_rect_width(&damage_area),
-drm_rect_height(&damage_area));
- }drivers/gpu/drm/drm_fb_helper.c +0
-21- - return ret; -} -EXPORT_SYMBOL (drm_fb_helper_sys_write); - -/** -* drm_fb_helper_sys_fillrect - wrapper around sys_fillrect -* @info: fbdev registered by the helper -* @rect: info about rectangle to fill -* -* A wrapper around sys_fillrect implemented by fbdev core -*/ -void drm_fb_helper_sys_fillrect (struct fb_info *info, - const struct fb_fillrect *rect) -{ - struct drm_fb_helper *helper = info->par; - - sys_fillrect(info, rect); - - if (helper->funcs->fb_dirty) - drm_fb_helper_damage(helper, rect->dx, rect->dy,
rect->width,rect->height);drivers/gpu/drm/drm_fb_helper.c +0
-19-} -EXPORT_SYMBOL (drm_fb_helper_sys_fillrect); - -/** -* drm_fb_helper_sys_copyarea - wrapper around sys_copyarea -* @info: fbdev registered by the helper -* @area: info about area to copy -* -* A wrapper around sys_copyarea implemented by fbdev core -*/ -void drm_fb_helper_sys_copyarea (struct fb_info *info, - const struct fb_copyarea *area) -{ - struct drm_fb_helper *helper = info->par; - - sys_copyarea(info, area); - - if (helper->funcs->fb_dirty) - drm_fb_helper_damage(helper, area->dx, area->dy,
area->width,area->height);drivers/gpu/drm/drm_fb_helper.c +0
-19-} -EXPORT_SYMBOL (drm_fb_helper_sys_copyarea); - -/** -* drm_fb_helper_sys_imageblit - wrapper around sys_imageblit -* @info: fbdev registered by the helper -* @image: info about image to blit -* -* A wrapper around sys_imageblit implemented by fbdev core -*/ -void drm_fb_helper_sys_imageblit (struct fb_info *info, - const struct fb_image *image) -{ - struct drm_fb_helper *helper = info->par; - - sys_imageblit(info, image); - - if (helper->funcs->fb_dirty) - drm_fb_helper_damage(helper, image->dx, image->dy,
image->width,image->height);drivers/gpu/drm/drm_fb_helper.c +0
-3-} -EXPORT_SYMBOL (drm_fb_helper_sys_imageblit); -/**
*drm_fb_helper_cfb_read- Implements struct &fb_ops.fb_read for I/O memory
* @info:fb_infostruct pointerdrivers/gpu/drm/drm_fbdev_generic.c +22
-0@@ -34,6 +34,43 @@ static int drm_fbdev_generic_fb_release(struct fb_info *info, int user) return 0; } +static ssize_t drm_fbdev_generic_fb_write (struct fb_info *info,const char __user *buf, + size_t count, loff_t *ppos) +{ + struct drm_fb_helper *helper = info->par; + loff_t pos = *ppos; + ssize_t ret; + + ret = fb_sys_write(info, buf, count, ppos); + if (ret > 0) + drm_fb_helper_damage_range(helper, pos, ret); + return ret; +} + +static void drm_fbdev_generic_fb_fillrect (struct fb_info *info,const struct fb_fillrect *rect) +{ + struct drm_fb_helper *helper = info->par; + + sys_fillrect(info, rect); + drm_fb_helper_damage(helper, rect->dx, rect->dy, rect->width, rect->height); +} + +static void drm_fbdev_generic_fb_copyarea(struct fb_info *info,const struct
fb_copyarea*area)drivers/gpu/drm/drm_fbdev_generic.c +5
-0+{ + struct drm_fb_helper *helper = info->par; + + sys_copyarea(info, area); + drm_fb_helper_damage(helper, area->dx, area->dy, area->width,
area->height);drivers/gpu/drm/drm_fbdev_generic.c +3
-0+} + +static void drm_fbdev_generic_fb_imageblit(struct fb_info *info,const struct
fb_image*image)drivers/gpu/drm/drm_fbdev_generic.c +5
-0+{ + struct drm_fb_helper *helper = info->par; + + sys_imageblit(info, image); + drm_fb_helper_damage(helper, image->dx, image->dy,
image->width,image->height);drivers/gpu/drm/drm_fbdev_generic.c +2
-0+} +static void
drm_fbdev_generic_fb_destroy(struct fb_info *info){
structdrm_fb_helper*fb_helper=info->par;drivers/gpu/drm/drm_fbdev_generic.c +5
-5@@ -56,12 +93,12 @@ static const struct fb_ops drm_fbdev_generic_fb_ops = { .owner = THIS_MODULE, .fb_open = drm_fbdev_generic_fb_open, .fb_release = drm_fbdev_generic_fb_release, - .fb_read = drm_fb_helper_sys_read, - .fb_write = drm_fb_helper_sys_write, + .fb_read = fb_sys_read, + .fb_write = drm_fbdev_generic_fb_write, DRM_FB_HELPER_DEFAULT_OPS, - .fb_fillrect = drm_fb_helper_sys_fillrect, - .fb_copyarea = drm_fb_helper_sys_copyarea, - .fb_imageblit = drm_fb_helper_sys_imageblit, + .fb_fillrect = drm_fbdev_generic_fb_fillrect, + .fb_copyarea = drm_fbdev_generic_fb_copyarea, + .fb_imageblit = drm_fbdev_generic_fb_imageblit, .fb_mmap = fb_deferred_io_mmap, .fb_destroy = drm_fbdev_generic_fb_destroy,};
include/drm/drm_fb_helper.h +0
-0@@ -259,18 +259,6 @@ void drm_fb_helper_damage_range(struct
drm_fb_helper*helper,off_toff,size_t
voiddrm_fb_helper_deferred_io(struct fb_info *info, struct list_head *pagereflist);include/drm/drm_fb_helper.h +0
-3-ssize_t drm_fb_helper_sys_read (struct fb_info *info,char __user *buf, - size_t count, loff_t *ppos); -ssize_t drm_fb_helper_sys_write(struct fb_info *info, const char
__user*buf,
-size_tcount,loff_t*ppos);include/drm/drm_fb_helper.h +0
-8- -void drm_fb_helper_sys_fillrect (struct fb_info *info, - const struct fb_fillrect *rect); -void drm_fb_helper_sys_copyarea (struct fb_info *info, - const struct fb_copyarea *area); -void drm_fb_helper_sys_imageblit (struct fb_info *info, - const struct fb_image *image); -
ssize_tdrm_fb_helper_cfb_read(struct fb_info *info, char __user *buf, size_t count, loff_t *ppos);
ssize_tdrm_fb_helper_cfb_write(structfb_info*info, const char__user*buf,include/drm/drm_fb_helper.h +0
-29@@ -398,35 +386,6 @@ static inline int drm_fb_helper_defio_init(struct drm_fb_helper *fb_helper) return -ENODEV; } -static inline ssize_t drm_fb_helper_sys_read (struct fb_info *info, - char __user *buf, size_t count, - loff_t *ppos) -{ - return -ENODEV; -} - -static inline ssize_t drm_fb_helper_sys_write (struct fb_info *info, - const char __user *buf, - size_t count, loff_t *ppos) -{ - return -ENODEV; -} - -static inline void drm_fb_helper_sys_fillrect (struct fb_info *info, - const struct fb_fillrect *rect) -{ -} - -static inline void drm_fb_helper_sys_copyarea (struct fb_info *info, - const struct fb_copyarea *area) -{ -} - -static inline void drm_fb_helper_sys_imageblit (struct fb_info *info, - const struct fb_image *image) -{ -} - static inline ssize_t drm_fb_helper_cfb_read(struct fb_info *info, char __user *buf, size_t count, loff_t *ppos) {
Signature · 6 lines
Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Frankenstrasse 146, 90461 Nuernberg, Germany GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman HRB 36809 (AG Nuernberg)
Thomas Zimmermann
maintainerPATCH v2 12/12 drm/i915: Implement dedicated fbdev I/O helpers
In reply to Thomas ZimmermannImplement dedicated fbdev helpers for framebuffer I/O instead of using DRM's helpers. i915 was the only caller of the DRM helpers, so remove them from the helper module.
v2:
* use FB_IO_HELPERS options
--- drivers/gpu/drm/Kconfig | 3 - drivers/gpu/drm/drm_fb_helper.c | 107 --------------------- drivers/gpu/drm/i915/Kconfig | 1 + drivers/gpu/drm/i915/display/intel_fbdev.c | 51 ++++++++-- include/drm/drm_fb_helper.h | 39 -------- 5 files changed, 46 insertions(+), 155 deletions(-)
drivers/gpu/drm/Kconfig +0 -3
@@ -133,9 +133,6 @@ config DRM_FBDEV_EMULATION bool "Enable legacy fbdev support for your modesetting driver" depends on DRM_KMS_HELPER depends on FB=y || FB=DRM_KMS_HELPER - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT select FRAMEBUFFER_CONSOLE if !EXPERT select FRAMEBUFFER_CONSOLE_DETECT_PRIMARY if FRAMEBUFFER_CONSOLE default y
drivers/gpu/drm/drm_fb_helper.c +0 -107
113 lines not on this page · raw message
drivers/gpu/drm/i915/Kconfig +1 -0
@@ -17,6 +17,7 @@ config DRM_I915 select DRM_KMS_HELPER select DRM_PANEL select DRM_MIPI_DSI + select FB_IO_HELPERS if DRM_FBDEV_EMULATION select RELAY select I2C select I2C_ALGOBIT
drivers/gpu/drm/i915/display/intel_fbdev.c +45 -6
76 lines not on this page · raw message
include/drm/drm_fb_helper.h +0 -39
@@ -259,18 +259,6 @@ void drm_fb_helper_damage_range(struct drm_fb_helper *helper, off_t off, size_tvoid drm_fb_helper_deferred_io (struct fb_info *info,struct list_head *pagereflist); -ssize_t drm_fb_helper_cfb_read (struct fb_info *info,char __user *buf, -size_t count,loff_t *ppos); -ssize_t drm_fb_helper_cfb_write (struct fb_info *info,const char __user *buf, -size_t count,loff_t *ppos); - -void drm_fb_helper_cfb_fillrect (struct fb_info *info, -const struct fb_fillrect *rect); -void drm_fb_helper_cfb_copyarea (struct fb_info *info, -const struct fb_copyarea *area); -void drm_fb_helper_cfb_imageblit (struct fb_info *info, -const struct fb_image *image); -void drm_fb_helper_set_suspend (struct drm_fb_helper *fb_helper,bool suspend);void drm_fb_helper_set_suspend_unlocked (struct drm_fb_helper *fb_helper,bool suspend);
@@ -386,33 +374,6 @@ static inline int drm_fb_helper_defio_init(struct drm_fb_helper *fb_helper)return -ENODEV ; } -static inline ssize_t drm_fb_helper_cfb_read (struct fb_info *info,char __user *buf, -size_t count,loff_t *ppos) -{ -return -ENODEV ; -} - -static inline ssize_t drm_fb_helper_cfb_write (struct fb_info *info,const char __user *buf, -size_t count,loff_t *ppos) -{ -return -ENODEV ; -} - -static inline void drm_fb_helper_cfb_fillrect (struct fb_info *info, -const struct fb_fillrect *rect) -{ -} - -static inline void drm_fb_helper_cfb_copyarea (struct fb_info *info, -const struct fb_copyarea *area) -{ -} - -static inline void drm_fb_helper_cfb_imageblit (struct fb_info *info, -const struct fb_image *image) -{ -} -static inline void drm_fb_helper_set_suspend (struct drm_fb_helper *fb_helper,bool suspend) {
Signature · 1 line
2.40.1
Patchwork
CI[Intel-gfx] ✗ Fi.CI.BUILD: failure for drm/fbdev: Remove DRM's helpers for fbdev I/O (rev2)
In reply to Thomas Zimmermann== Series Details ==
== Series Details ==
Series: drm/fbdev: Remove DRM's helpers for fbdev I/O (rev2)
URL : https://patchwork.freedesktop.org/series/117671/
State : failure
== Summary ==
Error: make failed
CALL scripts/checksyscalls.sh
DESCEND objtool
INSTALL libsubcmd_headers
MODPOST Module.symvers
ERROR: modpost: "fb_sys_write" [drivers/gpu/drm/drm_kms_helper.ko] undefined!
ERROR: modpost: "sys_imageblit" [drivers/gpu/drm/drm_kms_helper.ko] undefined!
ERROR: modpost: "sys_fillrect" [drivers/gpu/drm/drm_kms_helper.ko] undefined!
ERROR: modpost: "sys_copyarea" [drivers/gpu/drm/drm_kms_helper.ko] undefined!
ERROR: modpost: "fb_sys_read" [drivers/gpu/drm/drm_kms_helper.ko] undefined! make[1]: *** [scripts/Makefile.modpost:136: Module.symvers] Error 1
make: *** [Makefile:1978: modpost] Error 2
Build failed, no error log produced