All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 00/13] drm/fbdev: Remove DRM's helpers for fbdev I/O
@ 2023-05-24  9:21 ` Thomas Zimmermann
  0 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: dri-devel, linux-arm-kernel, linux-samsung-soc, intel-gfx,
	linux-arm-msm, freedreno, amd-gfx, linux-tegra,
	Thomas Zimmermann

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 options that DRM drivers (and
possibly other fbdev code) will use to select the correct set of I/O
helpers. Patch 2 adds initializers for struct fb_ops and generator
macros for the callback functions. These macros will simplify drivers.
This patchset applies the new options and macros to DRM fbdev emulation,
but regular fbdev drivers can use them as well.

Patches 3 to 10 replace the DRM wrappers in a number of fbdev emulations.
Patch 10 exports two helpers for damage handling. Patches 12 and 13
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.

v4:
	* use initializer and generator macros for struct fb_ops
	* partially support damage handling in msm (Dmitri)
v3:
	* fix Kconfig options (Jingfeng)
	* minimize changes to exynos (Sam)
v2:
	* simplify Kconfig handling (Sam)

Thomas Zimmermann (13):
  fbdev: Add Kconfig options to select different fb_ops helpers
  fbdev: Add initializer macros for struct fb_ops
  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      |   7 +-
 drivers/gpu/drm/drm_fb_helper.c            | 236 ++-------------------
 drivers/gpu/drm/drm_fbdev_dma.c            |  11 +-
 drivers/gpu/drm/drm_fbdev_generic.c        |  11 +-
 drivers/gpu/drm/exynos/Kconfig             |   1 +
 drivers/gpu/drm/exynos/exynos_drm_fbdev.c  |   9 +-
 drivers/gpu/drm/gma500/Kconfig             |   1 +
 drivers/gpu/drm/gma500/fbdev.c             |   8 +-
 drivers/gpu/drm/i915/Kconfig               |   1 +
 drivers/gpu/drm/i915/display/intel_fbdev.c |  14 +-
 drivers/gpu/drm/msm/Kconfig                |   1 +
 drivers/gpu/drm/msm/msm_fbdev.c            |  17 +-
 drivers/gpu/drm/omapdrm/Kconfig            |   1 +
 drivers/gpu/drm/omapdrm/omap_fbdev.c       |  11 +-
 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              |   8 +-
 drivers/video/fbdev/Kconfig                |  21 ++
 include/drm/drm_fb_helper.h                |  83 +-------
 include/linux/fb.h                         | 112 ++++++++++
 23 files changed, 212 insertions(+), 363 deletions(-)


base-commit: 216281f91018b24567e59ae46ce7e96fb92063cf
prerequisite-patch-id: 0aa359f6144c4015c140c8a6750be19099c676fb
prerequisite-patch-id: c67e5d886a47b7d0266d81100837557fda34cb24
prerequisite-patch-id: cbc453ee02fae02af22fbfdce56ab732c7a88c36
prerequisite-patch-id: 8bff2b12862e44027a25837ea7510f633d40839e
prerequisite-patch-id: 97ac107455aff4e0ec039d166ecdd2430d20f22e
-- 
2.40.1


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

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

* [Intel-gfx] [PATCH v4 00/13] drm/fbdev: Remove DRM's helpers for fbdev I/O
@ 2023-05-24  9:21 ` Thomas Zimmermann
  0 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: linux-samsung-soc, linux-arm-msm, intel-gfx, dri-devel, amd-gfx,
	Thomas Zimmermann, linux-tegra, freedreno, linux-arm-kernel

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 options that DRM drivers (and
possibly other fbdev code) will use to select the correct set of I/O
helpers. Patch 2 adds initializers for struct fb_ops and generator
macros for the callback functions. These macros will simplify drivers.
This patchset applies the new options and macros to DRM fbdev emulation,
but regular fbdev drivers can use them as well.

Patches 3 to 10 replace the DRM wrappers in a number of fbdev emulations.
Patch 10 exports two helpers for damage handling. Patches 12 and 13
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.

v4:
	* use initializer and generator macros for struct fb_ops
	* partially support damage handling in msm (Dmitri)
v3:
	* fix Kconfig options (Jingfeng)
	* minimize changes to exynos (Sam)
v2:
	* simplify Kconfig handling (Sam)

Thomas Zimmermann (13):
  fbdev: Add Kconfig options to select different fb_ops helpers
  fbdev: Add initializer macros for struct fb_ops
  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      |   7 +-
 drivers/gpu/drm/drm_fb_helper.c            | 236 ++-------------------
 drivers/gpu/drm/drm_fbdev_dma.c            |  11 +-
 drivers/gpu/drm/drm_fbdev_generic.c        |  11 +-
 drivers/gpu/drm/exynos/Kconfig             |   1 +
 drivers/gpu/drm/exynos/exynos_drm_fbdev.c  |   9 +-
 drivers/gpu/drm/gma500/Kconfig             |   1 +
 drivers/gpu/drm/gma500/fbdev.c             |   8 +-
 drivers/gpu/drm/i915/Kconfig               |   1 +
 drivers/gpu/drm/i915/display/intel_fbdev.c |  14 +-
 drivers/gpu/drm/msm/Kconfig                |   1 +
 drivers/gpu/drm/msm/msm_fbdev.c            |  17 +-
 drivers/gpu/drm/omapdrm/Kconfig            |   1 +
 drivers/gpu/drm/omapdrm/omap_fbdev.c       |  11 +-
 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              |   8 +-
 drivers/video/fbdev/Kconfig                |  21 ++
 include/drm/drm_fb_helper.h                |  83 +-------
 include/linux/fb.h                         | 112 ++++++++++
 23 files changed, 212 insertions(+), 363 deletions(-)


base-commit: 216281f91018b24567e59ae46ce7e96fb92063cf
prerequisite-patch-id: 0aa359f6144c4015c140c8a6750be19099c676fb
prerequisite-patch-id: c67e5d886a47b7d0266d81100837557fda34cb24
prerequisite-patch-id: cbc453ee02fae02af22fbfdce56ab732c7a88c36
prerequisite-patch-id: 8bff2b12862e44027a25837ea7510f633d40839e
prerequisite-patch-id: 97ac107455aff4e0ec039d166ecdd2430d20f22e
-- 
2.40.1


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

* [PATCH v4 00/13] drm/fbdev: Remove DRM's helpers for fbdev I/O
@ 2023-05-24  9:21 ` Thomas Zimmermann
  0 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: linux-samsung-soc, linux-arm-msm, intel-gfx, dri-devel, amd-gfx,
	Thomas Zimmermann, linux-tegra, freedreno, linux-arm-kernel

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 options that DRM drivers (and
possibly other fbdev code) will use to select the correct set of I/O
helpers. Patch 2 adds initializers for struct fb_ops and generator
macros for the callback functions. These macros will simplify drivers.
This patchset applies the new options and macros to DRM fbdev emulation,
but regular fbdev drivers can use them as well.

Patches 3 to 10 replace the DRM wrappers in a number of fbdev emulations.
Patch 10 exports two helpers for damage handling. Patches 12 and 13
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.

v4:
	* use initializer and generator macros for struct fb_ops
	* partially support damage handling in msm (Dmitri)
v3:
	* fix Kconfig options (Jingfeng)
	* minimize changes to exynos (Sam)
v2:
	* simplify Kconfig handling (Sam)

Thomas Zimmermann (13):
  fbdev: Add Kconfig options to select different fb_ops helpers
  fbdev: Add initializer macros for struct fb_ops
  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      |   7 +-
 drivers/gpu/drm/drm_fb_helper.c            | 236 ++-------------------
 drivers/gpu/drm/drm_fbdev_dma.c            |  11 +-
 drivers/gpu/drm/drm_fbdev_generic.c        |  11 +-
 drivers/gpu/drm/exynos/Kconfig             |   1 +
 drivers/gpu/drm/exynos/exynos_drm_fbdev.c  |   9 +-
 drivers/gpu/drm/gma500/Kconfig             |   1 +
 drivers/gpu/drm/gma500/fbdev.c             |   8 +-
 drivers/gpu/drm/i915/Kconfig               |   1 +
 drivers/gpu/drm/i915/display/intel_fbdev.c |  14 +-
 drivers/gpu/drm/msm/Kconfig                |   1 +
 drivers/gpu/drm/msm/msm_fbdev.c            |  17 +-
 drivers/gpu/drm/omapdrm/Kconfig            |   1 +
 drivers/gpu/drm/omapdrm/omap_fbdev.c       |  11 +-
 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              |   8 +-
 drivers/video/fbdev/Kconfig                |  21 ++
 include/drm/drm_fb_helper.h                |  83 +-------
 include/linux/fb.h                         | 112 ++++++++++
 23 files changed, 212 insertions(+), 363 deletions(-)


base-commit: 216281f91018b24567e59ae46ce7e96fb92063cf
prerequisite-patch-id: 0aa359f6144c4015c140c8a6750be19099c676fb
prerequisite-patch-id: c67e5d886a47b7d0266d81100837557fda34cb24
prerequisite-patch-id: cbc453ee02fae02af22fbfdce56ab732c7a88c36
prerequisite-patch-id: 8bff2b12862e44027a25837ea7510f633d40839e
prerequisite-patch-id: 97ac107455aff4e0ec039d166ecdd2430d20f22e
-- 
2.40.1


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

* [PATCH v4 00/13] drm/fbdev: Remove DRM's helpers for fbdev I/O
@ 2023-05-24  9:21 ` Thomas Zimmermann
  0 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: dri-devel, linux-arm-kernel, linux-samsung-soc, intel-gfx,
	linux-arm-msm, freedreno, amd-gfx, linux-tegra,
	Thomas Zimmermann

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 options that DRM drivers (and
possibly other fbdev code) will use to select the correct set of I/O
helpers. Patch 2 adds initializers for struct fb_ops and generator
macros for the callback functions. These macros will simplify drivers.
This patchset applies the new options and macros to DRM fbdev emulation,
but regular fbdev drivers can use them as well.

Patches 3 to 10 replace the DRM wrappers in a number of fbdev emulations.
Patch 10 exports two helpers for damage handling. Patches 12 and 13
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.

v4:
	* use initializer and generator macros for struct fb_ops
	* partially support damage handling in msm (Dmitri)
v3:
	* fix Kconfig options (Jingfeng)
	* minimize changes to exynos (Sam)
v2:
	* simplify Kconfig handling (Sam)

Thomas Zimmermann (13):
  fbdev: Add Kconfig options to select different fb_ops helpers
  fbdev: Add initializer macros for struct fb_ops
  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      |   7 +-
 drivers/gpu/drm/drm_fb_helper.c            | 236 ++-------------------
 drivers/gpu/drm/drm_fbdev_dma.c            |  11 +-
 drivers/gpu/drm/drm_fbdev_generic.c        |  11 +-
 drivers/gpu/drm/exynos/Kconfig             |   1 +
 drivers/gpu/drm/exynos/exynos_drm_fbdev.c  |   9 +-
 drivers/gpu/drm/gma500/Kconfig             |   1 +
 drivers/gpu/drm/gma500/fbdev.c             |   8 +-
 drivers/gpu/drm/i915/Kconfig               |   1 +
 drivers/gpu/drm/i915/display/intel_fbdev.c |  14 +-
 drivers/gpu/drm/msm/Kconfig                |   1 +
 drivers/gpu/drm/msm/msm_fbdev.c            |  17 +-
 drivers/gpu/drm/omapdrm/Kconfig            |   1 +
 drivers/gpu/drm/omapdrm/omap_fbdev.c       |  11 +-
 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              |   8 +-
 drivers/video/fbdev/Kconfig                |  21 ++
 include/drm/drm_fb_helper.h                |  83 +-------
 include/linux/fb.h                         | 112 ++++++++++
 23 files changed, 212 insertions(+), 363 deletions(-)


base-commit: 216281f91018b24567e59ae46ce7e96fb92063cf
prerequisite-patch-id: 0aa359f6144c4015c140c8a6750be19099c676fb
prerequisite-patch-id: c67e5d886a47b7d0266d81100837557fda34cb24
prerequisite-patch-id: cbc453ee02fae02af22fbfdce56ab732c7a88c36
prerequisite-patch-id: 8bff2b12862e44027a25837ea7510f633d40839e
prerequisite-patch-id: 97ac107455aff4e0ec039d166ecdd2430d20f22e
-- 
2.40.1


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

* [Intel-gfx] [PATCH v4 01/13] fbdev: Add Kconfig options to select different fb_ops helpers
  2023-05-24  9:21 ` [Intel-gfx] " Thomas Zimmermann
  (?)
  (?)
@ 2023-05-24  9:21   ` Thomas Zimmermann
  -1 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: linux-samsung-soc, linux-arm-msm, intel-gfx, dri-devel, amd-gfx,
	Thomas Zimmermann, linux-tegra, freedreno, linux-arm-kernel

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.

v3:
	* fix select statement (Jingfeng)

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/video/fbdev/Kconfig | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig
index e8889035c882..6df9bd09454a 100644
--- a/drivers/video/fbdev/Kconfig
+++ b/drivers/video/fbdev/Kconfig
@@ -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_HELPERS
+
 config FB_HECUBA
 	tristate
 	depends on FB
-- 
2.40.1


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

* [PATCH v4 01/13] fbdev: Add Kconfig options to select different fb_ops helpers
@ 2023-05-24  9:21   ` Thomas Zimmermann
  0 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: linux-samsung-soc, linux-arm-msm, intel-gfx, dri-devel, amd-gfx,
	Thomas Zimmermann, linux-tegra, freedreno, linux-arm-kernel

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.

v3:
	* fix select statement (Jingfeng)

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/video/fbdev/Kconfig | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig
index e8889035c882..6df9bd09454a 100644
--- a/drivers/video/fbdev/Kconfig
+++ b/drivers/video/fbdev/Kconfig
@@ -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_HELPERS
+
 config FB_HECUBA
 	tristate
 	depends on FB
-- 
2.40.1


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

* [PATCH v4 01/13] fbdev: Add Kconfig options to select different fb_ops helpers
@ 2023-05-24  9:21   ` Thomas Zimmermann
  0 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: dri-devel, linux-arm-kernel, linux-samsung-soc, intel-gfx,
	linux-arm-msm, freedreno, amd-gfx, linux-tegra,
	Thomas Zimmermann

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.

v3:
	* fix select statement (Jingfeng)

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/video/fbdev/Kconfig | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig
index e8889035c882..6df9bd09454a 100644
--- a/drivers/video/fbdev/Kconfig
+++ b/drivers/video/fbdev/Kconfig
@@ -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_HELPERS
+
 config FB_HECUBA
 	tristate
 	depends on FB
-- 
2.40.1


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

* [PATCH v4 01/13] fbdev: Add Kconfig options to select different fb_ops helpers
@ 2023-05-24  9:21   ` Thomas Zimmermann
  0 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: dri-devel, linux-arm-kernel, linux-samsung-soc, intel-gfx,
	linux-arm-msm, freedreno, amd-gfx, linux-tegra,
	Thomas Zimmermann

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.

v3:
	* fix select statement (Jingfeng)

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/video/fbdev/Kconfig | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig
index e8889035c882..6df9bd09454a 100644
--- a/drivers/video/fbdev/Kconfig
+++ b/drivers/video/fbdev/Kconfig
@@ -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_HELPERS
+
 config FB_HECUBA
 	tristate
 	depends on FB
-- 
2.40.1


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

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

* [PATCH v4 02/13] fbdev: Add initializer macros for struct fb_ops
  2023-05-24  9:21 ` [Intel-gfx] " Thomas Zimmermann
  (?)
  (?)
@ 2023-05-24  9:21   ` Thomas Zimmermann
  -1 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: dri-devel, linux-arm-kernel, linux-samsung-soc, intel-gfx,
	linux-arm-msm, freedreno, amd-gfx, linux-tegra,
	Thomas Zimmermann

For framebuffers in I/O and system memory, add macros that set
struct fb_ops to the respective callback functions.

For deferred I/O, add macros that generate callback functions with
damage handling. Add initializer macros that set struct fb_ops to
the generated callbacks.

These macros can remove a lot boilerplate code from fbdev drivers.
The drivers are supposed to use the macro that is required for its
framebuffer. Each macro is split into smaller helpers, so that
drivers with non-standard callbacks can pick and customize callbacks
as needed. There are individual helper macros for read/write, mmap
and drawing.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 include/linux/fb.h | 112 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 112 insertions(+)

diff --git a/include/linux/fb.h b/include/linux/fb.h
index 2cf8efcb9e32..731472a2bb62 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -538,9 +538,31 @@ extern ssize_t fb_io_read(struct fb_info *info, char __user *buf,
 extern ssize_t fb_io_write(struct fb_info *info, const char __user *buf,
 			   size_t count, loff_t *ppos);
 
+/*
+ * Initializes struct fb_ops for framebuffers in I/O memory.
+ */
+
+#define __FB_DEFAULT_IO_OPS_RDWR \
+	.fb_read	= fb_io_read, \
+	.fb_write	= fb_io_write
+
+#define __FB_DEFAULT_IO_OPS_DRAW \
+        .fb_fillrect	= cfb_fillrect, \
+        .fb_copyarea	= cfb_copyarea, \
+        .fb_imageblit	= cfb_imageblit
+
+#define __FB_DEFAULT_IO_OPS_MMAP \
+	.fb_mmap	= NULL // default implementation
+
+#define FB_DEFAULT_IO_OPS \
+	__FB_DEFAULT_IO_OPS_RDWR, \
+	__FB_DEFAULT_IO_OPS_DRAW, \
+	__FB_DEFAULT_IO_OPS_MMAP
+
 /*
  * Drawing operations where framebuffer is in system RAM
  */
+
 extern void sys_fillrect(struct fb_info *info, const struct fb_fillrect *rect);
 extern void sys_copyarea(struct fb_info *info, const struct fb_copyarea *area);
 extern void sys_imageblit(struct fb_info *info, const struct fb_image *image);
@@ -549,6 +571,27 @@ extern ssize_t fb_sys_read(struct fb_info *info, char __user *buf,
 extern ssize_t fb_sys_write(struct fb_info *info, const char __user *buf,
 			    size_t count, loff_t *ppos);
 
+/*
+ * Initializes struct fb_ops for framebuffers in system memory.
+ */
+
+#define __FB_DEFAULT_SYS_OPS_RDWR \
+	.fb_read	= fb_sys_read, \
+	.fb_write	= fb_sys_write
+
+#define __FB_DEFAULT_SYS_OPS_DRAW \
+        .fb_fillrect	= sys_fillrect, \
+        .fb_copyarea	= sys_copyarea, \
+        .fb_imageblit	= sys_imageblit
+
+#define __FB_DEFAULT_SYS_OPS_MMAP \
+	.fb_mmap	= NULL // default implementation
+
+#define FB_DEFAULT_SYS_OPS \
+	__FB_DEFAULT_SYS_OPS_RDWR, \
+	__FB_DEFAULT_SYS_OPS_DRAW, \
+	__FB_DEFAULT_SYS_OPS_MMAP
+
 /* drivers/video/fbmem.c */
 extern int register_framebuffer(struct fb_info *fb_info);
 extern void unregister_framebuffer(struct fb_info *fb_info);
@@ -604,6 +647,75 @@ extern void fb_deferred_io_cleanup(struct fb_info *info);
 extern int fb_deferred_io_fsync(struct file *file, loff_t start,
 				loff_t end, int datasync);
 
+/*
+ * Generate callbacks for deferred I/O
+ */
+
+#define __FB_GEN_DEFAULT_DEFERRED_OPS_RDWR(__prefix, __damage_range, __mode) \
+	static ssize_t __prefix ## _defio_read(struct fb_info *info, char __user *buf, \
+					       size_t count, loff_t *ppos) \
+	{ \
+		return fb_ ## __mode ## _read(info, buf, count, ppos); \
+	} \
+	static ssize_t __prefix ## _defio_write(struct fb_info *info, const char __user *buf, \
+						size_t count, loff_t *ppos) \
+	{ \
+		unsigned long offset = *ppos; \
+		ssize_t ret = fb_ ## __mode ## _write(info, buf, count, ppos); \
+		if (ret > 0) \
+			__damage_range(info, offset, ret); \
+		return ret; \
+	}
+
+#define __FB_GEN_DEFAULT_DEFERRED_OPS_DRAW(__prefix, __damage_area, __mode) \
+	static void __prefix ## _defio_fillrect(struct fb_info *info, \
+						const struct fb_fillrect *rect) \
+	{ \
+		__mode ## _fillrect(info, rect); \
+		__damage_area(info, rect->dx, rect->dy, rect->width, rect->height); \
+	} \
+	static void __prefix ## _defio_copyarea(struct fb_info *info, \
+						const struct fb_copyarea *area) \
+	{ \
+		__mode ## _copyarea(info, area); \
+		__damage_area(info, area->dx, area->dy, area->width, area->height); \
+	} \
+	static void __prefix ## _defio_imageblit(struct fb_info *info, \
+						 const struct fb_image *image) \
+	{ \
+		__mode ## _imageblit(info, image); \
+		__damage_area(info, image->dx, image->dy, image->width, image->height); \
+	}
+
+#define FB_GEN_DEFAULT_DEFERRED_IO_OPS(__prefix, __damage_range, __damage_area) \
+	__FB_GEN_DEFAULT_DEFERRED_OPS_RDWR(__prefix, __damage_range, io) \
+	__FB_GEN_DEFAULT_DEFERRED_OPS_DRAW(__prefix, __damage_area, cfb)
+
+#define FB_GEN_DEFAULT_DEFERRED_SYS_OPS(__prefix, __damage_range, __damage_area) \
+	__FB_GEN_DEFAULT_DEFERRED_OPS_RDWR(__prefix, __damage_range, sys) \
+	__FB_GEN_DEFAULT_DEFERRED_OPS_DRAW(__prefix, __damage_area, sys)
+
+/*
+ * Initializes struct fb_ops for deferred I/O.
+ */
+
+#define __FB_DEFAULT_DEFERRED_OPS_RDWR(__prefix) \
+	.fb_read	= __prefix ## _defio_read, \
+	.fb_write	= __prefix ## _defio_write
+
+#define __FB_DEFAULT_DEFERRED_OPS_DRAW(__prefix) \
+        .fb_fillrect	= __prefix ## _defio_fillrect, \
+        .fb_copyarea	= __prefix ## _defio_copyarea, \
+        .fb_imageblit	= __prefix ## _defio_imageblit
+
+#define __FB_DEFAULT_DEFERRED_OPS_MMAP(__prefix) \
+	.fb_mmap	= fb_deferred_io_mmap
+
+#define FB_DEFAULT_DEFERRED_OPS(__prefix) \
+	__FB_DEFAULT_DEFERRED_OPS_RDWR(__prefix), \
+	__FB_DEFAULT_DEFERRED_OPS_DRAW(__prefix), \
+	__FB_DEFAULT_DEFERRED_OPS_MMAP(__prefix)
+
 static inline bool fb_be_math(struct fb_info *info)
 {
 #ifdef CONFIG_FB_FOREIGN_ENDIAN
-- 
2.40.1


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

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

* [Intel-gfx] [PATCH v4 02/13] fbdev: Add initializer macros for struct fb_ops
@ 2023-05-24  9:21   ` Thomas Zimmermann
  0 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: linux-samsung-soc, linux-arm-msm, intel-gfx, dri-devel, amd-gfx,
	Thomas Zimmermann, linux-tegra, freedreno, linux-arm-kernel

For framebuffers in I/O and system memory, add macros that set
struct fb_ops to the respective callback functions.

For deferred I/O, add macros that generate callback functions with
damage handling. Add initializer macros that set struct fb_ops to
the generated callbacks.

These macros can remove a lot boilerplate code from fbdev drivers.
The drivers are supposed to use the macro that is required for its
framebuffer. Each macro is split into smaller helpers, so that
drivers with non-standard callbacks can pick and customize callbacks
as needed. There are individual helper macros for read/write, mmap
and drawing.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 include/linux/fb.h | 112 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 112 insertions(+)

diff --git a/include/linux/fb.h b/include/linux/fb.h
index 2cf8efcb9e32..731472a2bb62 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -538,9 +538,31 @@ extern ssize_t fb_io_read(struct fb_info *info, char __user *buf,
 extern ssize_t fb_io_write(struct fb_info *info, const char __user *buf,
 			   size_t count, loff_t *ppos);
 
+/*
+ * Initializes struct fb_ops for framebuffers in I/O memory.
+ */
+
+#define __FB_DEFAULT_IO_OPS_RDWR \
+	.fb_read	= fb_io_read, \
+	.fb_write	= fb_io_write
+
+#define __FB_DEFAULT_IO_OPS_DRAW \
+        .fb_fillrect	= cfb_fillrect, \
+        .fb_copyarea	= cfb_copyarea, \
+        .fb_imageblit	= cfb_imageblit
+
+#define __FB_DEFAULT_IO_OPS_MMAP \
+	.fb_mmap	= NULL // default implementation
+
+#define FB_DEFAULT_IO_OPS \
+	__FB_DEFAULT_IO_OPS_RDWR, \
+	__FB_DEFAULT_IO_OPS_DRAW, \
+	__FB_DEFAULT_IO_OPS_MMAP
+
 /*
  * Drawing operations where framebuffer is in system RAM
  */
+
 extern void sys_fillrect(struct fb_info *info, const struct fb_fillrect *rect);
 extern void sys_copyarea(struct fb_info *info, const struct fb_copyarea *area);
 extern void sys_imageblit(struct fb_info *info, const struct fb_image *image);
@@ -549,6 +571,27 @@ extern ssize_t fb_sys_read(struct fb_info *info, char __user *buf,
 extern ssize_t fb_sys_write(struct fb_info *info, const char __user *buf,
 			    size_t count, loff_t *ppos);
 
+/*
+ * Initializes struct fb_ops for framebuffers in system memory.
+ */
+
+#define __FB_DEFAULT_SYS_OPS_RDWR \
+	.fb_read	= fb_sys_read, \
+	.fb_write	= fb_sys_write
+
+#define __FB_DEFAULT_SYS_OPS_DRAW \
+        .fb_fillrect	= sys_fillrect, \
+        .fb_copyarea	= sys_copyarea, \
+        .fb_imageblit	= sys_imageblit
+
+#define __FB_DEFAULT_SYS_OPS_MMAP \
+	.fb_mmap	= NULL // default implementation
+
+#define FB_DEFAULT_SYS_OPS \
+	__FB_DEFAULT_SYS_OPS_RDWR, \
+	__FB_DEFAULT_SYS_OPS_DRAW, \
+	__FB_DEFAULT_SYS_OPS_MMAP
+
 /* drivers/video/fbmem.c */
 extern int register_framebuffer(struct fb_info *fb_info);
 extern void unregister_framebuffer(struct fb_info *fb_info);
@@ -604,6 +647,75 @@ extern void fb_deferred_io_cleanup(struct fb_info *info);
 extern int fb_deferred_io_fsync(struct file *file, loff_t start,
 				loff_t end, int datasync);
 
+/*
+ * Generate callbacks for deferred I/O
+ */
+
+#define __FB_GEN_DEFAULT_DEFERRED_OPS_RDWR(__prefix, __damage_range, __mode) \
+	static ssize_t __prefix ## _defio_read(struct fb_info *info, char __user *buf, \
+					       size_t count, loff_t *ppos) \
+	{ \
+		return fb_ ## __mode ## _read(info, buf, count, ppos); \
+	} \
+	static ssize_t __prefix ## _defio_write(struct fb_info *info, const char __user *buf, \
+						size_t count, loff_t *ppos) \
+	{ \
+		unsigned long offset = *ppos; \
+		ssize_t ret = fb_ ## __mode ## _write(info, buf, count, ppos); \
+		if (ret > 0) \
+			__damage_range(info, offset, ret); \
+		return ret; \
+	}
+
+#define __FB_GEN_DEFAULT_DEFERRED_OPS_DRAW(__prefix, __damage_area, __mode) \
+	static void __prefix ## _defio_fillrect(struct fb_info *info, \
+						const struct fb_fillrect *rect) \
+	{ \
+		__mode ## _fillrect(info, rect); \
+		__damage_area(info, rect->dx, rect->dy, rect->width, rect->height); \
+	} \
+	static void __prefix ## _defio_copyarea(struct fb_info *info, \
+						const struct fb_copyarea *area) \
+	{ \
+		__mode ## _copyarea(info, area); \
+		__damage_area(info, area->dx, area->dy, area->width, area->height); \
+	} \
+	static void __prefix ## _defio_imageblit(struct fb_info *info, \
+						 const struct fb_image *image) \
+	{ \
+		__mode ## _imageblit(info, image); \
+		__damage_area(info, image->dx, image->dy, image->width, image->height); \
+	}
+
+#define FB_GEN_DEFAULT_DEFERRED_IO_OPS(__prefix, __damage_range, __damage_area) \
+	__FB_GEN_DEFAULT_DEFERRED_OPS_RDWR(__prefix, __damage_range, io) \
+	__FB_GEN_DEFAULT_DEFERRED_OPS_DRAW(__prefix, __damage_area, cfb)
+
+#define FB_GEN_DEFAULT_DEFERRED_SYS_OPS(__prefix, __damage_range, __damage_area) \
+	__FB_GEN_DEFAULT_DEFERRED_OPS_RDWR(__prefix, __damage_range, sys) \
+	__FB_GEN_DEFAULT_DEFERRED_OPS_DRAW(__prefix, __damage_area, sys)
+
+/*
+ * Initializes struct fb_ops for deferred I/O.
+ */
+
+#define __FB_DEFAULT_DEFERRED_OPS_RDWR(__prefix) \
+	.fb_read	= __prefix ## _defio_read, \
+	.fb_write	= __prefix ## _defio_write
+
+#define __FB_DEFAULT_DEFERRED_OPS_DRAW(__prefix) \
+        .fb_fillrect	= __prefix ## _defio_fillrect, \
+        .fb_copyarea	= __prefix ## _defio_copyarea, \
+        .fb_imageblit	= __prefix ## _defio_imageblit
+
+#define __FB_DEFAULT_DEFERRED_OPS_MMAP(__prefix) \
+	.fb_mmap	= fb_deferred_io_mmap
+
+#define FB_DEFAULT_DEFERRED_OPS(__prefix) \
+	__FB_DEFAULT_DEFERRED_OPS_RDWR(__prefix), \
+	__FB_DEFAULT_DEFERRED_OPS_DRAW(__prefix), \
+	__FB_DEFAULT_DEFERRED_OPS_MMAP(__prefix)
+
 static inline bool fb_be_math(struct fb_info *info)
 {
 #ifdef CONFIG_FB_FOREIGN_ENDIAN
-- 
2.40.1


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

* [PATCH v4 02/13] fbdev: Add initializer macros for struct fb_ops
@ 2023-05-24  9:21   ` Thomas Zimmermann
  0 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: linux-samsung-soc, linux-arm-msm, intel-gfx, dri-devel, amd-gfx,
	Thomas Zimmermann, linux-tegra, freedreno, linux-arm-kernel

For framebuffers in I/O and system memory, add macros that set
struct fb_ops to the respective callback functions.

For deferred I/O, add macros that generate callback functions with
damage handling. Add initializer macros that set struct fb_ops to
the generated callbacks.

These macros can remove a lot boilerplate code from fbdev drivers.
The drivers are supposed to use the macro that is required for its
framebuffer. Each macro is split into smaller helpers, so that
drivers with non-standard callbacks can pick and customize callbacks
as needed. There are individual helper macros for read/write, mmap
and drawing.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 include/linux/fb.h | 112 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 112 insertions(+)

diff --git a/include/linux/fb.h b/include/linux/fb.h
index 2cf8efcb9e32..731472a2bb62 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -538,9 +538,31 @@ extern ssize_t fb_io_read(struct fb_info *info, char __user *buf,
 extern ssize_t fb_io_write(struct fb_info *info, const char __user *buf,
 			   size_t count, loff_t *ppos);
 
+/*
+ * Initializes struct fb_ops for framebuffers in I/O memory.
+ */
+
+#define __FB_DEFAULT_IO_OPS_RDWR \
+	.fb_read	= fb_io_read, \
+	.fb_write	= fb_io_write
+
+#define __FB_DEFAULT_IO_OPS_DRAW \
+        .fb_fillrect	= cfb_fillrect, \
+        .fb_copyarea	= cfb_copyarea, \
+        .fb_imageblit	= cfb_imageblit
+
+#define __FB_DEFAULT_IO_OPS_MMAP \
+	.fb_mmap	= NULL // default implementation
+
+#define FB_DEFAULT_IO_OPS \
+	__FB_DEFAULT_IO_OPS_RDWR, \
+	__FB_DEFAULT_IO_OPS_DRAW, \
+	__FB_DEFAULT_IO_OPS_MMAP
+
 /*
  * Drawing operations where framebuffer is in system RAM
  */
+
 extern void sys_fillrect(struct fb_info *info, const struct fb_fillrect *rect);
 extern void sys_copyarea(struct fb_info *info, const struct fb_copyarea *area);
 extern void sys_imageblit(struct fb_info *info, const struct fb_image *image);
@@ -549,6 +571,27 @@ extern ssize_t fb_sys_read(struct fb_info *info, char __user *buf,
 extern ssize_t fb_sys_write(struct fb_info *info, const char __user *buf,
 			    size_t count, loff_t *ppos);
 
+/*
+ * Initializes struct fb_ops for framebuffers in system memory.
+ */
+
+#define __FB_DEFAULT_SYS_OPS_RDWR \
+	.fb_read	= fb_sys_read, \
+	.fb_write	= fb_sys_write
+
+#define __FB_DEFAULT_SYS_OPS_DRAW \
+        .fb_fillrect	= sys_fillrect, \
+        .fb_copyarea	= sys_copyarea, \
+        .fb_imageblit	= sys_imageblit
+
+#define __FB_DEFAULT_SYS_OPS_MMAP \
+	.fb_mmap	= NULL // default implementation
+
+#define FB_DEFAULT_SYS_OPS \
+	__FB_DEFAULT_SYS_OPS_RDWR, \
+	__FB_DEFAULT_SYS_OPS_DRAW, \
+	__FB_DEFAULT_SYS_OPS_MMAP
+
 /* drivers/video/fbmem.c */
 extern int register_framebuffer(struct fb_info *fb_info);
 extern void unregister_framebuffer(struct fb_info *fb_info);
@@ -604,6 +647,75 @@ extern void fb_deferred_io_cleanup(struct fb_info *info);
 extern int fb_deferred_io_fsync(struct file *file, loff_t start,
 				loff_t end, int datasync);
 
+/*
+ * Generate callbacks for deferred I/O
+ */
+
+#define __FB_GEN_DEFAULT_DEFERRED_OPS_RDWR(__prefix, __damage_range, __mode) \
+	static ssize_t __prefix ## _defio_read(struct fb_info *info, char __user *buf, \
+					       size_t count, loff_t *ppos) \
+	{ \
+		return fb_ ## __mode ## _read(info, buf, count, ppos); \
+	} \
+	static ssize_t __prefix ## _defio_write(struct fb_info *info, const char __user *buf, \
+						size_t count, loff_t *ppos) \
+	{ \
+		unsigned long offset = *ppos; \
+		ssize_t ret = fb_ ## __mode ## _write(info, buf, count, ppos); \
+		if (ret > 0) \
+			__damage_range(info, offset, ret); \
+		return ret; \
+	}
+
+#define __FB_GEN_DEFAULT_DEFERRED_OPS_DRAW(__prefix, __damage_area, __mode) \
+	static void __prefix ## _defio_fillrect(struct fb_info *info, \
+						const struct fb_fillrect *rect) \
+	{ \
+		__mode ## _fillrect(info, rect); \
+		__damage_area(info, rect->dx, rect->dy, rect->width, rect->height); \
+	} \
+	static void __prefix ## _defio_copyarea(struct fb_info *info, \
+						const struct fb_copyarea *area) \
+	{ \
+		__mode ## _copyarea(info, area); \
+		__damage_area(info, area->dx, area->dy, area->width, area->height); \
+	} \
+	static void __prefix ## _defio_imageblit(struct fb_info *info, \
+						 const struct fb_image *image) \
+	{ \
+		__mode ## _imageblit(info, image); \
+		__damage_area(info, image->dx, image->dy, image->width, image->height); \
+	}
+
+#define FB_GEN_DEFAULT_DEFERRED_IO_OPS(__prefix, __damage_range, __damage_area) \
+	__FB_GEN_DEFAULT_DEFERRED_OPS_RDWR(__prefix, __damage_range, io) \
+	__FB_GEN_DEFAULT_DEFERRED_OPS_DRAW(__prefix, __damage_area, cfb)
+
+#define FB_GEN_DEFAULT_DEFERRED_SYS_OPS(__prefix, __damage_range, __damage_area) \
+	__FB_GEN_DEFAULT_DEFERRED_OPS_RDWR(__prefix, __damage_range, sys) \
+	__FB_GEN_DEFAULT_DEFERRED_OPS_DRAW(__prefix, __damage_area, sys)
+
+/*
+ * Initializes struct fb_ops for deferred I/O.
+ */
+
+#define __FB_DEFAULT_DEFERRED_OPS_RDWR(__prefix) \
+	.fb_read	= __prefix ## _defio_read, \
+	.fb_write	= __prefix ## _defio_write
+
+#define __FB_DEFAULT_DEFERRED_OPS_DRAW(__prefix) \
+        .fb_fillrect	= __prefix ## _defio_fillrect, \
+        .fb_copyarea	= __prefix ## _defio_copyarea, \
+        .fb_imageblit	= __prefix ## _defio_imageblit
+
+#define __FB_DEFAULT_DEFERRED_OPS_MMAP(__prefix) \
+	.fb_mmap	= fb_deferred_io_mmap
+
+#define FB_DEFAULT_DEFERRED_OPS(__prefix) \
+	__FB_DEFAULT_DEFERRED_OPS_RDWR(__prefix), \
+	__FB_DEFAULT_DEFERRED_OPS_DRAW(__prefix), \
+	__FB_DEFAULT_DEFERRED_OPS_MMAP(__prefix)
+
 static inline bool fb_be_math(struct fb_info *info)
 {
 #ifdef CONFIG_FB_FOREIGN_ENDIAN
-- 
2.40.1


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

* [PATCH v4 02/13] fbdev: Add initializer macros for struct fb_ops
@ 2023-05-24  9:21   ` Thomas Zimmermann
  0 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: dri-devel, linux-arm-kernel, linux-samsung-soc, intel-gfx,
	linux-arm-msm, freedreno, amd-gfx, linux-tegra,
	Thomas Zimmermann

For framebuffers in I/O and system memory, add macros that set
struct fb_ops to the respective callback functions.

For deferred I/O, add macros that generate callback functions with
damage handling. Add initializer macros that set struct fb_ops to
the generated callbacks.

These macros can remove a lot boilerplate code from fbdev drivers.
The drivers are supposed to use the macro that is required for its
framebuffer. Each macro is split into smaller helpers, so that
drivers with non-standard callbacks can pick and customize callbacks
as needed. There are individual helper macros for read/write, mmap
and drawing.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 include/linux/fb.h | 112 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 112 insertions(+)

diff --git a/include/linux/fb.h b/include/linux/fb.h
index 2cf8efcb9e32..731472a2bb62 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -538,9 +538,31 @@ extern ssize_t fb_io_read(struct fb_info *info, char __user *buf,
 extern ssize_t fb_io_write(struct fb_info *info, const char __user *buf,
 			   size_t count, loff_t *ppos);
 
+/*
+ * Initializes struct fb_ops for framebuffers in I/O memory.
+ */
+
+#define __FB_DEFAULT_IO_OPS_RDWR \
+	.fb_read	= fb_io_read, \
+	.fb_write	= fb_io_write
+
+#define __FB_DEFAULT_IO_OPS_DRAW \
+        .fb_fillrect	= cfb_fillrect, \
+        .fb_copyarea	= cfb_copyarea, \
+        .fb_imageblit	= cfb_imageblit
+
+#define __FB_DEFAULT_IO_OPS_MMAP \
+	.fb_mmap	= NULL // default implementation
+
+#define FB_DEFAULT_IO_OPS \
+	__FB_DEFAULT_IO_OPS_RDWR, \
+	__FB_DEFAULT_IO_OPS_DRAW, \
+	__FB_DEFAULT_IO_OPS_MMAP
+
 /*
  * Drawing operations where framebuffer is in system RAM
  */
+
 extern void sys_fillrect(struct fb_info *info, const struct fb_fillrect *rect);
 extern void sys_copyarea(struct fb_info *info, const struct fb_copyarea *area);
 extern void sys_imageblit(struct fb_info *info, const struct fb_image *image);
@@ -549,6 +571,27 @@ extern ssize_t fb_sys_read(struct fb_info *info, char __user *buf,
 extern ssize_t fb_sys_write(struct fb_info *info, const char __user *buf,
 			    size_t count, loff_t *ppos);
 
+/*
+ * Initializes struct fb_ops for framebuffers in system memory.
+ */
+
+#define __FB_DEFAULT_SYS_OPS_RDWR \
+	.fb_read	= fb_sys_read, \
+	.fb_write	= fb_sys_write
+
+#define __FB_DEFAULT_SYS_OPS_DRAW \
+        .fb_fillrect	= sys_fillrect, \
+        .fb_copyarea	= sys_copyarea, \
+        .fb_imageblit	= sys_imageblit
+
+#define __FB_DEFAULT_SYS_OPS_MMAP \
+	.fb_mmap	= NULL // default implementation
+
+#define FB_DEFAULT_SYS_OPS \
+	__FB_DEFAULT_SYS_OPS_RDWR, \
+	__FB_DEFAULT_SYS_OPS_DRAW, \
+	__FB_DEFAULT_SYS_OPS_MMAP
+
 /* drivers/video/fbmem.c */
 extern int register_framebuffer(struct fb_info *fb_info);
 extern void unregister_framebuffer(struct fb_info *fb_info);
@@ -604,6 +647,75 @@ extern void fb_deferred_io_cleanup(struct fb_info *info);
 extern int fb_deferred_io_fsync(struct file *file, loff_t start,
 				loff_t end, int datasync);
 
+/*
+ * Generate callbacks for deferred I/O
+ */
+
+#define __FB_GEN_DEFAULT_DEFERRED_OPS_RDWR(__prefix, __damage_range, __mode) \
+	static ssize_t __prefix ## _defio_read(struct fb_info *info, char __user *buf, \
+					       size_t count, loff_t *ppos) \
+	{ \
+		return fb_ ## __mode ## _read(info, buf, count, ppos); \
+	} \
+	static ssize_t __prefix ## _defio_write(struct fb_info *info, const char __user *buf, \
+						size_t count, loff_t *ppos) \
+	{ \
+		unsigned long offset = *ppos; \
+		ssize_t ret = fb_ ## __mode ## _write(info, buf, count, ppos); \
+		if (ret > 0) \
+			__damage_range(info, offset, ret); \
+		return ret; \
+	}
+
+#define __FB_GEN_DEFAULT_DEFERRED_OPS_DRAW(__prefix, __damage_area, __mode) \
+	static void __prefix ## _defio_fillrect(struct fb_info *info, \
+						const struct fb_fillrect *rect) \
+	{ \
+		__mode ## _fillrect(info, rect); \
+		__damage_area(info, rect->dx, rect->dy, rect->width, rect->height); \
+	} \
+	static void __prefix ## _defio_copyarea(struct fb_info *info, \
+						const struct fb_copyarea *area) \
+	{ \
+		__mode ## _copyarea(info, area); \
+		__damage_area(info, area->dx, area->dy, area->width, area->height); \
+	} \
+	static void __prefix ## _defio_imageblit(struct fb_info *info, \
+						 const struct fb_image *image) \
+	{ \
+		__mode ## _imageblit(info, image); \
+		__damage_area(info, image->dx, image->dy, image->width, image->height); \
+	}
+
+#define FB_GEN_DEFAULT_DEFERRED_IO_OPS(__prefix, __damage_range, __damage_area) \
+	__FB_GEN_DEFAULT_DEFERRED_OPS_RDWR(__prefix, __damage_range, io) \
+	__FB_GEN_DEFAULT_DEFERRED_OPS_DRAW(__prefix, __damage_area, cfb)
+
+#define FB_GEN_DEFAULT_DEFERRED_SYS_OPS(__prefix, __damage_range, __damage_area) \
+	__FB_GEN_DEFAULT_DEFERRED_OPS_RDWR(__prefix, __damage_range, sys) \
+	__FB_GEN_DEFAULT_DEFERRED_OPS_DRAW(__prefix, __damage_area, sys)
+
+/*
+ * Initializes struct fb_ops for deferred I/O.
+ */
+
+#define __FB_DEFAULT_DEFERRED_OPS_RDWR(__prefix) \
+	.fb_read	= __prefix ## _defio_read, \
+	.fb_write	= __prefix ## _defio_write
+
+#define __FB_DEFAULT_DEFERRED_OPS_DRAW(__prefix) \
+        .fb_fillrect	= __prefix ## _defio_fillrect, \
+        .fb_copyarea	= __prefix ## _defio_copyarea, \
+        .fb_imageblit	= __prefix ## _defio_imageblit
+
+#define __FB_DEFAULT_DEFERRED_OPS_MMAP(__prefix) \
+	.fb_mmap	= fb_deferred_io_mmap
+
+#define FB_DEFAULT_DEFERRED_OPS(__prefix) \
+	__FB_DEFAULT_DEFERRED_OPS_RDWR(__prefix), \
+	__FB_DEFAULT_DEFERRED_OPS_DRAW(__prefix), \
+	__FB_DEFAULT_DEFERRED_OPS_MMAP(__prefix)
+
 static inline bool fb_be_math(struct fb_info *info)
 {
 #ifdef CONFIG_FB_FOREIGN_ENDIAN
-- 
2.40.1


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

* [Intel-gfx] [PATCH v4 03/13] drm/armada: Use regular fbdev I/O helpers
  2023-05-24  9:21 ` [Intel-gfx] " Thomas Zimmermann
  (?)
  (?)
@ 2023-05-24  9:21   ` Thomas Zimmermann
  -1 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: linux-samsung-soc, linux-arm-msm, intel-gfx, Russell King,
	dri-devel, amd-gfx, Thomas Zimmermann, linux-tegra, freedreno,
	linux-arm-kernel

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.

v4:
	* use initializer macros for struct fb_ops
v2:
	* use FB_IO_HELPERS option

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Russell King <linux@armlinux.org.uk>
---
 drivers/gpu/drm/armada/Kconfig        | 1 +
 drivers/gpu/drm/armada/armada_fbdev.c | 7 ++-----
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/armada/Kconfig b/drivers/gpu/drm/armada/Kconfig
index f5c66d89ba99..5afade25e217 100644
--- a/drivers/gpu/drm/armada/Kconfig
+++ b/drivers/gpu/drm/armada/Kconfig
@@ -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
diff --git a/drivers/gpu/drm/armada/armada_fbdev.c b/drivers/gpu/drm/armada/armada_fbdev.c
index 0a5fd1aa86eb..3943e89cc06c 100644
--- a/drivers/gpu/drm/armada/armada_fbdev.c
+++ b/drivers/gpu/drm/armada/armada_fbdev.c
@@ -5,6 +5,7 @@
  */
 
 #include <linux/errno.h>
+#include <linux/fb.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 
@@ -33,12 +34,8 @@ static void armada_fbdev_fb_destroy(struct fb_info *info)
 
 static const struct fb_ops armada_fb_ops = {
 	.owner		= THIS_MODULE,
+	FB_DEFAULT_IO_OPS,
 	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_destroy	= armada_fbdev_fb_destroy,
 };
 
-- 
2.40.1


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

* [PATCH v4 03/13] drm/armada: Use regular fbdev I/O helpers
@ 2023-05-24  9:21   ` Thomas Zimmermann
  0 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: linux-samsung-soc, linux-arm-msm, intel-gfx, Russell King,
	dri-devel, amd-gfx, Thomas Zimmermann, linux-tegra, freedreno,
	linux-arm-kernel

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.

v4:
	* use initializer macros for struct fb_ops
v2:
	* use FB_IO_HELPERS option

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Russell King <linux@armlinux.org.uk>
---
 drivers/gpu/drm/armada/Kconfig        | 1 +
 drivers/gpu/drm/armada/armada_fbdev.c | 7 ++-----
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/armada/Kconfig b/drivers/gpu/drm/armada/Kconfig
index f5c66d89ba99..5afade25e217 100644
--- a/drivers/gpu/drm/armada/Kconfig
+++ b/drivers/gpu/drm/armada/Kconfig
@@ -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
diff --git a/drivers/gpu/drm/armada/armada_fbdev.c b/drivers/gpu/drm/armada/armada_fbdev.c
index 0a5fd1aa86eb..3943e89cc06c 100644
--- a/drivers/gpu/drm/armada/armada_fbdev.c
+++ b/drivers/gpu/drm/armada/armada_fbdev.c
@@ -5,6 +5,7 @@
  */
 
 #include <linux/errno.h>
+#include <linux/fb.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 
@@ -33,12 +34,8 @@ static void armada_fbdev_fb_destroy(struct fb_info *info)
 
 static const struct fb_ops armada_fb_ops = {
 	.owner		= THIS_MODULE,
+	FB_DEFAULT_IO_OPS,
 	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_destroy	= armada_fbdev_fb_destroy,
 };
 
-- 
2.40.1


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

* [PATCH v4 03/13] drm/armada: Use regular fbdev I/O helpers
@ 2023-05-24  9:21   ` Thomas Zimmermann
  0 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: dri-devel, linux-arm-kernel, linux-samsung-soc, intel-gfx,
	linux-arm-msm, freedreno, amd-gfx, linux-tegra,
	Thomas Zimmermann, Russell King

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.

v4:
	* use initializer macros for struct fb_ops
v2:
	* use FB_IO_HELPERS option

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Russell King <linux@armlinux.org.uk>
---
 drivers/gpu/drm/armada/Kconfig        | 1 +
 drivers/gpu/drm/armada/armada_fbdev.c | 7 ++-----
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/armada/Kconfig b/drivers/gpu/drm/armada/Kconfig
index f5c66d89ba99..5afade25e217 100644
--- a/drivers/gpu/drm/armada/Kconfig
+++ b/drivers/gpu/drm/armada/Kconfig
@@ -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
diff --git a/drivers/gpu/drm/armada/armada_fbdev.c b/drivers/gpu/drm/armada/armada_fbdev.c
index 0a5fd1aa86eb..3943e89cc06c 100644
--- a/drivers/gpu/drm/armada/armada_fbdev.c
+++ b/drivers/gpu/drm/armada/armada_fbdev.c
@@ -5,6 +5,7 @@
  */
 
 #include <linux/errno.h>
+#include <linux/fb.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 
@@ -33,12 +34,8 @@ static void armada_fbdev_fb_destroy(struct fb_info *info)
 
 static const struct fb_ops armada_fb_ops = {
 	.owner		= THIS_MODULE,
+	FB_DEFAULT_IO_OPS,
 	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_destroy	= armada_fbdev_fb_destroy,
 };
 
-- 
2.40.1


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

* [PATCH v4 03/13] drm/armada: Use regular fbdev I/O helpers
@ 2023-05-24  9:21   ` Thomas Zimmermann
  0 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: dri-devel, linux-arm-kernel, linux-samsung-soc, intel-gfx,
	linux-arm-msm, freedreno, amd-gfx, linux-tegra,
	Thomas Zimmermann, Russell King

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.

v4:
	* use initializer macros for struct fb_ops
v2:
	* use FB_IO_HELPERS option

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Russell King <linux@armlinux.org.uk>
---
 drivers/gpu/drm/armada/Kconfig        | 1 +
 drivers/gpu/drm/armada/armada_fbdev.c | 7 ++-----
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/armada/Kconfig b/drivers/gpu/drm/armada/Kconfig
index f5c66d89ba99..5afade25e217 100644
--- a/drivers/gpu/drm/armada/Kconfig
+++ b/drivers/gpu/drm/armada/Kconfig
@@ -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
diff --git a/drivers/gpu/drm/armada/armada_fbdev.c b/drivers/gpu/drm/armada/armada_fbdev.c
index 0a5fd1aa86eb..3943e89cc06c 100644
--- a/drivers/gpu/drm/armada/armada_fbdev.c
+++ b/drivers/gpu/drm/armada/armada_fbdev.c
@@ -5,6 +5,7 @@
  */
 
 #include <linux/errno.h>
+#include <linux/fb.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 
@@ -33,12 +34,8 @@ static void armada_fbdev_fb_destroy(struct fb_info *info)
 
 static const struct fb_ops armada_fb_ops = {
 	.owner		= THIS_MODULE,
+	FB_DEFAULT_IO_OPS,
 	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_destroy	= armada_fbdev_fb_destroy,
 };
 
-- 
2.40.1


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

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

* [Intel-gfx] [PATCH v4 04/13] drm/exynos: Use regular fbdev I/O helpers
  2023-05-24  9:21 ` [Intel-gfx] " Thomas Zimmermann
                     ` (2 preceding siblings ...)
  (?)
@ 2023-05-24  9:21   ` Thomas Zimmermann
  -1 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: linux-samsung-soc, Alim Akhtar, linux-arm-msm, intel-gfx,
	Seung-Woo Kim, Krzysztof Kozlowski, dri-devel, Inki Dae,
	Kyungmin Park, amd-gfx, Thomas Zimmermann, linux-tegra,
	freedreno, linux-arm-kernel

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.

v4:
	* use initializer macros for struct fb_ops
v3:
	* don't reorder Makefile rules (Sam)
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/exynos_drm_fbdev.c | 9 ++++-----
 2 files changed, 5 insertions(+), 5 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/exynos_drm_fbdev.c b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
index ea4b3d248aac..fdf65587f1fe 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>
@@ -47,13 +49,10 @@ static void exynos_drm_fb_destroy(struct fb_info *info)
 
 static const struct fb_ops exynos_drm_fb_ops = {
 	.owner		= THIS_MODULE,
+	__FB_DEFAULT_IO_OPS_RDWR,
 	DRM_FB_HELPER_DEFAULT_OPS,
+	__FB_DEFAULT_IO_OPS_DRAW,
 	.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_destroy	= exynos_drm_fb_destroy,
 };
 
-- 
2.40.1


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

* [PATCH v4 04/13] drm/exynos: Use regular fbdev I/O helpers
@ 2023-05-24  9:21   ` Thomas Zimmermann
  0 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: linux-samsung-soc, Alim Akhtar, linux-arm-msm, intel-gfx,
	Seung-Woo Kim, Krzysztof Kozlowski, dri-devel, Inki Dae,
	Kyungmin Park, amd-gfx, Thomas Zimmermann, linux-tegra,
	freedreno, linux-arm-kernel

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.

v4:
	* use initializer macros for struct fb_ops
v3:
	* don't reorder Makefile rules (Sam)
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/exynos_drm_fbdev.c | 9 ++++-----
 2 files changed, 5 insertions(+), 5 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/exynos_drm_fbdev.c b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
index ea4b3d248aac..fdf65587f1fe 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>
@@ -47,13 +49,10 @@ static void exynos_drm_fb_destroy(struct fb_info *info)
 
 static const struct fb_ops exynos_drm_fb_ops = {
 	.owner		= THIS_MODULE,
+	__FB_DEFAULT_IO_OPS_RDWR,
 	DRM_FB_HELPER_DEFAULT_OPS,
+	__FB_DEFAULT_IO_OPS_DRAW,
 	.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_destroy	= exynos_drm_fb_destroy,
 };
 
-- 
2.40.1


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

* [PATCH v4 04/13] drm/exynos: Use regular fbdev I/O helpers
@ 2023-05-24  9:21   ` Thomas Zimmermann
  0 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: dri-devel, linux-arm-kernel, linux-samsung-soc, intel-gfx,
	linux-arm-msm, freedreno, amd-gfx, linux-tegra,
	Thomas Zimmermann, Inki Dae, Seung-Woo Kim, Kyungmin Park,
	Krzysztof Kozlowski, Alim Akhtar

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.

v4:
	* use initializer macros for struct fb_ops
v3:
	* don't reorder Makefile rules (Sam)
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/exynos_drm_fbdev.c | 9 ++++-----
 2 files changed, 5 insertions(+), 5 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/exynos_drm_fbdev.c b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
index ea4b3d248aac..fdf65587f1fe 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>
@@ -47,13 +49,10 @@ static void exynos_drm_fb_destroy(struct fb_info *info)
 
 static const struct fb_ops exynos_drm_fb_ops = {
 	.owner		= THIS_MODULE,
+	__FB_DEFAULT_IO_OPS_RDWR,
 	DRM_FB_HELPER_DEFAULT_OPS,
+	__FB_DEFAULT_IO_OPS_DRAW,
 	.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_destroy	= exynos_drm_fb_destroy,
 };
 
-- 
2.40.1


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

* [PATCH v4 04/13] drm/exynos: Use regular fbdev I/O helpers
@ 2023-05-24  9:21   ` Thomas Zimmermann
  0 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: dri-devel, linux-arm-kernel, linux-samsung-soc, intel-gfx,
	linux-arm-msm, freedreno, amd-gfx, linux-tegra,
	Thomas Zimmermann, Inki Dae, Seung-Woo Kim, Kyungmin Park,
	Krzysztof Kozlowski, Alim Akhtar

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.

v4:
	* use initializer macros for struct fb_ops
v3:
	* don't reorder Makefile rules (Sam)
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/exynos_drm_fbdev.c | 9 ++++-----
 2 files changed, 5 insertions(+), 5 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/exynos_drm_fbdev.c b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
index ea4b3d248aac..fdf65587f1fe 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>
@@ -47,13 +49,10 @@ static void exynos_drm_fb_destroy(struct fb_info *info)
 
 static const struct fb_ops exynos_drm_fb_ops = {
 	.owner		= THIS_MODULE,
+	__FB_DEFAULT_IO_OPS_RDWR,
 	DRM_FB_HELPER_DEFAULT_OPS,
+	__FB_DEFAULT_IO_OPS_DRAW,
 	.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_destroy	= exynos_drm_fb_destroy,
 };
 
-- 
2.40.1


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

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

* [PATCH v4 04/13] drm/exynos: Use regular fbdev I/O helpers
@ 2023-05-24  9:21   ` Thomas Zimmermann
  0 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: linux-samsung-soc, Alim Akhtar, linux-arm-msm, intel-gfx,
	Seung-Woo Kim, Krzysztof Kozlowski, dri-devel, Kyungmin Park,
	amd-gfx, Thomas Zimmermann, linux-tegra, freedreno,
	linux-arm-kernel

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.

v4:
	* use initializer macros for struct fb_ops
v3:
	* don't reorder Makefile rules (Sam)
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/exynos_drm_fbdev.c | 9 ++++-----
 2 files changed, 5 insertions(+), 5 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/exynos_drm_fbdev.c b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
index ea4b3d248aac..fdf65587f1fe 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>
@@ -47,13 +49,10 @@ static void exynos_drm_fb_destroy(struct fb_info *info)
 
 static const struct fb_ops exynos_drm_fb_ops = {
 	.owner		= THIS_MODULE,
+	__FB_DEFAULT_IO_OPS_RDWR,
 	DRM_FB_HELPER_DEFAULT_OPS,
+	__FB_DEFAULT_IO_OPS_DRAW,
 	.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_destroy	= exynos_drm_fb_destroy,
 };
 
-- 
2.40.1


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

* [Intel-gfx] [PATCH v4 05/13] drm/gma500: Use regular fbdev I/O helpers
  2023-05-24  9:21 ` [Intel-gfx] " Thomas Zimmermann
                     ` (2 preceding siblings ...)
  (?)
@ 2023-05-24  9:21   ` Thomas Zimmermann
  -1 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: linux-samsung-soc, linux-arm-msm, intel-gfx, dri-devel, amd-gfx,
	Thomas Zimmermann, linux-tegra, freedreno, linux-arm-kernel

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

v4:
	* use initializer macros for struct fb_ops
v2:
	* use FB_IO_HELPERS option

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
---
 drivers/gpu/drm/gma500/Kconfig | 1 +
 drivers/gpu/drm/gma500/fbdev.c | 8 +++-----
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/gma500/Kconfig b/drivers/gpu/drm/gma500/Kconfig
index 2efc0eb41c64..cd3d92725ed4 100644
--- a/drivers/gpu/drm/gma500/Kconfig
+++ b/drivers/gpu/drm/gma500/Kconfig
@@ -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
diff --git a/drivers/gpu/drm/gma500/fbdev.c b/drivers/gpu/drm/gma500/fbdev.c
index 4f0309548b2b..955cbe9f05a7 100644
--- a/drivers/gpu/drm/gma500/fbdev.c
+++ b/drivers/gpu/drm/gma500/fbdev.c
@@ -5,6 +5,7 @@
  *
  **************************************************************************/
 
+#include <linux/fb.h>
 #include <linux/pfn_t.h>
 
 #include <drm/drm_crtc_helper.h>
@@ -134,13 +135,10 @@ static void psb_fbdev_fb_destroy(struct fb_info *info)
 
 static const struct fb_ops psb_fbdev_fb_ops = {
 	.owner = THIS_MODULE,
+	__FB_DEFAULT_IO_OPS_RDWR,
 	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_DEFAULT_IO_OPS_DRAW,
 	.fb_mmap = psb_fbdev_fb_mmap,
 	.fb_destroy = psb_fbdev_fb_destroy,
 };
-- 
2.40.1


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

* [PATCH v4 05/13] drm/gma500: Use regular fbdev I/O helpers
@ 2023-05-24  9:21   ` Thomas Zimmermann
  0 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: linux-samsung-soc, linux-arm-msm, intel-gfx, dri-devel,
	Patrik Jakobsson, amd-gfx, Thomas Zimmermann, linux-tegra,
	freedreno, linux-arm-kernel

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

v4:
	* use initializer macros for struct fb_ops
v2:
	* use FB_IO_HELPERS option

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
---
 drivers/gpu/drm/gma500/Kconfig | 1 +
 drivers/gpu/drm/gma500/fbdev.c | 8 +++-----
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/gma500/Kconfig b/drivers/gpu/drm/gma500/Kconfig
index 2efc0eb41c64..cd3d92725ed4 100644
--- a/drivers/gpu/drm/gma500/Kconfig
+++ b/drivers/gpu/drm/gma500/Kconfig
@@ -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
diff --git a/drivers/gpu/drm/gma500/fbdev.c b/drivers/gpu/drm/gma500/fbdev.c
index 4f0309548b2b..955cbe9f05a7 100644
--- a/drivers/gpu/drm/gma500/fbdev.c
+++ b/drivers/gpu/drm/gma500/fbdev.c
@@ -5,6 +5,7 @@
  *
  **************************************************************************/
 
+#include <linux/fb.h>
 #include <linux/pfn_t.h>
 
 #include <drm/drm_crtc_helper.h>
@@ -134,13 +135,10 @@ static void psb_fbdev_fb_destroy(struct fb_info *info)
 
 static const struct fb_ops psb_fbdev_fb_ops = {
 	.owner = THIS_MODULE,
+	__FB_DEFAULT_IO_OPS_RDWR,
 	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_DEFAULT_IO_OPS_DRAW,
 	.fb_mmap = psb_fbdev_fb_mmap,
 	.fb_destroy = psb_fbdev_fb_destroy,
 };
-- 
2.40.1


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

* [PATCH v4 05/13] drm/gma500: Use regular fbdev I/O helpers
@ 2023-05-24  9:21   ` Thomas Zimmermann
  0 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: dri-devel, linux-arm-kernel, linux-samsung-soc, intel-gfx,
	linux-arm-msm, freedreno, amd-gfx, linux-tegra,
	Thomas Zimmermann, Patrik Jakobsson

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

v4:
	* use initializer macros for struct fb_ops
v2:
	* use FB_IO_HELPERS option

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
---
 drivers/gpu/drm/gma500/Kconfig | 1 +
 drivers/gpu/drm/gma500/fbdev.c | 8 +++-----
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/gma500/Kconfig b/drivers/gpu/drm/gma500/Kconfig
index 2efc0eb41c64..cd3d92725ed4 100644
--- a/drivers/gpu/drm/gma500/Kconfig
+++ b/drivers/gpu/drm/gma500/Kconfig
@@ -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
diff --git a/drivers/gpu/drm/gma500/fbdev.c b/drivers/gpu/drm/gma500/fbdev.c
index 4f0309548b2b..955cbe9f05a7 100644
--- a/drivers/gpu/drm/gma500/fbdev.c
+++ b/drivers/gpu/drm/gma500/fbdev.c
@@ -5,6 +5,7 @@
  *
  **************************************************************************/
 
+#include <linux/fb.h>
 #include <linux/pfn_t.h>
 
 #include <drm/drm_crtc_helper.h>
@@ -134,13 +135,10 @@ static void psb_fbdev_fb_destroy(struct fb_info *info)
 
 static const struct fb_ops psb_fbdev_fb_ops = {
 	.owner = THIS_MODULE,
+	__FB_DEFAULT_IO_OPS_RDWR,
 	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_DEFAULT_IO_OPS_DRAW,
 	.fb_mmap = psb_fbdev_fb_mmap,
 	.fb_destroy = psb_fbdev_fb_destroy,
 };
-- 
2.40.1


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

* [PATCH v4 05/13] drm/gma500: Use regular fbdev I/O helpers
@ 2023-05-24  9:21   ` Thomas Zimmermann
  0 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: dri-devel, linux-arm-kernel, linux-samsung-soc, intel-gfx,
	linux-arm-msm, freedreno, amd-gfx, linux-tegra,
	Thomas Zimmermann, Patrik Jakobsson

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

v4:
	* use initializer macros for struct fb_ops
v2:
	* use FB_IO_HELPERS option

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
---
 drivers/gpu/drm/gma500/Kconfig | 1 +
 drivers/gpu/drm/gma500/fbdev.c | 8 +++-----
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/gma500/Kconfig b/drivers/gpu/drm/gma500/Kconfig
index 2efc0eb41c64..cd3d92725ed4 100644
--- a/drivers/gpu/drm/gma500/Kconfig
+++ b/drivers/gpu/drm/gma500/Kconfig
@@ -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
diff --git a/drivers/gpu/drm/gma500/fbdev.c b/drivers/gpu/drm/gma500/fbdev.c
index 4f0309548b2b..955cbe9f05a7 100644
--- a/drivers/gpu/drm/gma500/fbdev.c
+++ b/drivers/gpu/drm/gma500/fbdev.c
@@ -5,6 +5,7 @@
  *
  **************************************************************************/
 
+#include <linux/fb.h>
 #include <linux/pfn_t.h>
 
 #include <drm/drm_crtc_helper.h>
@@ -134,13 +135,10 @@ static void psb_fbdev_fb_destroy(struct fb_info *info)
 
 static const struct fb_ops psb_fbdev_fb_ops = {
 	.owner = THIS_MODULE,
+	__FB_DEFAULT_IO_OPS_RDWR,
 	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_DEFAULT_IO_OPS_DRAW,
 	.fb_mmap = psb_fbdev_fb_mmap,
 	.fb_destroy = psb_fbdev_fb_destroy,
 };
-- 
2.40.1


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

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

* [PATCH v4 05/13] drm/gma500: Use regular fbdev I/O helpers
@ 2023-05-24  9:21   ` Thomas Zimmermann
  0 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: linux-samsung-soc, linux-arm-msm, intel-gfx, dri-devel, amd-gfx,
	Thomas Zimmermann, linux-tegra, freedreno, linux-arm-kernel

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

v4:
	* use initializer macros for struct fb_ops
v2:
	* use FB_IO_HELPERS option

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
---
 drivers/gpu/drm/gma500/Kconfig | 1 +
 drivers/gpu/drm/gma500/fbdev.c | 8 +++-----
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/gma500/Kconfig b/drivers/gpu/drm/gma500/Kconfig
index 2efc0eb41c64..cd3d92725ed4 100644
--- a/drivers/gpu/drm/gma500/Kconfig
+++ b/drivers/gpu/drm/gma500/Kconfig
@@ -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
diff --git a/drivers/gpu/drm/gma500/fbdev.c b/drivers/gpu/drm/gma500/fbdev.c
index 4f0309548b2b..955cbe9f05a7 100644
--- a/drivers/gpu/drm/gma500/fbdev.c
+++ b/drivers/gpu/drm/gma500/fbdev.c
@@ -5,6 +5,7 @@
  *
  **************************************************************************/
 
+#include <linux/fb.h>
 #include <linux/pfn_t.h>
 
 #include <drm/drm_crtc_helper.h>
@@ -134,13 +135,10 @@ static void psb_fbdev_fb_destroy(struct fb_info *info)
 
 static const struct fb_ops psb_fbdev_fb_ops = {
 	.owner = THIS_MODULE,
+	__FB_DEFAULT_IO_OPS_RDWR,
 	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_DEFAULT_IO_OPS_DRAW,
 	.fb_mmap = psb_fbdev_fb_mmap,
 	.fb_destroy = psb_fbdev_fb_destroy,
 };
-- 
2.40.1


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

* [Intel-gfx] [PATCH v4 06/13] drm/radeon: Use regular fbdev I/O helpers
  2023-05-24  9:21 ` [Intel-gfx] " Thomas Zimmermann
  (?)
  (?)
@ 2023-05-24  9:21   ` Thomas Zimmermann
  -1 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: linux-samsung-soc, linux-arm-msm, intel-gfx, Pan, Xinhui,
	dri-devel, Alex Deucher, amd-gfx, Thomas Zimmermann, linux-tegra,
	freedreno, Christian König, linux-arm-kernel

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

v4:
	* use initializer macros for struct fb_ops
v2:
	* use FB_IO_HELPERS option

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: "Pan, Xinhui" <Xinhui.Pan@amd.com>
---
 drivers/gpu/drm/radeon/Kconfig        | 1 +
 drivers/gpu/drm/radeon/radeon_fbdev.c | 9 +++------
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/radeon/Kconfig b/drivers/gpu/drm/radeon/Kconfig
index e19d77d58810..fe498c8af1bb 100644
--- a/drivers/gpu/drm/radeon/Kconfig
+++ b/drivers/gpu/drm/radeon/Kconfig
@@ -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
diff --git a/drivers/gpu/drm/radeon/radeon_fbdev.c b/drivers/gpu/drm/radeon/radeon_fbdev.c
index fe76e29910ef..28212c2d6c98 100644
--- a/drivers/gpu/drm/radeon/radeon_fbdev.c
+++ b/drivers/gpu/drm/radeon/radeon_fbdev.c
@@ -24,6 +24,7 @@
  *     David Airlie
  */
 
+#include <linux/fb.h>
 #include <linux/pci.h>
 #include <linux/pm_runtime.h>
 #include <linux/vga_switcheroo.h>
@@ -190,14 +191,10 @@ static void radeon_fbdev_fb_destroy(struct fb_info *info)
 
 static const struct fb_ops radeon_fbdev_fb_ops = {
 	.owner = THIS_MODULE,
-	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_DEFAULT_IO_OPS,
+	DRM_FB_HELPER_DEFAULT_OPS,
 	.fb_destroy = radeon_fbdev_fb_destroy,
 };
 
-- 
2.40.1


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

* [PATCH v4 06/13] drm/radeon: Use regular fbdev I/O helpers
@ 2023-05-24  9:21   ` Thomas Zimmermann
  0 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: linux-samsung-soc, linux-arm-msm, intel-gfx, Pan, Xinhui,
	dri-devel, Alex Deucher, amd-gfx, Thomas Zimmermann, linux-tegra,
	freedreno, Christian König, linux-arm-kernel

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

v4:
	* use initializer macros for struct fb_ops
v2:
	* use FB_IO_HELPERS option

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: "Pan, Xinhui" <Xinhui.Pan@amd.com>
---
 drivers/gpu/drm/radeon/Kconfig        | 1 +
 drivers/gpu/drm/radeon/radeon_fbdev.c | 9 +++------
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/radeon/Kconfig b/drivers/gpu/drm/radeon/Kconfig
index e19d77d58810..fe498c8af1bb 100644
--- a/drivers/gpu/drm/radeon/Kconfig
+++ b/drivers/gpu/drm/radeon/Kconfig
@@ -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
diff --git a/drivers/gpu/drm/radeon/radeon_fbdev.c b/drivers/gpu/drm/radeon/radeon_fbdev.c
index fe76e29910ef..28212c2d6c98 100644
--- a/drivers/gpu/drm/radeon/radeon_fbdev.c
+++ b/drivers/gpu/drm/radeon/radeon_fbdev.c
@@ -24,6 +24,7 @@
  *     David Airlie
  */
 
+#include <linux/fb.h>
 #include <linux/pci.h>
 #include <linux/pm_runtime.h>
 #include <linux/vga_switcheroo.h>
@@ -190,14 +191,10 @@ static void radeon_fbdev_fb_destroy(struct fb_info *info)
 
 static const struct fb_ops radeon_fbdev_fb_ops = {
 	.owner = THIS_MODULE,
-	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_DEFAULT_IO_OPS,
+	DRM_FB_HELPER_DEFAULT_OPS,
 	.fb_destroy = radeon_fbdev_fb_destroy,
 };
 
-- 
2.40.1


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

* [PATCH v4 06/13] drm/radeon: Use regular fbdev I/O helpers
@ 2023-05-24  9:21   ` Thomas Zimmermann
  0 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: dri-devel, linux-arm-kernel, linux-samsung-soc, intel-gfx,
	linux-arm-msm, freedreno, amd-gfx, linux-tegra,
	Thomas Zimmermann, Alex Deucher, Christian König, Pan,
	Xinhui

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

v4:
	* use initializer macros for struct fb_ops
v2:
	* use FB_IO_HELPERS option

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: "Pan, Xinhui" <Xinhui.Pan@amd.com>
---
 drivers/gpu/drm/radeon/Kconfig        | 1 +
 drivers/gpu/drm/radeon/radeon_fbdev.c | 9 +++------
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/radeon/Kconfig b/drivers/gpu/drm/radeon/Kconfig
index e19d77d58810..fe498c8af1bb 100644
--- a/drivers/gpu/drm/radeon/Kconfig
+++ b/drivers/gpu/drm/radeon/Kconfig
@@ -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
diff --git a/drivers/gpu/drm/radeon/radeon_fbdev.c b/drivers/gpu/drm/radeon/radeon_fbdev.c
index fe76e29910ef..28212c2d6c98 100644
--- a/drivers/gpu/drm/radeon/radeon_fbdev.c
+++ b/drivers/gpu/drm/radeon/radeon_fbdev.c
@@ -24,6 +24,7 @@
  *     David Airlie
  */
 
+#include <linux/fb.h>
 #include <linux/pci.h>
 #include <linux/pm_runtime.h>
 #include <linux/vga_switcheroo.h>
@@ -190,14 +191,10 @@ static void radeon_fbdev_fb_destroy(struct fb_info *info)
 
 static const struct fb_ops radeon_fbdev_fb_ops = {
 	.owner = THIS_MODULE,
-	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_DEFAULT_IO_OPS,
+	DRM_FB_HELPER_DEFAULT_OPS,
 	.fb_destroy = radeon_fbdev_fb_destroy,
 };
 
-- 
2.40.1


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

* [PATCH v4 06/13] drm/radeon: Use regular fbdev I/O helpers
@ 2023-05-24  9:21   ` Thomas Zimmermann
  0 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: dri-devel, linux-arm-kernel, linux-samsung-soc, intel-gfx,
	linux-arm-msm, freedreno, amd-gfx, linux-tegra,
	Thomas Zimmermann, Alex Deucher, Christian König, Pan,
	Xinhui

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

v4:
	* use initializer macros for struct fb_ops
v2:
	* use FB_IO_HELPERS option

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: "Pan, Xinhui" <Xinhui.Pan@amd.com>
---
 drivers/gpu/drm/radeon/Kconfig        | 1 +
 drivers/gpu/drm/radeon/radeon_fbdev.c | 9 +++------
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/radeon/Kconfig b/drivers/gpu/drm/radeon/Kconfig
index e19d77d58810..fe498c8af1bb 100644
--- a/drivers/gpu/drm/radeon/Kconfig
+++ b/drivers/gpu/drm/radeon/Kconfig
@@ -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
diff --git a/drivers/gpu/drm/radeon/radeon_fbdev.c b/drivers/gpu/drm/radeon/radeon_fbdev.c
index fe76e29910ef..28212c2d6c98 100644
--- a/drivers/gpu/drm/radeon/radeon_fbdev.c
+++ b/drivers/gpu/drm/radeon/radeon_fbdev.c
@@ -24,6 +24,7 @@
  *     David Airlie
  */
 
+#include <linux/fb.h>
 #include <linux/pci.h>
 #include <linux/pm_runtime.h>
 #include <linux/vga_switcheroo.h>
@@ -190,14 +191,10 @@ static void radeon_fbdev_fb_destroy(struct fb_info *info)
 
 static const struct fb_ops radeon_fbdev_fb_ops = {
 	.owner = THIS_MODULE,
-	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_DEFAULT_IO_OPS,
+	DRM_FB_HELPER_DEFAULT_OPS,
 	.fb_destroy = radeon_fbdev_fb_destroy,
 };
 
-- 
2.40.1


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

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

* [Intel-gfx] [PATCH v4 07/13] drm/fbdev-dma: Use regular fbdev I/O helpers
  2023-05-24  9:21 ` [Intel-gfx] " Thomas Zimmermann
  (?)
  (?)
@ 2023-05-24  9:21   ` Thomas Zimmermann
  -1 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: linux-samsung-soc, linux-arm-msm, intel-gfx, dri-devel, amd-gfx,
	Thomas Zimmermann, linux-tegra, freedreno, linux-arm-kernel

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

v4:
	* use initializer macros for struct fb_ops
v2:
	* use FB_SYS_HELPERS option

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/gpu/drm/Kconfig         |  1 +
 drivers/gpu/drm/drm_fbdev_dma.c | 11 +++++------
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index ba3fb04bb691..77fb10ddd8a2 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -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
 
diff --git a/drivers/gpu/drm/drm_fbdev_dma.c b/drivers/gpu/drm/drm_fbdev_dma.c
index 728deffcc0d9..d86773fa8ab0 100644
--- a/drivers/gpu/drm/drm_fbdev_dma.c
+++ b/drivers/gpu/drm/drm_fbdev_dma.c
@@ -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,14 +66,11 @@ 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_DEFAULT_SYS_OPS_RDWR,
 	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_destroy = drm_fbdev_dma_fb_destroy,
+	__FB_DEFAULT_SYS_OPS_DRAW,
 	.fb_mmap = drm_fbdev_dma_fb_mmap,
+	.fb_destroy = drm_fbdev_dma_fb_destroy,
 };
 
 /*
-- 
2.40.1


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

* [PATCH v4 07/13] drm/fbdev-dma: Use regular fbdev I/O helpers
@ 2023-05-24  9:21   ` Thomas Zimmermann
  0 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: dri-devel, linux-arm-kernel, linux-samsung-soc, intel-gfx,
	linux-arm-msm, freedreno, amd-gfx, linux-tegra,
	Thomas Zimmermann

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

v4:
	* use initializer macros for struct fb_ops
v2:
	* use FB_SYS_HELPERS option

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/gpu/drm/Kconfig         |  1 +
 drivers/gpu/drm/drm_fbdev_dma.c | 11 +++++------
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index ba3fb04bb691..77fb10ddd8a2 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -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
 
diff --git a/drivers/gpu/drm/drm_fbdev_dma.c b/drivers/gpu/drm/drm_fbdev_dma.c
index 728deffcc0d9..d86773fa8ab0 100644
--- a/drivers/gpu/drm/drm_fbdev_dma.c
+++ b/drivers/gpu/drm/drm_fbdev_dma.c
@@ -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,14 +66,11 @@ 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_DEFAULT_SYS_OPS_RDWR,
 	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_destroy = drm_fbdev_dma_fb_destroy,
+	__FB_DEFAULT_SYS_OPS_DRAW,
 	.fb_mmap = drm_fbdev_dma_fb_mmap,
+	.fb_destroy = drm_fbdev_dma_fb_destroy,
 };
 
 /*
-- 
2.40.1


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

* [PATCH v4 07/13] drm/fbdev-dma: Use regular fbdev I/O helpers
@ 2023-05-24  9:21   ` Thomas Zimmermann
  0 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: dri-devel, linux-arm-kernel, linux-samsung-soc, intel-gfx,
	linux-arm-msm, freedreno, amd-gfx, linux-tegra,
	Thomas Zimmermann

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

v4:
	* use initializer macros for struct fb_ops
v2:
	* use FB_SYS_HELPERS option

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/gpu/drm/Kconfig         |  1 +
 drivers/gpu/drm/drm_fbdev_dma.c | 11 +++++------
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index ba3fb04bb691..77fb10ddd8a2 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -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
 
diff --git a/drivers/gpu/drm/drm_fbdev_dma.c b/drivers/gpu/drm/drm_fbdev_dma.c
index 728deffcc0d9..d86773fa8ab0 100644
--- a/drivers/gpu/drm/drm_fbdev_dma.c
+++ b/drivers/gpu/drm/drm_fbdev_dma.c
@@ -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,14 +66,11 @@ 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_DEFAULT_SYS_OPS_RDWR,
 	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_destroy = drm_fbdev_dma_fb_destroy,
+	__FB_DEFAULT_SYS_OPS_DRAW,
 	.fb_mmap = drm_fbdev_dma_fb_mmap,
+	.fb_destroy = drm_fbdev_dma_fb_destroy,
 };
 
 /*
-- 
2.40.1


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

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

* [PATCH v4 07/13] drm/fbdev-dma: Use regular fbdev I/O helpers
@ 2023-05-24  9:21   ` Thomas Zimmermann
  0 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: linux-samsung-soc, linux-arm-msm, intel-gfx, dri-devel, amd-gfx,
	Thomas Zimmermann, linux-tegra, freedreno, linux-arm-kernel

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

v4:
	* use initializer macros for struct fb_ops
v2:
	* use FB_SYS_HELPERS option

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/gpu/drm/Kconfig         |  1 +
 drivers/gpu/drm/drm_fbdev_dma.c | 11 +++++------
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index ba3fb04bb691..77fb10ddd8a2 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -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
 
diff --git a/drivers/gpu/drm/drm_fbdev_dma.c b/drivers/gpu/drm/drm_fbdev_dma.c
index 728deffcc0d9..d86773fa8ab0 100644
--- a/drivers/gpu/drm/drm_fbdev_dma.c
+++ b/drivers/gpu/drm/drm_fbdev_dma.c
@@ -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,14 +66,11 @@ 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_DEFAULT_SYS_OPS_RDWR,
 	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_destroy = drm_fbdev_dma_fb_destroy,
+	__FB_DEFAULT_SYS_OPS_DRAW,
 	.fb_mmap = drm_fbdev_dma_fb_mmap,
+	.fb_destroy = drm_fbdev_dma_fb_destroy,
 };
 
 /*
-- 
2.40.1


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

* [Intel-gfx] [PATCH v4 08/13] drm/msm: Use regular fbdev I/O helpers
  2023-05-24  9:21 ` [Intel-gfx] " Thomas Zimmermann
                     ` (2 preceding siblings ...)
  (?)
@ 2023-05-24  9:21   ` Thomas Zimmermann
  -1 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: linux-samsung-soc, linux-arm-msm, intel-gfx, Abhinav Kumar,
	dri-devel, Dmitry Baryshkov, amd-gfx, Thomas Zimmermann,
	linux-tegra, freedreno, linux-arm-kernel

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

Msm's fbdev emulation has been incomplete as it didn't implement
damage handling. Partilly fix this by implementing damage handling
for write and draw operation. It is still missing for mmaped pages.

v4:
	* use initializer macros for struct fb_ops
	* partially support damage handling
v2:
	* use FB_SYS_HELPERS option

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: Rob Clark <robdclark@gmail.com>
Cc: Abhinav Kumar <quic_abhinavk@quicinc.com>
Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: Sean Paul <sean@poorly.run>
---
 drivers/gpu/drm/msm/Kconfig     |  1 +
 drivers/gpu/drm/msm/msm_fbdev.c | 17 ++++++++---------
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/msm/Kconfig b/drivers/gpu/drm/msm/Kconfig
index 85f5ab1d552c..a78662bd6273 100644
--- a/drivers/gpu/drm/msm/Kconfig
+++ b/drivers/gpu/drm/msm/Kconfig
@@ -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
diff --git a/drivers/gpu/drm/msm/msm_fbdev.c b/drivers/gpu/drm/msm/msm_fbdev.c
index ce0ba6d1979a..fa9c1cbffae3 100644
--- a/drivers/gpu/drm/msm/msm_fbdev.c
+++ b/drivers/gpu/drm/msm/msm_fbdev.c
@@ -4,6 +4,8 @@
  * Author: Rob Clark <robdclark@gmail.com>
  */
 
+#include <linux/fb.h>
+
 #include <drm/drm_drv.h>
 #include <drm/drm_crtc_helper.h>
 #include <drm/drm_fb_helper.h>
@@ -23,6 +25,10 @@ module_param(fbdev, bool, 0600);
  * fbdev funcs, to implement legacy fbdev interface on top of drm driver
  */
 
+FB_GEN_DEFAULT_DEFERRED_SYS_OPS(msm_fbdev,
+				drm_fb_helper_damage_range,
+				drm_fb_helper_damage_area)
+
 static int msm_fbdev_mmap(struct fb_info *info, struct vm_area_struct *vma)
 {
 	struct drm_fb_helper *helper = (struct drm_fb_helper *)info->par;
@@ -52,16 +58,9 @@ static void msm_fbdev_fb_destroy(struct fb_info *info)
 
 static const struct fb_ops msm_fb_ops = {
 	.owner = THIS_MODULE,
+	__FB_DEFAULT_DEFERRED_OPS_RDWR(msm_fbdev),
 	DRM_FB_HELPER_DEFAULT_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_DEFAULT_DEFERRED_OPS_DRAW(msm_fbdev),
 	.fb_mmap = msm_fbdev_mmap,
 	.fb_destroy = msm_fbdev_fb_destroy,
 };
-- 
2.40.1


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

* [PATCH v4 08/13] drm/msm: Use regular fbdev I/O helpers
@ 2023-05-24  9:21   ` Thomas Zimmermann
  0 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: Sean Paul, linux-samsung-soc, linux-arm-msm, intel-gfx,
	Abhinav Kumar, dri-devel, Dmitry Baryshkov, Rob Clark, amd-gfx,
	Thomas Zimmermann, linux-tegra, freedreno, linux-arm-kernel

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

Msm's fbdev emulation has been incomplete as it didn't implement
damage handling. Partilly fix this by implementing damage handling
for write and draw operation. It is still missing for mmaped pages.

v4:
	* use initializer macros for struct fb_ops
	* partially support damage handling
v2:
	* use FB_SYS_HELPERS option

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: Rob Clark <robdclark@gmail.com>
Cc: Abhinav Kumar <quic_abhinavk@quicinc.com>
Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: Sean Paul <sean@poorly.run>
---
 drivers/gpu/drm/msm/Kconfig     |  1 +
 drivers/gpu/drm/msm/msm_fbdev.c | 17 ++++++++---------
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/msm/Kconfig b/drivers/gpu/drm/msm/Kconfig
index 85f5ab1d552c..a78662bd6273 100644
--- a/drivers/gpu/drm/msm/Kconfig
+++ b/drivers/gpu/drm/msm/Kconfig
@@ -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
diff --git a/drivers/gpu/drm/msm/msm_fbdev.c b/drivers/gpu/drm/msm/msm_fbdev.c
index ce0ba6d1979a..fa9c1cbffae3 100644
--- a/drivers/gpu/drm/msm/msm_fbdev.c
+++ b/drivers/gpu/drm/msm/msm_fbdev.c
@@ -4,6 +4,8 @@
  * Author: Rob Clark <robdclark@gmail.com>
  */
 
+#include <linux/fb.h>
+
 #include <drm/drm_drv.h>
 #include <drm/drm_crtc_helper.h>
 #include <drm/drm_fb_helper.h>
@@ -23,6 +25,10 @@ module_param(fbdev, bool, 0600);
  * fbdev funcs, to implement legacy fbdev interface on top of drm driver
  */
 
+FB_GEN_DEFAULT_DEFERRED_SYS_OPS(msm_fbdev,
+				drm_fb_helper_damage_range,
+				drm_fb_helper_damage_area)
+
 static int msm_fbdev_mmap(struct fb_info *info, struct vm_area_struct *vma)
 {
 	struct drm_fb_helper *helper = (struct drm_fb_helper *)info->par;
@@ -52,16 +58,9 @@ static void msm_fbdev_fb_destroy(struct fb_info *info)
 
 static const struct fb_ops msm_fb_ops = {
 	.owner = THIS_MODULE,
+	__FB_DEFAULT_DEFERRED_OPS_RDWR(msm_fbdev),
 	DRM_FB_HELPER_DEFAULT_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_DEFAULT_DEFERRED_OPS_DRAW(msm_fbdev),
 	.fb_mmap = msm_fbdev_mmap,
 	.fb_destroy = msm_fbdev_fb_destroy,
 };
-- 
2.40.1


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

* [PATCH v4 08/13] drm/msm: Use regular fbdev I/O helpers
@ 2023-05-24  9:21   ` Thomas Zimmermann
  0 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: dri-devel, linux-arm-kernel, linux-samsung-soc, intel-gfx,
	linux-arm-msm, freedreno, amd-gfx, linux-tegra,
	Thomas Zimmermann, Dmitry Baryshkov, Rob Clark, Abhinav Kumar,
	Sean Paul

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

Msm's fbdev emulation has been incomplete as it didn't implement
damage handling. Partilly fix this by implementing damage handling
for write and draw operation. It is still missing for mmaped pages.

v4:
	* use initializer macros for struct fb_ops
	* partially support damage handling
v2:
	* use FB_SYS_HELPERS option

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: Rob Clark <robdclark@gmail.com>
Cc: Abhinav Kumar <quic_abhinavk@quicinc.com>
Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: Sean Paul <sean@poorly.run>
---
 drivers/gpu/drm/msm/Kconfig     |  1 +
 drivers/gpu/drm/msm/msm_fbdev.c | 17 ++++++++---------
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/msm/Kconfig b/drivers/gpu/drm/msm/Kconfig
index 85f5ab1d552c..a78662bd6273 100644
--- a/drivers/gpu/drm/msm/Kconfig
+++ b/drivers/gpu/drm/msm/Kconfig
@@ -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
diff --git a/drivers/gpu/drm/msm/msm_fbdev.c b/drivers/gpu/drm/msm/msm_fbdev.c
index ce0ba6d1979a..fa9c1cbffae3 100644
--- a/drivers/gpu/drm/msm/msm_fbdev.c
+++ b/drivers/gpu/drm/msm/msm_fbdev.c
@@ -4,6 +4,8 @@
  * Author: Rob Clark <robdclark@gmail.com>
  */
 
+#include <linux/fb.h>
+
 #include <drm/drm_drv.h>
 #include <drm/drm_crtc_helper.h>
 #include <drm/drm_fb_helper.h>
@@ -23,6 +25,10 @@ module_param(fbdev, bool, 0600);
  * fbdev funcs, to implement legacy fbdev interface on top of drm driver
  */
 
+FB_GEN_DEFAULT_DEFERRED_SYS_OPS(msm_fbdev,
+				drm_fb_helper_damage_range,
+				drm_fb_helper_damage_area)
+
 static int msm_fbdev_mmap(struct fb_info *info, struct vm_area_struct *vma)
 {
 	struct drm_fb_helper *helper = (struct drm_fb_helper *)info->par;
@@ -52,16 +58,9 @@ static void msm_fbdev_fb_destroy(struct fb_info *info)
 
 static const struct fb_ops msm_fb_ops = {
 	.owner = THIS_MODULE,
+	__FB_DEFAULT_DEFERRED_OPS_RDWR(msm_fbdev),
 	DRM_FB_HELPER_DEFAULT_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_DEFAULT_DEFERRED_OPS_DRAW(msm_fbdev),
 	.fb_mmap = msm_fbdev_mmap,
 	.fb_destroy = msm_fbdev_fb_destroy,
 };
-- 
2.40.1


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

* [PATCH v4 08/13] drm/msm: Use regular fbdev I/O helpers
@ 2023-05-24  9:21   ` Thomas Zimmermann
  0 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: dri-devel, linux-arm-kernel, linux-samsung-soc, intel-gfx,
	linux-arm-msm, freedreno, amd-gfx, linux-tegra,
	Thomas Zimmermann, Dmitry Baryshkov, Rob Clark, Abhinav Kumar,
	Sean Paul

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

Msm's fbdev emulation has been incomplete as it didn't implement
damage handling. Partilly fix this by implementing damage handling
for write and draw operation. It is still missing for mmaped pages.

v4:
	* use initializer macros for struct fb_ops
	* partially support damage handling
v2:
	* use FB_SYS_HELPERS option

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: Rob Clark <robdclark@gmail.com>
Cc: Abhinav Kumar <quic_abhinavk@quicinc.com>
Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: Sean Paul <sean@poorly.run>
---
 drivers/gpu/drm/msm/Kconfig     |  1 +
 drivers/gpu/drm/msm/msm_fbdev.c | 17 ++++++++---------
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/msm/Kconfig b/drivers/gpu/drm/msm/Kconfig
index 85f5ab1d552c..a78662bd6273 100644
--- a/drivers/gpu/drm/msm/Kconfig
+++ b/drivers/gpu/drm/msm/Kconfig
@@ -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
diff --git a/drivers/gpu/drm/msm/msm_fbdev.c b/drivers/gpu/drm/msm/msm_fbdev.c
index ce0ba6d1979a..fa9c1cbffae3 100644
--- a/drivers/gpu/drm/msm/msm_fbdev.c
+++ b/drivers/gpu/drm/msm/msm_fbdev.c
@@ -4,6 +4,8 @@
  * Author: Rob Clark <robdclark@gmail.com>
  */
 
+#include <linux/fb.h>
+
 #include <drm/drm_drv.h>
 #include <drm/drm_crtc_helper.h>
 #include <drm/drm_fb_helper.h>
@@ -23,6 +25,10 @@ module_param(fbdev, bool, 0600);
  * fbdev funcs, to implement legacy fbdev interface on top of drm driver
  */
 
+FB_GEN_DEFAULT_DEFERRED_SYS_OPS(msm_fbdev,
+				drm_fb_helper_damage_range,
+				drm_fb_helper_damage_area)
+
 static int msm_fbdev_mmap(struct fb_info *info, struct vm_area_struct *vma)
 {
 	struct drm_fb_helper *helper = (struct drm_fb_helper *)info->par;
@@ -52,16 +58,9 @@ static void msm_fbdev_fb_destroy(struct fb_info *info)
 
 static const struct fb_ops msm_fb_ops = {
 	.owner = THIS_MODULE,
+	__FB_DEFAULT_DEFERRED_OPS_RDWR(msm_fbdev),
 	DRM_FB_HELPER_DEFAULT_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_DEFAULT_DEFERRED_OPS_DRAW(msm_fbdev),
 	.fb_mmap = msm_fbdev_mmap,
 	.fb_destroy = msm_fbdev_fb_destroy,
 };
-- 
2.40.1


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

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

* [PATCH v4 08/13] drm/msm: Use regular fbdev I/O helpers
@ 2023-05-24  9:21   ` Thomas Zimmermann
  0 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: Sean Paul, linux-samsung-soc, linux-arm-msm, intel-gfx,
	Abhinav Kumar, dri-devel, Dmitry Baryshkov, amd-gfx,
	Thomas Zimmermann, linux-tegra, freedreno, linux-arm-kernel

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

Msm's fbdev emulation has been incomplete as it didn't implement
damage handling. Partilly fix this by implementing damage handling
for write and draw operation. It is still missing for mmaped pages.

v4:
	* use initializer macros for struct fb_ops
	* partially support damage handling
v2:
	* use FB_SYS_HELPERS option

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: Rob Clark <robdclark@gmail.com>
Cc: Abhinav Kumar <quic_abhinavk@quicinc.com>
Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: Sean Paul <sean@poorly.run>
---
 drivers/gpu/drm/msm/Kconfig     |  1 +
 drivers/gpu/drm/msm/msm_fbdev.c | 17 ++++++++---------
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/msm/Kconfig b/drivers/gpu/drm/msm/Kconfig
index 85f5ab1d552c..a78662bd6273 100644
--- a/drivers/gpu/drm/msm/Kconfig
+++ b/drivers/gpu/drm/msm/Kconfig
@@ -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
diff --git a/drivers/gpu/drm/msm/msm_fbdev.c b/drivers/gpu/drm/msm/msm_fbdev.c
index ce0ba6d1979a..fa9c1cbffae3 100644
--- a/drivers/gpu/drm/msm/msm_fbdev.c
+++ b/drivers/gpu/drm/msm/msm_fbdev.c
@@ -4,6 +4,8 @@
  * Author: Rob Clark <robdclark@gmail.com>
  */
 
+#include <linux/fb.h>
+
 #include <drm/drm_drv.h>
 #include <drm/drm_crtc_helper.h>
 #include <drm/drm_fb_helper.h>
@@ -23,6 +25,10 @@ module_param(fbdev, bool, 0600);
  * fbdev funcs, to implement legacy fbdev interface on top of drm driver
  */
 
+FB_GEN_DEFAULT_DEFERRED_SYS_OPS(msm_fbdev,
+				drm_fb_helper_damage_range,
+				drm_fb_helper_damage_area)
+
 static int msm_fbdev_mmap(struct fb_info *info, struct vm_area_struct *vma)
 {
 	struct drm_fb_helper *helper = (struct drm_fb_helper *)info->par;
@@ -52,16 +58,9 @@ static void msm_fbdev_fb_destroy(struct fb_info *info)
 
 static const struct fb_ops msm_fb_ops = {
 	.owner = THIS_MODULE,
+	__FB_DEFAULT_DEFERRED_OPS_RDWR(msm_fbdev),
 	DRM_FB_HELPER_DEFAULT_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_DEFAULT_DEFERRED_OPS_DRAW(msm_fbdev),
 	.fb_mmap = msm_fbdev_mmap,
 	.fb_destroy = msm_fbdev_fb_destroy,
 };
-- 
2.40.1


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

* [Intel-gfx] [PATCH v4 09/13] drm/omapdrm: Use regular fbdev I/O helpers
  2023-05-24  9:21 ` [Intel-gfx] " Thomas Zimmermann
  (?)
  (?)
@ 2023-05-24  9:21   ` Thomas Zimmermann
  -1 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: linux-samsung-soc, Tomi Valkeinen, linux-arm-msm, intel-gfx,
	dri-devel, amd-gfx, Thomas Zimmermann, linux-tegra, freedreno,
	linux-arm-kernel

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

v4:
	* use initializer macros for struct fb_ops
v2:
	* use FB_SYS_HELPERS option

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Tomi Valkeinen <tomba@kernel.org>
---
 drivers/gpu/drm/omapdrm/Kconfig      |  1 +
 drivers/gpu/drm/omapdrm/omap_fbdev.c | 11 +++--------
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/Kconfig b/drivers/gpu/drm/omapdrm/Kconfig
index 76ded1568bd0..b4ac76c9f31b 100644
--- a/drivers/gpu/drm/omapdrm/Kconfig
+++ b/drivers/gpu/drm/omapdrm/Kconfig
@@ -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
diff --git a/drivers/gpu/drm/omapdrm/omap_fbdev.c b/drivers/gpu/drm/omapdrm/omap_fbdev.c
index b950e93b3846..b7ccce0704a3 100644
--- a/drivers/gpu/drm/omapdrm/omap_fbdev.c
+++ b/drivers/gpu/drm/omapdrm/omap_fbdev.c
@@ -4,6 +4,8 @@
  * Author: Rob Clark <rob@ti.com>
  */
 
+#include <linux/fb.h>
+
 #include <drm/drm_drv.h>
 #include <drm/drm_crtc_helper.h>
 #include <drm/drm_fb_helper.h>
@@ -95,20 +97,13 @@ static void omap_fbdev_fb_destroy(struct fb_info *info)
 
 static const struct fb_ops omap_fb_ops = {
 	.owner = THIS_MODULE,
-
+	FB_DEFAULT_SYS_OPS,
 	.fb_check_var	= drm_fb_helper_check_var,
 	.fb_set_par	= drm_fb_helper_set_par,
 	.fb_setcmap	= drm_fb_helper_setcmap,
 	.fb_blank	= drm_fb_helper_blank,
 	.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_destroy = omap_fbdev_fb_destroy,
 };
 
-- 
2.40.1


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

* [PATCH v4 09/13] drm/omapdrm: Use regular fbdev I/O helpers
@ 2023-05-24  9:21   ` Thomas Zimmermann
  0 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: linux-samsung-soc, Tomi Valkeinen, linux-arm-msm, intel-gfx,
	dri-devel, amd-gfx, Thomas Zimmermann, linux-tegra, freedreno,
	linux-arm-kernel

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

v4:
	* use initializer macros for struct fb_ops
v2:
	* use FB_SYS_HELPERS option

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Tomi Valkeinen <tomba@kernel.org>
---
 drivers/gpu/drm/omapdrm/Kconfig      |  1 +
 drivers/gpu/drm/omapdrm/omap_fbdev.c | 11 +++--------
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/Kconfig b/drivers/gpu/drm/omapdrm/Kconfig
index 76ded1568bd0..b4ac76c9f31b 100644
--- a/drivers/gpu/drm/omapdrm/Kconfig
+++ b/drivers/gpu/drm/omapdrm/Kconfig
@@ -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
diff --git a/drivers/gpu/drm/omapdrm/omap_fbdev.c b/drivers/gpu/drm/omapdrm/omap_fbdev.c
index b950e93b3846..b7ccce0704a3 100644
--- a/drivers/gpu/drm/omapdrm/omap_fbdev.c
+++ b/drivers/gpu/drm/omapdrm/omap_fbdev.c
@@ -4,6 +4,8 @@
  * Author: Rob Clark <rob@ti.com>
  */
 
+#include <linux/fb.h>
+
 #include <drm/drm_drv.h>
 #include <drm/drm_crtc_helper.h>
 #include <drm/drm_fb_helper.h>
@@ -95,20 +97,13 @@ static void omap_fbdev_fb_destroy(struct fb_info *info)
 
 static const struct fb_ops omap_fb_ops = {
 	.owner = THIS_MODULE,
-
+	FB_DEFAULT_SYS_OPS,
 	.fb_check_var	= drm_fb_helper_check_var,
 	.fb_set_par	= drm_fb_helper_set_par,
 	.fb_setcmap	= drm_fb_helper_setcmap,
 	.fb_blank	= drm_fb_helper_blank,
 	.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_destroy = omap_fbdev_fb_destroy,
 };
 
-- 
2.40.1


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

* [PATCH v4 09/13] drm/omapdrm: Use regular fbdev I/O helpers
@ 2023-05-24  9:21   ` Thomas Zimmermann
  0 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: dri-devel, linux-arm-kernel, linux-samsung-soc, intel-gfx,
	linux-arm-msm, freedreno, amd-gfx, linux-tegra,
	Thomas Zimmermann, Tomi Valkeinen

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

v4:
	* use initializer macros for struct fb_ops
v2:
	* use FB_SYS_HELPERS option

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Tomi Valkeinen <tomba@kernel.org>
---
 drivers/gpu/drm/omapdrm/Kconfig      |  1 +
 drivers/gpu/drm/omapdrm/omap_fbdev.c | 11 +++--------
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/Kconfig b/drivers/gpu/drm/omapdrm/Kconfig
index 76ded1568bd0..b4ac76c9f31b 100644
--- a/drivers/gpu/drm/omapdrm/Kconfig
+++ b/drivers/gpu/drm/omapdrm/Kconfig
@@ -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
diff --git a/drivers/gpu/drm/omapdrm/omap_fbdev.c b/drivers/gpu/drm/omapdrm/omap_fbdev.c
index b950e93b3846..b7ccce0704a3 100644
--- a/drivers/gpu/drm/omapdrm/omap_fbdev.c
+++ b/drivers/gpu/drm/omapdrm/omap_fbdev.c
@@ -4,6 +4,8 @@
  * Author: Rob Clark <rob@ti.com>
  */
 
+#include <linux/fb.h>
+
 #include <drm/drm_drv.h>
 #include <drm/drm_crtc_helper.h>
 #include <drm/drm_fb_helper.h>
@@ -95,20 +97,13 @@ static void omap_fbdev_fb_destroy(struct fb_info *info)
 
 static const struct fb_ops omap_fb_ops = {
 	.owner = THIS_MODULE,
-
+	FB_DEFAULT_SYS_OPS,
 	.fb_check_var	= drm_fb_helper_check_var,
 	.fb_set_par	= drm_fb_helper_set_par,
 	.fb_setcmap	= drm_fb_helper_setcmap,
 	.fb_blank	= drm_fb_helper_blank,
 	.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_destroy = omap_fbdev_fb_destroy,
 };
 
-- 
2.40.1


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

* [PATCH v4 09/13] drm/omapdrm: Use regular fbdev I/O helpers
@ 2023-05-24  9:21   ` Thomas Zimmermann
  0 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: dri-devel, linux-arm-kernel, linux-samsung-soc, intel-gfx,
	linux-arm-msm, freedreno, amd-gfx, linux-tegra,
	Thomas Zimmermann, Tomi Valkeinen

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

v4:
	* use initializer macros for struct fb_ops
v2:
	* use FB_SYS_HELPERS option

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Tomi Valkeinen <tomba@kernel.org>
---
 drivers/gpu/drm/omapdrm/Kconfig      |  1 +
 drivers/gpu/drm/omapdrm/omap_fbdev.c | 11 +++--------
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/Kconfig b/drivers/gpu/drm/omapdrm/Kconfig
index 76ded1568bd0..b4ac76c9f31b 100644
--- a/drivers/gpu/drm/omapdrm/Kconfig
+++ b/drivers/gpu/drm/omapdrm/Kconfig
@@ -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
diff --git a/drivers/gpu/drm/omapdrm/omap_fbdev.c b/drivers/gpu/drm/omapdrm/omap_fbdev.c
index b950e93b3846..b7ccce0704a3 100644
--- a/drivers/gpu/drm/omapdrm/omap_fbdev.c
+++ b/drivers/gpu/drm/omapdrm/omap_fbdev.c
@@ -4,6 +4,8 @@
  * Author: Rob Clark <rob@ti.com>
  */
 
+#include <linux/fb.h>
+
 #include <drm/drm_drv.h>
 #include <drm/drm_crtc_helper.h>
 #include <drm/drm_fb_helper.h>
@@ -95,20 +97,13 @@ static void omap_fbdev_fb_destroy(struct fb_info *info)
 
 static const struct fb_ops omap_fb_ops = {
 	.owner = THIS_MODULE,
-
+	FB_DEFAULT_SYS_OPS,
 	.fb_check_var	= drm_fb_helper_check_var,
 	.fb_set_par	= drm_fb_helper_set_par,
 	.fb_setcmap	= drm_fb_helper_setcmap,
 	.fb_blank	= drm_fb_helper_blank,
 	.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_destroy = omap_fbdev_fb_destroy,
 };
 
-- 
2.40.1


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

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

* [Intel-gfx] [PATCH v4 10/13] drm/tegra: Use regular fbdev I/O helpers
  2023-05-24  9:21 ` [Intel-gfx] " Thomas Zimmermann
  (?)
  (?)
@ 2023-05-24  9:21   ` Thomas Zimmermann
  -1 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: linux-samsung-soc, linux-arm-msm, intel-gfx, dri-devel,
	Mikko Perttunen, amd-gfx, Thomas Zimmermann, linux-tegra,
	Jonathan Hunter, freedreno, linux-arm-kernel

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

v4:
	* use initializer macros for struct fb_ops
v2:
	* use FB_SYS_HELPERS option

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Mikko Perttunen <mperttunen@nvidia.com>
Cc: Jonathan Hunter <jonathanh@nvidia.com>
---
 drivers/gpu/drm/tegra/Kconfig | 1 +
 drivers/gpu/drm/tegra/fbdev.c | 8 +++-----
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/tegra/Kconfig b/drivers/gpu/drm/tegra/Kconfig
index 56453ca277c2..498313778175 100644
--- a/drivers/gpu/drm/tegra/Kconfig
+++ b/drivers/gpu/drm/tegra/Kconfig
@@ -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
diff --git a/drivers/gpu/drm/tegra/fbdev.c b/drivers/gpu/drm/tegra/fbdev.c
index dca9eccae466..e74d9be981c7 100644
--- a/drivers/gpu/drm/tegra/fbdev.c
+++ b/drivers/gpu/drm/tegra/fbdev.c
@@ -8,6 +8,7 @@
  */
 
 #include <linux/console.h>
+#include <linux/fb.h>
 #include <linux/vmalloc.h>
 
 #include <drm/drm_drv.h>
@@ -58,12 +59,9 @@ static void tegra_fbdev_fb_destroy(struct fb_info *info)
 
 static const struct fb_ops tegra_fb_ops = {
 	.owner = THIS_MODULE,
+	__FB_DEFAULT_SYS_OPS_RDWR,
 	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_DEFAULT_SYS_OPS_DRAW,
 	.fb_mmap = tegra_fb_mmap,
 	.fb_destroy = tegra_fbdev_fb_destroy,
 };
-- 
2.40.1


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

* [PATCH v4 10/13] drm/tegra: Use regular fbdev I/O helpers
@ 2023-05-24  9:21   ` Thomas Zimmermann
  0 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: linux-samsung-soc, linux-arm-msm, intel-gfx, dri-devel,
	Mikko Perttunen, Thierry Reding, amd-gfx, Thomas Zimmermann,
	linux-tegra, Jonathan Hunter, freedreno, linux-arm-kernel

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

v4:
	* use initializer macros for struct fb_ops
v2:
	* use FB_SYS_HELPERS option

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Mikko Perttunen <mperttunen@nvidia.com>
Cc: Jonathan Hunter <jonathanh@nvidia.com>
---
 drivers/gpu/drm/tegra/Kconfig | 1 +
 drivers/gpu/drm/tegra/fbdev.c | 8 +++-----
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/tegra/Kconfig b/drivers/gpu/drm/tegra/Kconfig
index 56453ca277c2..498313778175 100644
--- a/drivers/gpu/drm/tegra/Kconfig
+++ b/drivers/gpu/drm/tegra/Kconfig
@@ -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
diff --git a/drivers/gpu/drm/tegra/fbdev.c b/drivers/gpu/drm/tegra/fbdev.c
index dca9eccae466..e74d9be981c7 100644
--- a/drivers/gpu/drm/tegra/fbdev.c
+++ b/drivers/gpu/drm/tegra/fbdev.c
@@ -8,6 +8,7 @@
  */
 
 #include <linux/console.h>
+#include <linux/fb.h>
 #include <linux/vmalloc.h>
 
 #include <drm/drm_drv.h>
@@ -58,12 +59,9 @@ static void tegra_fbdev_fb_destroy(struct fb_info *info)
 
 static const struct fb_ops tegra_fb_ops = {
 	.owner = THIS_MODULE,
+	__FB_DEFAULT_SYS_OPS_RDWR,
 	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_DEFAULT_SYS_OPS_DRAW,
 	.fb_mmap = tegra_fb_mmap,
 	.fb_destroy = tegra_fbdev_fb_destroy,
 };
-- 
2.40.1


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

* [PATCH v4 10/13] drm/tegra: Use regular fbdev I/O helpers
@ 2023-05-24  9:21   ` Thomas Zimmermann
  0 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: dri-devel, linux-arm-kernel, linux-samsung-soc, intel-gfx,
	linux-arm-msm, freedreno, amd-gfx, linux-tegra,
	Thomas Zimmermann, Thierry Reding, Mikko Perttunen,
	Jonathan Hunter

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

v4:
	* use initializer macros for struct fb_ops
v2:
	* use FB_SYS_HELPERS option

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Mikko Perttunen <mperttunen@nvidia.com>
Cc: Jonathan Hunter <jonathanh@nvidia.com>
---
 drivers/gpu/drm/tegra/Kconfig | 1 +
 drivers/gpu/drm/tegra/fbdev.c | 8 +++-----
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/tegra/Kconfig b/drivers/gpu/drm/tegra/Kconfig
index 56453ca277c2..498313778175 100644
--- a/drivers/gpu/drm/tegra/Kconfig
+++ b/drivers/gpu/drm/tegra/Kconfig
@@ -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
diff --git a/drivers/gpu/drm/tegra/fbdev.c b/drivers/gpu/drm/tegra/fbdev.c
index dca9eccae466..e74d9be981c7 100644
--- a/drivers/gpu/drm/tegra/fbdev.c
+++ b/drivers/gpu/drm/tegra/fbdev.c
@@ -8,6 +8,7 @@
  */
 
 #include <linux/console.h>
+#include <linux/fb.h>
 #include <linux/vmalloc.h>
 
 #include <drm/drm_drv.h>
@@ -58,12 +59,9 @@ static void tegra_fbdev_fb_destroy(struct fb_info *info)
 
 static const struct fb_ops tegra_fb_ops = {
 	.owner = THIS_MODULE,
+	__FB_DEFAULT_SYS_OPS_RDWR,
 	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_DEFAULT_SYS_OPS_DRAW,
 	.fb_mmap = tegra_fb_mmap,
 	.fb_destroy = tegra_fbdev_fb_destroy,
 };
-- 
2.40.1


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

* [PATCH v4 10/13] drm/tegra: Use regular fbdev I/O helpers
@ 2023-05-24  9:21   ` Thomas Zimmermann
  0 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: dri-devel, linux-arm-kernel, linux-samsung-soc, intel-gfx,
	linux-arm-msm, freedreno, amd-gfx, linux-tegra,
	Thomas Zimmermann, Thierry Reding, Mikko Perttunen,
	Jonathan Hunter

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

v4:
	* use initializer macros for struct fb_ops
v2:
	* use FB_SYS_HELPERS option

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Mikko Perttunen <mperttunen@nvidia.com>
Cc: Jonathan Hunter <jonathanh@nvidia.com>
---
 drivers/gpu/drm/tegra/Kconfig | 1 +
 drivers/gpu/drm/tegra/fbdev.c | 8 +++-----
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/tegra/Kconfig b/drivers/gpu/drm/tegra/Kconfig
index 56453ca277c2..498313778175 100644
--- a/drivers/gpu/drm/tegra/Kconfig
+++ b/drivers/gpu/drm/tegra/Kconfig
@@ -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
diff --git a/drivers/gpu/drm/tegra/fbdev.c b/drivers/gpu/drm/tegra/fbdev.c
index dca9eccae466..e74d9be981c7 100644
--- a/drivers/gpu/drm/tegra/fbdev.c
+++ b/drivers/gpu/drm/tegra/fbdev.c
@@ -8,6 +8,7 @@
  */
 
 #include <linux/console.h>
+#include <linux/fb.h>
 #include <linux/vmalloc.h>
 
 #include <drm/drm_drv.h>
@@ -58,12 +59,9 @@ static void tegra_fbdev_fb_destroy(struct fb_info *info)
 
 static const struct fb_ops tegra_fb_ops = {
 	.owner = THIS_MODULE,
+	__FB_DEFAULT_SYS_OPS_RDWR,
 	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_DEFAULT_SYS_OPS_DRAW,
 	.fb_mmap = tegra_fb_mmap,
 	.fb_destroy = tegra_fbdev_fb_destroy,
 };
-- 
2.40.1


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

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

* [Intel-gfx] [PATCH v4 11/13] drm/fb-helper: Export helpers for marking damage areas
  2023-05-24  9:21 ` [Intel-gfx] " Thomas Zimmermann
  (?)
  (?)
@ 2023-05-24  9:21   ` Thomas Zimmermann
  -1 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: linux-samsung-soc, linux-arm-msm, intel-gfx, dri-devel, amd-gfx,
	Thomas Zimmermann, linux-tegra, freedreno, linux-arm-kernel

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

v4:
	* update interfaces

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/gpu/drm/drm_fb_helper.c | 22 ++++++++++++++++++++++
 include/drm/drm_fb_helper.h     |  3 +++
 2 files changed, 25 insertions(+)

diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index f0e9549b6bd7..cb03099fd2e3 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -670,6 +670,28 @@ 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 fb_info *info, off_t off, size_t len)
+{
+	struct drm_fb_helper *fb_helper = info->par;
+	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);
+
+/* Don't use in new code. */
+void drm_fb_helper_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u32 height)
+{
+	struct drm_fb_helper *fb_helper = info->par;
+
+	drm_fb_helper_damage(fb_helper, x, y, width, height);
+}
+EXPORT_SYMBOL(drm_fb_helper_damage_area);
+
 /**
  * drm_fb_helper_deferred_io() - fbdev deferred_io callback function
  * @info: fb_info struct pointer
diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
index 72032c354a30..7d5804882be7 100644
--- a/include/drm/drm_fb_helper.h
+++ b/include/drm/drm_fb_helper.h
@@ -253,6 +253,9 @@ 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_range(struct fb_info *info, off_t off, size_t len);
+void drm_fb_helper_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u32 height);
+
 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,
-- 
2.40.1


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

* [PATCH v4 11/13] drm/fb-helper: Export helpers for marking damage areas
@ 2023-05-24  9:21   ` Thomas Zimmermann
  0 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: linux-samsung-soc, linux-arm-msm, intel-gfx, dri-devel, amd-gfx,
	Thomas Zimmermann, linux-tegra, freedreno, linux-arm-kernel

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

v4:
	* update interfaces

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/gpu/drm/drm_fb_helper.c | 22 ++++++++++++++++++++++
 include/drm/drm_fb_helper.h     |  3 +++
 2 files changed, 25 insertions(+)

diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index f0e9549b6bd7..cb03099fd2e3 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -670,6 +670,28 @@ 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 fb_info *info, off_t off, size_t len)
+{
+	struct drm_fb_helper *fb_helper = info->par;
+	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);
+
+/* Don't use in new code. */
+void drm_fb_helper_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u32 height)
+{
+	struct drm_fb_helper *fb_helper = info->par;
+
+	drm_fb_helper_damage(fb_helper, x, y, width, height);
+}
+EXPORT_SYMBOL(drm_fb_helper_damage_area);
+
 /**
  * drm_fb_helper_deferred_io() - fbdev deferred_io callback function
  * @info: fb_info struct pointer
diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
index 72032c354a30..7d5804882be7 100644
--- a/include/drm/drm_fb_helper.h
+++ b/include/drm/drm_fb_helper.h
@@ -253,6 +253,9 @@ 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_range(struct fb_info *info, off_t off, size_t len);
+void drm_fb_helper_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u32 height);
+
 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,
-- 
2.40.1


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

* [PATCH v4 11/13] drm/fb-helper: Export helpers for marking damage areas
@ 2023-05-24  9:21   ` Thomas Zimmermann
  0 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: dri-devel, linux-arm-kernel, linux-samsung-soc, intel-gfx,
	linux-arm-msm, freedreno, amd-gfx, linux-tegra,
	Thomas Zimmermann

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

v4:
	* update interfaces

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/gpu/drm/drm_fb_helper.c | 22 ++++++++++++++++++++++
 include/drm/drm_fb_helper.h     |  3 +++
 2 files changed, 25 insertions(+)

diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index f0e9549b6bd7..cb03099fd2e3 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -670,6 +670,28 @@ 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 fb_info *info, off_t off, size_t len)
+{
+	struct drm_fb_helper *fb_helper = info->par;
+	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);
+
+/* Don't use in new code. */
+void drm_fb_helper_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u32 height)
+{
+	struct drm_fb_helper *fb_helper = info->par;
+
+	drm_fb_helper_damage(fb_helper, x, y, width, height);
+}
+EXPORT_SYMBOL(drm_fb_helper_damage_area);
+
 /**
  * drm_fb_helper_deferred_io() - fbdev deferred_io callback function
  * @info: fb_info struct pointer
diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
index 72032c354a30..7d5804882be7 100644
--- a/include/drm/drm_fb_helper.h
+++ b/include/drm/drm_fb_helper.h
@@ -253,6 +253,9 @@ 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_range(struct fb_info *info, off_t off, size_t len);
+void drm_fb_helper_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u32 height);
+
 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,
-- 
2.40.1


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

* [PATCH v4 11/13] drm/fb-helper: Export helpers for marking damage areas
@ 2023-05-24  9:21   ` Thomas Zimmermann
  0 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: dri-devel, linux-arm-kernel, linux-samsung-soc, intel-gfx,
	linux-arm-msm, freedreno, amd-gfx, linux-tegra,
	Thomas Zimmermann

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

v4:
	* update interfaces

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/gpu/drm/drm_fb_helper.c | 22 ++++++++++++++++++++++
 include/drm/drm_fb_helper.h     |  3 +++
 2 files changed, 25 insertions(+)

diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index f0e9549b6bd7..cb03099fd2e3 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -670,6 +670,28 @@ 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 fb_info *info, off_t off, size_t len)
+{
+	struct drm_fb_helper *fb_helper = info->par;
+	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);
+
+/* Don't use in new code. */
+void drm_fb_helper_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u32 height)
+{
+	struct drm_fb_helper *fb_helper = info->par;
+
+	drm_fb_helper_damage(fb_helper, x, y, width, height);
+}
+EXPORT_SYMBOL(drm_fb_helper_damage_area);
+
 /**
  * drm_fb_helper_deferred_io() - fbdev deferred_io callback function
  * @info: fb_info struct pointer
diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
index 72032c354a30..7d5804882be7 100644
--- a/include/drm/drm_fb_helper.h
+++ b/include/drm/drm_fb_helper.h
@@ -253,6 +253,9 @@ 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_range(struct fb_info *info, off_t off, size_t len);
+void drm_fb_helper_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u32 height);
+
 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,
-- 
2.40.1


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

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

* [PATCH v4 12/13] drm/fbdev-generic: Implement dedicated fbdev I/O helpers
  2023-05-24  9:21 ` [Intel-gfx] " Thomas Zimmermann
  (?)
  (?)
@ 2023-05-24  9:21   ` Thomas Zimmermann
  -1 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: dri-devel, linux-arm-kernel, linux-samsung-soc, intel-gfx,
	linux-arm-msm, freedreno, amd-gfx, linux-tegra,
	Thomas Zimmermann

Implement dedicated fbdev helpers for framebuffer I/O instead
of using DRM's helpers. Use an fbdev generator macro for
deferred I/O to create the callbacks. Fbdev-generic was the
only caller of the DRM helpers, so remove them from the helper
module.

v4:
	* generate deferred-I/O helpers
	* use initializer macros for fb_ops
v2:
	* use FB_SYS_HELPERS_DEFERRED option

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/gpu/drm/Kconfig             |   6 +-
 drivers/gpu/drm/drm_fb_helper.c     | 107 ----------------------------
 drivers/gpu/drm/drm_fbdev_generic.c |  11 ++-
 include/drm/drm_fb_helper.h         |  41 -----------
 4 files changed, 6 insertions(+), 159 deletions(-)

diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index 77fb10ddd8a2..92a782827b7b 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -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
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index cb03099fd2e3..bab6b252f02a 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -736,113 +736,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
diff --git a/drivers/gpu/drm/drm_fbdev_generic.c b/drivers/gpu/drm/drm_fbdev_generic.c
index 8e5148bf40bb..98ae703848a0 100644
--- a/drivers/gpu/drm/drm_fbdev_generic.c
+++ b/drivers/gpu/drm/drm_fbdev_generic.c
@@ -34,6 +34,10 @@ static int drm_fbdev_generic_fb_release(struct fb_info *info, int user)
 	return 0;
 }
 
+FB_GEN_DEFAULT_DEFERRED_SYS_OPS(drm_fbdev_generic,
+				drm_fb_helper_damage_range,
+				drm_fb_helper_damage_area);
+
 static void drm_fbdev_generic_fb_destroy(struct fb_info *info)
 {
 	struct drm_fb_helper *fb_helper = info->par;
@@ -56,13 +60,8 @@ 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_DEFAULT_DEFERRED_OPS(drm_fbdev_generic),
 	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_mmap	= fb_deferred_io_mmap,
 	.fb_destroy	= drm_fbdev_generic_fb_destroy,
 };
 
diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
index 7d5804882be7..b50fd0c0b713 100644
--- a/include/drm/drm_fb_helper.h
+++ b/include/drm/drm_fb_helper.h
@@ -258,18 +258,6 @@ void drm_fb_helper_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u3
 
 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,
-			       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,
@@ -397,35 +385,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)
 {
-- 
2.40.1


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

* [PATCH v4 12/13] drm/fbdev-generic: Implement dedicated fbdev I/O helpers
@ 2023-05-24  9:21   ` Thomas Zimmermann
  0 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: dri-devel, linux-arm-kernel, linux-samsung-soc, intel-gfx,
	linux-arm-msm, freedreno, amd-gfx, linux-tegra,
	Thomas Zimmermann

Implement dedicated fbdev helpers for framebuffer I/O instead
of using DRM's helpers. Use an fbdev generator macro for
deferred I/O to create the callbacks. Fbdev-generic was the
only caller of the DRM helpers, so remove them from the helper
module.

v4:
	* generate deferred-I/O helpers
	* use initializer macros for fb_ops
v2:
	* use FB_SYS_HELPERS_DEFERRED option

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/gpu/drm/Kconfig             |   6 +-
 drivers/gpu/drm/drm_fb_helper.c     | 107 ----------------------------
 drivers/gpu/drm/drm_fbdev_generic.c |  11 ++-
 include/drm/drm_fb_helper.h         |  41 -----------
 4 files changed, 6 insertions(+), 159 deletions(-)

diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index 77fb10ddd8a2..92a782827b7b 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -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
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index cb03099fd2e3..bab6b252f02a 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -736,113 +736,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
diff --git a/drivers/gpu/drm/drm_fbdev_generic.c b/drivers/gpu/drm/drm_fbdev_generic.c
index 8e5148bf40bb..98ae703848a0 100644
--- a/drivers/gpu/drm/drm_fbdev_generic.c
+++ b/drivers/gpu/drm/drm_fbdev_generic.c
@@ -34,6 +34,10 @@ static int drm_fbdev_generic_fb_release(struct fb_info *info, int user)
 	return 0;
 }
 
+FB_GEN_DEFAULT_DEFERRED_SYS_OPS(drm_fbdev_generic,
+				drm_fb_helper_damage_range,
+				drm_fb_helper_damage_area);
+
 static void drm_fbdev_generic_fb_destroy(struct fb_info *info)
 {
 	struct drm_fb_helper *fb_helper = info->par;
@@ -56,13 +60,8 @@ 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_DEFAULT_DEFERRED_OPS(drm_fbdev_generic),
 	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_mmap	= fb_deferred_io_mmap,
 	.fb_destroy	= drm_fbdev_generic_fb_destroy,
 };
 
diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
index 7d5804882be7..b50fd0c0b713 100644
--- a/include/drm/drm_fb_helper.h
+++ b/include/drm/drm_fb_helper.h
@@ -258,18 +258,6 @@ void drm_fb_helper_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u3
 
 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,
-			       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,
@@ -397,35 +385,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)
 {
-- 
2.40.1


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

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

* [PATCH v4 12/13] drm/fbdev-generic: Implement dedicated fbdev I/O helpers
@ 2023-05-24  9:21   ` Thomas Zimmermann
  0 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: linux-samsung-soc, linux-arm-msm, intel-gfx, dri-devel, amd-gfx,
	Thomas Zimmermann, linux-tegra, freedreno, linux-arm-kernel

Implement dedicated fbdev helpers for framebuffer I/O instead
of using DRM's helpers. Use an fbdev generator macro for
deferred I/O to create the callbacks. Fbdev-generic was the
only caller of the DRM helpers, so remove them from the helper
module.

v4:
	* generate deferred-I/O helpers
	* use initializer macros for fb_ops
v2:
	* use FB_SYS_HELPERS_DEFERRED option

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/gpu/drm/Kconfig             |   6 +-
 drivers/gpu/drm/drm_fb_helper.c     | 107 ----------------------------
 drivers/gpu/drm/drm_fbdev_generic.c |  11 ++-
 include/drm/drm_fb_helper.h         |  41 -----------
 4 files changed, 6 insertions(+), 159 deletions(-)

diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index 77fb10ddd8a2..92a782827b7b 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -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
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index cb03099fd2e3..bab6b252f02a 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -736,113 +736,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
diff --git a/drivers/gpu/drm/drm_fbdev_generic.c b/drivers/gpu/drm/drm_fbdev_generic.c
index 8e5148bf40bb..98ae703848a0 100644
--- a/drivers/gpu/drm/drm_fbdev_generic.c
+++ b/drivers/gpu/drm/drm_fbdev_generic.c
@@ -34,6 +34,10 @@ static int drm_fbdev_generic_fb_release(struct fb_info *info, int user)
 	return 0;
 }
 
+FB_GEN_DEFAULT_DEFERRED_SYS_OPS(drm_fbdev_generic,
+				drm_fb_helper_damage_range,
+				drm_fb_helper_damage_area);
+
 static void drm_fbdev_generic_fb_destroy(struct fb_info *info)
 {
 	struct drm_fb_helper *fb_helper = info->par;
@@ -56,13 +60,8 @@ 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_DEFAULT_DEFERRED_OPS(drm_fbdev_generic),
 	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_mmap	= fb_deferred_io_mmap,
 	.fb_destroy	= drm_fbdev_generic_fb_destroy,
 };
 
diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
index 7d5804882be7..b50fd0c0b713 100644
--- a/include/drm/drm_fb_helper.h
+++ b/include/drm/drm_fb_helper.h
@@ -258,18 +258,6 @@ void drm_fb_helper_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u3
 
 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,
-			       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,
@@ -397,35 +385,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)
 {
-- 
2.40.1


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

* [Intel-gfx] [PATCH v4 12/13] drm/fbdev-generic: Implement dedicated fbdev I/O helpers
@ 2023-05-24  9:21   ` Thomas Zimmermann
  0 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: linux-samsung-soc, linux-arm-msm, intel-gfx, dri-devel, amd-gfx,
	Thomas Zimmermann, linux-tegra, freedreno, linux-arm-kernel

Implement dedicated fbdev helpers for framebuffer I/O instead
of using DRM's helpers. Use an fbdev generator macro for
deferred I/O to create the callbacks. Fbdev-generic was the
only caller of the DRM helpers, so remove them from the helper
module.

v4:
	* generate deferred-I/O helpers
	* use initializer macros for fb_ops
v2:
	* use FB_SYS_HELPERS_DEFERRED option

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/gpu/drm/Kconfig             |   6 +-
 drivers/gpu/drm/drm_fb_helper.c     | 107 ----------------------------
 drivers/gpu/drm/drm_fbdev_generic.c |  11 ++-
 include/drm/drm_fb_helper.h         |  41 -----------
 4 files changed, 6 insertions(+), 159 deletions(-)

diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index 77fb10ddd8a2..92a782827b7b 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -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
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index cb03099fd2e3..bab6b252f02a 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -736,113 +736,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
diff --git a/drivers/gpu/drm/drm_fbdev_generic.c b/drivers/gpu/drm/drm_fbdev_generic.c
index 8e5148bf40bb..98ae703848a0 100644
--- a/drivers/gpu/drm/drm_fbdev_generic.c
+++ b/drivers/gpu/drm/drm_fbdev_generic.c
@@ -34,6 +34,10 @@ static int drm_fbdev_generic_fb_release(struct fb_info *info, int user)
 	return 0;
 }
 
+FB_GEN_DEFAULT_DEFERRED_SYS_OPS(drm_fbdev_generic,
+				drm_fb_helper_damage_range,
+				drm_fb_helper_damage_area);
+
 static void drm_fbdev_generic_fb_destroy(struct fb_info *info)
 {
 	struct drm_fb_helper *fb_helper = info->par;
@@ -56,13 +60,8 @@ 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_DEFAULT_DEFERRED_OPS(drm_fbdev_generic),
 	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_mmap	= fb_deferred_io_mmap,
 	.fb_destroy	= drm_fbdev_generic_fb_destroy,
 };
 
diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
index 7d5804882be7..b50fd0c0b713 100644
--- a/include/drm/drm_fb_helper.h
+++ b/include/drm/drm_fb_helper.h
@@ -258,18 +258,6 @@ void drm_fb_helper_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u3
 
 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,
-			       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,
@@ -397,35 +385,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)
 {
-- 
2.40.1


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

* [Intel-gfx] [PATCH v4 13/13] drm/i915: Implement dedicated fbdev I/O helpers
  2023-05-24  9:21 ` [Intel-gfx] " Thomas Zimmermann
                     ` (2 preceding siblings ...)
  (?)
@ 2023-05-24  9:21   ` Thomas Zimmermann
  -1 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: linux-samsung-soc, linux-arm-msm, intel-gfx, dri-devel, amd-gfx,
	Thomas Zimmermann, Rodrigo Vivi, linux-tegra, freedreno,
	linux-arm-kernel

Implement dedicated fbdev helpers for framebuffer I/O instead
of using DRM's helpers. Use an fbdev generator macro for
deferred I/O to create the fbdev callbacks. i915 was the only
caller of the DRM helpers, so remove them from the helper module.

i915's fbdev emulation is still incomplete as it doesn't implement
deferred I/O and damage handling for mmaped pages.

v4:
	* generate deferred-I/O helpers
	* use initializer macros for fb_ops
v2:
	* use FB_IO_HELPERS options

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Cc: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
---
 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 |  14 +--
 include/drm/drm_fb_helper.h                |  39 --------
 5 files changed, 9 insertions(+), 155 deletions(-)

diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index 92a782827b7b..bb2e48cc6cd6 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -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
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index bab6b252f02a..9978147bbc8a 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -736,113 +736,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_cfb_read - Implements struct &fb_ops.fb_read for I/O 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_cfb_read(struct fb_info *info, char __user *buf,
-			       size_t count, loff_t *ppos)
-{
-	return fb_io_read(info, buf, count, ppos);
-}
-EXPORT_SYMBOL(drm_fb_helper_cfb_read);
-
-/**
- * drm_fb_helper_cfb_write - Implements struct &fb_ops.fb_write for I/O 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_cfb_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_io_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_cfb_write);
-
-/**
- * drm_fb_helper_cfb_fillrect - wrapper around cfb_fillrect
- * @info: fbdev registered by the helper
- * @rect: info about rectangle to fill
- *
- * A wrapper around cfb_fillrect implemented by fbdev core
- */
-void drm_fb_helper_cfb_fillrect(struct fb_info *info,
-				const struct fb_fillrect *rect)
-{
-	struct drm_fb_helper *helper = info->par;
-
-	cfb_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_cfb_fillrect);
-
-/**
- * drm_fb_helper_cfb_copyarea - wrapper around cfb_copyarea
- * @info: fbdev registered by the helper
- * @area: info about area to copy
- *
- * A wrapper around cfb_copyarea implemented by fbdev core
- */
-void drm_fb_helper_cfb_copyarea(struct fb_info *info,
-				const struct fb_copyarea *area)
-{
-	struct drm_fb_helper *helper = info->par;
-
-	cfb_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_cfb_copyarea);
-
-/**
- * drm_fb_helper_cfb_imageblit - wrapper around cfb_imageblit
- * @info: fbdev registered by the helper
- * @image: info about image to blit
- *
- * A wrapper around cfb_imageblit implemented by fbdev core
- */
-void drm_fb_helper_cfb_imageblit(struct fb_info *info,
-				 const struct fb_image *image)
-{
-	struct drm_fb_helper *helper = info->par;
-
-	cfb_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_cfb_imageblit);
-
 /**
  * drm_fb_helper_set_suspend - wrapper around fb_set_suspend
  * @fb_helper: driver-allocated fbdev helper, can be NULL
diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig
index e4f4d2e3fdfe..01b5a8272a27 100644
--- a/drivers/gpu/drm/i915/Kconfig
+++ b/drivers/gpu/drm/i915/Kconfig
@@ -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
diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
index aab1ae74a8f7..eccaceaf8b9d 100644
--- a/drivers/gpu/drm/i915/display/intel_fbdev.c
+++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
@@ -28,6 +28,7 @@
 #include <linux/console.h>
 #include <linux/delay.h>
 #include <linux/errno.h>
+#include <linux/fb.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
@@ -84,6 +85,10 @@ static void intel_fbdev_invalidate(struct intel_fbdev *ifbdev)
 	intel_frontbuffer_invalidate(to_frontbuffer(ifbdev), ORIGIN_CPU);
 }
 
+FB_GEN_DEFAULT_DEFERRED_IO_OPS(intel_fbdev,
+			       drm_fb_helper_damage_range,
+			       drm_fb_helper_damage_area)
+
 static int intel_fbdev_set_par(struct fb_info *info)
 {
 	struct intel_fbdev *ifbdev = to_intel_fbdev(info->par);
@@ -132,15 +137,12 @@ static int intel_fbdev_mmap(struct fb_info *info, struct vm_area_struct *vma)
 
 static const struct fb_ops intelfb_ops = {
 	.owner = THIS_MODULE,
+	__FB_DEFAULT_DEFERRED_OPS_RDWR(intel_fbdev),
 	DRM_FB_HELPER_DEFAULT_OPS,
 	.fb_set_par = intel_fbdev_set_par,
-	.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_pan_display = intel_fbdev_pan_display,
 	.fb_blank = intel_fbdev_blank,
+	.fb_pan_display = intel_fbdev_pan_display,
+	__FB_DEFAULT_DEFERRED_OPS_DRAW(intel_fbdev),
 	.fb_mmap = intel_fbdev_mmap,
 };
 
diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
index b50fd0c0b713..4863b0f8299e 100644
--- a/include/drm/drm_fb_helper.h
+++ b/include/drm/drm_fb_helper.h
@@ -258,18 +258,6 @@ void drm_fb_helper_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u3
 
 void 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);
@@ -385,33 +373,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)
 {
-- 
2.40.1


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

* [PATCH v4 13/13] drm/i915: Implement dedicated fbdev I/O helpers
@ 2023-05-24  9:21   ` Thomas Zimmermann
  0 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: Jani Nikula, Tvrtko Ursulin, linux-samsung-soc, linux-arm-msm,
	intel-gfx, Joonas Lahtinen, dri-devel, Ville Syrjälä,
	amd-gfx, Thomas Zimmermann, Rodrigo Vivi, linux-tegra, freedreno,
	linux-arm-kernel

Implement dedicated fbdev helpers for framebuffer I/O instead
of using DRM's helpers. Use an fbdev generator macro for
deferred I/O to create the fbdev callbacks. i915 was the only
caller of the DRM helpers, so remove them from the helper module.

i915's fbdev emulation is still incomplete as it doesn't implement
deferred I/O and damage handling for mmaped pages.

v4:
	* generate deferred-I/O helpers
	* use initializer macros for fb_ops
v2:
	* use FB_IO_HELPERS options

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Cc: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
---
 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 |  14 +--
 include/drm/drm_fb_helper.h                |  39 --------
 5 files changed, 9 insertions(+), 155 deletions(-)

diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index 92a782827b7b..bb2e48cc6cd6 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -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
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index bab6b252f02a..9978147bbc8a 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -736,113 +736,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_cfb_read - Implements struct &fb_ops.fb_read for I/O 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_cfb_read(struct fb_info *info, char __user *buf,
-			       size_t count, loff_t *ppos)
-{
-	return fb_io_read(info, buf, count, ppos);
-}
-EXPORT_SYMBOL(drm_fb_helper_cfb_read);
-
-/**
- * drm_fb_helper_cfb_write - Implements struct &fb_ops.fb_write for I/O 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_cfb_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_io_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_cfb_write);
-
-/**
- * drm_fb_helper_cfb_fillrect - wrapper around cfb_fillrect
- * @info: fbdev registered by the helper
- * @rect: info about rectangle to fill
- *
- * A wrapper around cfb_fillrect implemented by fbdev core
- */
-void drm_fb_helper_cfb_fillrect(struct fb_info *info,
-				const struct fb_fillrect *rect)
-{
-	struct drm_fb_helper *helper = info->par;
-
-	cfb_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_cfb_fillrect);
-
-/**
- * drm_fb_helper_cfb_copyarea - wrapper around cfb_copyarea
- * @info: fbdev registered by the helper
- * @area: info about area to copy
- *
- * A wrapper around cfb_copyarea implemented by fbdev core
- */
-void drm_fb_helper_cfb_copyarea(struct fb_info *info,
-				const struct fb_copyarea *area)
-{
-	struct drm_fb_helper *helper = info->par;
-
-	cfb_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_cfb_copyarea);
-
-/**
- * drm_fb_helper_cfb_imageblit - wrapper around cfb_imageblit
- * @info: fbdev registered by the helper
- * @image: info about image to blit
- *
- * A wrapper around cfb_imageblit implemented by fbdev core
- */
-void drm_fb_helper_cfb_imageblit(struct fb_info *info,
-				 const struct fb_image *image)
-{
-	struct drm_fb_helper *helper = info->par;
-
-	cfb_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_cfb_imageblit);
-
 /**
  * drm_fb_helper_set_suspend - wrapper around fb_set_suspend
  * @fb_helper: driver-allocated fbdev helper, can be NULL
diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig
index e4f4d2e3fdfe..01b5a8272a27 100644
--- a/drivers/gpu/drm/i915/Kconfig
+++ b/drivers/gpu/drm/i915/Kconfig
@@ -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
diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
index aab1ae74a8f7..eccaceaf8b9d 100644
--- a/drivers/gpu/drm/i915/display/intel_fbdev.c
+++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
@@ -28,6 +28,7 @@
 #include <linux/console.h>
 #include <linux/delay.h>
 #include <linux/errno.h>
+#include <linux/fb.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
@@ -84,6 +85,10 @@ static void intel_fbdev_invalidate(struct intel_fbdev *ifbdev)
 	intel_frontbuffer_invalidate(to_frontbuffer(ifbdev), ORIGIN_CPU);
 }
 
+FB_GEN_DEFAULT_DEFERRED_IO_OPS(intel_fbdev,
+			       drm_fb_helper_damage_range,
+			       drm_fb_helper_damage_area)
+
 static int intel_fbdev_set_par(struct fb_info *info)
 {
 	struct intel_fbdev *ifbdev = to_intel_fbdev(info->par);
@@ -132,15 +137,12 @@ static int intel_fbdev_mmap(struct fb_info *info, struct vm_area_struct *vma)
 
 static const struct fb_ops intelfb_ops = {
 	.owner = THIS_MODULE,
+	__FB_DEFAULT_DEFERRED_OPS_RDWR(intel_fbdev),
 	DRM_FB_HELPER_DEFAULT_OPS,
 	.fb_set_par = intel_fbdev_set_par,
-	.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_pan_display = intel_fbdev_pan_display,
 	.fb_blank = intel_fbdev_blank,
+	.fb_pan_display = intel_fbdev_pan_display,
+	__FB_DEFAULT_DEFERRED_OPS_DRAW(intel_fbdev),
 	.fb_mmap = intel_fbdev_mmap,
 };
 
diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
index b50fd0c0b713..4863b0f8299e 100644
--- a/include/drm/drm_fb_helper.h
+++ b/include/drm/drm_fb_helper.h
@@ -258,18 +258,6 @@ void drm_fb_helper_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u3
 
 void 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);
@@ -385,33 +373,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)
 {
-- 
2.40.1


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

* [PATCH v4 13/13] drm/i915: Implement dedicated fbdev I/O helpers
@ 2023-05-24  9:21   ` Thomas Zimmermann
  0 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: dri-devel, linux-arm-kernel, linux-samsung-soc, intel-gfx,
	linux-arm-msm, freedreno, amd-gfx, linux-tegra,
	Thomas Zimmermann, Jani Nikula, Joonas Lahtinen, Rodrigo Vivi,
	Tvrtko Ursulin, Ville Syrjälä

Implement dedicated fbdev helpers for framebuffer I/O instead
of using DRM's helpers. Use an fbdev generator macro for
deferred I/O to create the fbdev callbacks. i915 was the only
caller of the DRM helpers, so remove them from the helper module.

i915's fbdev emulation is still incomplete as it doesn't implement
deferred I/O and damage handling for mmaped pages.

v4:
	* generate deferred-I/O helpers
	* use initializer macros for fb_ops
v2:
	* use FB_IO_HELPERS options

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Cc: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
---
 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 |  14 +--
 include/drm/drm_fb_helper.h                |  39 --------
 5 files changed, 9 insertions(+), 155 deletions(-)

diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index 92a782827b7b..bb2e48cc6cd6 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -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
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index bab6b252f02a..9978147bbc8a 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -736,113 +736,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_cfb_read - Implements struct &fb_ops.fb_read for I/O 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_cfb_read(struct fb_info *info, char __user *buf,
-			       size_t count, loff_t *ppos)
-{
-	return fb_io_read(info, buf, count, ppos);
-}
-EXPORT_SYMBOL(drm_fb_helper_cfb_read);
-
-/**
- * drm_fb_helper_cfb_write - Implements struct &fb_ops.fb_write for I/O 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_cfb_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_io_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_cfb_write);
-
-/**
- * drm_fb_helper_cfb_fillrect - wrapper around cfb_fillrect
- * @info: fbdev registered by the helper
- * @rect: info about rectangle to fill
- *
- * A wrapper around cfb_fillrect implemented by fbdev core
- */
-void drm_fb_helper_cfb_fillrect(struct fb_info *info,
-				const struct fb_fillrect *rect)
-{
-	struct drm_fb_helper *helper = info->par;
-
-	cfb_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_cfb_fillrect);
-
-/**
- * drm_fb_helper_cfb_copyarea - wrapper around cfb_copyarea
- * @info: fbdev registered by the helper
- * @area: info about area to copy
- *
- * A wrapper around cfb_copyarea implemented by fbdev core
- */
-void drm_fb_helper_cfb_copyarea(struct fb_info *info,
-				const struct fb_copyarea *area)
-{
-	struct drm_fb_helper *helper = info->par;
-
-	cfb_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_cfb_copyarea);
-
-/**
- * drm_fb_helper_cfb_imageblit - wrapper around cfb_imageblit
- * @info: fbdev registered by the helper
- * @image: info about image to blit
- *
- * A wrapper around cfb_imageblit implemented by fbdev core
- */
-void drm_fb_helper_cfb_imageblit(struct fb_info *info,
-				 const struct fb_image *image)
-{
-	struct drm_fb_helper *helper = info->par;
-
-	cfb_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_cfb_imageblit);
-
 /**
  * drm_fb_helper_set_suspend - wrapper around fb_set_suspend
  * @fb_helper: driver-allocated fbdev helper, can be NULL
diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig
index e4f4d2e3fdfe..01b5a8272a27 100644
--- a/drivers/gpu/drm/i915/Kconfig
+++ b/drivers/gpu/drm/i915/Kconfig
@@ -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
diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
index aab1ae74a8f7..eccaceaf8b9d 100644
--- a/drivers/gpu/drm/i915/display/intel_fbdev.c
+++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
@@ -28,6 +28,7 @@
 #include <linux/console.h>
 #include <linux/delay.h>
 #include <linux/errno.h>
+#include <linux/fb.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
@@ -84,6 +85,10 @@ static void intel_fbdev_invalidate(struct intel_fbdev *ifbdev)
 	intel_frontbuffer_invalidate(to_frontbuffer(ifbdev), ORIGIN_CPU);
 }
 
+FB_GEN_DEFAULT_DEFERRED_IO_OPS(intel_fbdev,
+			       drm_fb_helper_damage_range,
+			       drm_fb_helper_damage_area)
+
 static int intel_fbdev_set_par(struct fb_info *info)
 {
 	struct intel_fbdev *ifbdev = to_intel_fbdev(info->par);
@@ -132,15 +137,12 @@ static int intel_fbdev_mmap(struct fb_info *info, struct vm_area_struct *vma)
 
 static const struct fb_ops intelfb_ops = {
 	.owner = THIS_MODULE,
+	__FB_DEFAULT_DEFERRED_OPS_RDWR(intel_fbdev),
 	DRM_FB_HELPER_DEFAULT_OPS,
 	.fb_set_par = intel_fbdev_set_par,
-	.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_pan_display = intel_fbdev_pan_display,
 	.fb_blank = intel_fbdev_blank,
+	.fb_pan_display = intel_fbdev_pan_display,
+	__FB_DEFAULT_DEFERRED_OPS_DRAW(intel_fbdev),
 	.fb_mmap = intel_fbdev_mmap,
 };
 
diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
index b50fd0c0b713..4863b0f8299e 100644
--- a/include/drm/drm_fb_helper.h
+++ b/include/drm/drm_fb_helper.h
@@ -258,18 +258,6 @@ void drm_fb_helper_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u3
 
 void 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);
@@ -385,33 +373,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)
 {
-- 
2.40.1


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

* [PATCH v4 13/13] drm/i915: Implement dedicated fbdev I/O helpers
@ 2023-05-24  9:21   ` Thomas Zimmermann
  0 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: dri-devel, linux-arm-kernel, linux-samsung-soc, intel-gfx,
	linux-arm-msm, freedreno, amd-gfx, linux-tegra,
	Thomas Zimmermann, Jani Nikula, Joonas Lahtinen, Rodrigo Vivi,
	Tvrtko Ursulin, Ville Syrjälä

Implement dedicated fbdev helpers for framebuffer I/O instead
of using DRM's helpers. Use an fbdev generator macro for
deferred I/O to create the fbdev callbacks. i915 was the only
caller of the DRM helpers, so remove them from the helper module.

i915's fbdev emulation is still incomplete as it doesn't implement
deferred I/O and damage handling for mmaped pages.

v4:
	* generate deferred-I/O helpers
	* use initializer macros for fb_ops
v2:
	* use FB_IO_HELPERS options

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Cc: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
---
 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 |  14 +--
 include/drm/drm_fb_helper.h                |  39 --------
 5 files changed, 9 insertions(+), 155 deletions(-)

diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index 92a782827b7b..bb2e48cc6cd6 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -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
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index bab6b252f02a..9978147bbc8a 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -736,113 +736,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_cfb_read - Implements struct &fb_ops.fb_read for I/O 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_cfb_read(struct fb_info *info, char __user *buf,
-			       size_t count, loff_t *ppos)
-{
-	return fb_io_read(info, buf, count, ppos);
-}
-EXPORT_SYMBOL(drm_fb_helper_cfb_read);
-
-/**
- * drm_fb_helper_cfb_write - Implements struct &fb_ops.fb_write for I/O 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_cfb_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_io_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_cfb_write);
-
-/**
- * drm_fb_helper_cfb_fillrect - wrapper around cfb_fillrect
- * @info: fbdev registered by the helper
- * @rect: info about rectangle to fill
- *
- * A wrapper around cfb_fillrect implemented by fbdev core
- */
-void drm_fb_helper_cfb_fillrect(struct fb_info *info,
-				const struct fb_fillrect *rect)
-{
-	struct drm_fb_helper *helper = info->par;
-
-	cfb_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_cfb_fillrect);
-
-/**
- * drm_fb_helper_cfb_copyarea - wrapper around cfb_copyarea
- * @info: fbdev registered by the helper
- * @area: info about area to copy
- *
- * A wrapper around cfb_copyarea implemented by fbdev core
- */
-void drm_fb_helper_cfb_copyarea(struct fb_info *info,
-				const struct fb_copyarea *area)
-{
-	struct drm_fb_helper *helper = info->par;
-
-	cfb_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_cfb_copyarea);
-
-/**
- * drm_fb_helper_cfb_imageblit - wrapper around cfb_imageblit
- * @info: fbdev registered by the helper
- * @image: info about image to blit
- *
- * A wrapper around cfb_imageblit implemented by fbdev core
- */
-void drm_fb_helper_cfb_imageblit(struct fb_info *info,
-				 const struct fb_image *image)
-{
-	struct drm_fb_helper *helper = info->par;
-
-	cfb_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_cfb_imageblit);
-
 /**
  * drm_fb_helper_set_suspend - wrapper around fb_set_suspend
  * @fb_helper: driver-allocated fbdev helper, can be NULL
diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig
index e4f4d2e3fdfe..01b5a8272a27 100644
--- a/drivers/gpu/drm/i915/Kconfig
+++ b/drivers/gpu/drm/i915/Kconfig
@@ -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
diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
index aab1ae74a8f7..eccaceaf8b9d 100644
--- a/drivers/gpu/drm/i915/display/intel_fbdev.c
+++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
@@ -28,6 +28,7 @@
 #include <linux/console.h>
 #include <linux/delay.h>
 #include <linux/errno.h>
+#include <linux/fb.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
@@ -84,6 +85,10 @@ static void intel_fbdev_invalidate(struct intel_fbdev *ifbdev)
 	intel_frontbuffer_invalidate(to_frontbuffer(ifbdev), ORIGIN_CPU);
 }
 
+FB_GEN_DEFAULT_DEFERRED_IO_OPS(intel_fbdev,
+			       drm_fb_helper_damage_range,
+			       drm_fb_helper_damage_area)
+
 static int intel_fbdev_set_par(struct fb_info *info)
 {
 	struct intel_fbdev *ifbdev = to_intel_fbdev(info->par);
@@ -132,15 +137,12 @@ static int intel_fbdev_mmap(struct fb_info *info, struct vm_area_struct *vma)
 
 static const struct fb_ops intelfb_ops = {
 	.owner = THIS_MODULE,
+	__FB_DEFAULT_DEFERRED_OPS_RDWR(intel_fbdev),
 	DRM_FB_HELPER_DEFAULT_OPS,
 	.fb_set_par = intel_fbdev_set_par,
-	.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_pan_display = intel_fbdev_pan_display,
 	.fb_blank = intel_fbdev_blank,
+	.fb_pan_display = intel_fbdev_pan_display,
+	__FB_DEFAULT_DEFERRED_OPS_DRAW(intel_fbdev),
 	.fb_mmap = intel_fbdev_mmap,
 };
 
diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
index b50fd0c0b713..4863b0f8299e 100644
--- a/include/drm/drm_fb_helper.h
+++ b/include/drm/drm_fb_helper.h
@@ -258,18 +258,6 @@ void drm_fb_helper_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u3
 
 void 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);
@@ -385,33 +373,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)
 {
-- 
2.40.1


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

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

* [PATCH v4 13/13] drm/i915: Implement dedicated fbdev I/O helpers
@ 2023-05-24  9:21   ` Thomas Zimmermann
  0 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-24  9:21 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: Tvrtko Ursulin, linux-samsung-soc, linux-arm-msm, intel-gfx,
	dri-devel, amd-gfx, Thomas Zimmermann, Rodrigo Vivi, linux-tegra,
	freedreno, linux-arm-kernel

Implement dedicated fbdev helpers for framebuffer I/O instead
of using DRM's helpers. Use an fbdev generator macro for
deferred I/O to create the fbdev callbacks. i915 was the only
caller of the DRM helpers, so remove them from the helper module.

i915's fbdev emulation is still incomplete as it doesn't implement
deferred I/O and damage handling for mmaped pages.

v4:
	* generate deferred-I/O helpers
	* use initializer macros for fb_ops
v2:
	* use FB_IO_HELPERS options

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Cc: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
---
 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 |  14 +--
 include/drm/drm_fb_helper.h                |  39 --------
 5 files changed, 9 insertions(+), 155 deletions(-)

diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index 92a782827b7b..bb2e48cc6cd6 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -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
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index bab6b252f02a..9978147bbc8a 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -736,113 +736,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_cfb_read - Implements struct &fb_ops.fb_read for I/O 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_cfb_read(struct fb_info *info, char __user *buf,
-			       size_t count, loff_t *ppos)
-{
-	return fb_io_read(info, buf, count, ppos);
-}
-EXPORT_SYMBOL(drm_fb_helper_cfb_read);
-
-/**
- * drm_fb_helper_cfb_write - Implements struct &fb_ops.fb_write for I/O 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_cfb_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_io_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_cfb_write);
-
-/**
- * drm_fb_helper_cfb_fillrect - wrapper around cfb_fillrect
- * @info: fbdev registered by the helper
- * @rect: info about rectangle to fill
- *
- * A wrapper around cfb_fillrect implemented by fbdev core
- */
-void drm_fb_helper_cfb_fillrect(struct fb_info *info,
-				const struct fb_fillrect *rect)
-{
-	struct drm_fb_helper *helper = info->par;
-
-	cfb_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_cfb_fillrect);
-
-/**
- * drm_fb_helper_cfb_copyarea - wrapper around cfb_copyarea
- * @info: fbdev registered by the helper
- * @area: info about area to copy
- *
- * A wrapper around cfb_copyarea implemented by fbdev core
- */
-void drm_fb_helper_cfb_copyarea(struct fb_info *info,
-				const struct fb_copyarea *area)
-{
-	struct drm_fb_helper *helper = info->par;
-
-	cfb_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_cfb_copyarea);
-
-/**
- * drm_fb_helper_cfb_imageblit - wrapper around cfb_imageblit
- * @info: fbdev registered by the helper
- * @image: info about image to blit
- *
- * A wrapper around cfb_imageblit implemented by fbdev core
- */
-void drm_fb_helper_cfb_imageblit(struct fb_info *info,
-				 const struct fb_image *image)
-{
-	struct drm_fb_helper *helper = info->par;
-
-	cfb_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_cfb_imageblit);
-
 /**
  * drm_fb_helper_set_suspend - wrapper around fb_set_suspend
  * @fb_helper: driver-allocated fbdev helper, can be NULL
diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig
index e4f4d2e3fdfe..01b5a8272a27 100644
--- a/drivers/gpu/drm/i915/Kconfig
+++ b/drivers/gpu/drm/i915/Kconfig
@@ -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
diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
index aab1ae74a8f7..eccaceaf8b9d 100644
--- a/drivers/gpu/drm/i915/display/intel_fbdev.c
+++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
@@ -28,6 +28,7 @@
 #include <linux/console.h>
 #include <linux/delay.h>
 #include <linux/errno.h>
+#include <linux/fb.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
@@ -84,6 +85,10 @@ static void intel_fbdev_invalidate(struct intel_fbdev *ifbdev)
 	intel_frontbuffer_invalidate(to_frontbuffer(ifbdev), ORIGIN_CPU);
 }
 
+FB_GEN_DEFAULT_DEFERRED_IO_OPS(intel_fbdev,
+			       drm_fb_helper_damage_range,
+			       drm_fb_helper_damage_area)
+
 static int intel_fbdev_set_par(struct fb_info *info)
 {
 	struct intel_fbdev *ifbdev = to_intel_fbdev(info->par);
@@ -132,15 +137,12 @@ static int intel_fbdev_mmap(struct fb_info *info, struct vm_area_struct *vma)
 
 static const struct fb_ops intelfb_ops = {
 	.owner = THIS_MODULE,
+	__FB_DEFAULT_DEFERRED_OPS_RDWR(intel_fbdev),
 	DRM_FB_HELPER_DEFAULT_OPS,
 	.fb_set_par = intel_fbdev_set_par,
-	.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_pan_display = intel_fbdev_pan_display,
 	.fb_blank = intel_fbdev_blank,
+	.fb_pan_display = intel_fbdev_pan_display,
+	__FB_DEFAULT_DEFERRED_OPS_DRAW(intel_fbdev),
 	.fb_mmap = intel_fbdev_mmap,
 };
 
diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
index b50fd0c0b713..4863b0f8299e 100644
--- a/include/drm/drm_fb_helper.h
+++ b/include/drm/drm_fb_helper.h
@@ -258,18 +258,6 @@ void drm_fb_helper_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u3
 
 void 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);
@@ -385,33 +373,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)
 {
-- 
2.40.1


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

* [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/fbdev: Remove DRM's helpers for fbdev I/O (rev4)
  2023-05-24  9:21 ` [Intel-gfx] " Thomas Zimmermann
                   ` (15 preceding siblings ...)
  (?)
@ 2023-05-24 19:25 ` Patchwork
  -1 siblings, 0 replies; 134+ messages in thread
From: Patchwork @ 2023-05-24 19:25 UTC (permalink / raw)
  To: Thomas Zimmermann; +Cc: intel-gfx

== Series Details ==

Series: drm/fbdev: Remove DRM's helpers for fbdev I/O (rev4)
URL   : https://patchwork.freedesktop.org/series/117671/
State : warning

== Summary ==

Error: dim checkpatch failed
53f77f7c19f8 fbdev: Add Kconfig options to select different fb_ops helpers
f6426b54c18e fbdev: Add initializer macros for struct fb_ops
-:39: ERROR:CODE_INDENT: code indent should use tabs where possible
#39: FILE: include/linux/fb.h:550:
+        .fb_fillrect^I= cfb_fillrect, \$

-:39: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#39: FILE: include/linux/fb.h:550:
+        .fb_fillrect^I= cfb_fillrect, \$

-:40: ERROR:CODE_INDENT: code indent should use tabs where possible
#40: FILE: include/linux/fb.h:551:
+        .fb_copyarea^I= cfb_copyarea, \$

-:40: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#40: FILE: include/linux/fb.h:551:
+        .fb_copyarea^I= cfb_copyarea, \$

-:41: ERROR:CODE_INDENT: code indent should use tabs where possible
#41: FILE: include/linux/fb.h:552:
+        .fb_imageblit^I= cfb_imageblit$

-:41: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#41: FILE: include/linux/fb.h:552:
+        .fb_imageblit^I= cfb_imageblit$

-:46: ERROR:COMPLEX_MACRO: Macros with complex values should be enclosed in parentheses
#46: FILE: include/linux/fb.h:557:
+#define FB_DEFAULT_IO_OPS \
+	__FB_DEFAULT_IO_OPS_RDWR, \
+	__FB_DEFAULT_IO_OPS_DRAW, \
+	__FB_DEFAULT_IO_OPS_MMAP

-:71: ERROR:CODE_INDENT: code indent should use tabs where possible
#71: FILE: include/linux/fb.h:583:
+        .fb_fillrect^I= sys_fillrect, \$

-:71: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#71: FILE: include/linux/fb.h:583:
+        .fb_fillrect^I= sys_fillrect, \$

-:72: ERROR:CODE_INDENT: code indent should use tabs where possible
#72: FILE: include/linux/fb.h:584:
+        .fb_copyarea^I= sys_copyarea, \$

-:72: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#72: FILE: include/linux/fb.h:584:
+        .fb_copyarea^I= sys_copyarea, \$

-:73: ERROR:CODE_INDENT: code indent should use tabs where possible
#73: FILE: include/linux/fb.h:585:
+        .fb_imageblit^I= sys_imageblit$

-:73: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#73: FILE: include/linux/fb.h:585:
+        .fb_imageblit^I= sys_imageblit$

-:78: ERROR:COMPLEX_MACRO: Macros with complex values should be enclosed in parentheses
#78: FILE: include/linux/fb.h:590:
+#define FB_DEFAULT_SYS_OPS \
+	__FB_DEFAULT_SYS_OPS_RDWR, \
+	__FB_DEFAULT_SYS_OPS_DRAW, \
+	__FB_DEFAULT_SYS_OPS_MMAP

-:110: CHECK:MACRO_ARG_REUSE: Macro argument reuse '__damage_area' - possible side-effects?
#110: FILE: include/linux/fb.h:670:
+#define __FB_GEN_DEFAULT_DEFERRED_OPS_DRAW(__prefix, __damage_area, __mode) \
+	static void __prefix ## _defio_fillrect(struct fb_info *info, \
+						const struct fb_fillrect *rect) \
+	{ \
+		__mode ## _fillrect(info, rect); \
+		__damage_area(info, rect->dx, rect->dy, rect->width, rect->height); \
+	} \
+	static void __prefix ## _defio_copyarea(struct fb_info *info, \
+						const struct fb_copyarea *area) \
+	{ \
+		__mode ## _copyarea(info, area); \
+		__damage_area(info, area->dx, area->dy, area->width, area->height); \
+	} \
+	static void __prefix ## _defio_imageblit(struct fb_info *info, \
+						 const struct fb_image *image) \
+	{ \
+		__mode ## _imageblit(info, image); \
+		__damage_area(info, image->dx, image->dy, image->width, image->height); \
+	}

-:130: ERROR:COMPLEX_MACRO: Macros with complex values should be enclosed in parentheses
#130: FILE: include/linux/fb.h:690:
+#define FB_GEN_DEFAULT_DEFERRED_IO_OPS(__prefix, __damage_range, __damage_area) \
+	__FB_GEN_DEFAULT_DEFERRED_OPS_RDWR(__prefix, __damage_range, io) \
+	__FB_GEN_DEFAULT_DEFERRED_OPS_DRAW(__prefix, __damage_area, cfb)

-:130: CHECK:MACRO_ARG_REUSE: Macro argument reuse '__prefix' - possible side-effects?
#130: FILE: include/linux/fb.h:690:
+#define FB_GEN_DEFAULT_DEFERRED_IO_OPS(__prefix, __damage_range, __damage_area) \
+	__FB_GEN_DEFAULT_DEFERRED_OPS_RDWR(__prefix, __damage_range, io) \
+	__FB_GEN_DEFAULT_DEFERRED_OPS_DRAW(__prefix, __damage_area, cfb)

-:134: ERROR:COMPLEX_MACRO: Macros with complex values should be enclosed in parentheses
#134: FILE: include/linux/fb.h:694:
+#define FB_GEN_DEFAULT_DEFERRED_SYS_OPS(__prefix, __damage_range, __damage_area) \
+	__FB_GEN_DEFAULT_DEFERRED_OPS_RDWR(__prefix, __damage_range, sys) \
+	__FB_GEN_DEFAULT_DEFERRED_OPS_DRAW(__prefix, __damage_area, sys)

-:134: CHECK:MACRO_ARG_REUSE: Macro argument reuse '__prefix' - possible side-effects?
#134: FILE: include/linux/fb.h:694:
+#define FB_GEN_DEFAULT_DEFERRED_SYS_OPS(__prefix, __damage_range, __damage_area) \
+	__FB_GEN_DEFAULT_DEFERRED_OPS_RDWR(__prefix, __damage_range, sys) \
+	__FB_GEN_DEFAULT_DEFERRED_OPS_DRAW(__prefix, __damage_area, sys)

-:147: ERROR:CODE_INDENT: code indent should use tabs where possible
#147: FILE: include/linux/fb.h:707:
+        .fb_fillrect^I= __prefix ## _defio_fillrect, \$

-:147: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#147: FILE: include/linux/fb.h:707:
+        .fb_fillrect^I= __prefix ## _defio_fillrect, \$

-:148: ERROR:CODE_INDENT: code indent should use tabs where possible
#148: FILE: include/linux/fb.h:708:
+        .fb_copyarea^I= __prefix ## _defio_copyarea, \$

-:148: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#148: FILE: include/linux/fb.h:708:
+        .fb_copyarea^I= __prefix ## _defio_copyarea, \$

-:149: ERROR:CODE_INDENT: code indent should use tabs where possible
#149: FILE: include/linux/fb.h:709:
+        .fb_imageblit^I= __prefix ## _defio_imageblit$

-:149: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#149: FILE: include/linux/fb.h:709:
+        .fb_imageblit^I= __prefix ## _defio_imageblit$

-:154: ERROR:COMPLEX_MACRO: Macros with complex values should be enclosed in parentheses
#154: FILE: include/linux/fb.h:714:
+#define FB_DEFAULT_DEFERRED_OPS(__prefix) \
+	__FB_DEFAULT_DEFERRED_OPS_RDWR(__prefix), \
+	__FB_DEFAULT_DEFERRED_OPS_DRAW(__prefix), \
+	__FB_DEFAULT_DEFERRED_OPS_MMAP(__prefix)

-:154: CHECK:MACRO_ARG_REUSE: Macro argument reuse '__prefix' - possible side-effects?
#154: FILE: include/linux/fb.h:714:
+#define FB_DEFAULT_DEFERRED_OPS(__prefix) \
+	__FB_DEFAULT_DEFERRED_OPS_RDWR(__prefix), \
+	__FB_DEFAULT_DEFERRED_OPS_DRAW(__prefix), \
+	__FB_DEFAULT_DEFERRED_OPS_MMAP(__prefix)

total: 14 errors, 9 warnings, 4 checks, 133 lines checked
e493182c2236 drm/armada: Use regular fbdev I/O helpers
159bd857408f drm/exynos: Use regular fbdev I/O helpers
20551d544e87 drm/gma500: Use regular fbdev I/O helpers
57890b1e6124 drm/radeon: Use regular fbdev I/O helpers
1b166fa5fddd drm/fbdev-dma: Use regular fbdev I/O helpers
3958db34e25d drm/msm: Use regular fbdev I/O helpers
8a56657d53d6 drm/omapdrm: Use regular fbdev I/O helpers
8e7526c5fda2 drm/tegra: Use regular fbdev I/O helpers
71087dc6b386 drm/fb-helper: Export helpers for marking damage areas
89322e558595 drm/fbdev-generic: Implement dedicated fbdev I/O helpers
6429f9d4c336 drm/i915: Implement dedicated fbdev I/O helpers



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

* [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/fbdev: Remove DRM's helpers for fbdev I/O (rev4)
  2023-05-24  9:21 ` [Intel-gfx] " Thomas Zimmermann
                   ` (16 preceding siblings ...)
  (?)
@ 2023-05-24 19:26 ` Patchwork
  -1 siblings, 0 replies; 134+ messages in thread
From: Patchwork @ 2023-05-24 19:26 UTC (permalink / raw)
  To: Thomas Zimmermann; +Cc: intel-gfx

== Series Details ==

Series: drm/fbdev: Remove DRM's helpers for fbdev I/O (rev4)
URL   : https://patchwork.freedesktop.org/series/117671/
State : warning

== Summary ==

Error: dim sparse failed
Sparse version: v0.6.2
Fast mode used, each commit won't be checked separately.
+./arch/x86/include/asm/bitops.h:117:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:117:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:117:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:117:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:117:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:117:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:117:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:117:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:117:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:117:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:117:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:117:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:117:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:117:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:117:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:117:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:117:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:117:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:117:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:117:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:117:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:117:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:117:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:117:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:117:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:117:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:117:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:117:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:117:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:117:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:117:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:117:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:148:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:148:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:148:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:148:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:148:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:148:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:148:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:148:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:148:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:148:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:148:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:148:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:148:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:148:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:148:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:148:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:148:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:148:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:148:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:148:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:148:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:148:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:148:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:148:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:148:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:148:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:148:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:148:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:148:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:148:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:148:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:148:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:150:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:150:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:150:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:150:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:150:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:150:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:150:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:150:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:150:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:150:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:150:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:150:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:150:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:150:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:150:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:150:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:150:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:150:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:150:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:150:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:150:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:150:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:150:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:150:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:150:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:150:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:150:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:150:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:150:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:150:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:150:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:150:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:154:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:154:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:154:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:154:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:154:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:154:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:154:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:154:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:154:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:154:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:154:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:154:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:154:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:154:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:154:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:154:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:154:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:154:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:154:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:154:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:154:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:154:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:154:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:154:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:154:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:154:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:154:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:154:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:154:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:154:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:154:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:154:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:156:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:156:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:156:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:156:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:156:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:156:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:156:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:156:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:156:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:156:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:156:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:156:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:156:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:156:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:156:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:156:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:156:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:156:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:156:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:156:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:156:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:156:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:156:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:156:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:156:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:156:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:156:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:156:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:156:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:156:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:156:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:156:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:156:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:156:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:156:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:156:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:156:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:156:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:156:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:156:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:156:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:156:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:156:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:156:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:156:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:156:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:156:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:156:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:156:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:156:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:156:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:156:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:156:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:156:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:156:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:156:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:156:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:156:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:156:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:156:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:156:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:156:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:156:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:156:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:174:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:174:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:174:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:174:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:174:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:174:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:174:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:174:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:174:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:174:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:174:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:174:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:174:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:174:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:174:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:174:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:174:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:174:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:174:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:174:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:174:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:174:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:174:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:174:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:174:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:174:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:174:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:174:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:174:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:174:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:174:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:174:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:176:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:176:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:176:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:176:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:176:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:176:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:176:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:176:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:176:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:176:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:176:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:176:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:176:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:176:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:176:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:176:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:176:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:176:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:176:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:176:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:176:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:176:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:176:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:176:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:176:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:176:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:176:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:176:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:176:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:176:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:176:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:176:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:180:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:180:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:180:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:180:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:180:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:180:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:180:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:180:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:180:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:180:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:180:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:180:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:180:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:180:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:180:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:180:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:180:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:180:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:180:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:180:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:180:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:180:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:180:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:180:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:180:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:180:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:180:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:180:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:180:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:180:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:180:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:180:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:182:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:182:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:182:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:182:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:182:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:182:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:182:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:182:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:182:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:182:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:182:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:182:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:182:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:182:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:182:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:182:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:182:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:182:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:182:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:182:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:182:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:182:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:182:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:182:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:182:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:182:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:182:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:182:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:182:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:182:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:182:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:182:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:182:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:182:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:182:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:182:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:182:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:182:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:182:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:182:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:182:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:182:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:182:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:182:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:182:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:182:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:182:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:182:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:182:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:182:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:182:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:182:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:182:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:182:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:182:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:182:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:182:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:182:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:182:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:182:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:182:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:182:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:182:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:182:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:186:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:186:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:186:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:186:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:186:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:186:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:186:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:186:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:186:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:186:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:186:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:186:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:186:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:186:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:186:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:186:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:186:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:186:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:186:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:186:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:186:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:186:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:186:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:186:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:186:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:186:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:186:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:186:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:186:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:186:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:186:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:186:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:188:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:188:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:188:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:188:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:188:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:188:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:188:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:188:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:188:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:188:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:188:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:188:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:188:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:188:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:188:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:188:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:188:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:188:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:188:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:188:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:188:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:188:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:188:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:188:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:188:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:188:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:188:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:188:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:188:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:188:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:188:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:188:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:192:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:192:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:192:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:192:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:192:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:192:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:192:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:192:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:192:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:192:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:192:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:192:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:192:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:192:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:192:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:192:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:192:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:192:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:192:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:192:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:192:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:192:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:192:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:192:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:192:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:192:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:192:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:192:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:192:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:192:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:192:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:192:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:195:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:195:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:195:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:195:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:195:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:195:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:195:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:195:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:195:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:195:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:195:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:195:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:195:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:195:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:195:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:195:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:195:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:195:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:195:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:195:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:195:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:195:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:195:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:195:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:195:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:195:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:195:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:195:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:195:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:195:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:195:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:195:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:195:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:195:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:195:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:195:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:195:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:195:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:195:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:195:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:195:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:195:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:195:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:195:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:195:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:195:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:195:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:195:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:195:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:195:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:195:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:195:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:195:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:195:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:195:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:195:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:195:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:195:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:195:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:195:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:195:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:195:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:195:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:195:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:237:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:237:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:237:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:237:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:237:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:237:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:237:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:237:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:237:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:237:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:237:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:237:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:237:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:237:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:237:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:237:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:237:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:237:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:237:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:237:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:237:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:237:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:237:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:237:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:237:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:237:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:237:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:237:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:237:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:237:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:237:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:237:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:239:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:239:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:239:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:239:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:239:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:239:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:239:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:239:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:239:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:239:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:239:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:239:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:239:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:239:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:239:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:239:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:239:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:239:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:239:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:239:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:239:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:239:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:239:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:239:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:239:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:239:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:239:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:239:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:239:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:239:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:239:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:239:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:66:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:66:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:66:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:66:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:66:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:66:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:66:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:66:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:66:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:66:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:66:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:66:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:66:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:66:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:66:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:66:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:66:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:66:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:66:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:66:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:66:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:66:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:66:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:66:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:66:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:66:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:66:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:66:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:66:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:66:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:66:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:66:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:92:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:92:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:92:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:92:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:92:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:92:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:92:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:92:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:92:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:92:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:92:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:92:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:92:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:92:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:92:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:92:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:92:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:92:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:92:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:92:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:92:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:92:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:92:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:92:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:92:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:92:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:92:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:92:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:92:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:92:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:92:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:92:1: warning: unreplaced symbol 'return'
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:320:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:320:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:320:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:320:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:320:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+drivers/gpu/drm/radeon/atombios_encoders.c:1079:52:    expected unsigned short [addressable] [assigned] [usertype] usInitInfo
+drivers/gpu/drm/radeon/atombios_encoders.c:1079:52:    got restricted __le16 [usertype]
+drivers/gpu/drm/radeon/atombios_encoders.c:1079:52: warning: incorrect type in assignment (different base types)
+drivers/gpu/drm/radeon/atombios_encoders.c:1085:62:    expected unsigned short [addressable] [assigned] [usertype] usPixelClock
+drivers/gpu/drm/radeon/atombios_encoders.c:1085:62:    got restricted __le16 [usertype]
+drivers/gpu/drm/radeon/atombios_encoders.c:1085:62: warning: incorrect type in assignment (different base types)
+drivers/gpu/drm/radeon/atombios_encoders.c:1087:62:    expected unsigned short [addressable] [assigned] [usertype] usPixelClock
+drivers/gpu/drm/radeon/atombios_encoders.c:1087:62:    got restricted __le16 [usertype]
+drivers/gpu/drm/radeon/atombios_encoders.c:1087:62: warning: incorrect type in assignment (different base types)
+drivers/gpu/drm/radeon/atombios_encoders.c:1089:62:    expected unsigned short [addressable] [assigned] [usertype] usPixelClock
+drivers/gpu/drm/radeon/atombios_encoders.c:1089:62:    got restricted __le16 [usertype]
+drivers/gpu/drm/radeon/atombios_encoders.c:1089:62: warning: incorrect type in assignment (different base types)
+drivers/gpu/drm/radeon/atombios_encoders.c:1136:52: warning: too many warnings
+drivers/gpu/drm/radeon/atombios_encoders.c:389:27:    expected unsigned short [addressable] [assigned] [usertype] usPixelClock
+drivers/gpu/drm/radeon/atombios_encoders.c:389:27:    got restricted __le16 [usertype]
+drivers/gpu/drm/radeon/atombios_encoders.c:389:27: warning: incorrect type in assignment (different base types)
+drivers/gpu/drm/radeon/atombios_encoders.c:445:38:    expected unsigned short [addressable] [assigned] [usertype] usPixelClock
+drivers/gpu/drm/radeon/atombios_encoders.c:445:38:    got restricted __le16 [usertype]
+drivers/gpu/drm/radeon/atombios_encoders.c:445:38: warning: incorrect type in assignment (different base types)
+drivers/gpu/drm/radeon/atombios_encoders.c:518:59:    expected unsigned short [addressable] [assigned] [usertype] usPixelClock
+drivers/gpu/drm/radeon/atombios_encoders.c:518:59:    got restricted __le16 [usertype]
+drivers/gpu/drm/radeon/atombios_encoders.c:518:59: warning: incorrect type in assignment (different base types)
+drivers/gpu/drm/radeon/atombios_encoders.c:528:50:    expected unsigned short [addressable] [assigned] [usertype] usPixelClock
+drivers/gpu/drm/radeon/atombios_encoders.c:528:50:    got restricted __le16 [usertype]
+drivers/gpu/drm/radeon/atombios_encoders.c:528:50: warning: incorrect type in assignment (different base types)
+drivers/gpu/drm/radeon/atombios_encoders.c:534:50:    expected unsigned short [addressable] [assigned] [usertype] usPixelClock
+drivers/gpu/drm/radeon/atombios_encoders.c:534:50:    got restricted __le16 [usertype]
+drivers/gpu/drm/radeon/atombios_encoders.c:534:50: warning: incorrect type in assignment (different base types)
+drivers/gpu/drm/radeon/atombios_encoders.c:604:46:    expected unsigned short [addressable] [assigned] [usertype] usPixelClock
+drivers/gpu/drm/radeon/atombios_encoders.c:604:46:    got restricted __le16 [usertype]
+drivers/gpu/drm/radeon/atombios_encoders.c:604:46: warning: incorrect type in assignment (different base types)
+drivers/gpu/drm/radeon/atombios_encoders.c:629:46:    expected unsigned short [addressable] [assigned] [usertype] usPixelClock
+drivers/gpu/drm/radeon/atombios_encoders.c:629:46:    got restricted __le16 [usertype]
+drivers/gpu/drm/radeon/atombios_encoders.c:629:46: warning: incorrect type in assignment (different base types)
+drivers/gpu/drm/radeon/atombios_encoders.c:877:46:    expected unsigned short [addressable] [assigned] [usertype] usPixelClock
+drivers/gpu/drm/radeon/atombios_encoders.c:877:46:    got restricted __le16 [usertype]
+drivers/gpu/drm/radeon/atombios_encoders.c:877:46: warning: incorrect type in assignment (different base types)
+drivers/gpu/drm/radeon/atombios_encoders.c:914:46:    expected unsigned short [addressable] [assigned] [usertype] usPixelClock
+drivers/gpu/drm/radeon/atombios_encoders.c:914:46:    got restricted __le16 [usertype]
+drivers/gpu/drm/radeon/atombios_encoders.c:914:46: warning: incorrect type in assignment (different base types)
+drivers/gpu/drm/radeon/atombios_encoders.c:937:46:    expected unsigned short [addressable] [assigned] [usertype] usPixelClock
+drivers/gpu/drm/radeon/atombios_encoders.c:937:46:    got restricted __le16 [usertype]
+drivers/gpu/drm/radeon/atombios_encoders.c:937:46: warning: incorrect type in assignment (different base types)
+drivers/gpu/drm/radeon/radeon_atpx_handler.c:594:6: warning: symbol 'radeon_register_atpx_handler' was not declared. Should it be static?
+drivers/gpu/drm/radeon/radeon_atpx_handler.c:612:6: warning: symbol 'radeon_unregister_atpx_handler' was not declared. Should it be static?
+drivers/gpu/drm/radeon/radeon_atpx_handler.c:64:6: warning: symbol 'radeon_has_atpx' was not declared. Should it be static?
+drivers/gpu/drm/radeon/radeon_atpx_handler.c:68:6: warning: symbol 'radeon_has_atpx_dgpu_power_cntl' was not declared. Should it be static?
+drivers/gpu/drm/radeon/radeon_atpx_handler.c:72:6: warning: symbol 'radeon_is_atpx_hybrid' was not declared. Should it be static?
+drivers/gpu/drm/radeon/radeon_atpx_handler.c:76:6: warning: symbol 'radeon_atpx_dgpu_req_power_for_displays' was not declared. Should it be static?
+drivers/gpu/drm/radeon/radeon_kms.c:270:43:    expected void const [noderef] __user *from
+drivers/gpu/drm/radeon/radeon_kms.c:270:43:    got unsigned int [usertype] *[assigned] value_ptr
+drivers/gpu/drm/radeon/radeon_kms.c:270:43: warning: incorrect type in argument 2 (different address spaces)
+drivers/gpu/drm/radeon/radeon_kms.c:327:43:    expected void const [noderef] __user *from
+drivers/gpu/drm/radeon/radeon_kms.c:327:43:    got unsigned int [usertype] *[assigned] value_ptr
+drivers/gpu/drm/radeon/radeon_kms.c:327:43: warning: incorrect type in argument 2 (different address spaces)
+drivers/gpu/drm/radeon/radeon_kms.c:339:43:    expected void const [noderef] __user *from
+drivers/gpu/drm/radeon/radeon_kms.c:339:43:    got unsigned int [usertype] *[assigned] value_ptr
+drivers/gpu/drm/radeon/radeon_kms.c:339:43: warning: incorrect type in argument 2 (different address spaces)
+drivers/gpu/drm/radeon/radeon_kms.c:475:43:    expected void const [noderef] __user *from
+drivers/gpu/drm/radeon/radeon_kms.c:475:43:    got unsigned int [usertype] *[assigned] value_ptr
+drivers/gpu/drm/radeon/radeon_kms.c:475:43: warning: incorrect type in argument 2 (different address spaces)
+drivers/gpu/drm/radeon/radeon_kms.c:600:43:    expected void const [noderef] __user *from
+drivers/gpu/drm/radeon/radeon_kms.c:600:43:    got unsigned int [usertype] *[assigned] value_ptr
+drivers/gpu/drm/radeon/radeon_kms.c:600:43: warning: incorrect type in argument 2 (different address spaces)
+drivers/gpu/drm/radeon/radeon_kms.c:617:26:    expected void [noderef] __user *to
+drivers/gpu/drm/radeon/radeon_kms.c:617:26:    got unsigned int [usertype] *[assigned] value_ptr
+drivers/gpu/drm/radeon/radeon_kms.c:617:26: warning: incorrect type in argument 1 (different address spaces)
+./include/asm-generic/bitops/generic-non-atomic.h:100:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:100:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:100:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:100:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:100:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:100:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:100:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:100:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:100:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:100:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:100:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:100:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:100:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:100:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:100:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:100:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:100:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:100:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:100:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:100:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:100:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:100:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:100:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:100:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:100:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:100:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:100:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:100:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:100:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:100:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:100:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:100:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:100:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:100:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:100:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:100:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:100:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:100:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:100:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:100:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:100:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:100:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:100:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:100:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:100:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:100:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:100:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:100:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:100:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:100:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:100:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:100:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:100:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:100:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:100:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:100:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:100:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:100:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:100:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:100:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:100:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:100:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:100:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:100:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:100:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:100:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:100:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:100:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:100:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:100:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:100:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:100:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:100:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:100:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:100:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:100:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:100:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:100:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:100:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:100:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:100:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:100:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:100:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:100:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:100:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:100:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:100:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:100:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:100:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:100:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:100:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:100:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:100:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:100:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:100:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:100:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:105:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:105:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:105:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:105:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:105:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:105:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:105:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:105:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:105:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:105:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:105:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:105:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:105:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:105:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:105:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:105:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:105:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:105:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:105:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:105:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:105:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:105:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:105:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:105:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:105:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:105:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:105:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:105:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:105:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:105:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:105:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:105:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:107:9: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:107:9: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:107:9: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:107:9: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:107:9: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:107:9: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:107:9: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:107:9: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:107:9: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:107:9: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:107:9: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:107:9: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:107:9: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:107:9: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:107:9: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:107:9: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:107:9: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:107:9: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:107:9: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:107:9: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:107:9: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:107:9: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:107:9: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:107:9: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:107:9: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:107:9: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:107:9: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:107:9: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:107:9: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:107:9: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:107:9: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:107:9: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:108:9: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:108:9: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:108:9: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:108:9: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:108:9: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:108:9: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:108:9: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:108:9: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:108:9: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:108:9: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:108:9: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:108:9: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:108:9: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:108:9: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:108:9: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:108:9: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:108:9: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:108:9: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:108:9: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:108:9: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:108:9: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:108:9: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:108:9: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:108:9: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:108:9: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:108:9: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:108:9: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:108:9: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:108:9: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:108:9: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:108:9: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:108:9: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:109:9: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:109:9: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:109:9: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:109:9: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:109:9: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:109:9: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:109:9: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:109:9: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:109:9: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:109:9: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:109:9: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:109:9: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:109:9: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:109:9: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:109:9: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:109:9: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:109:9: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:109:9: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:109:9: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:109:9: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:109:9: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:109:9: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:109:9: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:109:9: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:109:9: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:109:9: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:109:9: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:109:9: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:109:9: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:109:9: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:109:9: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:109:9: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:111:10: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:111:10: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:111:10: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:111:10: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:111:10: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:111:10: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:111:10: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:111:10: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:111:10: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:111:10: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:111:10: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:111:10: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:111:10: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:111:10: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:111:10: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:111:10: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:111:10: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:111:10: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:111:10: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:111:10: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:111:10: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:111:10: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:111:10: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:111:10: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:111:10: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:111:10: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:111:10: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:111:10: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:111:10: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:111:10: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:111:10: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:111:10: warning: unreplaced symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:111:14: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:111:14: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:111:14: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:111:14: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:111:14: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:111:14: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:111:14: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:111:14: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:111:14: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:111:14: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:111:14: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:111:14: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:111:14: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:111:14: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:111:14: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:111:14: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:111:14: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:111:14: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:111:14: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:111:14: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:111:14: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:111:14: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:111:14: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:111:14: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:111:14: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:111:14: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:111:14: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:111:14: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:111:14: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:111:14: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:111:14: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:111:14: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:111:20: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:111:20: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:111:20: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:111:20: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:111:20: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:111:20: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:111:20: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:111:20: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:111:20: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:111:20: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:111:20: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:111:20: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:111:20: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:111:20: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:111:20: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:111:20: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:111:20: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:111:20: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:111:20: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:111:20: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:111:20: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:111:20: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:111:20: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:111:20: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:111:20: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:111:20: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:111:20: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:111:20: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:111:20: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:111:20: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:111:20: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:111:20: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:112:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:112:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:112:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:112:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:112:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:112:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:112:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:112:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:112:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:112:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:112:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:112:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:112:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:112:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:112:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:112:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:112:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:112:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:112:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:112:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:112:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:112:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:112:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:112:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:112:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:112:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:112:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:112:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:112:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:112:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:112:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:112:17: warning: unreplaced symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:112:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:112:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:112:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:112:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:112:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:112:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:112:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:112:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:112:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:112:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:112:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:112:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:112:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:112:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:112:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:112:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:112:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:112:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:112:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:112:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:112:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:112:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:112:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:112:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:112:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:112:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:112:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:112:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:112:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:112:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:112:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:112:23: warning: unreplaced symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:112:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:112:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:112:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:112:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:112:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:112:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:112:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:112:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:112:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:112:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:112:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:112:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:112:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:112:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:112:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:112:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:112:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:112:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:112:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:112:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:112:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:112:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:112:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:112:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:112:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:112:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:112:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:112:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:112:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:112:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:112:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:112:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:121:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:121:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:121:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:121:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:121:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:121:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:121:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:121:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:121:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:121:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:121:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:121:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:121:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:121:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:121:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:121:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:121:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:121:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:121:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:121:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:121:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:121:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:121:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:121:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:121:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:121:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:121:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:121:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:121:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:121:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:121:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:121:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:128:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:128:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:128:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:128:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:128:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:128:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:128:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:128:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:128:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:128:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:128:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:128:9: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non



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

* [Intel-gfx] ✓ Fi.CI.BAT: success for drm/fbdev: Remove DRM's helpers for fbdev I/O (rev4)
  2023-05-24  9:21 ` [Intel-gfx] " Thomas Zimmermann
                   ` (17 preceding siblings ...)
  (?)
@ 2023-05-24 19:41 ` Patchwork
  -1 siblings, 0 replies; 134+ messages in thread
From: Patchwork @ 2023-05-24 19:41 UTC (permalink / raw)
  To: Thomas Zimmermann; +Cc: intel-gfx

[-- Attachment #1: Type: text/plain, Size: 7998 bytes --]

== Series Details ==

Series: drm/fbdev: Remove DRM's helpers for fbdev I/O (rev4)
URL   : https://patchwork.freedesktop.org/series/117671/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_13187 -> Patchwork_117671v4
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117671v4/index.html

Participating hosts (39 -> 37)
------------------------------

  Additional (1): fi-tgl-1115g4 
  Missing    (3): fi-kbl-soraka fi-snb-2520m bat-mtlp-6 

Known issues
------------

  Here are the changes found in Patchwork_117671v4 that come from known issues:

### CI changes ###

#### Issues hit ####

  * boot:
    - fi-cfl-8700k:       [PASS][1] -> [FAIL][2] ([i915#8293])
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13187/fi-cfl-8700k/boot.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117671v4/fi-cfl-8700k/boot.html

  

### IGT changes ###

#### Issues hit ####

  * igt@debugfs_test@basic-hwmon:
    - fi-tgl-1115g4:      NOTRUN -> [SKIP][3] ([i915#7456])
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117671v4/fi-tgl-1115g4/igt@debugfs_test@basic-hwmon.html

  * igt@gem_huc_copy@huc-copy:
    - fi-tgl-1115g4:      NOTRUN -> [SKIP][4] ([i915#2190])
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117671v4/fi-tgl-1115g4/igt@gem_huc_copy@huc-copy.html

  * igt@gem_lmem_swapping@parallel-random-engines:
    - fi-tgl-1115g4:      NOTRUN -> [SKIP][5] ([i915#4613]) +3 similar issues
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117671v4/fi-tgl-1115g4/igt@gem_lmem_swapping@parallel-random-engines.html

  * igt@i915_pm_backlight@basic-brightness:
    - fi-tgl-1115g4:      NOTRUN -> [SKIP][6] ([i915#3546] / [i915#7561])
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117671v4/fi-tgl-1115g4/igt@i915_pm_backlight@basic-brightness.html

  * igt@i915_selftest@live@requests:
    - bat-rpls-2:         [PASS][7] -> [ABORT][8] ([i915#7913] / [i915#7982])
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13187/bat-rpls-2/igt@i915_selftest@live@requests.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117671v4/bat-rpls-2/igt@i915_selftest@live@requests.html

  * igt@i915_suspend@basic-s3-without-i915:
    - fi-tgl-1115g4:      NOTRUN -> [INCOMPLETE][9] ([i915#7443] / [i915#8102])
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117671v4/fi-tgl-1115g4/igt@i915_suspend@basic-s3-without-i915.html

  * igt@kms_chamelium_edid@dp-edid-read:
    - fi-tgl-1115g4:      NOTRUN -> [SKIP][10] ([i915#7828]) +7 similar issues
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117671v4/fi-tgl-1115g4/igt@kms_chamelium_edid@dp-edid-read.html

  * igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic:
    - fi-tgl-1115g4:      NOTRUN -> [SKIP][11] ([i915#4103]) +1 similar issue
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117671v4/fi-tgl-1115g4/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic.html

  * igt@kms_force_connector_basic@force-load-detect:
    - fi-tgl-1115g4:      NOTRUN -> [SKIP][12] ([fdo#109285])
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117671v4/fi-tgl-1115g4/igt@kms_force_connector_basic@force-load-detect.html

  * igt@kms_pipe_crc_basic@nonblocking-crc-frame-sequence:
    - bat-dg2-11:         NOTRUN -> [SKIP][13] ([i915#1845] / [i915#5354]) +2 similar issues
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117671v4/bat-dg2-11/igt@kms_pipe_crc_basic@nonblocking-crc-frame-sequence.html

  * igt@kms_psr@cursor_plane_move:
    - fi-tgl-1115g4:      NOTRUN -> [SKIP][14] ([fdo#110189]) +3 similar issues
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117671v4/fi-tgl-1115g4/igt@kms_psr@cursor_plane_move.html

  * igt@kms_setmode@basic-clone-single-crtc:
    - fi-tgl-1115g4:      NOTRUN -> [SKIP][15] ([i915#3555] / [i915#4579])
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117671v4/fi-tgl-1115g4/igt@kms_setmode@basic-clone-single-crtc.html

  
#### Possible fixes ####

  * igt@i915_selftest@live@guc:
    - bat-rpls-1:         [DMESG-WARN][16] ([i915#7852]) -> [PASS][17]
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13187/bat-rpls-1/igt@i915_selftest@live@guc.html
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117671v4/bat-rpls-1/igt@i915_selftest@live@guc.html

  * igt@i915_selftest@live@migrate:
    - bat-dg2-11:         [DMESG-WARN][18] ([i915#7699]) -> [PASS][19]
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13187/bat-dg2-11/igt@i915_selftest@live@migrate.html
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117671v4/bat-dg2-11/igt@i915_selftest@live@migrate.html

  * igt@kms_pipe_crc_basic@nonblocking-crc-frame-sequence@pipe-c-dp-1:
    - bat-dg2-8:          [FAIL][20] ([i915#7932]) -> [PASS][21] +1 similar issue
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13187/bat-dg2-8/igt@kms_pipe_crc_basic@nonblocking-crc-frame-sequence@pipe-c-dp-1.html
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117671v4/bat-dg2-8/igt@kms_pipe_crc_basic@nonblocking-crc-frame-sequence@pipe-c-dp-1.html

  
  [fdo#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285
  [fdo#110189]: https://bugs.freedesktop.org/show_bug.cgi?id=110189
  [i915#1845]: https://gitlab.freedesktop.org/drm/intel/issues/1845
  [i915#2190]: https://gitlab.freedesktop.org/drm/intel/issues/2190
  [i915#3546]: https://gitlab.freedesktop.org/drm/intel/issues/3546
  [i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
  [i915#4103]: https://gitlab.freedesktop.org/drm/intel/issues/4103
  [i915#4579]: https://gitlab.freedesktop.org/drm/intel/issues/4579
  [i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
  [i915#5354]: https://gitlab.freedesktop.org/drm/intel/issues/5354
  [i915#7443]: https://gitlab.freedesktop.org/drm/intel/issues/7443
  [i915#7456]: https://gitlab.freedesktop.org/drm/intel/issues/7456
  [i915#7561]: https://gitlab.freedesktop.org/drm/intel/issues/7561
  [i915#7699]: https://gitlab.freedesktop.org/drm/intel/issues/7699
  [i915#7828]: https://gitlab.freedesktop.org/drm/intel/issues/7828
  [i915#7852]: https://gitlab.freedesktop.org/drm/intel/issues/7852
  [i915#7913]: https://gitlab.freedesktop.org/drm/intel/issues/7913
  [i915#7932]: https://gitlab.freedesktop.org/drm/intel/issues/7932
  [i915#7982]: https://gitlab.freedesktop.org/drm/intel/issues/7982
  [i915#8102]: https://gitlab.freedesktop.org/drm/intel/issues/8102
  [i915#8293]: https://gitlab.freedesktop.org/drm/intel/issues/8293


Build changes
-------------

  * Linux: CI_DRM_13187 -> Patchwork_117671v4

  CI-20190529: 20190529
  CI_DRM_13187: e72bc131968e21d9deeae208605481c93581f142 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_7303: 8f09a9f1da506db907b549bb477f3233b5416733 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
  Patchwork_117671v4: e72bc131968e21d9deeae208605481c93581f142 @ git://anongit.freedesktop.org/gfx-ci/linux


### Linux commits

ffade2f59f54 drm/i915: Implement dedicated fbdev I/O helpers
cdb008958eb0 drm/fbdev-generic: Implement dedicated fbdev I/O helpers
974676246000 drm/fb-helper: Export helpers for marking damage areas
67b1d9088081 drm/tegra: Use regular fbdev I/O helpers
3988c35b6667 drm/omapdrm: Use regular fbdev I/O helpers
5574eab2867b drm/msm: Use regular fbdev I/O helpers
1d2febacc1c0 drm/fbdev-dma: Use regular fbdev I/O helpers
0ce24a602ae1 drm/radeon: Use regular fbdev I/O helpers
4c8977cbdfa8 drm/gma500: Use regular fbdev I/O helpers
d6281963d8d5 drm/exynos: Use regular fbdev I/O helpers
f8c3dfd92983 drm/armada: Use regular fbdev I/O helpers
e49a2fbbc911 fbdev: Add initializer macros for struct fb_ops
b7684883b5c2 fbdev: Add Kconfig options to select different fb_ops helpers

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117671v4/index.html

[-- Attachment #2: Type: text/html, Size: 9069 bytes --]

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

* Re: [v4,12/13] drm/fbdev-generic: Implement dedicated fbdev I/O helpers
  2023-05-24  9:21   ` Thomas Zimmermann
  (?)
@ 2023-05-24 20:23     ` Sui Jingfeng
  -1 siblings, 0 replies; 134+ messages in thread
From: Sui Jingfeng @ 2023-05-24 20:23 UTC (permalink / raw)
  To: Thomas Zimmermann, daniel, airlied, maarten.lankhorst, mripard,
	javierm, sam
  Cc: linux-samsung-soc, linux-arm-msm, intel-gfx, amd-gfx, dri-devel,
	linux-tegra, freedreno, linux-arm-kernel

Tested-by: Sui Jingfeng <suijingfeng@loongson.cn>


This version works fine, I have tested it On LoongArch with 
drm/loongson(v14) as it is most handy for me.

Also because it using fbdev-generic. fbdev of IGT report no error. Then 
I run fbtest from geert[1],


Before apply your patch:


Benchmarking... 10x10 squares: 468.39 Mpixels/s
Benchmarking... 20x20 squares: 985.02 Mpixels/s
Benchmarking... 50x50 squares: 2247.22 Mpixels/s
Benchmarking... 100x100 squares: 2242.30 Mpixels/s
Benchmarking... 200x200 squares: 2883.18 Mpixels/s
Benchmarking... 500x500 squares: 3642.18 Mpixels/s
Benchmarking... 1000x1000 squares: 3992.77 Mpixels/s
Benchmarking... R5 circles: 261.90 Mpixels/s
Benchmarking... R10 circles: 596.27 Mpixels/s
Benchmarking... R25 circles: 1513.96 Mpixels/s
Benchmarking... R50 circles: 1965.07 Mpixels/s
Benchmarking... R100 circles: 2470.75 Mpixels/s
Benchmarking... R250 circles: 3288.00 Mpixels/s
Benchmarking... R500 circles: 3705.66 Mpixels/s


After apply your patch:


Benchmarking... 10x10 squares: 477.04 Mpixels/s
Benchmarking... 20x20 squares: 1021.07 Mpixels/s
Benchmarking... 50x50 squares: 2315.70 Mpixels/s
Benchmarking... 100x100 squares: 2267.69 Mpixels/s
Benchmarking... 200x200 squares: 3006.28 Mpixels/s
Benchmarking... 500x500 squares: 3761.44 Mpixels/s
Benchmarking... 1000x1000 squares: 4112.49 Mpixels/s
Benchmarking... R5 circles: 269.19 Mpixels/s
Benchmarking... R10 circles: 620.77 Mpixels/s
Benchmarking... R25 circles: 1559.02 Mpixels/s
Benchmarking... R50 circles: 2027.36 Mpixels/s
Benchmarking... R100 circles: 2574.42 Mpixels/s
Benchmarking... R250 circles: 3363.28 Mpixels/s
Benchmarking... R500 circles: 3815.51 Mpixels/s


It seems that this bring a little bit performance gain.

Directly operate on video RAM is slower than have a shadow in system RAM.

I also test this patch in intel i3-8100 @ 3.6Ghz, the results show that 
i915 is a bit slower.

Because it operate directly on device memory.


[1] https://git.kernel.org/pub/scm/linux/kernel/git/geert/fbtest.git


On 2023/5/24 17:21, Thomas Zimmermann wrote:
> Implement dedicated fbdev helpers for framebuffer I/O instead
> of using DRM's helpers. Use an fbdev generator macro for
> deferred I/O to create the callbacks. Fbdev-generic was the
> only caller of the DRM helpers, so remove them from the helper
> module.
>
> v4:
> 	* generate deferred-I/O helpers
> 	* use initializer macros for fb_ops
> v2:
> 	* use FB_SYS_HELPERS_DEFERRED option
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> ---
>   drivers/gpu/drm/Kconfig             |   6 +-
>   drivers/gpu/drm/drm_fb_helper.c     | 107 ----------------------------
>   drivers/gpu/drm/drm_fbdev_generic.c |  11 ++-
>   include/drm/drm_fb_helper.h         |  41 -----------
>   4 files changed, 6 insertions(+), 159 deletions(-)
>
> diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
> index 77fb10ddd8a2..92a782827b7b 100644
> --- a/drivers/gpu/drm/Kconfig
> +++ b/drivers/gpu/drm/Kconfig
> @@ -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
> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> index cb03099fd2e3..bab6b252f02a 100644
> --- a/drivers/gpu/drm/drm_fb_helper.c
> +++ b/drivers/gpu/drm/drm_fb_helper.c
> @@ -736,113 +736,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
> diff --git a/drivers/gpu/drm/drm_fbdev_generic.c b/drivers/gpu/drm/drm_fbdev_generic.c
> index 8e5148bf40bb..98ae703848a0 100644
> --- a/drivers/gpu/drm/drm_fbdev_generic.c
> +++ b/drivers/gpu/drm/drm_fbdev_generic.c
> @@ -34,6 +34,10 @@ static int drm_fbdev_generic_fb_release(struct fb_info *info, int user)
>   	return 0;
>   }
>   
> +FB_GEN_DEFAULT_DEFERRED_SYS_OPS(drm_fbdev_generic,
> +				drm_fb_helper_damage_range,
> +				drm_fb_helper_damage_area);
> +
>   static void drm_fbdev_generic_fb_destroy(struct fb_info *info)
>   {
>   	struct drm_fb_helper *fb_helper = info->par;
> @@ -56,13 +60,8 @@ 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_DEFAULT_DEFERRED_OPS(drm_fbdev_generic),
>   	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_mmap	= fb_deferred_io_mmap,
>   	.fb_destroy	= drm_fbdev_generic_fb_destroy,
>   };
>   
> diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
> index 7d5804882be7..b50fd0c0b713 100644
> --- a/include/drm/drm_fb_helper.h
> +++ b/include/drm/drm_fb_helper.h
> @@ -258,18 +258,6 @@ void drm_fb_helper_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u3
>   
>   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,
> -			       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,
> @@ -397,35 +385,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)
>   {

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

* Re: [v4,12/13] drm/fbdev-generic: Implement dedicated fbdev I/O helpers
@ 2023-05-24 20:23     ` Sui Jingfeng
  0 siblings, 0 replies; 134+ messages in thread
From: Sui Jingfeng @ 2023-05-24 20:23 UTC (permalink / raw)
  To: Thomas Zimmermann, daniel, airlied, maarten.lankhorst, mripard,
	javierm, sam
  Cc: linux-samsung-soc, linux-arm-msm, intel-gfx, dri-devel, amd-gfx,
	linux-tegra, freedreno, linux-arm-kernel

Tested-by: Sui Jingfeng <suijingfeng@loongson.cn>


This version works fine, I have tested it On LoongArch with 
drm/loongson(v14) as it is most handy for me.

Also because it using fbdev-generic. fbdev of IGT report no error. Then 
I run fbtest from geert[1],


Before apply your patch:


Benchmarking... 10x10 squares: 468.39 Mpixels/s
Benchmarking... 20x20 squares: 985.02 Mpixels/s
Benchmarking... 50x50 squares: 2247.22 Mpixels/s
Benchmarking... 100x100 squares: 2242.30 Mpixels/s
Benchmarking... 200x200 squares: 2883.18 Mpixels/s
Benchmarking... 500x500 squares: 3642.18 Mpixels/s
Benchmarking... 1000x1000 squares: 3992.77 Mpixels/s
Benchmarking... R5 circles: 261.90 Mpixels/s
Benchmarking... R10 circles: 596.27 Mpixels/s
Benchmarking... R25 circles: 1513.96 Mpixels/s
Benchmarking... R50 circles: 1965.07 Mpixels/s
Benchmarking... R100 circles: 2470.75 Mpixels/s
Benchmarking... R250 circles: 3288.00 Mpixels/s
Benchmarking... R500 circles: 3705.66 Mpixels/s


After apply your patch:


Benchmarking... 10x10 squares: 477.04 Mpixels/s
Benchmarking... 20x20 squares: 1021.07 Mpixels/s
Benchmarking... 50x50 squares: 2315.70 Mpixels/s
Benchmarking... 100x100 squares: 2267.69 Mpixels/s
Benchmarking... 200x200 squares: 3006.28 Mpixels/s
Benchmarking... 500x500 squares: 3761.44 Mpixels/s
Benchmarking... 1000x1000 squares: 4112.49 Mpixels/s
Benchmarking... R5 circles: 269.19 Mpixels/s
Benchmarking... R10 circles: 620.77 Mpixels/s
Benchmarking... R25 circles: 1559.02 Mpixels/s
Benchmarking... R50 circles: 2027.36 Mpixels/s
Benchmarking... R100 circles: 2574.42 Mpixels/s
Benchmarking... R250 circles: 3363.28 Mpixels/s
Benchmarking... R500 circles: 3815.51 Mpixels/s


It seems that this bring a little bit performance gain.

Directly operate on video RAM is slower than have a shadow in system RAM.

I also test this patch in intel i3-8100 @ 3.6Ghz, the results show that 
i915 is a bit slower.

Because it operate directly on device memory.


[1] https://git.kernel.org/pub/scm/linux/kernel/git/geert/fbtest.git


On 2023/5/24 17:21, Thomas Zimmermann wrote:
> Implement dedicated fbdev helpers for framebuffer I/O instead
> of using DRM's helpers. Use an fbdev generator macro for
> deferred I/O to create the callbacks. Fbdev-generic was the
> only caller of the DRM helpers, so remove them from the helper
> module.
>
> v4:
> 	* generate deferred-I/O helpers
> 	* use initializer macros for fb_ops
> v2:
> 	* use FB_SYS_HELPERS_DEFERRED option
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> ---
>   drivers/gpu/drm/Kconfig             |   6 +-
>   drivers/gpu/drm/drm_fb_helper.c     | 107 ----------------------------
>   drivers/gpu/drm/drm_fbdev_generic.c |  11 ++-
>   include/drm/drm_fb_helper.h         |  41 -----------
>   4 files changed, 6 insertions(+), 159 deletions(-)
>
> diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
> index 77fb10ddd8a2..92a782827b7b 100644
> --- a/drivers/gpu/drm/Kconfig
> +++ b/drivers/gpu/drm/Kconfig
> @@ -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
> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> index cb03099fd2e3..bab6b252f02a 100644
> --- a/drivers/gpu/drm/drm_fb_helper.c
> +++ b/drivers/gpu/drm/drm_fb_helper.c
> @@ -736,113 +736,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
> diff --git a/drivers/gpu/drm/drm_fbdev_generic.c b/drivers/gpu/drm/drm_fbdev_generic.c
> index 8e5148bf40bb..98ae703848a0 100644
> --- a/drivers/gpu/drm/drm_fbdev_generic.c
> +++ b/drivers/gpu/drm/drm_fbdev_generic.c
> @@ -34,6 +34,10 @@ static int drm_fbdev_generic_fb_release(struct fb_info *info, int user)
>   	return 0;
>   }
>   
> +FB_GEN_DEFAULT_DEFERRED_SYS_OPS(drm_fbdev_generic,
> +				drm_fb_helper_damage_range,
> +				drm_fb_helper_damage_area);
> +
>   static void drm_fbdev_generic_fb_destroy(struct fb_info *info)
>   {
>   	struct drm_fb_helper *fb_helper = info->par;
> @@ -56,13 +60,8 @@ 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_DEFAULT_DEFERRED_OPS(drm_fbdev_generic),
>   	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_mmap	= fb_deferred_io_mmap,
>   	.fb_destroy	= drm_fbdev_generic_fb_destroy,
>   };
>   
> diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
> index 7d5804882be7..b50fd0c0b713 100644
> --- a/include/drm/drm_fb_helper.h
> +++ b/include/drm/drm_fb_helper.h
> @@ -258,18 +258,6 @@ void drm_fb_helper_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u3
>   
>   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,
> -			       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,
> @@ -397,35 +385,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)
>   {

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

* Re: [Intel-gfx] [v4, 12/13] drm/fbdev-generic: Implement dedicated fbdev I/O helpers
@ 2023-05-24 20:23     ` Sui Jingfeng
  0 siblings, 0 replies; 134+ messages in thread
From: Sui Jingfeng @ 2023-05-24 20:23 UTC (permalink / raw)
  To: Thomas Zimmermann, daniel, airlied, maarten.lankhorst, mripard,
	javierm, sam
  Cc: linux-samsung-soc, linux-arm-msm, intel-gfx, amd-gfx, dri-devel,
	linux-tegra, freedreno, linux-arm-kernel

Tested-by: Sui Jingfeng <suijingfeng@loongson.cn>


This version works fine, I have tested it On LoongArch with 
drm/loongson(v14) as it is most handy for me.

Also because it using fbdev-generic. fbdev of IGT report no error. Then 
I run fbtest from geert[1],


Before apply your patch:


Benchmarking... 10x10 squares: 468.39 Mpixels/s
Benchmarking... 20x20 squares: 985.02 Mpixels/s
Benchmarking... 50x50 squares: 2247.22 Mpixels/s
Benchmarking... 100x100 squares: 2242.30 Mpixels/s
Benchmarking... 200x200 squares: 2883.18 Mpixels/s
Benchmarking... 500x500 squares: 3642.18 Mpixels/s
Benchmarking... 1000x1000 squares: 3992.77 Mpixels/s
Benchmarking... R5 circles: 261.90 Mpixels/s
Benchmarking... R10 circles: 596.27 Mpixels/s
Benchmarking... R25 circles: 1513.96 Mpixels/s
Benchmarking... R50 circles: 1965.07 Mpixels/s
Benchmarking... R100 circles: 2470.75 Mpixels/s
Benchmarking... R250 circles: 3288.00 Mpixels/s
Benchmarking... R500 circles: 3705.66 Mpixels/s


After apply your patch:


Benchmarking... 10x10 squares: 477.04 Mpixels/s
Benchmarking... 20x20 squares: 1021.07 Mpixels/s
Benchmarking... 50x50 squares: 2315.70 Mpixels/s
Benchmarking... 100x100 squares: 2267.69 Mpixels/s
Benchmarking... 200x200 squares: 3006.28 Mpixels/s
Benchmarking... 500x500 squares: 3761.44 Mpixels/s
Benchmarking... 1000x1000 squares: 4112.49 Mpixels/s
Benchmarking... R5 circles: 269.19 Mpixels/s
Benchmarking... R10 circles: 620.77 Mpixels/s
Benchmarking... R25 circles: 1559.02 Mpixels/s
Benchmarking... R50 circles: 2027.36 Mpixels/s
Benchmarking... R100 circles: 2574.42 Mpixels/s
Benchmarking... R250 circles: 3363.28 Mpixels/s
Benchmarking... R500 circles: 3815.51 Mpixels/s


It seems that this bring a little bit performance gain.

Directly operate on video RAM is slower than have a shadow in system RAM.

I also test this patch in intel i3-8100 @ 3.6Ghz, the results show that 
i915 is a bit slower.

Because it operate directly on device memory.


[1] https://git.kernel.org/pub/scm/linux/kernel/git/geert/fbtest.git


On 2023/5/24 17:21, Thomas Zimmermann wrote:
> Implement dedicated fbdev helpers for framebuffer I/O instead
> of using DRM's helpers. Use an fbdev generator macro for
> deferred I/O to create the callbacks. Fbdev-generic was the
> only caller of the DRM helpers, so remove them from the helper
> module.
>
> v4:
> 	* generate deferred-I/O helpers
> 	* use initializer macros for fb_ops
> v2:
> 	* use FB_SYS_HELPERS_DEFERRED option
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> ---
>   drivers/gpu/drm/Kconfig             |   6 +-
>   drivers/gpu/drm/drm_fb_helper.c     | 107 ----------------------------
>   drivers/gpu/drm/drm_fbdev_generic.c |  11 ++-
>   include/drm/drm_fb_helper.h         |  41 -----------
>   4 files changed, 6 insertions(+), 159 deletions(-)
>
> diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
> index 77fb10ddd8a2..92a782827b7b 100644
> --- a/drivers/gpu/drm/Kconfig
> +++ b/drivers/gpu/drm/Kconfig
> @@ -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
> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> index cb03099fd2e3..bab6b252f02a 100644
> --- a/drivers/gpu/drm/drm_fb_helper.c
> +++ b/drivers/gpu/drm/drm_fb_helper.c
> @@ -736,113 +736,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
> diff --git a/drivers/gpu/drm/drm_fbdev_generic.c b/drivers/gpu/drm/drm_fbdev_generic.c
> index 8e5148bf40bb..98ae703848a0 100644
> --- a/drivers/gpu/drm/drm_fbdev_generic.c
> +++ b/drivers/gpu/drm/drm_fbdev_generic.c
> @@ -34,6 +34,10 @@ static int drm_fbdev_generic_fb_release(struct fb_info *info, int user)
>   	return 0;
>   }
>   
> +FB_GEN_DEFAULT_DEFERRED_SYS_OPS(drm_fbdev_generic,
> +				drm_fb_helper_damage_range,
> +				drm_fb_helper_damage_area);
> +
>   static void drm_fbdev_generic_fb_destroy(struct fb_info *info)
>   {
>   	struct drm_fb_helper *fb_helper = info->par;
> @@ -56,13 +60,8 @@ 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_DEFAULT_DEFERRED_OPS(drm_fbdev_generic),
>   	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_mmap	= fb_deferred_io_mmap,
>   	.fb_destroy	= drm_fbdev_generic_fb_destroy,
>   };
>   
> diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
> index 7d5804882be7..b50fd0c0b713 100644
> --- a/include/drm/drm_fb_helper.h
> +++ b/include/drm/drm_fb_helper.h
> @@ -258,18 +258,6 @@ void drm_fb_helper_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u3
>   
>   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,
> -			       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,
> @@ -397,35 +385,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)
>   {

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

* Re: [v4,01/13] fbdev: Add Kconfig options to select different fb_ops helpers
  2023-05-24  9:21   ` Thomas Zimmermann
  (?)
@ 2023-05-24 20:46     ` Sui Jingfeng
  -1 siblings, 0 replies; 134+ messages in thread
From: Sui Jingfeng @ 2023-05-24 20:46 UTC (permalink / raw)
  To: Thomas Zimmermann, daniel, airlied, maarten.lankhorst, mripard,
	javierm, sam
  Cc: linux-samsung-soc, linux-arm-msm, intel-gfx, dri-devel, amd-gfx,
	linux-tegra, freedreno, linux-arm-kernel

Reviewed-by: Sui Jingfeng <suijingfeng@loongson.cn>


On 2023/5/24 17:21, Thomas Zimmermann wrote:
> 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.
>
> v3:
> 	* fix select statement (Jingfeng)
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> ---
>   drivers/video/fbdev/Kconfig | 21 +++++++++++++++++++++
>   1 file changed, 21 insertions(+)
>
> diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig
> index e8889035c882..6df9bd09454a 100644
> --- a/drivers/video/fbdev/Kconfig
> +++ b/drivers/video/fbdev/Kconfig
> @@ -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_HELPERS
> +
>   config FB_HECUBA
>   	tristate
>   	depends on FB

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

* Re: [v4, 01/13] fbdev: Add Kconfig options to select different fb_ops helpers
@ 2023-05-24 20:46     ` Sui Jingfeng
  0 siblings, 0 replies; 134+ messages in thread
From: Sui Jingfeng @ 2023-05-24 20:46 UTC (permalink / raw)
  To: Thomas Zimmermann, daniel, airlied, maarten.lankhorst, mripard,
	javierm, sam
  Cc: linux-samsung-soc, linux-arm-msm, intel-gfx, amd-gfx, dri-devel,
	linux-tegra, freedreno, linux-arm-kernel

Reviewed-by: Sui Jingfeng <suijingfeng@loongson.cn>


On 2023/5/24 17:21, Thomas Zimmermann wrote:
> 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.
>
> v3:
> 	* fix select statement (Jingfeng)
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> ---
>   drivers/video/fbdev/Kconfig | 21 +++++++++++++++++++++
>   1 file changed, 21 insertions(+)
>
> diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig
> index e8889035c882..6df9bd09454a 100644
> --- a/drivers/video/fbdev/Kconfig
> +++ b/drivers/video/fbdev/Kconfig
> @@ -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_HELPERS
> +
>   config FB_HECUBA
>   	tristate
>   	depends on FB

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

* Re: [Intel-gfx] [v4, 01/13] fbdev: Add Kconfig options to select different fb_ops helpers
@ 2023-05-24 20:46     ` Sui Jingfeng
  0 siblings, 0 replies; 134+ messages in thread
From: Sui Jingfeng @ 2023-05-24 20:46 UTC (permalink / raw)
  To: Thomas Zimmermann, daniel, airlied, maarten.lankhorst, mripard,
	javierm, sam
  Cc: linux-samsung-soc, linux-arm-msm, intel-gfx, amd-gfx, dri-devel,
	linux-tegra, freedreno, linux-arm-kernel

Reviewed-by: Sui Jingfeng <suijingfeng@loongson.cn>


On 2023/5/24 17:21, Thomas Zimmermann wrote:
> 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.
>
> v3:
> 	* fix select statement (Jingfeng)
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> ---
>   drivers/video/fbdev/Kconfig | 21 +++++++++++++++++++++
>   1 file changed, 21 insertions(+)
>
> diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig
> index e8889035c882..6df9bd09454a 100644
> --- a/drivers/video/fbdev/Kconfig
> +++ b/drivers/video/fbdev/Kconfig
> @@ -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_HELPERS
> +
>   config FB_HECUBA
>   	tristate
>   	depends on FB

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

* Re: [v4,02/13] fbdev: Add initializer macros for struct fb_ops
  2023-05-24  9:21   ` [Intel-gfx] " Thomas Zimmermann
  (?)
@ 2023-05-24 20:57     ` Sui Jingfeng
  -1 siblings, 0 replies; 134+ messages in thread
From: Sui Jingfeng @ 2023-05-24 20:57 UTC (permalink / raw)
  To: Thomas Zimmermann, daniel, airlied, maarten.lankhorst, mripard,
	javierm, sam
  Cc: linux-samsung-soc, linux-arm-msm, intel-gfx, dri-devel, amd-gfx,
	linux-tegra, freedreno, linux-arm-kernel

Hi,


we love your patch:


On 2023/5/24 17:21, Thomas Zimmermann wrote:
> For framebuffers in I/O and system memory, add macros that set
> struct fb_ops to the respective callback functions.
>
> For deferred I/O, add macros that generate callback functions with
> damage handling. Add initializer macros that set struct fb_ops to
> the generated callbacks.
>
> These macros can remove a lot boilerplate code from fbdev drivers.
> The drivers are supposed to use the macro that is required for its
> framebuffer. Each macro is split into smaller helpers, so that
> drivers with non-standard callbacks can pick and customize callbacks
> as needed. There are individual helper macros for read/write, mmap
> and drawing.
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> ---
>   include/linux/fb.h | 112 +++++++++++++++++++++++++++++++++++++++++++++
>   1 file changed, 112 insertions(+)
>
> diff --git a/include/linux/fb.h b/include/linux/fb.h
> index 2cf8efcb9e32..731472a2bb62 100644
> --- a/include/linux/fb.h
> +++ b/include/linux/fb.h
> @@ -538,9 +538,31 @@ extern ssize_t fb_io_read(struct fb_info *info, char __user *buf,
>   extern ssize_t fb_io_write(struct fb_info *info, const char __user *buf,
>   			   size_t count, loff_t *ppos);
>   
> +/*
> + * Initializes struct fb_ops for framebuffers in I/O memory.
> + */
> +
> +#define __FB_DEFAULT_IO_OPS_RDWR \
> +	.fb_read	= fb_io_read, \
> +	.fb_write	= fb_io_write
> +
> +#define __FB_DEFAULT_IO_OPS_DRAW \
> +        .fb_fillrect	= cfb_fillrect, \
> +        .fb_copyarea	= cfb_copyarea, \
> +        .fb_imageblit	= cfb_imageblit

Here,  it seems that your text editor replace the tap with space, but 
I'm OK.

I'm asking because I see other __FB__DEFAULT_* macro begin with tabs.

> +#define __FB_DEFAULT_IO_OPS_MMAP \
> +	.fb_mmap	= NULL // default implementation
> +
> +#define FB_DEFAULT_IO_OPS \
> +	__FB_DEFAULT_IO_OPS_RDWR, \
> +	__FB_DEFAULT_IO_OPS_DRAW, \
> +	__FB_DEFAULT_IO_OPS_MMAP
> +
>   /*
>    * Drawing operations where framebuffer is in system RAM
>    */
> +
>   extern void sys_fillrect(struct fb_info *info, const struct fb_fillrect *rect);
>   extern void sys_copyarea(struct fb_info *info, const struct fb_copyarea *area);
>   extern void sys_imageblit(struct fb_info *info, const struct fb_image *image);
> @@ -549,6 +571,27 @@ extern ssize_t fb_sys_read(struct fb_info *info, char __user *buf,
>   extern ssize_t fb_sys_write(struct fb_info *info, const char __user *buf,
>   			    size_t count, loff_t *ppos);
>   
> +/*
> + * Initializes struct fb_ops for framebuffers in system memory.
> + */
> +
> +#define __FB_DEFAULT_SYS_OPS_RDWR \
> +	.fb_read	= fb_sys_read, \
> +	.fb_write	= fb_sys_write
> +
> +#define __FB_DEFAULT_SYS_OPS_DRAW \
> +        .fb_fillrect	= sys_fillrect, \
> +        .fb_copyarea	= sys_copyarea, \
> +        .fb_imageblit	= sys_imageblit
> +
> +#define __FB_DEFAULT_SYS_OPS_MMAP \
> +	.fb_mmap	= NULL // default implementation
> +
> +#define FB_DEFAULT_SYS_OPS \
> +	__FB_DEFAULT_SYS_OPS_RDWR, \
> +	__FB_DEFAULT_SYS_OPS_DRAW, \
> +	__FB_DEFAULT_SYS_OPS_MMAP
> +
>   /* drivers/video/fbmem.c */
>   extern int register_framebuffer(struct fb_info *fb_info);
>   extern void unregister_framebuffer(struct fb_info *fb_info);
> @@ -604,6 +647,75 @@ extern void fb_deferred_io_cleanup(struct fb_info *info);
>   extern int fb_deferred_io_fsync(struct file *file, loff_t start,
>   				loff_t end, int datasync);
>   
> +/*
> + * Generate callbacks for deferred I/O
> + */
> +
> +#define __FB_GEN_DEFAULT_DEFERRED_OPS_RDWR(__prefix, __damage_range, __mode) \
> +	static ssize_t __prefix ## _defio_read(struct fb_info *info, char __user *buf, \
> +					       size_t count, loff_t *ppos) \
> +	{ \
> +		return fb_ ## __mode ## _read(info, buf, count, ppos); \
> +	} \
> +	static ssize_t __prefix ## _defio_write(struct fb_info *info, const char __user *buf, \
> +						size_t count, loff_t *ppos) \
> +	{ \
> +		unsigned long offset = *ppos; \
> +		ssize_t ret = fb_ ## __mode ## _write(info, buf, count, ppos); \
> +		if (ret > 0) \
> +			__damage_range(info, offset, ret); \
> +		return ret; \
> +	}
> +
> +#define __FB_GEN_DEFAULT_DEFERRED_OPS_DRAW(__prefix, __damage_area, __mode) \
> +	static void __prefix ## _defio_fillrect(struct fb_info *info, \
> +						const struct fb_fillrect *rect) \
> +	{ \
> +		__mode ## _fillrect(info, rect); \
> +		__damage_area(info, rect->dx, rect->dy, rect->width, rect->height); \
> +	} \
> +	static void __prefix ## _defio_copyarea(struct fb_info *info, \
> +						const struct fb_copyarea *area) \
> +	{ \
> +		__mode ## _copyarea(info, area); \
> +		__damage_area(info, area->dx, area->dy, area->width, area->height); \
> +	} \
> +	static void __prefix ## _defio_imageblit(struct fb_info *info, \
> +						 const struct fb_image *image) \
> +	{ \
> +		__mode ## _imageblit(info, image); \
> +		__damage_area(info, image->dx, image->dy, image->width, image->height); \
> +	}
> +
> +#define FB_GEN_DEFAULT_DEFERRED_IO_OPS(__prefix, __damage_range, __damage_area) \
> +	__FB_GEN_DEFAULT_DEFERRED_OPS_RDWR(__prefix, __damage_range, io) \
> +	__FB_GEN_DEFAULT_DEFERRED_OPS_DRAW(__prefix, __damage_area, cfb)
> +
> +#define FB_GEN_DEFAULT_DEFERRED_SYS_OPS(__prefix, __damage_range, __damage_area) \
> +	__FB_GEN_DEFAULT_DEFERRED_OPS_RDWR(__prefix, __damage_range, sys) \
> +	__FB_GEN_DEFAULT_DEFERRED_OPS_DRAW(__prefix, __damage_area, sys)
> +
> +/*
> + * Initializes struct fb_ops for deferred I/O.
> + */
> +
> +#define __FB_DEFAULT_DEFERRED_OPS_RDWR(__prefix) \
> +	.fb_read	= __prefix ## _defio_read, \
> +	.fb_write	= __prefix ## _defio_write
> +
> +#define __FB_DEFAULT_DEFERRED_OPS_DRAW(__prefix) \
> +        .fb_fillrect	= __prefix ## _defio_fillrect, \
> +        .fb_copyarea	= __prefix ## _defio_copyarea, \
> +        .fb_imageblit	= __prefix ## _defio_imageblit

Here also,  '.fb_fillrect', '.fb_copyarea' and '.fb_imageblit' begin 
with space, but I'm OK.

I'm asking because I see other __FB__DEFAULT_* macro begin with tabs.

> +#define __FB_DEFAULT_DEFERRED_OPS_MMAP(__prefix) \
> +	.fb_mmap	= fb_deferred_io_mmap
> +
> +#define FB_DEFAULT_DEFERRED_OPS(__prefix) \
> +	__FB_DEFAULT_DEFERRED_OPS_RDWR(__prefix), \
> +	__FB_DEFAULT_DEFERRED_OPS_DRAW(__prefix), \
> +	__FB_DEFAULT_DEFERRED_OPS_MMAP(__prefix)
> +
>   static inline bool fb_be_math(struct fb_info *info)
>   {
>   #ifdef CONFIG_FB_FOREIGN_ENDIAN

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

* Re: [v4,02/13] fbdev: Add initializer macros for struct fb_ops
@ 2023-05-24 20:57     ` Sui Jingfeng
  0 siblings, 0 replies; 134+ messages in thread
From: Sui Jingfeng @ 2023-05-24 20:57 UTC (permalink / raw)
  To: Thomas Zimmermann, daniel, airlied, maarten.lankhorst, mripard,
	javierm, sam
  Cc: linux-samsung-soc, linux-arm-msm, intel-gfx, amd-gfx, dri-devel,
	linux-tegra, freedreno, linux-arm-kernel

Hi,


we love your patch:


On 2023/5/24 17:21, Thomas Zimmermann wrote:
> For framebuffers in I/O and system memory, add macros that set
> struct fb_ops to the respective callback functions.
>
> For deferred I/O, add macros that generate callback functions with
> damage handling. Add initializer macros that set struct fb_ops to
> the generated callbacks.
>
> These macros can remove a lot boilerplate code from fbdev drivers.
> The drivers are supposed to use the macro that is required for its
> framebuffer. Each macro is split into smaller helpers, so that
> drivers with non-standard callbacks can pick and customize callbacks
> as needed. There are individual helper macros for read/write, mmap
> and drawing.
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> ---
>   include/linux/fb.h | 112 +++++++++++++++++++++++++++++++++++++++++++++
>   1 file changed, 112 insertions(+)
>
> diff --git a/include/linux/fb.h b/include/linux/fb.h
> index 2cf8efcb9e32..731472a2bb62 100644
> --- a/include/linux/fb.h
> +++ b/include/linux/fb.h
> @@ -538,9 +538,31 @@ extern ssize_t fb_io_read(struct fb_info *info, char __user *buf,
>   extern ssize_t fb_io_write(struct fb_info *info, const char __user *buf,
>   			   size_t count, loff_t *ppos);
>   
> +/*
> + * Initializes struct fb_ops for framebuffers in I/O memory.
> + */
> +
> +#define __FB_DEFAULT_IO_OPS_RDWR \
> +	.fb_read	= fb_io_read, \
> +	.fb_write	= fb_io_write
> +
> +#define __FB_DEFAULT_IO_OPS_DRAW \
> +        .fb_fillrect	= cfb_fillrect, \
> +        .fb_copyarea	= cfb_copyarea, \
> +        .fb_imageblit	= cfb_imageblit

Here,  it seems that your text editor replace the tap with space, but 
I'm OK.

I'm asking because I see other __FB__DEFAULT_* macro begin with tabs.

> +#define __FB_DEFAULT_IO_OPS_MMAP \
> +	.fb_mmap	= NULL // default implementation
> +
> +#define FB_DEFAULT_IO_OPS \
> +	__FB_DEFAULT_IO_OPS_RDWR, \
> +	__FB_DEFAULT_IO_OPS_DRAW, \
> +	__FB_DEFAULT_IO_OPS_MMAP
> +
>   /*
>    * Drawing operations where framebuffer is in system RAM
>    */
> +
>   extern void sys_fillrect(struct fb_info *info, const struct fb_fillrect *rect);
>   extern void sys_copyarea(struct fb_info *info, const struct fb_copyarea *area);
>   extern void sys_imageblit(struct fb_info *info, const struct fb_image *image);
> @@ -549,6 +571,27 @@ extern ssize_t fb_sys_read(struct fb_info *info, char __user *buf,
>   extern ssize_t fb_sys_write(struct fb_info *info, const char __user *buf,
>   			    size_t count, loff_t *ppos);
>   
> +/*
> + * Initializes struct fb_ops for framebuffers in system memory.
> + */
> +
> +#define __FB_DEFAULT_SYS_OPS_RDWR \
> +	.fb_read	= fb_sys_read, \
> +	.fb_write	= fb_sys_write
> +
> +#define __FB_DEFAULT_SYS_OPS_DRAW \
> +        .fb_fillrect	= sys_fillrect, \
> +        .fb_copyarea	= sys_copyarea, \
> +        .fb_imageblit	= sys_imageblit
> +
> +#define __FB_DEFAULT_SYS_OPS_MMAP \
> +	.fb_mmap	= NULL // default implementation
> +
> +#define FB_DEFAULT_SYS_OPS \
> +	__FB_DEFAULT_SYS_OPS_RDWR, \
> +	__FB_DEFAULT_SYS_OPS_DRAW, \
> +	__FB_DEFAULT_SYS_OPS_MMAP
> +
>   /* drivers/video/fbmem.c */
>   extern int register_framebuffer(struct fb_info *fb_info);
>   extern void unregister_framebuffer(struct fb_info *fb_info);
> @@ -604,6 +647,75 @@ extern void fb_deferred_io_cleanup(struct fb_info *info);
>   extern int fb_deferred_io_fsync(struct file *file, loff_t start,
>   				loff_t end, int datasync);
>   
> +/*
> + * Generate callbacks for deferred I/O
> + */
> +
> +#define __FB_GEN_DEFAULT_DEFERRED_OPS_RDWR(__prefix, __damage_range, __mode) \
> +	static ssize_t __prefix ## _defio_read(struct fb_info *info, char __user *buf, \
> +					       size_t count, loff_t *ppos) \
> +	{ \
> +		return fb_ ## __mode ## _read(info, buf, count, ppos); \
> +	} \
> +	static ssize_t __prefix ## _defio_write(struct fb_info *info, const char __user *buf, \
> +						size_t count, loff_t *ppos) \
> +	{ \
> +		unsigned long offset = *ppos; \
> +		ssize_t ret = fb_ ## __mode ## _write(info, buf, count, ppos); \
> +		if (ret > 0) \
> +			__damage_range(info, offset, ret); \
> +		return ret; \
> +	}
> +
> +#define __FB_GEN_DEFAULT_DEFERRED_OPS_DRAW(__prefix, __damage_area, __mode) \
> +	static void __prefix ## _defio_fillrect(struct fb_info *info, \
> +						const struct fb_fillrect *rect) \
> +	{ \
> +		__mode ## _fillrect(info, rect); \
> +		__damage_area(info, rect->dx, rect->dy, rect->width, rect->height); \
> +	} \
> +	static void __prefix ## _defio_copyarea(struct fb_info *info, \
> +						const struct fb_copyarea *area) \
> +	{ \
> +		__mode ## _copyarea(info, area); \
> +		__damage_area(info, area->dx, area->dy, area->width, area->height); \
> +	} \
> +	static void __prefix ## _defio_imageblit(struct fb_info *info, \
> +						 const struct fb_image *image) \
> +	{ \
> +		__mode ## _imageblit(info, image); \
> +		__damage_area(info, image->dx, image->dy, image->width, image->height); \
> +	}
> +
> +#define FB_GEN_DEFAULT_DEFERRED_IO_OPS(__prefix, __damage_range, __damage_area) \
> +	__FB_GEN_DEFAULT_DEFERRED_OPS_RDWR(__prefix, __damage_range, io) \
> +	__FB_GEN_DEFAULT_DEFERRED_OPS_DRAW(__prefix, __damage_area, cfb)
> +
> +#define FB_GEN_DEFAULT_DEFERRED_SYS_OPS(__prefix, __damage_range, __damage_area) \
> +	__FB_GEN_DEFAULT_DEFERRED_OPS_RDWR(__prefix, __damage_range, sys) \
> +	__FB_GEN_DEFAULT_DEFERRED_OPS_DRAW(__prefix, __damage_area, sys)
> +
> +/*
> + * Initializes struct fb_ops for deferred I/O.
> + */
> +
> +#define __FB_DEFAULT_DEFERRED_OPS_RDWR(__prefix) \
> +	.fb_read	= __prefix ## _defio_read, \
> +	.fb_write	= __prefix ## _defio_write
> +
> +#define __FB_DEFAULT_DEFERRED_OPS_DRAW(__prefix) \
> +        .fb_fillrect	= __prefix ## _defio_fillrect, \
> +        .fb_copyarea	= __prefix ## _defio_copyarea, \
> +        .fb_imageblit	= __prefix ## _defio_imageblit

Here also,  '.fb_fillrect', '.fb_copyarea' and '.fb_imageblit' begin 
with space, but I'm OK.

I'm asking because I see other __FB__DEFAULT_* macro begin with tabs.

> +#define __FB_DEFAULT_DEFERRED_OPS_MMAP(__prefix) \
> +	.fb_mmap	= fb_deferred_io_mmap
> +
> +#define FB_DEFAULT_DEFERRED_OPS(__prefix) \
> +	__FB_DEFAULT_DEFERRED_OPS_RDWR(__prefix), \
> +	__FB_DEFAULT_DEFERRED_OPS_DRAW(__prefix), \
> +	__FB_DEFAULT_DEFERRED_OPS_MMAP(__prefix)
> +
>   static inline bool fb_be_math(struct fb_info *info)
>   {
>   #ifdef CONFIG_FB_FOREIGN_ENDIAN

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

* Re: [Intel-gfx] [v4, 02/13] fbdev: Add initializer macros for struct fb_ops
@ 2023-05-24 20:57     ` Sui Jingfeng
  0 siblings, 0 replies; 134+ messages in thread
From: Sui Jingfeng @ 2023-05-24 20:57 UTC (permalink / raw)
  To: Thomas Zimmermann, daniel, airlied, maarten.lankhorst, mripard,
	javierm, sam
  Cc: linux-samsung-soc, linux-arm-msm, intel-gfx, amd-gfx, dri-devel,
	linux-tegra, freedreno, linux-arm-kernel

Hi,


we love your patch:


On 2023/5/24 17:21, Thomas Zimmermann wrote:
> For framebuffers in I/O and system memory, add macros that set
> struct fb_ops to the respective callback functions.
>
> For deferred I/O, add macros that generate callback functions with
> damage handling. Add initializer macros that set struct fb_ops to
> the generated callbacks.
>
> These macros can remove a lot boilerplate code from fbdev drivers.
> The drivers are supposed to use the macro that is required for its
> framebuffer. Each macro is split into smaller helpers, so that
> drivers with non-standard callbacks can pick and customize callbacks
> as needed. There are individual helper macros for read/write, mmap
> and drawing.
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> ---
>   include/linux/fb.h | 112 +++++++++++++++++++++++++++++++++++++++++++++
>   1 file changed, 112 insertions(+)
>
> diff --git a/include/linux/fb.h b/include/linux/fb.h
> index 2cf8efcb9e32..731472a2bb62 100644
> --- a/include/linux/fb.h
> +++ b/include/linux/fb.h
> @@ -538,9 +538,31 @@ extern ssize_t fb_io_read(struct fb_info *info, char __user *buf,
>   extern ssize_t fb_io_write(struct fb_info *info, const char __user *buf,
>   			   size_t count, loff_t *ppos);
>   
> +/*
> + * Initializes struct fb_ops for framebuffers in I/O memory.
> + */
> +
> +#define __FB_DEFAULT_IO_OPS_RDWR \
> +	.fb_read	= fb_io_read, \
> +	.fb_write	= fb_io_write
> +
> +#define __FB_DEFAULT_IO_OPS_DRAW \
> +        .fb_fillrect	= cfb_fillrect, \
> +        .fb_copyarea	= cfb_copyarea, \
> +        .fb_imageblit	= cfb_imageblit

Here,  it seems that your text editor replace the tap with space, but 
I'm OK.

I'm asking because I see other __FB__DEFAULT_* macro begin with tabs.

> +#define __FB_DEFAULT_IO_OPS_MMAP \
> +	.fb_mmap	= NULL // default implementation
> +
> +#define FB_DEFAULT_IO_OPS \
> +	__FB_DEFAULT_IO_OPS_RDWR, \
> +	__FB_DEFAULT_IO_OPS_DRAW, \
> +	__FB_DEFAULT_IO_OPS_MMAP
> +
>   /*
>    * Drawing operations where framebuffer is in system RAM
>    */
> +
>   extern void sys_fillrect(struct fb_info *info, const struct fb_fillrect *rect);
>   extern void sys_copyarea(struct fb_info *info, const struct fb_copyarea *area);
>   extern void sys_imageblit(struct fb_info *info, const struct fb_image *image);
> @@ -549,6 +571,27 @@ extern ssize_t fb_sys_read(struct fb_info *info, char __user *buf,
>   extern ssize_t fb_sys_write(struct fb_info *info, const char __user *buf,
>   			    size_t count, loff_t *ppos);
>   
> +/*
> + * Initializes struct fb_ops for framebuffers in system memory.
> + */
> +
> +#define __FB_DEFAULT_SYS_OPS_RDWR \
> +	.fb_read	= fb_sys_read, \
> +	.fb_write	= fb_sys_write
> +
> +#define __FB_DEFAULT_SYS_OPS_DRAW \
> +        .fb_fillrect	= sys_fillrect, \
> +        .fb_copyarea	= sys_copyarea, \
> +        .fb_imageblit	= sys_imageblit
> +
> +#define __FB_DEFAULT_SYS_OPS_MMAP \
> +	.fb_mmap	= NULL // default implementation
> +
> +#define FB_DEFAULT_SYS_OPS \
> +	__FB_DEFAULT_SYS_OPS_RDWR, \
> +	__FB_DEFAULT_SYS_OPS_DRAW, \
> +	__FB_DEFAULT_SYS_OPS_MMAP
> +
>   /* drivers/video/fbmem.c */
>   extern int register_framebuffer(struct fb_info *fb_info);
>   extern void unregister_framebuffer(struct fb_info *fb_info);
> @@ -604,6 +647,75 @@ extern void fb_deferred_io_cleanup(struct fb_info *info);
>   extern int fb_deferred_io_fsync(struct file *file, loff_t start,
>   				loff_t end, int datasync);
>   
> +/*
> + * Generate callbacks for deferred I/O
> + */
> +
> +#define __FB_GEN_DEFAULT_DEFERRED_OPS_RDWR(__prefix, __damage_range, __mode) \
> +	static ssize_t __prefix ## _defio_read(struct fb_info *info, char __user *buf, \
> +					       size_t count, loff_t *ppos) \
> +	{ \
> +		return fb_ ## __mode ## _read(info, buf, count, ppos); \
> +	} \
> +	static ssize_t __prefix ## _defio_write(struct fb_info *info, const char __user *buf, \
> +						size_t count, loff_t *ppos) \
> +	{ \
> +		unsigned long offset = *ppos; \
> +		ssize_t ret = fb_ ## __mode ## _write(info, buf, count, ppos); \
> +		if (ret > 0) \
> +			__damage_range(info, offset, ret); \
> +		return ret; \
> +	}
> +
> +#define __FB_GEN_DEFAULT_DEFERRED_OPS_DRAW(__prefix, __damage_area, __mode) \
> +	static void __prefix ## _defio_fillrect(struct fb_info *info, \
> +						const struct fb_fillrect *rect) \
> +	{ \
> +		__mode ## _fillrect(info, rect); \
> +		__damage_area(info, rect->dx, rect->dy, rect->width, rect->height); \
> +	} \
> +	static void __prefix ## _defio_copyarea(struct fb_info *info, \
> +						const struct fb_copyarea *area) \
> +	{ \
> +		__mode ## _copyarea(info, area); \
> +		__damage_area(info, area->dx, area->dy, area->width, area->height); \
> +	} \
> +	static void __prefix ## _defio_imageblit(struct fb_info *info, \
> +						 const struct fb_image *image) \
> +	{ \
> +		__mode ## _imageblit(info, image); \
> +		__damage_area(info, image->dx, image->dy, image->width, image->height); \
> +	}
> +
> +#define FB_GEN_DEFAULT_DEFERRED_IO_OPS(__prefix, __damage_range, __damage_area) \
> +	__FB_GEN_DEFAULT_DEFERRED_OPS_RDWR(__prefix, __damage_range, io) \
> +	__FB_GEN_DEFAULT_DEFERRED_OPS_DRAW(__prefix, __damage_area, cfb)
> +
> +#define FB_GEN_DEFAULT_DEFERRED_SYS_OPS(__prefix, __damage_range, __damage_area) \
> +	__FB_GEN_DEFAULT_DEFERRED_OPS_RDWR(__prefix, __damage_range, sys) \
> +	__FB_GEN_DEFAULT_DEFERRED_OPS_DRAW(__prefix, __damage_area, sys)
> +
> +/*
> + * Initializes struct fb_ops for deferred I/O.
> + */
> +
> +#define __FB_DEFAULT_DEFERRED_OPS_RDWR(__prefix) \
> +	.fb_read	= __prefix ## _defio_read, \
> +	.fb_write	= __prefix ## _defio_write
> +
> +#define __FB_DEFAULT_DEFERRED_OPS_DRAW(__prefix) \
> +        .fb_fillrect	= __prefix ## _defio_fillrect, \
> +        .fb_copyarea	= __prefix ## _defio_copyarea, \
> +        .fb_imageblit	= __prefix ## _defio_imageblit

Here also,  '.fb_fillrect', '.fb_copyarea' and '.fb_imageblit' begin 
with space, but I'm OK.

I'm asking because I see other __FB__DEFAULT_* macro begin with tabs.

> +#define __FB_DEFAULT_DEFERRED_OPS_MMAP(__prefix) \
> +	.fb_mmap	= fb_deferred_io_mmap
> +
> +#define FB_DEFAULT_DEFERRED_OPS(__prefix) \
> +	__FB_DEFAULT_DEFERRED_OPS_RDWR(__prefix), \
> +	__FB_DEFAULT_DEFERRED_OPS_DRAW(__prefix), \
> +	__FB_DEFAULT_DEFERRED_OPS_MMAP(__prefix)
> +
>   static inline bool fb_be_math(struct fb_info *info)
>   {
>   #ifdef CONFIG_FB_FOREIGN_ENDIAN

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

* Re: [v4,13/13] drm/i915: Implement dedicated fbdev I/O helpers
  2023-05-24  9:21   ` Thomas Zimmermann
  (?)
@ 2023-05-24 21:25     ` Sui Jingfeng
  -1 siblings, 0 replies; 134+ messages in thread
From: Sui Jingfeng @ 2023-05-24 21:25 UTC (permalink / raw)
  To: Thomas Zimmermann, daniel, airlied, maarten.lankhorst, mripard,
	javierm, sam
  Cc: Tvrtko Ursulin, linux-samsung-soc, linux-arm-msm, intel-gfx,
	dri-devel, amd-gfx, Rodrigo Vivi, linux-tegra, freedreno,
	linux-arm-kernel

Hi,


I have just tested this patch on my i3-8100@3.6Ghz cpu + h110 
motherboard with fbtest:


Benchmarking... 10x10 squares: 26.44 Mpixels/s
Benchmarking... 20x20 squares: 52.54 Mpixels/s
Benchmarking... 50x50 squares: 128.13 Mpixels/s
Benchmarking... 100x100 squares: 252.21 Mpixels/s
Benchmarking... 200x200 squares: 489.48 Mpixels/s
Benchmarking... 500x500 squares: 1073.42 Mpixels/s
Benchmarking... 1000x1000 squares: 1823.72 Mpixels/s
Benchmarking... R5 circles: 18.73 Mpixels/s
Benchmarking... R10 circles: 39.05 Mpixels/s
Benchmarking... R25 circles: 98.60 Mpixels/s
Benchmarking... R50 circles: 196.31 Mpixels/s
Benchmarking... R100 circles: 382.81 Mpixels/s
Benchmarking... R250 circles: 872.09 Mpixels/s
Benchmarking... R500 circles: 1511.50 Mpixels/s


Then I mount ast2400 card on the same motherboard:


Benchmarking... 10x10 squares: 261.75 Mpixels/s
Benchmarking... 20x20 squares: 539.37 Mpixels/s
Benchmarking... 50x50 squares: 1161.53 Mpixels/s
Benchmarking... 100x100 squares: 1624.30 Mpixels/s
Benchmarking... 200x200 squares: 2089.74 Mpixels/s
Benchmarking... 500x500 squares: 2779.27 Mpixels/s
Benchmarking... 1000x1000 squares: 2382.28 Mpixels/s
Benchmarking... R5 circles: 151.03 Mpixels/s
Benchmarking... R10 circles: 311.34 Mpixels/s
Benchmarking... R25 circles: 698.63 Mpixels/s
Benchmarking... R50 circles: 1184.14 Mpixels/s
Benchmarking... R100 circles: 1791.60 Mpixels/s
Benchmarking... R250 circles: 2641.76 Mpixels/s
Benchmarking... R500 circles: 2669.38 Mpixels/s


The logs of fbtest and fbdev of IGT say passed.


On 2023/5/24 17:21, Thomas Zimmermann wrote:
> Implement dedicated fbdev helpers for framebuffer I/O instead
> of using DRM's helpers. Use an fbdev generator macro for
> deferred I/O to create the fbdev callbacks. i915 was the only
> caller of the DRM helpers, so remove them from the helper module.
>
> i915's fbdev emulation is still incomplete as it doesn't implement
> deferred I/O and damage handling for mmaped pages.
>
> v4:
> 	* generate deferred-I/O helpers
> 	* use initializer macros for fb_ops
> v2:
> 	* use FB_IO_HELPERS options
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
> Cc: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
> ---
>   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 |  14 +--
>   include/drm/drm_fb_helper.h                |  39 --------
>   5 files changed, 9 insertions(+), 155 deletions(-)
>
> diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
> index 92a782827b7b..bb2e48cc6cd6 100644
> --- a/drivers/gpu/drm/Kconfig
> +++ b/drivers/gpu/drm/Kconfig
> @@ -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
> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> index bab6b252f02a..9978147bbc8a 100644
> --- a/drivers/gpu/drm/drm_fb_helper.c
> +++ b/drivers/gpu/drm/drm_fb_helper.c
> @@ -736,113 +736,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_cfb_read - Implements struct &fb_ops.fb_read for I/O 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_cfb_read(struct fb_info *info, char __user *buf,
> -			       size_t count, loff_t *ppos)
> -{
> -	return fb_io_read(info, buf, count, ppos);
> -}
> -EXPORT_SYMBOL(drm_fb_helper_cfb_read);
> -
> -/**
> - * drm_fb_helper_cfb_write - Implements struct &fb_ops.fb_write for I/O 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_cfb_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_io_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_cfb_write);
> -
> -/**
> - * drm_fb_helper_cfb_fillrect - wrapper around cfb_fillrect
> - * @info: fbdev registered by the helper
> - * @rect: info about rectangle to fill
> - *
> - * A wrapper around cfb_fillrect implemented by fbdev core
> - */
> -void drm_fb_helper_cfb_fillrect(struct fb_info *info,
> -				const struct fb_fillrect *rect)
> -{
> -	struct drm_fb_helper *helper = info->par;
> -
> -	cfb_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_cfb_fillrect);
> -
> -/**
> - * drm_fb_helper_cfb_copyarea - wrapper around cfb_copyarea
> - * @info: fbdev registered by the helper
> - * @area: info about area to copy
> - *
> - * A wrapper around cfb_copyarea implemented by fbdev core
> - */
> -void drm_fb_helper_cfb_copyarea(struct fb_info *info,
> -				const struct fb_copyarea *area)
> -{
> -	struct drm_fb_helper *helper = info->par;
> -
> -	cfb_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_cfb_copyarea);
> -
> -/**
> - * drm_fb_helper_cfb_imageblit - wrapper around cfb_imageblit
> - * @info: fbdev registered by the helper
> - * @image: info about image to blit
> - *
> - * A wrapper around cfb_imageblit implemented by fbdev core
> - */
> -void drm_fb_helper_cfb_imageblit(struct fb_info *info,
> -				 const struct fb_image *image)
> -{
> -	struct drm_fb_helper *helper = info->par;
> -
> -	cfb_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_cfb_imageblit);
> -
>   /**
>    * drm_fb_helper_set_suspend - wrapper around fb_set_suspend
>    * @fb_helper: driver-allocated fbdev helper, can be NULL
> diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig
> index e4f4d2e3fdfe..01b5a8272a27 100644
> --- a/drivers/gpu/drm/i915/Kconfig
> +++ b/drivers/gpu/drm/i915/Kconfig
> @@ -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
> diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
> index aab1ae74a8f7..eccaceaf8b9d 100644
> --- a/drivers/gpu/drm/i915/display/intel_fbdev.c
> +++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
> @@ -28,6 +28,7 @@
>   #include <linux/console.h>
>   #include <linux/delay.h>
>   #include <linux/errno.h>
> +#include <linux/fb.h>
>   #include <linux/init.h>
>   #include <linux/kernel.h>
>   #include <linux/mm.h>
> @@ -84,6 +85,10 @@ static void intel_fbdev_invalidate(struct intel_fbdev *ifbdev)
>   	intel_frontbuffer_invalidate(to_frontbuffer(ifbdev), ORIGIN_CPU);
>   }
>   
> +FB_GEN_DEFAULT_DEFERRED_IO_OPS(intel_fbdev,
> +			       drm_fb_helper_damage_range,
> +			       drm_fb_helper_damage_area)
> +
>   static int intel_fbdev_set_par(struct fb_info *info)
>   {
>   	struct intel_fbdev *ifbdev = to_intel_fbdev(info->par);
> @@ -132,15 +137,12 @@ static int intel_fbdev_mmap(struct fb_info *info, struct vm_area_struct *vma)
>   
>   static const struct fb_ops intelfb_ops = {
>   	.owner = THIS_MODULE,
> +	__FB_DEFAULT_DEFERRED_OPS_RDWR(intel_fbdev),
>   	DRM_FB_HELPER_DEFAULT_OPS,
>   	.fb_set_par = intel_fbdev_set_par,
> -	.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_pan_display = intel_fbdev_pan_display,
>   	.fb_blank = intel_fbdev_blank,
> +	.fb_pan_display = intel_fbdev_pan_display,
This override the default implements(drm_fb_helper_blank, 
drm_fb_helper_pan_display and drm_fb_helper_set_par) defined in

DRM_FB_HELPER_DEFAULT_OPS, but I think this intended.

> +	__FB_DEFAULT_DEFERRED_OPS_DRAW(intel_fbdev),
>   	.fb_mmap = intel_fbdev_mmap,
>   };
>   
> diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
> index b50fd0c0b713..4863b0f8299e 100644
> --- a/include/drm/drm_fb_helper.h
> +++ b/include/drm/drm_fb_helper.h
> @@ -258,18 +258,6 @@ void drm_fb_helper_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u3
>   
>   void 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);
> @@ -385,33 +373,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)
>   {

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

* Re: [v4,13/13] drm/i915: Implement dedicated fbdev I/O helpers
@ 2023-05-24 21:25     ` Sui Jingfeng
  0 siblings, 0 replies; 134+ messages in thread
From: Sui Jingfeng @ 2023-05-24 21:25 UTC (permalink / raw)
  To: Thomas Zimmermann, daniel, airlied, maarten.lankhorst, mripard,
	javierm, sam
  Cc: Tvrtko Ursulin, linux-samsung-soc, linux-arm-msm, intel-gfx,
	amd-gfx, dri-devel, Rodrigo Vivi, linux-tegra, freedreno,
	linux-arm-kernel

Hi,


I have just tested this patch on my i3-8100@3.6Ghz cpu + h110 
motherboard with fbtest:


Benchmarking... 10x10 squares: 26.44 Mpixels/s
Benchmarking... 20x20 squares: 52.54 Mpixels/s
Benchmarking... 50x50 squares: 128.13 Mpixels/s
Benchmarking... 100x100 squares: 252.21 Mpixels/s
Benchmarking... 200x200 squares: 489.48 Mpixels/s
Benchmarking... 500x500 squares: 1073.42 Mpixels/s
Benchmarking... 1000x1000 squares: 1823.72 Mpixels/s
Benchmarking... R5 circles: 18.73 Mpixels/s
Benchmarking... R10 circles: 39.05 Mpixels/s
Benchmarking... R25 circles: 98.60 Mpixels/s
Benchmarking... R50 circles: 196.31 Mpixels/s
Benchmarking... R100 circles: 382.81 Mpixels/s
Benchmarking... R250 circles: 872.09 Mpixels/s
Benchmarking... R500 circles: 1511.50 Mpixels/s


Then I mount ast2400 card on the same motherboard:


Benchmarking... 10x10 squares: 261.75 Mpixels/s
Benchmarking... 20x20 squares: 539.37 Mpixels/s
Benchmarking... 50x50 squares: 1161.53 Mpixels/s
Benchmarking... 100x100 squares: 1624.30 Mpixels/s
Benchmarking... 200x200 squares: 2089.74 Mpixels/s
Benchmarking... 500x500 squares: 2779.27 Mpixels/s
Benchmarking... 1000x1000 squares: 2382.28 Mpixels/s
Benchmarking... R5 circles: 151.03 Mpixels/s
Benchmarking... R10 circles: 311.34 Mpixels/s
Benchmarking... R25 circles: 698.63 Mpixels/s
Benchmarking... R50 circles: 1184.14 Mpixels/s
Benchmarking... R100 circles: 1791.60 Mpixels/s
Benchmarking... R250 circles: 2641.76 Mpixels/s
Benchmarking... R500 circles: 2669.38 Mpixels/s


The logs of fbtest and fbdev of IGT say passed.


On 2023/5/24 17:21, Thomas Zimmermann wrote:
> Implement dedicated fbdev helpers for framebuffer I/O instead
> of using DRM's helpers. Use an fbdev generator macro for
> deferred I/O to create the fbdev callbacks. i915 was the only
> caller of the DRM helpers, so remove them from the helper module.
>
> i915's fbdev emulation is still incomplete as it doesn't implement
> deferred I/O and damage handling for mmaped pages.
>
> v4:
> 	* generate deferred-I/O helpers
> 	* use initializer macros for fb_ops
> v2:
> 	* use FB_IO_HELPERS options
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
> Cc: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
> ---
>   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 |  14 +--
>   include/drm/drm_fb_helper.h                |  39 --------
>   5 files changed, 9 insertions(+), 155 deletions(-)
>
> diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
> index 92a782827b7b..bb2e48cc6cd6 100644
> --- a/drivers/gpu/drm/Kconfig
> +++ b/drivers/gpu/drm/Kconfig
> @@ -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
> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> index bab6b252f02a..9978147bbc8a 100644
> --- a/drivers/gpu/drm/drm_fb_helper.c
> +++ b/drivers/gpu/drm/drm_fb_helper.c
> @@ -736,113 +736,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_cfb_read - Implements struct &fb_ops.fb_read for I/O 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_cfb_read(struct fb_info *info, char __user *buf,
> -			       size_t count, loff_t *ppos)
> -{
> -	return fb_io_read(info, buf, count, ppos);
> -}
> -EXPORT_SYMBOL(drm_fb_helper_cfb_read);
> -
> -/**
> - * drm_fb_helper_cfb_write - Implements struct &fb_ops.fb_write for I/O 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_cfb_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_io_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_cfb_write);
> -
> -/**
> - * drm_fb_helper_cfb_fillrect - wrapper around cfb_fillrect
> - * @info: fbdev registered by the helper
> - * @rect: info about rectangle to fill
> - *
> - * A wrapper around cfb_fillrect implemented by fbdev core
> - */
> -void drm_fb_helper_cfb_fillrect(struct fb_info *info,
> -				const struct fb_fillrect *rect)
> -{
> -	struct drm_fb_helper *helper = info->par;
> -
> -	cfb_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_cfb_fillrect);
> -
> -/**
> - * drm_fb_helper_cfb_copyarea - wrapper around cfb_copyarea
> - * @info: fbdev registered by the helper
> - * @area: info about area to copy
> - *
> - * A wrapper around cfb_copyarea implemented by fbdev core
> - */
> -void drm_fb_helper_cfb_copyarea(struct fb_info *info,
> -				const struct fb_copyarea *area)
> -{
> -	struct drm_fb_helper *helper = info->par;
> -
> -	cfb_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_cfb_copyarea);
> -
> -/**
> - * drm_fb_helper_cfb_imageblit - wrapper around cfb_imageblit
> - * @info: fbdev registered by the helper
> - * @image: info about image to blit
> - *
> - * A wrapper around cfb_imageblit implemented by fbdev core
> - */
> -void drm_fb_helper_cfb_imageblit(struct fb_info *info,
> -				 const struct fb_image *image)
> -{
> -	struct drm_fb_helper *helper = info->par;
> -
> -	cfb_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_cfb_imageblit);
> -
>   /**
>    * drm_fb_helper_set_suspend - wrapper around fb_set_suspend
>    * @fb_helper: driver-allocated fbdev helper, can be NULL
> diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig
> index e4f4d2e3fdfe..01b5a8272a27 100644
> --- a/drivers/gpu/drm/i915/Kconfig
> +++ b/drivers/gpu/drm/i915/Kconfig
> @@ -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
> diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
> index aab1ae74a8f7..eccaceaf8b9d 100644
> --- a/drivers/gpu/drm/i915/display/intel_fbdev.c
> +++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
> @@ -28,6 +28,7 @@
>   #include <linux/console.h>
>   #include <linux/delay.h>
>   #include <linux/errno.h>
> +#include <linux/fb.h>
>   #include <linux/init.h>
>   #include <linux/kernel.h>
>   #include <linux/mm.h>
> @@ -84,6 +85,10 @@ static void intel_fbdev_invalidate(struct intel_fbdev *ifbdev)
>   	intel_frontbuffer_invalidate(to_frontbuffer(ifbdev), ORIGIN_CPU);
>   }
>   
> +FB_GEN_DEFAULT_DEFERRED_IO_OPS(intel_fbdev,
> +			       drm_fb_helper_damage_range,
> +			       drm_fb_helper_damage_area)
> +
>   static int intel_fbdev_set_par(struct fb_info *info)
>   {
>   	struct intel_fbdev *ifbdev = to_intel_fbdev(info->par);
> @@ -132,15 +137,12 @@ static int intel_fbdev_mmap(struct fb_info *info, struct vm_area_struct *vma)
>   
>   static const struct fb_ops intelfb_ops = {
>   	.owner = THIS_MODULE,
> +	__FB_DEFAULT_DEFERRED_OPS_RDWR(intel_fbdev),
>   	DRM_FB_HELPER_DEFAULT_OPS,
>   	.fb_set_par = intel_fbdev_set_par,
> -	.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_pan_display = intel_fbdev_pan_display,
>   	.fb_blank = intel_fbdev_blank,
> +	.fb_pan_display = intel_fbdev_pan_display,
This override the default implements(drm_fb_helper_blank, 
drm_fb_helper_pan_display and drm_fb_helper_set_par) defined in

DRM_FB_HELPER_DEFAULT_OPS, but I think this intended.

> +	__FB_DEFAULT_DEFERRED_OPS_DRAW(intel_fbdev),
>   	.fb_mmap = intel_fbdev_mmap,
>   };
>   
> diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
> index b50fd0c0b713..4863b0f8299e 100644
> --- a/include/drm/drm_fb_helper.h
> +++ b/include/drm/drm_fb_helper.h
> @@ -258,18 +258,6 @@ void drm_fb_helper_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u3
>   
>   void 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);
> @@ -385,33 +373,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)
>   {

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

* Re: [Intel-gfx] [v4, 13/13] drm/i915: Implement dedicated fbdev I/O helpers
@ 2023-05-24 21:25     ` Sui Jingfeng
  0 siblings, 0 replies; 134+ messages in thread
From: Sui Jingfeng @ 2023-05-24 21:25 UTC (permalink / raw)
  To: Thomas Zimmermann, daniel, airlied, maarten.lankhorst, mripard,
	javierm, sam
  Cc: linux-samsung-soc, linux-arm-msm, intel-gfx, amd-gfx, dri-devel,
	Rodrigo Vivi, linux-tegra, freedreno, linux-arm-kernel

Hi,


I have just tested this patch on my i3-8100@3.6Ghz cpu + h110 
motherboard with fbtest:


Benchmarking... 10x10 squares: 26.44 Mpixels/s
Benchmarking... 20x20 squares: 52.54 Mpixels/s
Benchmarking... 50x50 squares: 128.13 Mpixels/s
Benchmarking... 100x100 squares: 252.21 Mpixels/s
Benchmarking... 200x200 squares: 489.48 Mpixels/s
Benchmarking... 500x500 squares: 1073.42 Mpixels/s
Benchmarking... 1000x1000 squares: 1823.72 Mpixels/s
Benchmarking... R5 circles: 18.73 Mpixels/s
Benchmarking... R10 circles: 39.05 Mpixels/s
Benchmarking... R25 circles: 98.60 Mpixels/s
Benchmarking... R50 circles: 196.31 Mpixels/s
Benchmarking... R100 circles: 382.81 Mpixels/s
Benchmarking... R250 circles: 872.09 Mpixels/s
Benchmarking... R500 circles: 1511.50 Mpixels/s


Then I mount ast2400 card on the same motherboard:


Benchmarking... 10x10 squares: 261.75 Mpixels/s
Benchmarking... 20x20 squares: 539.37 Mpixels/s
Benchmarking... 50x50 squares: 1161.53 Mpixels/s
Benchmarking... 100x100 squares: 1624.30 Mpixels/s
Benchmarking... 200x200 squares: 2089.74 Mpixels/s
Benchmarking... 500x500 squares: 2779.27 Mpixels/s
Benchmarking... 1000x1000 squares: 2382.28 Mpixels/s
Benchmarking... R5 circles: 151.03 Mpixels/s
Benchmarking... R10 circles: 311.34 Mpixels/s
Benchmarking... R25 circles: 698.63 Mpixels/s
Benchmarking... R50 circles: 1184.14 Mpixels/s
Benchmarking... R100 circles: 1791.60 Mpixels/s
Benchmarking... R250 circles: 2641.76 Mpixels/s
Benchmarking... R500 circles: 2669.38 Mpixels/s


The logs of fbtest and fbdev of IGT say passed.


On 2023/5/24 17:21, Thomas Zimmermann wrote:
> Implement dedicated fbdev helpers for framebuffer I/O instead
> of using DRM's helpers. Use an fbdev generator macro for
> deferred I/O to create the fbdev callbacks. i915 was the only
> caller of the DRM helpers, so remove them from the helper module.
>
> i915's fbdev emulation is still incomplete as it doesn't implement
> deferred I/O and damage handling for mmaped pages.
>
> v4:
> 	* generate deferred-I/O helpers
> 	* use initializer macros for fb_ops
> v2:
> 	* use FB_IO_HELPERS options
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
> Cc: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
> ---
>   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 |  14 +--
>   include/drm/drm_fb_helper.h                |  39 --------
>   5 files changed, 9 insertions(+), 155 deletions(-)
>
> diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
> index 92a782827b7b..bb2e48cc6cd6 100644
> --- a/drivers/gpu/drm/Kconfig
> +++ b/drivers/gpu/drm/Kconfig
> @@ -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
> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> index bab6b252f02a..9978147bbc8a 100644
> --- a/drivers/gpu/drm/drm_fb_helper.c
> +++ b/drivers/gpu/drm/drm_fb_helper.c
> @@ -736,113 +736,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_cfb_read - Implements struct &fb_ops.fb_read for I/O 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_cfb_read(struct fb_info *info, char __user *buf,
> -			       size_t count, loff_t *ppos)
> -{
> -	return fb_io_read(info, buf, count, ppos);
> -}
> -EXPORT_SYMBOL(drm_fb_helper_cfb_read);
> -
> -/**
> - * drm_fb_helper_cfb_write - Implements struct &fb_ops.fb_write for I/O 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_cfb_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_io_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_cfb_write);
> -
> -/**
> - * drm_fb_helper_cfb_fillrect - wrapper around cfb_fillrect
> - * @info: fbdev registered by the helper
> - * @rect: info about rectangle to fill
> - *
> - * A wrapper around cfb_fillrect implemented by fbdev core
> - */
> -void drm_fb_helper_cfb_fillrect(struct fb_info *info,
> -				const struct fb_fillrect *rect)
> -{
> -	struct drm_fb_helper *helper = info->par;
> -
> -	cfb_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_cfb_fillrect);
> -
> -/**
> - * drm_fb_helper_cfb_copyarea - wrapper around cfb_copyarea
> - * @info: fbdev registered by the helper
> - * @area: info about area to copy
> - *
> - * A wrapper around cfb_copyarea implemented by fbdev core
> - */
> -void drm_fb_helper_cfb_copyarea(struct fb_info *info,
> -				const struct fb_copyarea *area)
> -{
> -	struct drm_fb_helper *helper = info->par;
> -
> -	cfb_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_cfb_copyarea);
> -
> -/**
> - * drm_fb_helper_cfb_imageblit - wrapper around cfb_imageblit
> - * @info: fbdev registered by the helper
> - * @image: info about image to blit
> - *
> - * A wrapper around cfb_imageblit implemented by fbdev core
> - */
> -void drm_fb_helper_cfb_imageblit(struct fb_info *info,
> -				 const struct fb_image *image)
> -{
> -	struct drm_fb_helper *helper = info->par;
> -
> -	cfb_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_cfb_imageblit);
> -
>   /**
>    * drm_fb_helper_set_suspend - wrapper around fb_set_suspend
>    * @fb_helper: driver-allocated fbdev helper, can be NULL
> diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig
> index e4f4d2e3fdfe..01b5a8272a27 100644
> --- a/drivers/gpu/drm/i915/Kconfig
> +++ b/drivers/gpu/drm/i915/Kconfig
> @@ -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
> diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
> index aab1ae74a8f7..eccaceaf8b9d 100644
> --- a/drivers/gpu/drm/i915/display/intel_fbdev.c
> +++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
> @@ -28,6 +28,7 @@
>   #include <linux/console.h>
>   #include <linux/delay.h>
>   #include <linux/errno.h>
> +#include <linux/fb.h>
>   #include <linux/init.h>
>   #include <linux/kernel.h>
>   #include <linux/mm.h>
> @@ -84,6 +85,10 @@ static void intel_fbdev_invalidate(struct intel_fbdev *ifbdev)
>   	intel_frontbuffer_invalidate(to_frontbuffer(ifbdev), ORIGIN_CPU);
>   }
>   
> +FB_GEN_DEFAULT_DEFERRED_IO_OPS(intel_fbdev,
> +			       drm_fb_helper_damage_range,
> +			       drm_fb_helper_damage_area)
> +
>   static int intel_fbdev_set_par(struct fb_info *info)
>   {
>   	struct intel_fbdev *ifbdev = to_intel_fbdev(info->par);
> @@ -132,15 +137,12 @@ static int intel_fbdev_mmap(struct fb_info *info, struct vm_area_struct *vma)
>   
>   static const struct fb_ops intelfb_ops = {
>   	.owner = THIS_MODULE,
> +	__FB_DEFAULT_DEFERRED_OPS_RDWR(intel_fbdev),
>   	DRM_FB_HELPER_DEFAULT_OPS,
>   	.fb_set_par = intel_fbdev_set_par,
> -	.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_pan_display = intel_fbdev_pan_display,
>   	.fb_blank = intel_fbdev_blank,
> +	.fb_pan_display = intel_fbdev_pan_display,
This override the default implements(drm_fb_helper_blank, 
drm_fb_helper_pan_display and drm_fb_helper_set_par) defined in

DRM_FB_HELPER_DEFAULT_OPS, but I think this intended.

> +	__FB_DEFAULT_DEFERRED_OPS_DRAW(intel_fbdev),
>   	.fb_mmap = intel_fbdev_mmap,
>   };
>   
> diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
> index b50fd0c0b713..4863b0f8299e 100644
> --- a/include/drm/drm_fb_helper.h
> +++ b/include/drm/drm_fb_helper.h
> @@ -258,18 +258,6 @@ void drm_fb_helper_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u3
>   
>   void 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);
> @@ -385,33 +373,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)
>   {

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

* Re: [v4,12/13] drm/fbdev-generic: Implement dedicated fbdev I/O helpers
  2023-05-24  9:21   ` Thomas Zimmermann
  (?)
@ 2023-05-25  2:46     ` Sui Jingfeng
  -1 siblings, 0 replies; 134+ messages in thread
From: Sui Jingfeng @ 2023-05-25  2:46 UTC (permalink / raw)
  To: Thomas Zimmermann, daniel, airlied, maarten.lankhorst, mripard,
	javierm, sam
  Cc: linux-samsung-soc, linux-arm-msm, intel-gfx, dri-devel, amd-gfx,
	linux-tegra, freedreno, linux-arm-kernel

Reviewed-by: Sui Jingfeng <suijingfeng@loongson.cn>


On 2023/5/24 17:21, Thomas Zimmermann wrote:
> Implement dedicated fbdev helpers for framebuffer I/O instead
> of using DRM's helpers. Use an fbdev generator macro for
> deferred I/O to create the callbacks. Fbdev-generic was the
> only caller of the DRM helpers, so remove them from the helper
> module.
>
> v4:
> 	* generate deferred-I/O helpers
> 	* use initializer macros for fb_ops
> v2:
> 	* use FB_SYS_HELPERS_DEFERRED option
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> ---
>   drivers/gpu/drm/Kconfig             |   6 +-
>   drivers/gpu/drm/drm_fb_helper.c     | 107 ----------------------------
>   drivers/gpu/drm/drm_fbdev_generic.c |  11 ++-
>   include/drm/drm_fb_helper.h         |  41 -----------
>   4 files changed, 6 insertions(+), 159 deletions(-)
>
> diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
> index 77fb10ddd8a2..92a782827b7b 100644
> --- a/drivers/gpu/drm/Kconfig
> +++ b/drivers/gpu/drm/Kconfig
> @@ -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
> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> index cb03099fd2e3..bab6b252f02a 100644
> --- a/drivers/gpu/drm/drm_fb_helper.c
> +++ b/drivers/gpu/drm/drm_fb_helper.c
> @@ -736,113 +736,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
> diff --git a/drivers/gpu/drm/drm_fbdev_generic.c b/drivers/gpu/drm/drm_fbdev_generic.c
> index 8e5148bf40bb..98ae703848a0 100644
> --- a/drivers/gpu/drm/drm_fbdev_generic.c
> +++ b/drivers/gpu/drm/drm_fbdev_generic.c
> @@ -34,6 +34,10 @@ static int drm_fbdev_generic_fb_release(struct fb_info *info, int user)
>   	return 0;
>   }
>   
> +FB_GEN_DEFAULT_DEFERRED_SYS_OPS(drm_fbdev_generic,
> +				drm_fb_helper_damage_range,
> +				drm_fb_helper_damage_area);
> +
>   static void drm_fbdev_generic_fb_destroy(struct fb_info *info)
>   {
>   	struct drm_fb_helper *fb_helper = info->par;
> @@ -56,13 +60,8 @@ 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_DEFAULT_DEFERRED_OPS(drm_fbdev_generic),
>   	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_mmap	= fb_deferred_io_mmap,
>   	.fb_destroy	= drm_fbdev_generic_fb_destroy,
>   };
>   
> diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
> index 7d5804882be7..b50fd0c0b713 100644
> --- a/include/drm/drm_fb_helper.h
> +++ b/include/drm/drm_fb_helper.h
> @@ -258,18 +258,6 @@ void drm_fb_helper_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u3
>   
>   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,
> -			       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,
> @@ -397,35 +385,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)
>   {

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

* Re: [v4,12/13] drm/fbdev-generic: Implement dedicated fbdev I/O helpers
@ 2023-05-25  2:46     ` Sui Jingfeng
  0 siblings, 0 replies; 134+ messages in thread
From: Sui Jingfeng @ 2023-05-25  2:46 UTC (permalink / raw)
  To: Thomas Zimmermann, daniel, airlied, maarten.lankhorst, mripard,
	javierm, sam
  Cc: linux-samsung-soc, linux-arm-msm, intel-gfx, amd-gfx, dri-devel,
	linux-tegra, freedreno, linux-arm-kernel

Reviewed-by: Sui Jingfeng <suijingfeng@loongson.cn>


On 2023/5/24 17:21, Thomas Zimmermann wrote:
> Implement dedicated fbdev helpers for framebuffer I/O instead
> of using DRM's helpers. Use an fbdev generator macro for
> deferred I/O to create the callbacks. Fbdev-generic was the
> only caller of the DRM helpers, so remove them from the helper
> module.
>
> v4:
> 	* generate deferred-I/O helpers
> 	* use initializer macros for fb_ops
> v2:
> 	* use FB_SYS_HELPERS_DEFERRED option
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> ---
>   drivers/gpu/drm/Kconfig             |   6 +-
>   drivers/gpu/drm/drm_fb_helper.c     | 107 ----------------------------
>   drivers/gpu/drm/drm_fbdev_generic.c |  11 ++-
>   include/drm/drm_fb_helper.h         |  41 -----------
>   4 files changed, 6 insertions(+), 159 deletions(-)
>
> diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
> index 77fb10ddd8a2..92a782827b7b 100644
> --- a/drivers/gpu/drm/Kconfig
> +++ b/drivers/gpu/drm/Kconfig
> @@ -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
> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> index cb03099fd2e3..bab6b252f02a 100644
> --- a/drivers/gpu/drm/drm_fb_helper.c
> +++ b/drivers/gpu/drm/drm_fb_helper.c
> @@ -736,113 +736,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
> diff --git a/drivers/gpu/drm/drm_fbdev_generic.c b/drivers/gpu/drm/drm_fbdev_generic.c
> index 8e5148bf40bb..98ae703848a0 100644
> --- a/drivers/gpu/drm/drm_fbdev_generic.c
> +++ b/drivers/gpu/drm/drm_fbdev_generic.c
> @@ -34,6 +34,10 @@ static int drm_fbdev_generic_fb_release(struct fb_info *info, int user)
>   	return 0;
>   }
>   
> +FB_GEN_DEFAULT_DEFERRED_SYS_OPS(drm_fbdev_generic,
> +				drm_fb_helper_damage_range,
> +				drm_fb_helper_damage_area);
> +
>   static void drm_fbdev_generic_fb_destroy(struct fb_info *info)
>   {
>   	struct drm_fb_helper *fb_helper = info->par;
> @@ -56,13 +60,8 @@ 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_DEFAULT_DEFERRED_OPS(drm_fbdev_generic),
>   	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_mmap	= fb_deferred_io_mmap,
>   	.fb_destroy	= drm_fbdev_generic_fb_destroy,
>   };
>   
> diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
> index 7d5804882be7..b50fd0c0b713 100644
> --- a/include/drm/drm_fb_helper.h
> +++ b/include/drm/drm_fb_helper.h
> @@ -258,18 +258,6 @@ void drm_fb_helper_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u3
>   
>   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,
> -			       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,
> @@ -397,35 +385,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)
>   {

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

* Re: [Intel-gfx] [v4, 12/13] drm/fbdev-generic: Implement dedicated fbdev I/O helpers
@ 2023-05-25  2:46     ` Sui Jingfeng
  0 siblings, 0 replies; 134+ messages in thread
From: Sui Jingfeng @ 2023-05-25  2:46 UTC (permalink / raw)
  To: Thomas Zimmermann, daniel, airlied, maarten.lankhorst, mripard,
	javierm, sam
  Cc: linux-samsung-soc, linux-arm-msm, intel-gfx, amd-gfx, dri-devel,
	linux-tegra, freedreno, linux-arm-kernel

Reviewed-by: Sui Jingfeng <suijingfeng@loongson.cn>


On 2023/5/24 17:21, Thomas Zimmermann wrote:
> Implement dedicated fbdev helpers for framebuffer I/O instead
> of using DRM's helpers. Use an fbdev generator macro for
> deferred I/O to create the callbacks. Fbdev-generic was the
> only caller of the DRM helpers, so remove them from the helper
> module.
>
> v4:
> 	* generate deferred-I/O helpers
> 	* use initializer macros for fb_ops
> v2:
> 	* use FB_SYS_HELPERS_DEFERRED option
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> ---
>   drivers/gpu/drm/Kconfig             |   6 +-
>   drivers/gpu/drm/drm_fb_helper.c     | 107 ----------------------------
>   drivers/gpu/drm/drm_fbdev_generic.c |  11 ++-
>   include/drm/drm_fb_helper.h         |  41 -----------
>   4 files changed, 6 insertions(+), 159 deletions(-)
>
> diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
> index 77fb10ddd8a2..92a782827b7b 100644
> --- a/drivers/gpu/drm/Kconfig
> +++ b/drivers/gpu/drm/Kconfig
> @@ -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
> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> index cb03099fd2e3..bab6b252f02a 100644
> --- a/drivers/gpu/drm/drm_fb_helper.c
> +++ b/drivers/gpu/drm/drm_fb_helper.c
> @@ -736,113 +736,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
> diff --git a/drivers/gpu/drm/drm_fbdev_generic.c b/drivers/gpu/drm/drm_fbdev_generic.c
> index 8e5148bf40bb..98ae703848a0 100644
> --- a/drivers/gpu/drm/drm_fbdev_generic.c
> +++ b/drivers/gpu/drm/drm_fbdev_generic.c
> @@ -34,6 +34,10 @@ static int drm_fbdev_generic_fb_release(struct fb_info *info, int user)
>   	return 0;
>   }
>   
> +FB_GEN_DEFAULT_DEFERRED_SYS_OPS(drm_fbdev_generic,
> +				drm_fb_helper_damage_range,
> +				drm_fb_helper_damage_area);
> +
>   static void drm_fbdev_generic_fb_destroy(struct fb_info *info)
>   {
>   	struct drm_fb_helper *fb_helper = info->par;
> @@ -56,13 +60,8 @@ 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_DEFAULT_DEFERRED_OPS(drm_fbdev_generic),
>   	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_mmap	= fb_deferred_io_mmap,
>   	.fb_destroy	= drm_fbdev_generic_fb_destroy,
>   };
>   
> diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
> index 7d5804882be7..b50fd0c0b713 100644
> --- a/include/drm/drm_fb_helper.h
> +++ b/include/drm/drm_fb_helper.h
> @@ -258,18 +258,6 @@ void drm_fb_helper_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u3
>   
>   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,
> -			       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,
> @@ -397,35 +385,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)
>   {

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

* [Intel-gfx] ✓ Fi.CI.IGT: success for drm/fbdev: Remove DRM's helpers for fbdev I/O (rev4)
  2023-05-24  9:21 ` [Intel-gfx] " Thomas Zimmermann
                   ` (18 preceding siblings ...)
  (?)
@ 2023-05-25 12:44 ` Patchwork
  -1 siblings, 0 replies; 134+ messages in thread
From: Patchwork @ 2023-05-25 12:44 UTC (permalink / raw)
  To: Thomas Zimmermann; +Cc: intel-gfx

[-- Attachment #1: Type: text/plain, Size: 50797 bytes --]

== Series Details ==

Series: drm/fbdev: Remove DRM's helpers for fbdev I/O (rev4)
URL   : https://patchwork.freedesktop.org/series/117671/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_13187_full -> Patchwork_117671v4_full
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  

Participating hosts (7 -> 8)
------------------------------

  Additional (1): shard-rkl0 

Possible new issues
-------------------

  Here are the unknown changes that may have been introduced in Patchwork_117671v4_full:

### IGT changes ###

#### Suppressed ####

  The following results come from untrusted machines, tests, or statuses.
  They do not affect the overall result.

  * igt@kms_flip@wf_vblank-ts-check-interruptible@a-hdmi-a4:
    - {shard-dg1}:        [PASS][1] -> [ABORT][2]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13187/shard-dg1-14/igt@kms_flip@wf_vblank-ts-check-interruptible@a-hdmi-a4.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117671v4/shard-dg1-18/igt@kms_flip@wf_vblank-ts-check-interruptible@a-hdmi-a4.html

  * igt@kms_flip@wf_vblank-ts-check-interruptible@b-hdmi-a4:
    - {shard-dg1}:        [PASS][3] -> [DMESG-WARN][4]
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13187/shard-dg1-14/igt@kms_flip@wf_vblank-ts-check-interruptible@b-hdmi-a4.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117671v4/shard-dg1-18/igt@kms_flip@wf_vblank-ts-check-interruptible@b-hdmi-a4.html

  
New tests
---------

  New tests have been introduced between CI_DRM_13187_full and Patchwork_117671v4_full:

### New IGT tests (278) ###

  * igt@kms_flip@2x-dpms-vs-vblank-race@ab-hdmi-a1-hdmi-a2:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_flip@2x-dpms-vs-vblank-race@ac-hdmi-a1-hdmi-a2:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_flip@2x-dpms-vs-vblank-race@bc-hdmi-a1-hdmi-a2:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-modifiers-factor-0-25:
    - Statuses :
    - Exec time: [None] s

  * igt@kms_plane_scaling@plane-downscale-with-modifiers-factor-0-25@pipe-a-dp-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-modifiers-factor-0-25@pipe-a-hdmi-a-1:
    - Statuses : 2 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-modifiers-factor-0-25@pipe-a-vga-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-modifiers-factor-0-25@pipe-b-dp-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-modifiers-factor-0-25@pipe-b-hdmi-a-1:
    - Statuses : 2 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-modifiers-factor-0-25@pipe-b-hdmi-a-2:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-modifiers-factor-0-25@pipe-b-vga-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-modifiers-factor-0-25@pipe-c-dp-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-modifiers-factor-0-25@pipe-c-hdmi-a-1:
    - Statuses : 2 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-modifiers-factor-0-25@pipe-d-hdmi-a-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-modifiers-factor-0-5@pipe-a-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-modifiers-factor-0-5@pipe-a-hdmi-a-1:
    - Statuses : 2 pass(s) 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-modifiers-factor-0-5@pipe-b-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-modifiers-factor-0-5@pipe-c-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-modifiers-factor-0-5@pipe-c-hdmi-a-1:
    - Statuses : 2 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-modifiers-factor-0-75:
    - Statuses :
    - Exec time: [None] s

  * igt@kms_plane_scaling@plane-downscale-with-modifiers-factor-0-75@pipe-a-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-modifiers-factor-0-75@pipe-a-hdmi-a-1:
    - Statuses : 2 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-modifiers-factor-0-75@pipe-a-vga-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-modifiers-factor-0-75@pipe-b-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-modifiers-factor-0-75@pipe-b-hdmi-a-1:
    - Statuses : 2 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-modifiers-factor-0-75@pipe-b-hdmi-a-2:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-modifiers-factor-0-75@pipe-b-vga-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-modifiers-factor-0-75@pipe-c-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-modifiers-factor-0-75@pipe-c-hdmi-a-1:
    - Statuses : 2 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-modifiers-factor-0-75@pipe-d-hdmi-a-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-pixel-format-factor-0-25:
    - Statuses :
    - Exec time: [None] s

  * igt@kms_plane_scaling@plane-downscale-with-pixel-format-factor-0-25@pipe-a-hdmi-a-1:
    - Statuses : 3 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-pixel-format-factor-0-25@pipe-a-vga-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-pixel-format-factor-0-25@pipe-b-vga-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-pixel-format-factor-0-25@pipe-c-hdmi-a-1:
    - Statuses : 2 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-pixel-format-factor-0-5@pipe-a-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-pixel-format-factor-0-5@pipe-b-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-pixel-format-factor-0-5@pipe-c-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-pixel-format-factor-0-75:
    - Statuses :
    - Exec time: [None] s

  * igt@kms_plane_scaling@plane-downscale-with-pixel-format-factor-0-75@pipe-a-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-pixel-format-factor-0-75@pipe-a-hdmi-a-1:
    - Statuses : 2 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-pixel-format-factor-0-75@pipe-a-vga-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-pixel-format-factor-0-75@pipe-b-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-pixel-format-factor-0-75@pipe-b-hdmi-a-2:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-pixel-format-factor-0-75@pipe-b-vga-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-pixel-format-factor-0-75@pipe-c-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-pixel-format-factor-0-75@pipe-c-hdmi-a-1:
    - Statuses : 2 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-rotation-factor-0-25@pipe-a-dp-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-rotation-factor-0-25@pipe-b-dp-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-rotation-factor-0-25@pipe-c-dp-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-rotation-factor-0-5:
    - Statuses :
    - Exec time: [None] s

  * igt@kms_plane_scaling@plane-downscale-with-rotation-factor-0-5@pipe-a-dp-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-rotation-factor-0-5@pipe-a-hdmi-a-1:
    - Statuses : 2 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-rotation-factor-0-5@pipe-a-vga-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-rotation-factor-0-5@pipe-b-dp-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-rotation-factor-0-5@pipe-b-hdmi-a-1:
    - Statuses : 2 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-rotation-factor-0-5@pipe-b-hdmi-a-2:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-rotation-factor-0-5@pipe-b-vga-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-rotation-factor-0-5@pipe-c-dp-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-rotation-factor-0-5@pipe-c-hdmi-a-1:
    - Statuses : 2 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-rotation-factor-0-5@pipe-d-hdmi-a-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-rotation-factor-0-75@pipe-a-dp-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-rotation-factor-0-75@pipe-a-hdmi-a-1:
    - Statuses : 3 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-rotation-factor-0-75@pipe-a-vga-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-rotation-factor-0-75@pipe-b-dp-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-rotation-factor-0-75@pipe-b-vga-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-rotation-factor-0-75@pipe-c-dp-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-rotation-factor-0-75@pipe-c-hdmi-a-1:
    - Statuses : 2 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-scaler-with-clipping-clamping-modifiers:
    - Statuses :
    - Exec time: [None] s

  * igt@kms_plane_scaling@plane-scaler-with-clipping-clamping-modifiers@pipe-a-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-scaler-with-clipping-clamping-modifiers@pipe-a-hdmi-a-1:
    - Statuses : 2 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-scaler-with-clipping-clamping-modifiers@pipe-b-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-scaler-with-clipping-clamping-modifiers@pipe-b-hdmi-a-1:
    - Statuses : 2 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-scaler-with-clipping-clamping-modifiers@pipe-b-hdmi-a-2:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-scaler-with-clipping-clamping-modifiers@pipe-c-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-scaler-with-clipping-clamping-modifiers@pipe-c-hdmi-a-1:
    - Statuses : 2 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-scaler-with-clipping-clamping-modifiers@pipe-d-hdmi-a-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-scaler-with-clipping-clamping-pixel-formats@pipe-a-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-scaler-with-clipping-clamping-pixel-formats@pipe-b-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-scaler-with-clipping-clamping-pixel-formats@pipe-c-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-scaler-with-clipping-clamping-rotation:
    - Statuses :
    - Exec time: [None] s

  * igt@kms_plane_scaling@plane-scaler-with-clipping-clamping-rotation@pipe-a-dp-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-scaler-with-clipping-clamping-rotation@pipe-a-hdmi-a-1:
    - Statuses : 3 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-scaler-with-clipping-clamping-rotation@pipe-b-dp-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-scaler-with-clipping-clamping-rotation@pipe-b-hdmi-a-2:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-scaler-with-clipping-clamping-rotation@pipe-c-dp-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-scaler-with-clipping-clamping-rotation@pipe-c-hdmi-a-1:
    - Statuses : 2 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-scaler-with-modifiers-unity-scaling:
    - Statuses :
    - Exec time: [None] s

  * igt@kms_plane_scaling@plane-scaler-with-modifiers-unity-scaling@pipe-a-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-scaler-with-modifiers-unity-scaling@pipe-a-hdmi-a-1:
    - Statuses : 2 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-scaler-with-modifiers-unity-scaling@pipe-a-vga-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-scaler-with-modifiers-unity-scaling@pipe-b-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-scaler-with-modifiers-unity-scaling@pipe-b-hdmi-a-1:
    - Statuses : 2 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-scaler-with-modifiers-unity-scaling@pipe-b-hdmi-a-2:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-scaler-with-modifiers-unity-scaling@pipe-b-vga-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-scaler-with-modifiers-unity-scaling@pipe-c-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-scaler-with-modifiers-unity-scaling@pipe-c-hdmi-a-1:
    - Statuses : 2 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-scaler-with-modifiers-unity-scaling@pipe-d-hdmi-a-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-scaler-with-pixel-format-unity-scaling:
    - Statuses :
    - Exec time: [None] s

  * igt@kms_plane_scaling@plane-scaler-with-pixel-format-unity-scaling@pipe-a-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-scaler-with-pixel-format-unity-scaling@pipe-a-hdmi-a-1:
    - Statuses : 2 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-scaler-with-pixel-format-unity-scaling@pipe-a-vga-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-scaler-with-pixel-format-unity-scaling@pipe-b-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-scaler-with-pixel-format-unity-scaling@pipe-b-hdmi-a-1:
    - Statuses : 2 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-scaler-with-pixel-format-unity-scaling@pipe-b-hdmi-a-2:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-scaler-with-pixel-format-unity-scaling@pipe-b-vga-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-scaler-with-pixel-format-unity-scaling@pipe-c-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-scaler-with-pixel-format-unity-scaling@pipe-c-hdmi-a-1:
    - Statuses : 2 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-scaler-with-pixel-format-unity-scaling@pipe-d-hdmi-a-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-scaler-with-rotation-unity-scaling@pipe-a-dp-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-scaler-with-rotation-unity-scaling@pipe-a-hdmi-a-1:
    - Statuses : 1 pass(s) 2 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-scaler-with-rotation-unity-scaling@pipe-b-dp-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-scaler-with-rotation-unity-scaling@pipe-b-hdmi-a-1:
    - Statuses : 1 pass(s) 2 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-scaler-with-rotation-unity-scaling@pipe-b-hdmi-a-2:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-scaler-with-rotation-unity-scaling@pipe-c-dp-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-scaler-with-rotation-unity-scaling@pipe-c-hdmi-a-1:
    - Statuses : 2 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-scaler-with-rotation-unity-scaling@pipe-d-hdmi-a-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-upscale-with-modifiers-20x20:
    - Statuses :
    - Exec time: [None] s

  * igt@kms_plane_scaling@plane-upscale-with-modifiers-20x20@pipe-a-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-upscale-with-modifiers-20x20@pipe-a-vga-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-upscale-with-modifiers-20x20@pipe-b-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-upscale-with-modifiers-20x20@pipe-b-hdmi-a-2:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-upscale-with-modifiers-20x20@pipe-b-vga-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-upscale-with-modifiers-20x20@pipe-c-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-upscale-with-modifiers-factor-0-25:
    - Statuses :
    - Exec time: [None] s

  * igt@kms_plane_scaling@plane-upscale-with-modifiers-factor-0-25@pipe-a-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-upscale-with-modifiers-factor-0-25@pipe-a-hdmi-a-1:
    - Statuses : 2 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-upscale-with-modifiers-factor-0-25@pipe-a-vga-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-upscale-with-modifiers-factor-0-25@pipe-b-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-upscale-with-modifiers-factor-0-25@pipe-b-hdmi-a-1:
    - Statuses : 2 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-upscale-with-modifiers-factor-0-25@pipe-b-hdmi-a-2:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-upscale-with-modifiers-factor-0-25@pipe-b-vga-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-upscale-with-modifiers-factor-0-25@pipe-c-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-upscale-with-modifiers-factor-0-25@pipe-c-hdmi-a-1:
    - Statuses : 2 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-upscale-with-modifiers-factor-0-25@pipe-d-hdmi-a-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-upscale-with-pixel-format-20x20@pipe-a-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-upscale-with-pixel-format-20x20@pipe-b-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-upscale-with-pixel-format-20x20@pipe-c-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-upscale-with-pixel-format-factor-0-25:
    - Statuses :
    - Exec time: [None] s

  * igt@kms_plane_scaling@plane-upscale-with-pixel-format-factor-0-25@pipe-a-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-upscale-with-pixel-format-factor-0-25@pipe-a-hdmi-a-1:
    - Statuses : 2 pass(s) 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-upscale-with-pixel-format-factor-0-25@pipe-b-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-upscale-with-pixel-format-factor-0-25@pipe-b-hdmi-a-1:
    - Statuses : 2 pass(s) 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-upscale-with-pixel-format-factor-0-25@pipe-c-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-upscale-with-pixel-format-factor-0-25@pipe-c-hdmi-a-1:
    - Statuses : 2 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-upscale-with-pixel-format-factor-0-25@pipe-d-hdmi-a-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-upscale-with-rotation-20x20@pipe-a-dp-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-upscale-with-rotation-20x20@pipe-a-hdmi-a-1:
    - Statuses : 3 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-upscale-with-rotation-20x20@pipe-b-dp-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-upscale-with-rotation-20x20@pipe-b-hdmi-a-1:
    - Statuses : 3 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-upscale-with-rotation-20x20@pipe-b-hdmi-a-2:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-upscale-with-rotation-20x20@pipe-c-dp-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-upscale-with-rotation-20x20@pipe-c-hdmi-a-1:
    - Statuses : 2 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-upscale-with-rotation-20x20@pipe-d-hdmi-a-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-upscale-with-rotation-factor-0-25@pipe-a-dp-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-upscale-with-rotation-factor-0-25@pipe-a-hdmi-a-1:
    - Statuses : 3 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-upscale-with-rotation-factor-0-25@pipe-b-dp-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-upscale-with-rotation-factor-0-25@pipe-b-hdmi-a-1:
    - Statuses : 3 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-upscale-with-rotation-factor-0-25@pipe-b-hdmi-a-2:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-upscale-with-rotation-factor-0-25@pipe-c-dp-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-upscale-with-rotation-factor-0-25@pipe-c-hdmi-a-1:
    - Statuses : 2 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-upscale-with-rotation-factor-0-25@pipe-d-hdmi-a-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-downscale-factor-0-25@pipe-a-dp-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-downscale-factor-0-25@pipe-a-hdmi-a-1:
    - Statuses : 2 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-downscale-factor-0-25@pipe-a-vga-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-downscale-factor-0-25@pipe-b-dp-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-downscale-factor-0-25@pipe-b-hdmi-a-1:
    - Statuses : 2 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-downscale-factor-0-25@pipe-b-hdmi-a-2:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-downscale-factor-0-25@pipe-b-vga-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-downscale-factor-0-25@pipe-c-dp-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-downscale-factor-0-25@pipe-c-hdmi-a-1:
    - Statuses : 2 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-downscale-factor-0-25@pipe-d-hdmi-a-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-downscale-factor-0-5@pipe-a-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-downscale-factor-0-5@pipe-a-hdmi-a-1:
    - Statuses : 2 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-downscale-factor-0-5@pipe-a-vga-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-downscale-factor-0-5@pipe-b-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-downscale-factor-0-5@pipe-b-hdmi-a-1:
    - Statuses : 2 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-downscale-factor-0-5@pipe-b-hdmi-a-2:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-downscale-factor-0-5@pipe-b-vga-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-downscale-factor-0-5@pipe-c-dp-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-downscale-factor-0-5@pipe-c-hdmi-a-1:
    - Statuses : 1 pass(s) 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-downscale-factor-0-5@pipe-d-hdmi-a-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-downscale-factor-0-75@pipe-a-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-downscale-factor-0-75@pipe-b-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-downscale-factor-0-75@pipe-c-dp-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-scaler-unity-scaling:
    - Statuses :
    - Exec time: [None] s

  * igt@kms_plane_scaling@planes-scaler-unity-scaling@pipe-a-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-scaler-unity-scaling@pipe-a-vga-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-scaler-unity-scaling@pipe-b-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-scaler-unity-scaling@pipe-b-vga-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-scaler-unity-scaling@pipe-c-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-unity-scaling-downscale-factor-0-25@pipe-a-dp-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-unity-scaling-downscale-factor-0-25@pipe-a-hdmi-a-1:
    - Statuses : 3 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-unity-scaling-downscale-factor-0-25@pipe-a-vga-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-unity-scaling-downscale-factor-0-25@pipe-b-dp-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-unity-scaling-downscale-factor-0-25@pipe-b-hdmi-a-1:
    - Statuses : 3 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-unity-scaling-downscale-factor-0-25@pipe-b-vga-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-unity-scaling-downscale-factor-0-25@pipe-c-dp-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-unity-scaling-downscale-factor-0-25@pipe-c-hdmi-a-1:
    - Statuses : 2 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-unity-scaling-downscale-factor-0-25@pipe-d-hdmi-a-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-unity-scaling-downscale-factor-0-5@pipe-a-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-unity-scaling-downscale-factor-0-5@pipe-a-hdmi-a-1:
    - Statuses : 2 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-unity-scaling-downscale-factor-0-5@pipe-a-vga-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-unity-scaling-downscale-factor-0-5@pipe-b-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-unity-scaling-downscale-factor-0-5@pipe-b-hdmi-a-1:
    - Statuses : 2 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-unity-scaling-downscale-factor-0-5@pipe-b-hdmi-a-2:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-unity-scaling-downscale-factor-0-5@pipe-b-vga-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-unity-scaling-downscale-factor-0-5@pipe-c-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-unity-scaling-downscale-factor-0-5@pipe-c-hdmi-a-1:
    - Statuses : 2 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-unity-scaling-downscale-factor-0-5@pipe-d-hdmi-a-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-unity-scaling-downscale-factor-0-75@pipe-a-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-unity-scaling-downscale-factor-0-75@pipe-a-hdmi-a-1:
    - Statuses : 2 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-unity-scaling-downscale-factor-0-75@pipe-a-vga-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-unity-scaling-downscale-factor-0-75@pipe-b-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-unity-scaling-downscale-factor-0-75@pipe-b-hdmi-a-1:
    - Statuses : 2 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-unity-scaling-downscale-factor-0-75@pipe-b-hdmi-a-2:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-unity-scaling-downscale-factor-0-75@pipe-b-vga-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-unity-scaling-downscale-factor-0-75@pipe-c-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-unity-scaling-downscale-factor-0-75@pipe-c-hdmi-a-1:
    - Statuses : 2 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-unity-scaling-downscale-factor-0-75@pipe-d-hdmi-a-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-20x20-downscale-factor-0-25@pipe-a-dp-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-20x20-downscale-factor-0-25@pipe-a-vga-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-20x20-downscale-factor-0-25@pipe-b-dp-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-20x20-downscale-factor-0-25@pipe-b-hdmi-a-2:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-20x20-downscale-factor-0-25@pipe-b-vga-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-20x20-downscale-factor-0-25@pipe-c-dp-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-20x20-downscale-factor-0-5@pipe-a-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-20x20-downscale-factor-0-5@pipe-a-vga-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-20x20-downscale-factor-0-5@pipe-b-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-20x20-downscale-factor-0-5@pipe-b-vga-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-20x20-downscale-factor-0-5@pipe-c-dp-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-20x20-downscale-factor-0-75@pipe-a-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-20x20-downscale-factor-0-75@pipe-a-hdmi-a-1:
    - Statuses : 2 pass(s) 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-20x20-downscale-factor-0-75@pipe-b-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-20x20-downscale-factor-0-75@pipe-b-hdmi-a-1:
    - Statuses : 2 pass(s) 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-20x20-downscale-factor-0-75@pipe-b-hdmi-a-2:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-20x20-downscale-factor-0-75@pipe-c-dp-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-20x20-downscale-factor-0-75@pipe-c-hdmi-a-1:
    - Statuses : 1 pass(s) 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-20x20-downscale-factor-0-75@pipe-d-hdmi-a-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-20x20@pipe-a-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-20x20@pipe-a-vga-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-20x20@pipe-b-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-20x20@pipe-b-hdmi-a-2:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-20x20@pipe-b-vga-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-20x20@pipe-c-dp-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-factor-0-25-downscale-factor-0-25@pipe-a-dp-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-factor-0-25-downscale-factor-0-25@pipe-a-hdmi-a-1:
    - Statuses : 2 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-factor-0-25-downscale-factor-0-25@pipe-a-vga-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-factor-0-25-downscale-factor-0-25@pipe-b-dp-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-factor-0-25-downscale-factor-0-25@pipe-b-hdmi-a-2:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-factor-0-25-downscale-factor-0-25@pipe-b-vga-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-factor-0-25-downscale-factor-0-25@pipe-c-dp-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-factor-0-25-downscale-factor-0-25@pipe-c-hdmi-a-1:
    - Statuses : 2 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-factor-0-25-downscale-factor-0-5@pipe-a-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-factor-0-25-downscale-factor-0-5@pipe-a-hdmi-a-1:
    - Statuses : 2 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-factor-0-25-downscale-factor-0-5@pipe-a-vga-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-factor-0-25-downscale-factor-0-5@pipe-b-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-factor-0-25-downscale-factor-0-5@pipe-b-hdmi-a-2:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-factor-0-25-downscale-factor-0-5@pipe-b-vga-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-factor-0-25-downscale-factor-0-5@pipe-c-dp-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-factor-0-25-downscale-factor-0-5@pipe-c-hdmi-a-1:
    - Statuses : 1 pass(s) 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-factor-0-25-downscale-factor-0-75@pipe-a-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-factor-0-25-downscale-factor-0-75@pipe-a-hdmi-a-1:
    - Statuses : 2 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-factor-0-25-downscale-factor-0-75@pipe-a-vga-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-factor-0-25-downscale-factor-0-75@pipe-b-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-factor-0-25-downscale-factor-0-75@pipe-b-vga-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-factor-0-25-downscale-factor-0-75@pipe-c-dp-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-factor-0-25-downscale-factor-0-75@pipe-c-hdmi-a-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-factor-0-25@pipe-a-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-factor-0-25@pipe-a-hdmi-a-1:
    - Statuses : 2 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-factor-0-25@pipe-a-vga-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-factor-0-25@pipe-b-dp-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-factor-0-25@pipe-b-hdmi-a-1:
    - Statuses : 2 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-factor-0-25@pipe-b-hdmi-a-2:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-factor-0-25@pipe-b-vga-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-factor-0-25@pipe-c-dp-1:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-factor-0-25@pipe-c-hdmi-a-1:
    - Statuses : 1 pass(s) 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-factor-0-25@pipe-d-hdmi-a-1:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  

Known issues
------------

  Here are the changes found in Patchwork_117671v4_full that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@gem_barrier_race@remote-request@rcs0:
    - shard-apl:          [PASS][5] -> [ABORT][6] ([i915#7461] / [i915#8211] / [i915#8234])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13187/shard-apl1/igt@gem_barrier_race@remote-request@rcs0.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117671v4/shard-apl3/igt@gem_barrier_race@remote-request@rcs0.html

  * igt@gem_exec_fair@basic-throttle@rcs0:
    - shard-glk:          NOTRUN -> [FAIL][7] ([i915#2842])
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117671v4/shard-glk7/igt@gem_exec_fair@basic-throttle@rcs0.html

  * igt@gem_lmem_swapping@basic:
    - shard-glk:          NOTRUN -> [SKIP][8] ([fdo#109271] / [i915#4613])
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117671v4/shard-glk7/igt@gem_lmem_swapping@basic.html

  * igt@i915_selftest@live@gt_heartbeat:
    - shard-apl:          [PASS][9] -> [DMESG-FAIL][10] ([i915#5334])
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13187/shard-apl2/igt@i915_selftest@live@gt_heartbeat.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117671v4/shard-apl1/igt@i915_selftest@live@gt_heartbeat.html

  * igt@kms_ccs@pipe-c-bad-aux-stride-y_tiled_gen12_rc_ccs_cc:
    - shard-glk:          NOTRUN -> [SKIP][11] ([fdo#109271] / [i915#3886]) +1 similar issue
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117671v4/shard-glk7/igt@kms_ccs@pipe-c-bad-aux-stride-y_tiled_gen12_rc_ccs_cc.html

  * igt@kms_ccs@pipe-c-bad-rotation-90-y_tiled_gen12_rc_ccs:
    - shard-glk:          NOTRUN -> [SKIP][12] ([fdo#109271]) +15 similar issues
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117671v4/shard-glk7/igt@kms_ccs@pipe-c-bad-rotation-90-y_tiled_gen12_rc_ccs.html

  * igt@kms_color@ctm-max@pipe-a-hdmi-a-1:
    - shard-snb:          NOTRUN -> [SKIP][13] ([fdo#109271]) +15 similar issues
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117671v4/shard-snb1/igt@kms_color@ctm-max@pipe-a-hdmi-a-1.html

  * igt@kms_cursor_legacy@2x-long-flip-vs-cursor-atomic:
    - shard-glk:          [PASS][14] -> [FAIL][15] ([IGT#6] / [i915#72])
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13187/shard-glk7/igt@kms_cursor_legacy@2x-long-flip-vs-cursor-atomic.html
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117671v4/shard-glk4/igt@kms_cursor_legacy@2x-long-flip-vs-cursor-atomic.html

  * igt@kms_flip@flip-vs-expired-vblank-interruptible@b-hdmi-a1:
    - shard-glk:          [PASS][16] -> [FAIL][17] ([i915#79])
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13187/shard-glk9/igt@kms_flip@flip-vs-expired-vblank-interruptible@b-hdmi-a1.html
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117671v4/shard-glk9/igt@kms_flip@flip-vs-expired-vblank-interruptible@b-hdmi-a1.html

  * igt@kms_flip@flip-vs-suspend@b-dp1:
    - shard-apl:          [PASS][18] -> [ABORT][19] ([i915#180])
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13187/shard-apl7/igt@kms_flip@flip-vs-suspend@b-dp1.html
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117671v4/shard-apl7/igt@kms_flip@flip-vs-suspend@b-dp1.html

  * igt@kms_frontbuffer_tracking@psr-1p-offscren-pri-indfb-draw-mmap-cpu:
    - shard-glk:          NOTRUN -> [SKIP][20] ([IGT#6] / [fdo#109271]) +10 similar issues
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117671v4/shard-glk7/igt@kms_frontbuffer_tracking@psr-1p-offscren-pri-indfb-draw-mmap-cpu.html

  * igt@kms_plane_scaling@plane-downscale-with-pixel-format-factor-0-25@pipe-a-hdmi-a-1 (NEW):
    - {shard-rkl}:        NOTRUN -> [SKIP][21] ([i915#5176]) +1 similar issue
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117671v4/shard-rkl-7/igt@kms_plane_scaling@plane-downscale-with-pixel-format-factor-0-25@pipe-a-hdmi-a-1.html

  * igt@kms_plane_scaling@plane-scaler-with-clipping-clamping-rotation@pipe-b-hdmi-a-1:
    - shard-snb:          NOTRUN -> [SKIP][22] ([fdo#109271] / [i915#4579]) +12 similar issues
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117671v4/shard-snb1/igt@kms_plane_scaling@plane-scaler-with-clipping-clamping-rotation@pipe-b-hdmi-a-1.html

  * igt@kms_plane_scaling@plane-scaler-with-clipping-clamping-rotation@pipe-b-hdmi-a-2 (NEW):
    - {shard-rkl}:        NOTRUN -> [SKIP][23] ([i915#4579] / [i915#5176]) +1 similar issue
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117671v4/shard-rkl-1/igt@kms_plane_scaling@plane-scaler-with-clipping-clamping-rotation@pipe-b-hdmi-a-2.html

  * igt@kms_plane_scaling@planes-downscale-factor-0-25@pipe-c-hdmi-a-1 (NEW):
    - shard-glk:          NOTRUN -> [SKIP][24] ([fdo#109271] / [i915#4579]) +2 similar issues
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117671v4/shard-glk7/igt@kms_plane_scaling@planes-downscale-factor-0-25@pipe-c-hdmi-a-1.html

  * igt@kms_plane_scaling@planes-unity-scaling-downscale-factor-0-25@pipe-a-hdmi-a-1 (NEW):
    - {shard-rkl}:        NOTRUN -> [SKIP][25] ([i915#5235])
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117671v4/shard-rkl-7/igt@kms_plane_scaling@planes-unity-scaling-downscale-factor-0-25@pipe-a-hdmi-a-1.html

  * igt@kms_plane_scaling@planes-unity-scaling-downscale-factor-0-25@pipe-b-hdmi-a-1 (NEW):
    - {shard-rkl}:        NOTRUN -> [SKIP][26] ([i915#4579] / [i915#5235]) +1 similar issue
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117671v4/shard-rkl-7/igt@kms_plane_scaling@planes-unity-scaling-downscale-factor-0-25@pipe-b-hdmi-a-1.html

  
#### Possible fixes ####

  * igt@gem_exec_fair@basic-none@bcs0:
    - {shard-rkl}:        [FAIL][27] ([i915#2842]) -> [PASS][28]
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13187/shard-rkl-1/igt@gem_exec_fair@basic-none@bcs0.html
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117671v4/shard-rkl-4/igt@gem_exec_fair@basic-none@bcs0.html

  * igt@gem_spin_batch@user-each:
    - shard-apl:          [FAIL][29] ([i915#2898]) -> [PASS][30]
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13187/shard-apl3/igt@gem_spin_batch@user-each.html
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117671v4/shard-apl3/igt@gem_spin_batch@user-each.html

  * igt@gen9_exec_parse@allowed-single:
    - shard-glk:          [ABORT][31] ([i915#5566]) -> [PASS][32]
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13187/shard-glk2/igt@gen9_exec_parse@allowed-single.html
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117671v4/shard-glk7/igt@gen9_exec_parse@allowed-single.html

  * igt@i915_pm_rpm@modeset-lpsp-stress-no-wait:
    - {shard-rkl}:        [SKIP][33] ([i915#1397]) -> [PASS][34]
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13187/shard-rkl-3/igt@i915_pm_rpm@modeset-lpsp-stress-no-wait.html
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117671v4/shard-rkl-7/igt@i915_pm_rpm@modeset-lpsp-stress-no-wait.html

  * igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions:
    - shard-glk:          [FAIL][35] ([IGT#6] / [i915#2346]) -> [PASS][36] +1 similar issue
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13187/shard-glk9/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions.html
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117671v4/shard-glk9/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions.html
    - shard-apl:          [FAIL][37] ([IGT#6] / [i915#2346]) -> [PASS][38]
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13187/shard-apl3/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions.html
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117671v4/shard-apl3/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions.html

  * igt@kms_flip@2x-flip-vs-expired-vblank-interruptible@bc-hdmi-a1-hdmi-a2:
    - shard-glk:          [FAIL][39] ([i915#79]) -> [PASS][40] +1 similar issue
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13187/shard-glk4/igt@kms_flip@2x-flip-vs-expired-vblank-interruptible@bc-hdmi-a1-hdmi-a2.html
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117671v4/shard-glk8/igt@kms_flip@2x-flip-vs-expired-vblank-interruptible@bc-hdmi-a1-hdmi-a2.html

  
#### Warnings ####

  * igt@kms_hdr@static-toggle:
    - shard-snb:          [SKIP][41] ([fdo#109271] / [i915#4579]) -> [SKIP][42] ([fdo#109271])
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13187/shard-snb4/igt@kms_hdr@static-toggle.html
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117671v4/shard-snb4/igt@kms_hdr@static-toggle.html

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [IGT#6]: https://gitlab.freedesktop.org/drm/igt-gpu-tools/issues/6
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285
  [fdo#110189]: https://bugs.freedesktop.org/show_bug.cgi?id=110189
  [i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072
  [i915#1397]: https://gitlab.freedesktop.org/drm/intel/issues/1397
  [i915#180]: https://gitlab.freedesktop.org/drm/intel/issues/180
  [i915#2346]: https://gitlab.freedesktop.org/drm/intel/issues/2346
  [i915#2842]: https://gitlab.freedesktop.org/drm/intel/issues/2842
  [i915#2898]: https://gitlab.freedesktop.org/drm/intel/issues/2898
  [i915#315]: https://gitlab.freedesktop.org/drm/intel/issues/315
  [i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
  [i915#3591]: https://gitlab.freedesktop.org/drm/intel/issues/3591
  [i915#3804]: https://gitlab.freedesktop.org/drm/intel/issues/3804
  [i915#3886]: https://gitlab.freedesktop.org/drm/intel/issues/3886
  [i915#3955]: https://gitlab.freedesktop.org/drm/intel/issues/3955
  [i915#4070]: https://gitlab.freedesktop.org/drm/intel/issues/4070
  [i915#4078]: https://gitlab.freedesktop.org/drm/intel/issues/4078
  [i915#4098]: https://gitlab.freedesktop.org/drm/intel/issues/4098
  [i915#4579]: https://gitlab.freedesktop.org/drm/intel/issues/4579
  [i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
  [i915#4816]: https://gitlab.freedesktop.org/drm/intel/issues/4816
  [i915#4936]: https://gitlab.freedesktop.org/drm/intel/issues/4936
  [i915#5176]: https://gitlab.freedesktop.org/drm/intel/issues/5176
  [i915#5235]: https://gitlab.freedesktop.org/drm/intel/issues/5235
  [i915#5334]: https://gitlab.freedesktop.org/drm/intel/issues/5334
  [i915#5493]: https://gitlab.freedesktop.org/drm/intel/issues/5493
  [i915#5566]: https://gitlab.freedesktop.org/drm/intel/issues/5566
  [i915#5784]: https://gitlab.freedesktop.org/drm/intel/issues/5784
  [i915#6268]: https://gitlab.freedesktop.org/drm/intel/issues/6268
  [i915#6755]: https://gitlab.freedesktop.org/drm/intel/issues/6755
  [i915#6786]: https://gitlab.freedesktop.org/drm/intel/issues/6786
  [i915#72]: https://gitlab.freedesktop.org/drm/intel/issues/72
  [i915#7392]: https://gitlab.freedesktop.org/drm/intel/issues/7392
  [i915#7461]: https://gitlab.freedesktop.org/drm/intel/issues/7461
  [i915#79]: https://gitlab.freedesktop.org/drm/intel/issues/79
  [i915#8211]: https://gitlab.freedesktop.org/drm/intel/issues/8211
  [i915#8234]: https://gitlab.freedesktop.org/drm/intel/issues/8234


Build changes
-------------

  * Linux: CI_DRM_13187 -> Patchwork_117671v4

  CI-20190529: 20190529
  CI_DRM_13187: e72bc131968e21d9deeae208605481c93581f142 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_7303: 8f09a9f1da506db907b549bb477f3233b5416733 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
  Patchwork_117671v4: e72bc131968e21d9deeae208605481c93581f142 @ git://anongit.freedesktop.org/gfx-ci/linux
  piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117671v4/index.html

[-- Attachment #2: Type: text/html, Size: 60481 bytes --]

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

* Re: [v4,02/13] fbdev: Add initializer macros for struct fb_ops
  2023-05-24 20:57     ` [v4,02/13] " Sui Jingfeng
  (?)
  (?)
@ 2023-05-26 12:38       ` Thomas Zimmermann
  -1 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-26 12:38 UTC (permalink / raw)
  To: Sui Jingfeng, daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: linux-samsung-soc, linux-arm-msm, intel-gfx, dri-devel, amd-gfx,
	linux-tegra, freedreno, linux-arm-kernel


[-- Attachment #1.1: Type: text/plain, Size: 8048 bytes --]

Hi

Am 24.05.23 um 22:57 schrieb Sui Jingfeng:
> Hi,
> 
> 
> we love your patch:
> 
> 
> On 2023/5/24 17:21, Thomas Zimmermann wrote:
>> For framebuffers in I/O and system memory, add macros that set
>> struct fb_ops to the respective callback functions.
>>
>> For deferred I/O, add macros that generate callback functions with
>> damage handling. Add initializer macros that set struct fb_ops to
>> the generated callbacks.
>>
>> These macros can remove a lot boilerplate code from fbdev drivers.
>> The drivers are supposed to use the macro that is required for its
>> framebuffer. Each macro is split into smaller helpers, so that
>> drivers with non-standard callbacks can pick and customize callbacks
>> as needed. There are individual helper macros for read/write, mmap
>> and drawing.
>>
>> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
>> ---
>>   include/linux/fb.h | 112 +++++++++++++++++++++++++++++++++++++++++++++
>>   1 file changed, 112 insertions(+)
>>
>> diff --git a/include/linux/fb.h b/include/linux/fb.h
>> index 2cf8efcb9e32..731472a2bb62 100644
>> --- a/include/linux/fb.h
>> +++ b/include/linux/fb.h
>> @@ -538,9 +538,31 @@ extern ssize_t fb_io_read(struct fb_info *info, 
>> char __user *buf,
>>   extern ssize_t fb_io_write(struct fb_info *info, const char __user 
>> *buf,
>>                  size_t count, loff_t *ppos);
>> +/*
>> + * Initializes struct fb_ops for framebuffers in I/O memory.
>> + */
>> +
>> +#define __FB_DEFAULT_IO_OPS_RDWR \
>> +    .fb_read    = fb_io_read, \
>> +    .fb_write    = fb_io_write
>> +
>> +#define __FB_DEFAULT_IO_OPS_DRAW \
>> +        .fb_fillrect    = cfb_fillrect, \
>> +        .fb_copyarea    = cfb_copyarea, \
>> +        .fb_imageblit    = cfb_imageblit
> 
> Here,  it seems that your text editor replace the tap with space, but 
> I'm OK.
> 
> I'm asking because I see other __FB__DEFAULT_* macro begin with tabs.

Yeah, these are mistakes. I'll fix that with the next version.

Best regards
Thomas

> 
>> +#define __FB_DEFAULT_IO_OPS_MMAP \
>> +    .fb_mmap    = NULL // default implementation
>> +
>> +#define FB_DEFAULT_IO_OPS \
>> +    __FB_DEFAULT_IO_OPS_RDWR, \
>> +    __FB_DEFAULT_IO_OPS_DRAW, \
>> +    __FB_DEFAULT_IO_OPS_MMAP
>> +
>>   /*
>>    * Drawing operations where framebuffer is in system RAM
>>    */
>> +
>>   extern void sys_fillrect(struct fb_info *info, const struct 
>> fb_fillrect *rect);
>>   extern void sys_copyarea(struct fb_info *info, const struct 
>> fb_copyarea *area);
>>   extern void sys_imageblit(struct fb_info *info, const struct 
>> fb_image *image);
>> @@ -549,6 +571,27 @@ extern ssize_t fb_sys_read(struct fb_info *info, 
>> char __user *buf,
>>   extern ssize_t fb_sys_write(struct fb_info *info, const char __user 
>> *buf,
>>                   size_t count, loff_t *ppos);
>> +/*
>> + * Initializes struct fb_ops for framebuffers in system memory.
>> + */
>> +
>> +#define __FB_DEFAULT_SYS_OPS_RDWR \
>> +    .fb_read    = fb_sys_read, \
>> +    .fb_write    = fb_sys_write
>> +
>> +#define __FB_DEFAULT_SYS_OPS_DRAW \
>> +        .fb_fillrect    = sys_fillrect, \
>> +        .fb_copyarea    = sys_copyarea, \
>> +        .fb_imageblit    = sys_imageblit
>> +
>> +#define __FB_DEFAULT_SYS_OPS_MMAP \
>> +    .fb_mmap    = NULL // default implementation
>> +
>> +#define FB_DEFAULT_SYS_OPS \
>> +    __FB_DEFAULT_SYS_OPS_RDWR, \
>> +    __FB_DEFAULT_SYS_OPS_DRAW, \
>> +    __FB_DEFAULT_SYS_OPS_MMAP
>> +
>>   /* drivers/video/fbmem.c */
>>   extern int register_framebuffer(struct fb_info *fb_info);
>>   extern void unregister_framebuffer(struct fb_info *fb_info);
>> @@ -604,6 +647,75 @@ extern void fb_deferred_io_cleanup(struct fb_info 
>> *info);
>>   extern int fb_deferred_io_fsync(struct file *file, loff_t start,
>>                   loff_t end, int datasync);
>> +/*
>> + * Generate callbacks for deferred I/O
>> + */
>> +
>> +#define __FB_GEN_DEFAULT_DEFERRED_OPS_RDWR(__prefix, __damage_range, 
>> __mode) \
>> +    static ssize_t __prefix ## _defio_read(struct fb_info *info, char 
>> __user *buf, \
>> +                           size_t count, loff_t *ppos) \
>> +    { \
>> +        return fb_ ## __mode ## _read(info, buf, count, ppos); \
>> +    } \
>> +    static ssize_t __prefix ## _defio_write(struct fb_info *info, 
>> const char __user *buf, \
>> +                        size_t count, loff_t *ppos) \
>> +    { \
>> +        unsigned long offset = *ppos; \
>> +        ssize_t ret = fb_ ## __mode ## _write(info, buf, count, ppos); \
>> +        if (ret > 0) \
>> +            __damage_range(info, offset, ret); \
>> +        return ret; \
>> +    }
>> +
>> +#define __FB_GEN_DEFAULT_DEFERRED_OPS_DRAW(__prefix, __damage_area, 
>> __mode) \
>> +    static void __prefix ## _defio_fillrect(struct fb_info *info, \
>> +                        const struct fb_fillrect *rect) \
>> +    { \
>> +        __mode ## _fillrect(info, rect); \
>> +        __damage_area(info, rect->dx, rect->dy, rect->width, 
>> rect->height); \
>> +    } \
>> +    static void __prefix ## _defio_copyarea(struct fb_info *info, \
>> +                        const struct fb_copyarea *area) \
>> +    { \
>> +        __mode ## _copyarea(info, area); \
>> +        __damage_area(info, area->dx, area->dy, area->width, 
>> area->height); \
>> +    } \
>> +    static void __prefix ## _defio_imageblit(struct fb_info *info, \
>> +                         const struct fb_image *image) \
>> +    { \
>> +        __mode ## _imageblit(info, image); \
>> +        __damage_area(info, image->dx, image->dy, image->width, 
>> image->height); \
>> +    }
>> +
>> +#define FB_GEN_DEFAULT_DEFERRED_IO_OPS(__prefix, __damage_range, 
>> __damage_area) \
>> +    __FB_GEN_DEFAULT_DEFERRED_OPS_RDWR(__prefix, __damage_range, io) \
>> +    __FB_GEN_DEFAULT_DEFERRED_OPS_DRAW(__prefix, __damage_area, cfb)
>> +
>> +#define FB_GEN_DEFAULT_DEFERRED_SYS_OPS(__prefix, __damage_range, 
>> __damage_area) \
>> +    __FB_GEN_DEFAULT_DEFERRED_OPS_RDWR(__prefix, __damage_range, sys) \
>> +    __FB_GEN_DEFAULT_DEFERRED_OPS_DRAW(__prefix, __damage_area, sys)
>> +
>> +/*
>> + * Initializes struct fb_ops for deferred I/O.
>> + */
>> +
>> +#define __FB_DEFAULT_DEFERRED_OPS_RDWR(__prefix) \
>> +    .fb_read    = __prefix ## _defio_read, \
>> +    .fb_write    = __prefix ## _defio_write
>> +
>> +#define __FB_DEFAULT_DEFERRED_OPS_DRAW(__prefix) \
>> +        .fb_fillrect    = __prefix ## _defio_fillrect, \
>> +        .fb_copyarea    = __prefix ## _defio_copyarea, \
>> +        .fb_imageblit    = __prefix ## _defio_imageblit
> 
> Here also,  '.fb_fillrect', '.fb_copyarea' and '.fb_imageblit' begin 
> with space, but I'm OK.
> 
> I'm asking because I see other __FB__DEFAULT_* macro begin with tabs.
> 
>> +#define __FB_DEFAULT_DEFERRED_OPS_MMAP(__prefix) \
>> +    .fb_mmap    = fb_deferred_io_mmap
>> +
>> +#define FB_DEFAULT_DEFERRED_OPS(__prefix) \
>> +    __FB_DEFAULT_DEFERRED_OPS_RDWR(__prefix), \
>> +    __FB_DEFAULT_DEFERRED_OPS_DRAW(__prefix), \
>> +    __FB_DEFAULT_DEFERRED_OPS_MMAP(__prefix)
>> +
>>   static inline bool fb_be_math(struct fb_info *info)
>>   {
>>   #ifdef CONFIG_FB_FOREIGN_ENDIAN

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

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

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

* Re: [v4,02/13] fbdev: Add initializer macros for struct fb_ops
@ 2023-05-26 12:38       ` Thomas Zimmermann
  0 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-26 12:38 UTC (permalink / raw)
  To: Sui Jingfeng, daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: linux-samsung-soc, linux-arm-msm, intel-gfx, dri-devel, amd-gfx,
	linux-tegra, freedreno, linux-arm-kernel


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

Hi

Am 24.05.23 um 22:57 schrieb Sui Jingfeng:
> Hi,
> 
> 
> we love your patch:
> 
> 
> On 2023/5/24 17:21, Thomas Zimmermann wrote:
>> For framebuffers in I/O and system memory, add macros that set
>> struct fb_ops to the respective callback functions.
>>
>> For deferred I/O, add macros that generate callback functions with
>> damage handling. Add initializer macros that set struct fb_ops to
>> the generated callbacks.
>>
>> These macros can remove a lot boilerplate code from fbdev drivers.
>> The drivers are supposed to use the macro that is required for its
>> framebuffer. Each macro is split into smaller helpers, so that
>> drivers with non-standard callbacks can pick and customize callbacks
>> as needed. There are individual helper macros for read/write, mmap
>> and drawing.
>>
>> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
>> ---
>>   include/linux/fb.h | 112 +++++++++++++++++++++++++++++++++++++++++++++
>>   1 file changed, 112 insertions(+)
>>
>> diff --git a/include/linux/fb.h b/include/linux/fb.h
>> index 2cf8efcb9e32..731472a2bb62 100644
>> --- a/include/linux/fb.h
>> +++ b/include/linux/fb.h
>> @@ -538,9 +538,31 @@ extern ssize_t fb_io_read(struct fb_info *info, 
>> char __user *buf,
>>   extern ssize_t fb_io_write(struct fb_info *info, const char __user 
>> *buf,
>>                  size_t count, loff_t *ppos);
>> +/*
>> + * Initializes struct fb_ops for framebuffers in I/O memory.
>> + */
>> +
>> +#define __FB_DEFAULT_IO_OPS_RDWR \
>> +    .fb_read    = fb_io_read, \
>> +    .fb_write    = fb_io_write
>> +
>> +#define __FB_DEFAULT_IO_OPS_DRAW \
>> +        .fb_fillrect    = cfb_fillrect, \
>> +        .fb_copyarea    = cfb_copyarea, \
>> +        .fb_imageblit    = cfb_imageblit
> 
> Here,  it seems that your text editor replace the tap with space, but 
> I'm OK.
> 
> I'm asking because I see other __FB__DEFAULT_* macro begin with tabs.

Yeah, these are mistakes. I'll fix that with the next version.

Best regards
Thomas

> 
>> +#define __FB_DEFAULT_IO_OPS_MMAP \
>> +    .fb_mmap    = NULL // default implementation
>> +
>> +#define FB_DEFAULT_IO_OPS \
>> +    __FB_DEFAULT_IO_OPS_RDWR, \
>> +    __FB_DEFAULT_IO_OPS_DRAW, \
>> +    __FB_DEFAULT_IO_OPS_MMAP
>> +
>>   /*
>>    * Drawing operations where framebuffer is in system RAM
>>    */
>> +
>>   extern void sys_fillrect(struct fb_info *info, const struct 
>> fb_fillrect *rect);
>>   extern void sys_copyarea(struct fb_info *info, const struct 
>> fb_copyarea *area);
>>   extern void sys_imageblit(struct fb_info *info, const struct 
>> fb_image *image);
>> @@ -549,6 +571,27 @@ extern ssize_t fb_sys_read(struct fb_info *info, 
>> char __user *buf,
>>   extern ssize_t fb_sys_write(struct fb_info *info, const char __user 
>> *buf,
>>                   size_t count, loff_t *ppos);
>> +/*
>> + * Initializes struct fb_ops for framebuffers in system memory.
>> + */
>> +
>> +#define __FB_DEFAULT_SYS_OPS_RDWR \
>> +    .fb_read    = fb_sys_read, \
>> +    .fb_write    = fb_sys_write
>> +
>> +#define __FB_DEFAULT_SYS_OPS_DRAW \
>> +        .fb_fillrect    = sys_fillrect, \
>> +        .fb_copyarea    = sys_copyarea, \
>> +        .fb_imageblit    = sys_imageblit
>> +
>> +#define __FB_DEFAULT_SYS_OPS_MMAP \
>> +    .fb_mmap    = NULL // default implementation
>> +
>> +#define FB_DEFAULT_SYS_OPS \
>> +    __FB_DEFAULT_SYS_OPS_RDWR, \
>> +    __FB_DEFAULT_SYS_OPS_DRAW, \
>> +    __FB_DEFAULT_SYS_OPS_MMAP
>> +
>>   /* drivers/video/fbmem.c */
>>   extern int register_framebuffer(struct fb_info *fb_info);
>>   extern void unregister_framebuffer(struct fb_info *fb_info);
>> @@ -604,6 +647,75 @@ extern void fb_deferred_io_cleanup(struct fb_info 
>> *info);
>>   extern int fb_deferred_io_fsync(struct file *file, loff_t start,
>>                   loff_t end, int datasync);
>> +/*
>> + * Generate callbacks for deferred I/O
>> + */
>> +
>> +#define __FB_GEN_DEFAULT_DEFERRED_OPS_RDWR(__prefix, __damage_range, 
>> __mode) \
>> +    static ssize_t __prefix ## _defio_read(struct fb_info *info, char 
>> __user *buf, \
>> +                           size_t count, loff_t *ppos) \
>> +    { \
>> +        return fb_ ## __mode ## _read(info, buf, count, ppos); \
>> +    } \
>> +    static ssize_t __prefix ## _defio_write(struct fb_info *info, 
>> const char __user *buf, \
>> +                        size_t count, loff_t *ppos) \
>> +    { \
>> +        unsigned long offset = *ppos; \
>> +        ssize_t ret = fb_ ## __mode ## _write(info, buf, count, ppos); \
>> +        if (ret > 0) \
>> +            __damage_range(info, offset, ret); \
>> +        return ret; \
>> +    }
>> +
>> +#define __FB_GEN_DEFAULT_DEFERRED_OPS_DRAW(__prefix, __damage_area, 
>> __mode) \
>> +    static void __prefix ## _defio_fillrect(struct fb_info *info, \
>> +                        const struct fb_fillrect *rect) \
>> +    { \
>> +        __mode ## _fillrect(info, rect); \
>> +        __damage_area(info, rect->dx, rect->dy, rect->width, 
>> rect->height); \
>> +    } \
>> +    static void __prefix ## _defio_copyarea(struct fb_info *info, \
>> +                        const struct fb_copyarea *area) \
>> +    { \
>> +        __mode ## _copyarea(info, area); \
>> +        __damage_area(info, area->dx, area->dy, area->width, 
>> area->height); \
>> +    } \
>> +    static void __prefix ## _defio_imageblit(struct fb_info *info, \
>> +                         const struct fb_image *image) \
>> +    { \
>> +        __mode ## _imageblit(info, image); \
>> +        __damage_area(info, image->dx, image->dy, image->width, 
>> image->height); \
>> +    }
>> +
>> +#define FB_GEN_DEFAULT_DEFERRED_IO_OPS(__prefix, __damage_range, 
>> __damage_area) \
>> +    __FB_GEN_DEFAULT_DEFERRED_OPS_RDWR(__prefix, __damage_range, io) \
>> +    __FB_GEN_DEFAULT_DEFERRED_OPS_DRAW(__prefix, __damage_area, cfb)
>> +
>> +#define FB_GEN_DEFAULT_DEFERRED_SYS_OPS(__prefix, __damage_range, 
>> __damage_area) \
>> +    __FB_GEN_DEFAULT_DEFERRED_OPS_RDWR(__prefix, __damage_range, sys) \
>> +    __FB_GEN_DEFAULT_DEFERRED_OPS_DRAW(__prefix, __damage_area, sys)
>> +
>> +/*
>> + * Initializes struct fb_ops for deferred I/O.
>> + */
>> +
>> +#define __FB_DEFAULT_DEFERRED_OPS_RDWR(__prefix) \
>> +    .fb_read    = __prefix ## _defio_read, \
>> +    .fb_write    = __prefix ## _defio_write
>> +
>> +#define __FB_DEFAULT_DEFERRED_OPS_DRAW(__prefix) \
>> +        .fb_fillrect    = __prefix ## _defio_fillrect, \
>> +        .fb_copyarea    = __prefix ## _defio_copyarea, \
>> +        .fb_imageblit    = __prefix ## _defio_imageblit
> 
> Here also,  '.fb_fillrect', '.fb_copyarea' and '.fb_imageblit' begin 
> with space, but I'm OK.
> 
> I'm asking because I see other __FB__DEFAULT_* macro begin with tabs.
> 
>> +#define __FB_DEFAULT_DEFERRED_OPS_MMAP(__prefix) \
>> +    .fb_mmap    = fb_deferred_io_mmap
>> +
>> +#define FB_DEFAULT_DEFERRED_OPS(__prefix) \
>> +    __FB_DEFAULT_DEFERRED_OPS_RDWR(__prefix), \
>> +    __FB_DEFAULT_DEFERRED_OPS_DRAW(__prefix), \
>> +    __FB_DEFAULT_DEFERRED_OPS_MMAP(__prefix)
>> +
>>   static inline bool fb_be_math(struct fb_info *info)
>>   {
>>   #ifdef CONFIG_FB_FOREIGN_ENDIAN

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

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

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

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

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

* Re: [v4,02/13] fbdev: Add initializer macros for struct fb_ops
@ 2023-05-26 12:38       ` Thomas Zimmermann
  0 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-26 12:38 UTC (permalink / raw)
  To: Sui Jingfeng, daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: linux-samsung-soc, linux-arm-msm, intel-gfx, amd-gfx, dri-devel,
	linux-tegra, freedreno, linux-arm-kernel


[-- Attachment #1.1: Type: text/plain, Size: 8048 bytes --]

Hi

Am 24.05.23 um 22:57 schrieb Sui Jingfeng:
> Hi,
> 
> 
> we love your patch:
> 
> 
> On 2023/5/24 17:21, Thomas Zimmermann wrote:
>> For framebuffers in I/O and system memory, add macros that set
>> struct fb_ops to the respective callback functions.
>>
>> For deferred I/O, add macros that generate callback functions with
>> damage handling. Add initializer macros that set struct fb_ops to
>> the generated callbacks.
>>
>> These macros can remove a lot boilerplate code from fbdev drivers.
>> The drivers are supposed to use the macro that is required for its
>> framebuffer. Each macro is split into smaller helpers, so that
>> drivers with non-standard callbacks can pick and customize callbacks
>> as needed. There are individual helper macros for read/write, mmap
>> and drawing.
>>
>> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
>> ---
>>   include/linux/fb.h | 112 +++++++++++++++++++++++++++++++++++++++++++++
>>   1 file changed, 112 insertions(+)
>>
>> diff --git a/include/linux/fb.h b/include/linux/fb.h
>> index 2cf8efcb9e32..731472a2bb62 100644
>> --- a/include/linux/fb.h
>> +++ b/include/linux/fb.h
>> @@ -538,9 +538,31 @@ extern ssize_t fb_io_read(struct fb_info *info, 
>> char __user *buf,
>>   extern ssize_t fb_io_write(struct fb_info *info, const char __user 
>> *buf,
>>                  size_t count, loff_t *ppos);
>> +/*
>> + * Initializes struct fb_ops for framebuffers in I/O memory.
>> + */
>> +
>> +#define __FB_DEFAULT_IO_OPS_RDWR \
>> +    .fb_read    = fb_io_read, \
>> +    .fb_write    = fb_io_write
>> +
>> +#define __FB_DEFAULT_IO_OPS_DRAW \
>> +        .fb_fillrect    = cfb_fillrect, \
>> +        .fb_copyarea    = cfb_copyarea, \
>> +        .fb_imageblit    = cfb_imageblit
> 
> Here,  it seems that your text editor replace the tap with space, but 
> I'm OK.
> 
> I'm asking because I see other __FB__DEFAULT_* macro begin with tabs.

Yeah, these are mistakes. I'll fix that with the next version.

Best regards
Thomas

> 
>> +#define __FB_DEFAULT_IO_OPS_MMAP \
>> +    .fb_mmap    = NULL // default implementation
>> +
>> +#define FB_DEFAULT_IO_OPS \
>> +    __FB_DEFAULT_IO_OPS_RDWR, \
>> +    __FB_DEFAULT_IO_OPS_DRAW, \
>> +    __FB_DEFAULT_IO_OPS_MMAP
>> +
>>   /*
>>    * Drawing operations where framebuffer is in system RAM
>>    */
>> +
>>   extern void sys_fillrect(struct fb_info *info, const struct 
>> fb_fillrect *rect);
>>   extern void sys_copyarea(struct fb_info *info, const struct 
>> fb_copyarea *area);
>>   extern void sys_imageblit(struct fb_info *info, const struct 
>> fb_image *image);
>> @@ -549,6 +571,27 @@ extern ssize_t fb_sys_read(struct fb_info *info, 
>> char __user *buf,
>>   extern ssize_t fb_sys_write(struct fb_info *info, const char __user 
>> *buf,
>>                   size_t count, loff_t *ppos);
>> +/*
>> + * Initializes struct fb_ops for framebuffers in system memory.
>> + */
>> +
>> +#define __FB_DEFAULT_SYS_OPS_RDWR \
>> +    .fb_read    = fb_sys_read, \
>> +    .fb_write    = fb_sys_write
>> +
>> +#define __FB_DEFAULT_SYS_OPS_DRAW \
>> +        .fb_fillrect    = sys_fillrect, \
>> +        .fb_copyarea    = sys_copyarea, \
>> +        .fb_imageblit    = sys_imageblit
>> +
>> +#define __FB_DEFAULT_SYS_OPS_MMAP \
>> +    .fb_mmap    = NULL // default implementation
>> +
>> +#define FB_DEFAULT_SYS_OPS \
>> +    __FB_DEFAULT_SYS_OPS_RDWR, \
>> +    __FB_DEFAULT_SYS_OPS_DRAW, \
>> +    __FB_DEFAULT_SYS_OPS_MMAP
>> +
>>   /* drivers/video/fbmem.c */
>>   extern int register_framebuffer(struct fb_info *fb_info);
>>   extern void unregister_framebuffer(struct fb_info *fb_info);
>> @@ -604,6 +647,75 @@ extern void fb_deferred_io_cleanup(struct fb_info 
>> *info);
>>   extern int fb_deferred_io_fsync(struct file *file, loff_t start,
>>                   loff_t end, int datasync);
>> +/*
>> + * Generate callbacks for deferred I/O
>> + */
>> +
>> +#define __FB_GEN_DEFAULT_DEFERRED_OPS_RDWR(__prefix, __damage_range, 
>> __mode) \
>> +    static ssize_t __prefix ## _defio_read(struct fb_info *info, char 
>> __user *buf, \
>> +                           size_t count, loff_t *ppos) \
>> +    { \
>> +        return fb_ ## __mode ## _read(info, buf, count, ppos); \
>> +    } \
>> +    static ssize_t __prefix ## _defio_write(struct fb_info *info, 
>> const char __user *buf, \
>> +                        size_t count, loff_t *ppos) \
>> +    { \
>> +        unsigned long offset = *ppos; \
>> +        ssize_t ret = fb_ ## __mode ## _write(info, buf, count, ppos); \
>> +        if (ret > 0) \
>> +            __damage_range(info, offset, ret); \
>> +        return ret; \
>> +    }
>> +
>> +#define __FB_GEN_DEFAULT_DEFERRED_OPS_DRAW(__prefix, __damage_area, 
>> __mode) \
>> +    static void __prefix ## _defio_fillrect(struct fb_info *info, \
>> +                        const struct fb_fillrect *rect) \
>> +    { \
>> +        __mode ## _fillrect(info, rect); \
>> +        __damage_area(info, rect->dx, rect->dy, rect->width, 
>> rect->height); \
>> +    } \
>> +    static void __prefix ## _defio_copyarea(struct fb_info *info, \
>> +                        const struct fb_copyarea *area) \
>> +    { \
>> +        __mode ## _copyarea(info, area); \
>> +        __damage_area(info, area->dx, area->dy, area->width, 
>> area->height); \
>> +    } \
>> +    static void __prefix ## _defio_imageblit(struct fb_info *info, \
>> +                         const struct fb_image *image) \
>> +    { \
>> +        __mode ## _imageblit(info, image); \
>> +        __damage_area(info, image->dx, image->dy, image->width, 
>> image->height); \
>> +    }
>> +
>> +#define FB_GEN_DEFAULT_DEFERRED_IO_OPS(__prefix, __damage_range, 
>> __damage_area) \
>> +    __FB_GEN_DEFAULT_DEFERRED_OPS_RDWR(__prefix, __damage_range, io) \
>> +    __FB_GEN_DEFAULT_DEFERRED_OPS_DRAW(__prefix, __damage_area, cfb)
>> +
>> +#define FB_GEN_DEFAULT_DEFERRED_SYS_OPS(__prefix, __damage_range, 
>> __damage_area) \
>> +    __FB_GEN_DEFAULT_DEFERRED_OPS_RDWR(__prefix, __damage_range, sys) \
>> +    __FB_GEN_DEFAULT_DEFERRED_OPS_DRAW(__prefix, __damage_area, sys)
>> +
>> +/*
>> + * Initializes struct fb_ops for deferred I/O.
>> + */
>> +
>> +#define __FB_DEFAULT_DEFERRED_OPS_RDWR(__prefix) \
>> +    .fb_read    = __prefix ## _defio_read, \
>> +    .fb_write    = __prefix ## _defio_write
>> +
>> +#define __FB_DEFAULT_DEFERRED_OPS_DRAW(__prefix) \
>> +        .fb_fillrect    = __prefix ## _defio_fillrect, \
>> +        .fb_copyarea    = __prefix ## _defio_copyarea, \
>> +        .fb_imageblit    = __prefix ## _defio_imageblit
> 
> Here also,  '.fb_fillrect', '.fb_copyarea' and '.fb_imageblit' begin 
> with space, but I'm OK.
> 
> I'm asking because I see other __FB__DEFAULT_* macro begin with tabs.
> 
>> +#define __FB_DEFAULT_DEFERRED_OPS_MMAP(__prefix) \
>> +    .fb_mmap    = fb_deferred_io_mmap
>> +
>> +#define FB_DEFAULT_DEFERRED_OPS(__prefix) \
>> +    __FB_DEFAULT_DEFERRED_OPS_RDWR(__prefix), \
>> +    __FB_DEFAULT_DEFERRED_OPS_DRAW(__prefix), \
>> +    __FB_DEFAULT_DEFERRED_OPS_MMAP(__prefix)
>> +
>>   static inline bool fb_be_math(struct fb_info *info)
>>   {
>>   #ifdef CONFIG_FB_FOREIGN_ENDIAN

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

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

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

* Re: [Intel-gfx] [v4, 02/13] fbdev: Add initializer macros for struct fb_ops
@ 2023-05-26 12:38       ` Thomas Zimmermann
  0 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-26 12:38 UTC (permalink / raw)
  To: Sui Jingfeng, daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: linux-samsung-soc, linux-arm-msm, intel-gfx, amd-gfx, dri-devel,
	linux-tegra, freedreno, linux-arm-kernel


[-- Attachment #1.1: Type: text/plain, Size: 8048 bytes --]

Hi

Am 24.05.23 um 22:57 schrieb Sui Jingfeng:
> Hi,
> 
> 
> we love your patch:
> 
> 
> On 2023/5/24 17:21, Thomas Zimmermann wrote:
>> For framebuffers in I/O and system memory, add macros that set
>> struct fb_ops to the respective callback functions.
>>
>> For deferred I/O, add macros that generate callback functions with
>> damage handling. Add initializer macros that set struct fb_ops to
>> the generated callbacks.
>>
>> These macros can remove a lot boilerplate code from fbdev drivers.
>> The drivers are supposed to use the macro that is required for its
>> framebuffer. Each macro is split into smaller helpers, so that
>> drivers with non-standard callbacks can pick and customize callbacks
>> as needed. There are individual helper macros for read/write, mmap
>> and drawing.
>>
>> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
>> ---
>>   include/linux/fb.h | 112 +++++++++++++++++++++++++++++++++++++++++++++
>>   1 file changed, 112 insertions(+)
>>
>> diff --git a/include/linux/fb.h b/include/linux/fb.h
>> index 2cf8efcb9e32..731472a2bb62 100644
>> --- a/include/linux/fb.h
>> +++ b/include/linux/fb.h
>> @@ -538,9 +538,31 @@ extern ssize_t fb_io_read(struct fb_info *info, 
>> char __user *buf,
>>   extern ssize_t fb_io_write(struct fb_info *info, const char __user 
>> *buf,
>>                  size_t count, loff_t *ppos);
>> +/*
>> + * Initializes struct fb_ops for framebuffers in I/O memory.
>> + */
>> +
>> +#define __FB_DEFAULT_IO_OPS_RDWR \
>> +    .fb_read    = fb_io_read, \
>> +    .fb_write    = fb_io_write
>> +
>> +#define __FB_DEFAULT_IO_OPS_DRAW \
>> +        .fb_fillrect    = cfb_fillrect, \
>> +        .fb_copyarea    = cfb_copyarea, \
>> +        .fb_imageblit    = cfb_imageblit
> 
> Here,  it seems that your text editor replace the tap with space, but 
> I'm OK.
> 
> I'm asking because I see other __FB__DEFAULT_* macro begin with tabs.

Yeah, these are mistakes. I'll fix that with the next version.

Best regards
Thomas

> 
>> +#define __FB_DEFAULT_IO_OPS_MMAP \
>> +    .fb_mmap    = NULL // default implementation
>> +
>> +#define FB_DEFAULT_IO_OPS \
>> +    __FB_DEFAULT_IO_OPS_RDWR, \
>> +    __FB_DEFAULT_IO_OPS_DRAW, \
>> +    __FB_DEFAULT_IO_OPS_MMAP
>> +
>>   /*
>>    * Drawing operations where framebuffer is in system RAM
>>    */
>> +
>>   extern void sys_fillrect(struct fb_info *info, const struct 
>> fb_fillrect *rect);
>>   extern void sys_copyarea(struct fb_info *info, const struct 
>> fb_copyarea *area);
>>   extern void sys_imageblit(struct fb_info *info, const struct 
>> fb_image *image);
>> @@ -549,6 +571,27 @@ extern ssize_t fb_sys_read(struct fb_info *info, 
>> char __user *buf,
>>   extern ssize_t fb_sys_write(struct fb_info *info, const char __user 
>> *buf,
>>                   size_t count, loff_t *ppos);
>> +/*
>> + * Initializes struct fb_ops for framebuffers in system memory.
>> + */
>> +
>> +#define __FB_DEFAULT_SYS_OPS_RDWR \
>> +    .fb_read    = fb_sys_read, \
>> +    .fb_write    = fb_sys_write
>> +
>> +#define __FB_DEFAULT_SYS_OPS_DRAW \
>> +        .fb_fillrect    = sys_fillrect, \
>> +        .fb_copyarea    = sys_copyarea, \
>> +        .fb_imageblit    = sys_imageblit
>> +
>> +#define __FB_DEFAULT_SYS_OPS_MMAP \
>> +    .fb_mmap    = NULL // default implementation
>> +
>> +#define FB_DEFAULT_SYS_OPS \
>> +    __FB_DEFAULT_SYS_OPS_RDWR, \
>> +    __FB_DEFAULT_SYS_OPS_DRAW, \
>> +    __FB_DEFAULT_SYS_OPS_MMAP
>> +
>>   /* drivers/video/fbmem.c */
>>   extern int register_framebuffer(struct fb_info *fb_info);
>>   extern void unregister_framebuffer(struct fb_info *fb_info);
>> @@ -604,6 +647,75 @@ extern void fb_deferred_io_cleanup(struct fb_info 
>> *info);
>>   extern int fb_deferred_io_fsync(struct file *file, loff_t start,
>>                   loff_t end, int datasync);
>> +/*
>> + * Generate callbacks for deferred I/O
>> + */
>> +
>> +#define __FB_GEN_DEFAULT_DEFERRED_OPS_RDWR(__prefix, __damage_range, 
>> __mode) \
>> +    static ssize_t __prefix ## _defio_read(struct fb_info *info, char 
>> __user *buf, \
>> +                           size_t count, loff_t *ppos) \
>> +    { \
>> +        return fb_ ## __mode ## _read(info, buf, count, ppos); \
>> +    } \
>> +    static ssize_t __prefix ## _defio_write(struct fb_info *info, 
>> const char __user *buf, \
>> +                        size_t count, loff_t *ppos) \
>> +    { \
>> +        unsigned long offset = *ppos; \
>> +        ssize_t ret = fb_ ## __mode ## _write(info, buf, count, ppos); \
>> +        if (ret > 0) \
>> +            __damage_range(info, offset, ret); \
>> +        return ret; \
>> +    }
>> +
>> +#define __FB_GEN_DEFAULT_DEFERRED_OPS_DRAW(__prefix, __damage_area, 
>> __mode) \
>> +    static void __prefix ## _defio_fillrect(struct fb_info *info, \
>> +                        const struct fb_fillrect *rect) \
>> +    { \
>> +        __mode ## _fillrect(info, rect); \
>> +        __damage_area(info, rect->dx, rect->dy, rect->width, 
>> rect->height); \
>> +    } \
>> +    static void __prefix ## _defio_copyarea(struct fb_info *info, \
>> +                        const struct fb_copyarea *area) \
>> +    { \
>> +        __mode ## _copyarea(info, area); \
>> +        __damage_area(info, area->dx, area->dy, area->width, 
>> area->height); \
>> +    } \
>> +    static void __prefix ## _defio_imageblit(struct fb_info *info, \
>> +                         const struct fb_image *image) \
>> +    { \
>> +        __mode ## _imageblit(info, image); \
>> +        __damage_area(info, image->dx, image->dy, image->width, 
>> image->height); \
>> +    }
>> +
>> +#define FB_GEN_DEFAULT_DEFERRED_IO_OPS(__prefix, __damage_range, 
>> __damage_area) \
>> +    __FB_GEN_DEFAULT_DEFERRED_OPS_RDWR(__prefix, __damage_range, io) \
>> +    __FB_GEN_DEFAULT_DEFERRED_OPS_DRAW(__prefix, __damage_area, cfb)
>> +
>> +#define FB_GEN_DEFAULT_DEFERRED_SYS_OPS(__prefix, __damage_range, 
>> __damage_area) \
>> +    __FB_GEN_DEFAULT_DEFERRED_OPS_RDWR(__prefix, __damage_range, sys) \
>> +    __FB_GEN_DEFAULT_DEFERRED_OPS_DRAW(__prefix, __damage_area, sys)
>> +
>> +/*
>> + * Initializes struct fb_ops for deferred I/O.
>> + */
>> +
>> +#define __FB_DEFAULT_DEFERRED_OPS_RDWR(__prefix) \
>> +    .fb_read    = __prefix ## _defio_read, \
>> +    .fb_write    = __prefix ## _defio_write
>> +
>> +#define __FB_DEFAULT_DEFERRED_OPS_DRAW(__prefix) \
>> +        .fb_fillrect    = __prefix ## _defio_fillrect, \
>> +        .fb_copyarea    = __prefix ## _defio_copyarea, \
>> +        .fb_imageblit    = __prefix ## _defio_imageblit
> 
> Here also,  '.fb_fillrect', '.fb_copyarea' and '.fb_imageblit' begin 
> with space, but I'm OK.
> 
> I'm asking because I see other __FB__DEFAULT_* macro begin with tabs.
> 
>> +#define __FB_DEFAULT_DEFERRED_OPS_MMAP(__prefix) \
>> +    .fb_mmap    = fb_deferred_io_mmap
>> +
>> +#define FB_DEFAULT_DEFERRED_OPS(__prefix) \
>> +    __FB_DEFAULT_DEFERRED_OPS_RDWR(__prefix), \
>> +    __FB_DEFAULT_DEFERRED_OPS_DRAW(__prefix), \
>> +    __FB_DEFAULT_DEFERRED_OPS_MMAP(__prefix)
>> +
>>   static inline bool fb_be_math(struct fb_info *info)
>>   {
>>   #ifdef CONFIG_FB_FOREIGN_ENDIAN

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

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

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

* Re: [v4,12/13] drm/fbdev-generic: Implement dedicated fbdev I/O helpers
  2023-05-24 20:23     ` [v4,12/13] " Sui Jingfeng
  (?)
  (?)
@ 2023-05-26 12:44       ` Thomas Zimmermann
  -1 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-26 12:44 UTC (permalink / raw)
  To: Sui Jingfeng, daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: linux-samsung-soc, linux-arm-msm, intel-gfx, dri-devel, amd-gfx,
	linux-tegra, freedreno, linux-arm-kernel


[-- Attachment #1.1: Type: text/plain, Size: 13432 bytes --]

Hi

Am 24.05.23 um 22:23 schrieb Sui Jingfeng:
> Tested-by: Sui Jingfeng <suijingfeng@loongson.cn>
> 
> 
> This version works fine, I have tested it On LoongArch with 
> drm/loongson(v14) as it is most handy for me.
> 
> Also because it using fbdev-generic. fbdev of IGT report no error. Then 
> I run fbtest from geert[1],
> 
> 
> Before apply your patch:
> 
> 
> Benchmarking... 10x10 squares: 468.39 Mpixels/s
> Benchmarking... 20x20 squares: 985.02 Mpixels/s
> Benchmarking... 50x50 squares: 2247.22 Mpixels/s
> Benchmarking... 100x100 squares: 2242.30 Mpixels/s
> Benchmarking... 200x200 squares: 2883.18 Mpixels/s
> Benchmarking... 500x500 squares: 3642.18 Mpixels/s
> Benchmarking... 1000x1000 squares: 3992.77 Mpixels/s
> Benchmarking... R5 circles: 261.90 Mpixels/s
> Benchmarking... R10 circles: 596.27 Mpixels/s
> Benchmarking... R25 circles: 1513.96 Mpixels/s
> Benchmarking... R50 circles: 1965.07 Mpixels/s
> Benchmarking... R100 circles: 2470.75 Mpixels/s
> Benchmarking... R250 circles: 3288.00 Mpixels/s
> Benchmarking... R500 circles: 3705.66 Mpixels/s
> 
> 
> After apply your patch:
> 
> 
> Benchmarking... 10x10 squares: 477.04 Mpixels/s
> Benchmarking... 20x20 squares: 1021.07 Mpixels/s
> Benchmarking... 50x50 squares: 2315.70 Mpixels/s
> Benchmarking... 100x100 squares: 2267.69 Mpixels/s
> Benchmarking... 200x200 squares: 3006.28 Mpixels/s
> Benchmarking... 500x500 squares: 3761.44 Mpixels/s
> Benchmarking... 1000x1000 squares: 4112.49 Mpixels/s
> Benchmarking... R5 circles: 269.19 Mpixels/s
> Benchmarking... R10 circles: 620.77 Mpixels/s
> Benchmarking... R25 circles: 1559.02 Mpixels/s
> Benchmarking... R50 circles: 2027.36 Mpixels/s
> Benchmarking... R100 circles: 2574.42 Mpixels/s
> Benchmarking... R250 circles: 3363.28 Mpixels/s
> Benchmarking... R500 circles: 3815.51 Mpixels/s
> 
> 
> It seems that this bring a little bit performance gain.

Thanks for testing. I can't really tell why the code is now faster. All 
the patch really does is to eliminate an intermediate cross-module 
function call and the pointer derefs.  This, apparently, already has an 
impact.

Best regards
Thomas

> 
> Directly operate on video RAM is slower than have a shadow in system RAM.
> 
> I also test this patch in intel i3-8100 @ 3.6Ghz, the results show that 
> i915 is a bit slower.
> 
> Because it operate directly on device memory.
> 
> 
> [1] https://git.kernel.org/pub/scm/linux/kernel/git/geert/fbtest.git
> 
> 
> On 2023/5/24 17:21, Thomas Zimmermann wrote:
>> Implement dedicated fbdev helpers for framebuffer I/O instead
>> of using DRM's helpers. Use an fbdev generator macro for
>> deferred I/O to create the callbacks. Fbdev-generic was the
>> only caller of the DRM helpers, so remove them from the helper
>> module.
>>
>> v4:
>>     * generate deferred-I/O helpers
>>     * use initializer macros for fb_ops
>> v2:
>>     * use FB_SYS_HELPERS_DEFERRED option
>>
>> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
>> ---
>>   drivers/gpu/drm/Kconfig             |   6 +-
>>   drivers/gpu/drm/drm_fb_helper.c     | 107 ----------------------------
>>   drivers/gpu/drm/drm_fbdev_generic.c |  11 ++-
>>   include/drm/drm_fb_helper.h         |  41 -----------
>>   4 files changed, 6 insertions(+), 159 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
>> index 77fb10ddd8a2..92a782827b7b 100644
>> --- a/drivers/gpu/drm/Kconfig
>> +++ b/drivers/gpu/drm/Kconfig
>> @@ -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
>> diff --git a/drivers/gpu/drm/drm_fb_helper.c 
>> b/drivers/gpu/drm/drm_fb_helper.c
>> index cb03099fd2e3..bab6b252f02a 100644
>> --- a/drivers/gpu/drm/drm_fb_helper.c
>> +++ b/drivers/gpu/drm/drm_fb_helper.c
>> @@ -736,113 +736,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
>> diff --git a/drivers/gpu/drm/drm_fbdev_generic.c 
>> b/drivers/gpu/drm/drm_fbdev_generic.c
>> index 8e5148bf40bb..98ae703848a0 100644
>> --- a/drivers/gpu/drm/drm_fbdev_generic.c
>> +++ b/drivers/gpu/drm/drm_fbdev_generic.c
>> @@ -34,6 +34,10 @@ static int drm_fbdev_generic_fb_release(struct 
>> fb_info *info, int user)
>>       return 0;
>>   }
>> +FB_GEN_DEFAULT_DEFERRED_SYS_OPS(drm_fbdev_generic,
>> +                drm_fb_helper_damage_range,
>> +                drm_fb_helper_damage_area);
>> +
>>   static void drm_fbdev_generic_fb_destroy(struct fb_info *info)
>>   {
>>       struct drm_fb_helper *fb_helper = info->par;
>> @@ -56,13 +60,8 @@ 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_DEFAULT_DEFERRED_OPS(drm_fbdev_generic),
>>       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_mmap    = fb_deferred_io_mmap,
>>       .fb_destroy    = drm_fbdev_generic_fb_destroy,
>>   };
>> diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
>> index 7d5804882be7..b50fd0c0b713 100644
>> --- a/include/drm/drm_fb_helper.h
>> +++ b/include/drm/drm_fb_helper.h
>> @@ -258,18 +258,6 @@ void drm_fb_helper_damage_area(struct fb_info 
>> *info, u32 x, u32 y, u32 width, u3
>>   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,
>> -                   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,
>> @@ -397,35 +385,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
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)

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

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

* Re: [v4,12/13] drm/fbdev-generic: Implement dedicated fbdev I/O helpers
@ 2023-05-26 12:44       ` Thomas Zimmermann
  0 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-26 12:44 UTC (permalink / raw)
  To: Sui Jingfeng, daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: linux-samsung-soc, linux-arm-msm, intel-gfx, amd-gfx, dri-devel,
	linux-tegra, freedreno, linux-arm-kernel


[-- Attachment #1.1: Type: text/plain, Size: 13432 bytes --]

Hi

Am 24.05.23 um 22:23 schrieb Sui Jingfeng:
> Tested-by: Sui Jingfeng <suijingfeng@loongson.cn>
> 
> 
> This version works fine, I have tested it On LoongArch with 
> drm/loongson(v14) as it is most handy for me.
> 
> Also because it using fbdev-generic. fbdev of IGT report no error. Then 
> I run fbtest from geert[1],
> 
> 
> Before apply your patch:
> 
> 
> Benchmarking... 10x10 squares: 468.39 Mpixels/s
> Benchmarking... 20x20 squares: 985.02 Mpixels/s
> Benchmarking... 50x50 squares: 2247.22 Mpixels/s
> Benchmarking... 100x100 squares: 2242.30 Mpixels/s
> Benchmarking... 200x200 squares: 2883.18 Mpixels/s
> Benchmarking... 500x500 squares: 3642.18 Mpixels/s
> Benchmarking... 1000x1000 squares: 3992.77 Mpixels/s
> Benchmarking... R5 circles: 261.90 Mpixels/s
> Benchmarking... R10 circles: 596.27 Mpixels/s
> Benchmarking... R25 circles: 1513.96 Mpixels/s
> Benchmarking... R50 circles: 1965.07 Mpixels/s
> Benchmarking... R100 circles: 2470.75 Mpixels/s
> Benchmarking... R250 circles: 3288.00 Mpixels/s
> Benchmarking... R500 circles: 3705.66 Mpixels/s
> 
> 
> After apply your patch:
> 
> 
> Benchmarking... 10x10 squares: 477.04 Mpixels/s
> Benchmarking... 20x20 squares: 1021.07 Mpixels/s
> Benchmarking... 50x50 squares: 2315.70 Mpixels/s
> Benchmarking... 100x100 squares: 2267.69 Mpixels/s
> Benchmarking... 200x200 squares: 3006.28 Mpixels/s
> Benchmarking... 500x500 squares: 3761.44 Mpixels/s
> Benchmarking... 1000x1000 squares: 4112.49 Mpixels/s
> Benchmarking... R5 circles: 269.19 Mpixels/s
> Benchmarking... R10 circles: 620.77 Mpixels/s
> Benchmarking... R25 circles: 1559.02 Mpixels/s
> Benchmarking... R50 circles: 2027.36 Mpixels/s
> Benchmarking... R100 circles: 2574.42 Mpixels/s
> Benchmarking... R250 circles: 3363.28 Mpixels/s
> Benchmarking... R500 circles: 3815.51 Mpixels/s
> 
> 
> It seems that this bring a little bit performance gain.

Thanks for testing. I can't really tell why the code is now faster. All 
the patch really does is to eliminate an intermediate cross-module 
function call and the pointer derefs.  This, apparently, already has an 
impact.

Best regards
Thomas

> 
> Directly operate on video RAM is slower than have a shadow in system RAM.
> 
> I also test this patch in intel i3-8100 @ 3.6Ghz, the results show that 
> i915 is a bit slower.
> 
> Because it operate directly on device memory.
> 
> 
> [1] https://git.kernel.org/pub/scm/linux/kernel/git/geert/fbtest.git
> 
> 
> On 2023/5/24 17:21, Thomas Zimmermann wrote:
>> Implement dedicated fbdev helpers for framebuffer I/O instead
>> of using DRM's helpers. Use an fbdev generator macro for
>> deferred I/O to create the callbacks. Fbdev-generic was the
>> only caller of the DRM helpers, so remove them from the helper
>> module.
>>
>> v4:
>>     * generate deferred-I/O helpers
>>     * use initializer macros for fb_ops
>> v2:
>>     * use FB_SYS_HELPERS_DEFERRED option
>>
>> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
>> ---
>>   drivers/gpu/drm/Kconfig             |   6 +-
>>   drivers/gpu/drm/drm_fb_helper.c     | 107 ----------------------------
>>   drivers/gpu/drm/drm_fbdev_generic.c |  11 ++-
>>   include/drm/drm_fb_helper.h         |  41 -----------
>>   4 files changed, 6 insertions(+), 159 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
>> index 77fb10ddd8a2..92a782827b7b 100644
>> --- a/drivers/gpu/drm/Kconfig
>> +++ b/drivers/gpu/drm/Kconfig
>> @@ -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
>> diff --git a/drivers/gpu/drm/drm_fb_helper.c 
>> b/drivers/gpu/drm/drm_fb_helper.c
>> index cb03099fd2e3..bab6b252f02a 100644
>> --- a/drivers/gpu/drm/drm_fb_helper.c
>> +++ b/drivers/gpu/drm/drm_fb_helper.c
>> @@ -736,113 +736,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
>> diff --git a/drivers/gpu/drm/drm_fbdev_generic.c 
>> b/drivers/gpu/drm/drm_fbdev_generic.c
>> index 8e5148bf40bb..98ae703848a0 100644
>> --- a/drivers/gpu/drm/drm_fbdev_generic.c
>> +++ b/drivers/gpu/drm/drm_fbdev_generic.c
>> @@ -34,6 +34,10 @@ static int drm_fbdev_generic_fb_release(struct 
>> fb_info *info, int user)
>>       return 0;
>>   }
>> +FB_GEN_DEFAULT_DEFERRED_SYS_OPS(drm_fbdev_generic,
>> +                drm_fb_helper_damage_range,
>> +                drm_fb_helper_damage_area);
>> +
>>   static void drm_fbdev_generic_fb_destroy(struct fb_info *info)
>>   {
>>       struct drm_fb_helper *fb_helper = info->par;
>> @@ -56,13 +60,8 @@ 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_DEFAULT_DEFERRED_OPS(drm_fbdev_generic),
>>       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_mmap    = fb_deferred_io_mmap,
>>       .fb_destroy    = drm_fbdev_generic_fb_destroy,
>>   };
>> diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
>> index 7d5804882be7..b50fd0c0b713 100644
>> --- a/include/drm/drm_fb_helper.h
>> +++ b/include/drm/drm_fb_helper.h
>> @@ -258,18 +258,6 @@ void drm_fb_helper_damage_area(struct fb_info 
>> *info, u32 x, u32 y, u32 width, u3
>>   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,
>> -                   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,
>> @@ -397,35 +385,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
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)

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

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

* Re: [Intel-gfx] [v4, 12/13] drm/fbdev-generic: Implement dedicated fbdev I/O helpers
@ 2023-05-26 12:44       ` Thomas Zimmermann
  0 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-26 12:44 UTC (permalink / raw)
  To: Sui Jingfeng, daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: linux-samsung-soc, linux-arm-msm, intel-gfx, amd-gfx, dri-devel,
	linux-tegra, freedreno, linux-arm-kernel


[-- Attachment #1.1: Type: text/plain, Size: 13432 bytes --]

Hi

Am 24.05.23 um 22:23 schrieb Sui Jingfeng:
> Tested-by: Sui Jingfeng <suijingfeng@loongson.cn>
> 
> 
> This version works fine, I have tested it On LoongArch with 
> drm/loongson(v14) as it is most handy for me.
> 
> Also because it using fbdev-generic. fbdev of IGT report no error. Then 
> I run fbtest from geert[1],
> 
> 
> Before apply your patch:
> 
> 
> Benchmarking... 10x10 squares: 468.39 Mpixels/s
> Benchmarking... 20x20 squares: 985.02 Mpixels/s
> Benchmarking... 50x50 squares: 2247.22 Mpixels/s
> Benchmarking... 100x100 squares: 2242.30 Mpixels/s
> Benchmarking... 200x200 squares: 2883.18 Mpixels/s
> Benchmarking... 500x500 squares: 3642.18 Mpixels/s
> Benchmarking... 1000x1000 squares: 3992.77 Mpixels/s
> Benchmarking... R5 circles: 261.90 Mpixels/s
> Benchmarking... R10 circles: 596.27 Mpixels/s
> Benchmarking... R25 circles: 1513.96 Mpixels/s
> Benchmarking... R50 circles: 1965.07 Mpixels/s
> Benchmarking... R100 circles: 2470.75 Mpixels/s
> Benchmarking... R250 circles: 3288.00 Mpixels/s
> Benchmarking... R500 circles: 3705.66 Mpixels/s
> 
> 
> After apply your patch:
> 
> 
> Benchmarking... 10x10 squares: 477.04 Mpixels/s
> Benchmarking... 20x20 squares: 1021.07 Mpixels/s
> Benchmarking... 50x50 squares: 2315.70 Mpixels/s
> Benchmarking... 100x100 squares: 2267.69 Mpixels/s
> Benchmarking... 200x200 squares: 3006.28 Mpixels/s
> Benchmarking... 500x500 squares: 3761.44 Mpixels/s
> Benchmarking... 1000x1000 squares: 4112.49 Mpixels/s
> Benchmarking... R5 circles: 269.19 Mpixels/s
> Benchmarking... R10 circles: 620.77 Mpixels/s
> Benchmarking... R25 circles: 1559.02 Mpixels/s
> Benchmarking... R50 circles: 2027.36 Mpixels/s
> Benchmarking... R100 circles: 2574.42 Mpixels/s
> Benchmarking... R250 circles: 3363.28 Mpixels/s
> Benchmarking... R500 circles: 3815.51 Mpixels/s
> 
> 
> It seems that this bring a little bit performance gain.

Thanks for testing. I can't really tell why the code is now faster. All 
the patch really does is to eliminate an intermediate cross-module 
function call and the pointer derefs.  This, apparently, already has an 
impact.

Best regards
Thomas

> 
> Directly operate on video RAM is slower than have a shadow in system RAM.
> 
> I also test this patch in intel i3-8100 @ 3.6Ghz, the results show that 
> i915 is a bit slower.
> 
> Because it operate directly on device memory.
> 
> 
> [1] https://git.kernel.org/pub/scm/linux/kernel/git/geert/fbtest.git
> 
> 
> On 2023/5/24 17:21, Thomas Zimmermann wrote:
>> Implement dedicated fbdev helpers for framebuffer I/O instead
>> of using DRM's helpers. Use an fbdev generator macro for
>> deferred I/O to create the callbacks. Fbdev-generic was the
>> only caller of the DRM helpers, so remove them from the helper
>> module.
>>
>> v4:
>>     * generate deferred-I/O helpers
>>     * use initializer macros for fb_ops
>> v2:
>>     * use FB_SYS_HELPERS_DEFERRED option
>>
>> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
>> ---
>>   drivers/gpu/drm/Kconfig             |   6 +-
>>   drivers/gpu/drm/drm_fb_helper.c     | 107 ----------------------------
>>   drivers/gpu/drm/drm_fbdev_generic.c |  11 ++-
>>   include/drm/drm_fb_helper.h         |  41 -----------
>>   4 files changed, 6 insertions(+), 159 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
>> index 77fb10ddd8a2..92a782827b7b 100644
>> --- a/drivers/gpu/drm/Kconfig
>> +++ b/drivers/gpu/drm/Kconfig
>> @@ -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
>> diff --git a/drivers/gpu/drm/drm_fb_helper.c 
>> b/drivers/gpu/drm/drm_fb_helper.c
>> index cb03099fd2e3..bab6b252f02a 100644
>> --- a/drivers/gpu/drm/drm_fb_helper.c
>> +++ b/drivers/gpu/drm/drm_fb_helper.c
>> @@ -736,113 +736,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
>> diff --git a/drivers/gpu/drm/drm_fbdev_generic.c 
>> b/drivers/gpu/drm/drm_fbdev_generic.c
>> index 8e5148bf40bb..98ae703848a0 100644
>> --- a/drivers/gpu/drm/drm_fbdev_generic.c
>> +++ b/drivers/gpu/drm/drm_fbdev_generic.c
>> @@ -34,6 +34,10 @@ static int drm_fbdev_generic_fb_release(struct 
>> fb_info *info, int user)
>>       return 0;
>>   }
>> +FB_GEN_DEFAULT_DEFERRED_SYS_OPS(drm_fbdev_generic,
>> +                drm_fb_helper_damage_range,
>> +                drm_fb_helper_damage_area);
>> +
>>   static void drm_fbdev_generic_fb_destroy(struct fb_info *info)
>>   {
>>       struct drm_fb_helper *fb_helper = info->par;
>> @@ -56,13 +60,8 @@ 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_DEFAULT_DEFERRED_OPS(drm_fbdev_generic),
>>       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_mmap    = fb_deferred_io_mmap,
>>       .fb_destroy    = drm_fbdev_generic_fb_destroy,
>>   };
>> diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
>> index 7d5804882be7..b50fd0c0b713 100644
>> --- a/include/drm/drm_fb_helper.h
>> +++ b/include/drm/drm_fb_helper.h
>> @@ -258,18 +258,6 @@ void drm_fb_helper_damage_area(struct fb_info 
>> *info, u32 x, u32 y, u32 width, u3
>>   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,
>> -                   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,
>> @@ -397,35 +385,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
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)

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

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

* Re: [v4,12/13] drm/fbdev-generic: Implement dedicated fbdev I/O helpers
@ 2023-05-26 12:44       ` Thomas Zimmermann
  0 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-26 12:44 UTC (permalink / raw)
  To: Sui Jingfeng, daniel, airlied, maarten.lankhorst, mripard, javierm, sam
  Cc: linux-samsung-soc, linux-arm-msm, intel-gfx, dri-devel, amd-gfx,
	linux-tegra, freedreno, linux-arm-kernel


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

Hi

Am 24.05.23 um 22:23 schrieb Sui Jingfeng:
> Tested-by: Sui Jingfeng <suijingfeng@loongson.cn>
> 
> 
> This version works fine, I have tested it On LoongArch with 
> drm/loongson(v14) as it is most handy for me.
> 
> Also because it using fbdev-generic. fbdev of IGT report no error. Then 
> I run fbtest from geert[1],
> 
> 
> Before apply your patch:
> 
> 
> Benchmarking... 10x10 squares: 468.39 Mpixels/s
> Benchmarking... 20x20 squares: 985.02 Mpixels/s
> Benchmarking... 50x50 squares: 2247.22 Mpixels/s
> Benchmarking... 100x100 squares: 2242.30 Mpixels/s
> Benchmarking... 200x200 squares: 2883.18 Mpixels/s
> Benchmarking... 500x500 squares: 3642.18 Mpixels/s
> Benchmarking... 1000x1000 squares: 3992.77 Mpixels/s
> Benchmarking... R5 circles: 261.90 Mpixels/s
> Benchmarking... R10 circles: 596.27 Mpixels/s
> Benchmarking... R25 circles: 1513.96 Mpixels/s
> Benchmarking... R50 circles: 1965.07 Mpixels/s
> Benchmarking... R100 circles: 2470.75 Mpixels/s
> Benchmarking... R250 circles: 3288.00 Mpixels/s
> Benchmarking... R500 circles: 3705.66 Mpixels/s
> 
> 
> After apply your patch:
> 
> 
> Benchmarking... 10x10 squares: 477.04 Mpixels/s
> Benchmarking... 20x20 squares: 1021.07 Mpixels/s
> Benchmarking... 50x50 squares: 2315.70 Mpixels/s
> Benchmarking... 100x100 squares: 2267.69 Mpixels/s
> Benchmarking... 200x200 squares: 3006.28 Mpixels/s
> Benchmarking... 500x500 squares: 3761.44 Mpixels/s
> Benchmarking... 1000x1000 squares: 4112.49 Mpixels/s
> Benchmarking... R5 circles: 269.19 Mpixels/s
> Benchmarking... R10 circles: 620.77 Mpixels/s
> Benchmarking... R25 circles: 1559.02 Mpixels/s
> Benchmarking... R50 circles: 2027.36 Mpixels/s
> Benchmarking... R100 circles: 2574.42 Mpixels/s
> Benchmarking... R250 circles: 3363.28 Mpixels/s
> Benchmarking... R500 circles: 3815.51 Mpixels/s
> 
> 
> It seems that this bring a little bit performance gain.

Thanks for testing. I can't really tell why the code is now faster. All 
the patch really does is to eliminate an intermediate cross-module 
function call and the pointer derefs.  This, apparently, already has an 
impact.

Best regards
Thomas

> 
> Directly operate on video RAM is slower than have a shadow in system RAM.
> 
> I also test this patch in intel i3-8100 @ 3.6Ghz, the results show that 
> i915 is a bit slower.
> 
> Because it operate directly on device memory.
> 
> 
> [1] https://git.kernel.org/pub/scm/linux/kernel/git/geert/fbtest.git
> 
> 
> On 2023/5/24 17:21, Thomas Zimmermann wrote:
>> Implement dedicated fbdev helpers for framebuffer I/O instead
>> of using DRM's helpers. Use an fbdev generator macro for
>> deferred I/O to create the callbacks. Fbdev-generic was the
>> only caller of the DRM helpers, so remove them from the helper
>> module.
>>
>> v4:
>>     * generate deferred-I/O helpers
>>     * use initializer macros for fb_ops
>> v2:
>>     * use FB_SYS_HELPERS_DEFERRED option
>>
>> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
>> ---
>>   drivers/gpu/drm/Kconfig             |   6 +-
>>   drivers/gpu/drm/drm_fb_helper.c     | 107 ----------------------------
>>   drivers/gpu/drm/drm_fbdev_generic.c |  11 ++-
>>   include/drm/drm_fb_helper.h         |  41 -----------
>>   4 files changed, 6 insertions(+), 159 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
>> index 77fb10ddd8a2..92a782827b7b 100644
>> --- a/drivers/gpu/drm/Kconfig
>> +++ b/drivers/gpu/drm/Kconfig
>> @@ -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
>> diff --git a/drivers/gpu/drm/drm_fb_helper.c 
>> b/drivers/gpu/drm/drm_fb_helper.c
>> index cb03099fd2e3..bab6b252f02a 100644
>> --- a/drivers/gpu/drm/drm_fb_helper.c
>> +++ b/drivers/gpu/drm/drm_fb_helper.c
>> @@ -736,113 +736,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
>> diff --git a/drivers/gpu/drm/drm_fbdev_generic.c 
>> b/drivers/gpu/drm/drm_fbdev_generic.c
>> index 8e5148bf40bb..98ae703848a0 100644
>> --- a/drivers/gpu/drm/drm_fbdev_generic.c
>> +++ b/drivers/gpu/drm/drm_fbdev_generic.c
>> @@ -34,6 +34,10 @@ static int drm_fbdev_generic_fb_release(struct 
>> fb_info *info, int user)
>>       return 0;
>>   }
>> +FB_GEN_DEFAULT_DEFERRED_SYS_OPS(drm_fbdev_generic,
>> +                drm_fb_helper_damage_range,
>> +                drm_fb_helper_damage_area);
>> +
>>   static void drm_fbdev_generic_fb_destroy(struct fb_info *info)
>>   {
>>       struct drm_fb_helper *fb_helper = info->par;
>> @@ -56,13 +60,8 @@ 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_DEFAULT_DEFERRED_OPS(drm_fbdev_generic),
>>       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_mmap    = fb_deferred_io_mmap,
>>       .fb_destroy    = drm_fbdev_generic_fb_destroy,
>>   };
>> diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
>> index 7d5804882be7..b50fd0c0b713 100644
>> --- a/include/drm/drm_fb_helper.h
>> +++ b/include/drm/drm_fb_helper.h
>> @@ -258,18 +258,6 @@ void drm_fb_helper_damage_area(struct fb_info 
>> *info, u32 x, u32 y, u32 width, u3
>>   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,
>> -                   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,
>> @@ -397,35 +385,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
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)

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

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

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

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

* Re: [PATCH v4 01/13] fbdev: Add Kconfig options to select different fb_ops helpers
  2023-05-24  9:21   ` Thomas Zimmermann
                       ` (2 preceding siblings ...)
  (?)
@ 2023-05-29 19:17     ` Sam Ravnborg
  -1 siblings, 0 replies; 134+ messages in thread
From: Sam Ravnborg @ 2023-05-29 19:17 UTC (permalink / raw)
  To: Thomas Zimmermann
  Cc: daniel, airlied, maarten.lankhorst, mripard, javierm, dri-devel,
	linux-arm-kernel, linux-samsung-soc, intel-gfx, linux-arm-msm,
	freedreno, amd-gfx, linux-tegra

Hi Thomas,

On Wed, May 24, 2023 at 11:21:38AM +0200, Thomas Zimmermann wrote:
> 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.
> 
> v3:
> 	* fix select statement (Jingfeng)
> 
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
I like these, thanks.
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>

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

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

* Re: [PATCH v4 01/13] fbdev: Add Kconfig options to select different fb_ops helpers
@ 2023-05-29 19:17     ` Sam Ravnborg
  0 siblings, 0 replies; 134+ messages in thread
From: Sam Ravnborg @ 2023-05-29 19:17 UTC (permalink / raw)
  To: Thomas Zimmermann
  Cc: freedreno, linux-samsung-soc, amd-gfx, linux-arm-msm, intel-gfx,
	javierm, dri-devel, linux-tegra, linux-arm-kernel

Hi Thomas,

On Wed, May 24, 2023 at 11:21:38AM +0200, Thomas Zimmermann wrote:
> 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.
> 
> v3:
> 	* fix select statement (Jingfeng)
> 
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
I like these, thanks.
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>

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

* Re: [PATCH v4 01/13] fbdev: Add Kconfig options to select different fb_ops helpers
@ 2023-05-29 19:17     ` Sam Ravnborg
  0 siblings, 0 replies; 134+ messages in thread
From: Sam Ravnborg @ 2023-05-29 19:17 UTC (permalink / raw)
  To: Thomas Zimmermann
  Cc: daniel, airlied, maarten.lankhorst, mripard, javierm, dri-devel,
	linux-arm-kernel, linux-samsung-soc, intel-gfx, linux-arm-msm,
	freedreno, amd-gfx, linux-tegra

Hi Thomas,

On Wed, May 24, 2023 at 11:21:38AM +0200, Thomas Zimmermann wrote:
> 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.
> 
> v3:
> 	* fix select statement (Jingfeng)
> 
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
I like these, thanks.
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>

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

* Re: [Intel-gfx] [PATCH v4 01/13] fbdev: Add Kconfig options to select different fb_ops helpers
@ 2023-05-29 19:17     ` Sam Ravnborg
  0 siblings, 0 replies; 134+ messages in thread
From: Sam Ravnborg @ 2023-05-29 19:17 UTC (permalink / raw)
  To: Thomas Zimmermann
  Cc: freedreno, linux-samsung-soc, amd-gfx, linux-arm-msm, intel-gfx,
	javierm, dri-devel, mripard, daniel, linux-tegra, airlied,
	linux-arm-kernel

Hi Thomas,

On Wed, May 24, 2023 at 11:21:38AM +0200, Thomas Zimmermann wrote:
> 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.
> 
> v3:
> 	* fix select statement (Jingfeng)
> 
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
I like these, thanks.
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>

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

* Re: [PATCH v4 01/13] fbdev: Add Kconfig options to select different fb_ops helpers
@ 2023-05-29 19:17     ` Sam Ravnborg
  0 siblings, 0 replies; 134+ messages in thread
From: Sam Ravnborg @ 2023-05-29 19:17 UTC (permalink / raw)
  To: Thomas Zimmermann
  Cc: freedreno, linux-samsung-soc, amd-gfx, linux-arm-msm, intel-gfx,
	maarten.lankhorst, javierm, dri-devel, mripard, daniel,
	linux-tegra, airlied, linux-arm-kernel

Hi Thomas,

On Wed, May 24, 2023 at 11:21:38AM +0200, Thomas Zimmermann wrote:
> 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.
> 
> v3:
> 	* fix select statement (Jingfeng)
> 
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
I like these, thanks.
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>

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

* Re: [PATCH v4 02/13] fbdev: Add initializer macros for struct fb_ops
  2023-05-24  9:21   ` [Intel-gfx] " Thomas Zimmermann
                       ` (2 preceding siblings ...)
  (?)
@ 2023-05-29 19:23     ` Sam Ravnborg
  -1 siblings, 0 replies; 134+ messages in thread
From: Sam Ravnborg @ 2023-05-29 19:23 UTC (permalink / raw)
  To: Thomas Zimmermann
  Cc: daniel, airlied, maarten.lankhorst, mripard, javierm, dri-devel,
	linux-arm-kernel, linux-samsung-soc, intel-gfx, linux-arm-msm,
	freedreno, amd-gfx, linux-tegra

On Wed, May 24, 2023 at 11:21:39AM +0200, Thomas Zimmermann wrote:
> For framebuffers in I/O and system memory, add macros that set
> struct fb_ops to the respective callback functions.
> 
> For deferred I/O, add macros that generate callback functions with
> damage handling. Add initializer macros that set struct fb_ops to
> the generated callbacks.
> 
> These macros can remove a lot boilerplate code from fbdev drivers.
> The drivers are supposed to use the macro that is required for its
> framebuffer. Each macro is split into smaller helpers, so that
> drivers with non-standard callbacks can pick and customize callbacks
> as needed. There are individual helper macros for read/write, mmap
> and drawing.
> 
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
I am not a fan of public functions/macros names __something.
But I see it used in so many places, so maybe it is just me.
And everything looks consistent, so OK.

With the white space issues fixed:
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>

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

* Re: [PATCH v4 02/13] fbdev: Add initializer macros for struct fb_ops
@ 2023-05-29 19:23     ` Sam Ravnborg
  0 siblings, 0 replies; 134+ messages in thread
From: Sam Ravnborg @ 2023-05-29 19:23 UTC (permalink / raw)
  To: Thomas Zimmermann
  Cc: daniel, airlied, maarten.lankhorst, mripard, javierm, dri-devel,
	linux-arm-kernel, linux-samsung-soc, intel-gfx, linux-arm-msm,
	freedreno, amd-gfx, linux-tegra

On Wed, May 24, 2023 at 11:21:39AM +0200, Thomas Zimmermann wrote:
> For framebuffers in I/O and system memory, add macros that set
> struct fb_ops to the respective callback functions.
> 
> For deferred I/O, add macros that generate callback functions with
> damage handling. Add initializer macros that set struct fb_ops to
> the generated callbacks.
> 
> These macros can remove a lot boilerplate code from fbdev drivers.
> The drivers are supposed to use the macro that is required for its
> framebuffer. Each macro is split into smaller helpers, so that
> drivers with non-standard callbacks can pick and customize callbacks
> as needed. There are individual helper macros for read/write, mmap
> and drawing.
> 
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
I am not a fan of public functions/macros names __something.
But I see it used in so many places, so maybe it is just me.
And everything looks consistent, so OK.

With the white space issues fixed:
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>

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

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

* Re: [PATCH v4 02/13] fbdev: Add initializer macros for struct fb_ops
@ 2023-05-29 19:23     ` Sam Ravnborg
  0 siblings, 0 replies; 134+ messages in thread
From: Sam Ravnborg @ 2023-05-29 19:23 UTC (permalink / raw)
  To: Thomas Zimmermann
  Cc: freedreno, linux-samsung-soc, amd-gfx, linux-arm-msm, intel-gfx,
	javierm, dri-devel, linux-tegra, linux-arm-kernel

On Wed, May 24, 2023 at 11:21:39AM +0200, Thomas Zimmermann wrote:
> For framebuffers in I/O and system memory, add macros that set
> struct fb_ops to the respective callback functions.
> 
> For deferred I/O, add macros that generate callback functions with
> damage handling. Add initializer macros that set struct fb_ops to
> the generated callbacks.
> 
> These macros can remove a lot boilerplate code from fbdev drivers.
> The drivers are supposed to use the macro that is required for its
> framebuffer. Each macro is split into smaller helpers, so that
> drivers with non-standard callbacks can pick and customize callbacks
> as needed. There are individual helper macros for read/write, mmap
> and drawing.
> 
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
I am not a fan of public functions/macros names __something.
But I see it used in so many places, so maybe it is just me.
And everything looks consistent, so OK.

With the white space issues fixed:
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>

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

* Re: [Intel-gfx] [PATCH v4 02/13] fbdev: Add initializer macros for struct fb_ops
@ 2023-05-29 19:23     ` Sam Ravnborg
  0 siblings, 0 replies; 134+ messages in thread
From: Sam Ravnborg @ 2023-05-29 19:23 UTC (permalink / raw)
  To: Thomas Zimmermann
  Cc: freedreno, linux-samsung-soc, amd-gfx, linux-arm-msm, intel-gfx,
	javierm, dri-devel, mripard, daniel, linux-tegra, airlied,
	linux-arm-kernel

On Wed, May 24, 2023 at 11:21:39AM +0200, Thomas Zimmermann wrote:
> For framebuffers in I/O and system memory, add macros that set
> struct fb_ops to the respective callback functions.
> 
> For deferred I/O, add macros that generate callback functions with
> damage handling. Add initializer macros that set struct fb_ops to
> the generated callbacks.
> 
> These macros can remove a lot boilerplate code from fbdev drivers.
> The drivers are supposed to use the macro that is required for its
> framebuffer. Each macro is split into smaller helpers, so that
> drivers with non-standard callbacks can pick and customize callbacks
> as needed. There are individual helper macros for read/write, mmap
> and drawing.
> 
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
I am not a fan of public functions/macros names __something.
But I see it used in so many places, so maybe it is just me.
And everything looks consistent, so OK.

With the white space issues fixed:
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>

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

* Re: [PATCH v4 02/13] fbdev: Add initializer macros for struct fb_ops
@ 2023-05-29 19:23     ` Sam Ravnborg
  0 siblings, 0 replies; 134+ messages in thread
From: Sam Ravnborg @ 2023-05-29 19:23 UTC (permalink / raw)
  To: Thomas Zimmermann
  Cc: freedreno, linux-samsung-soc, amd-gfx, linux-arm-msm, intel-gfx,
	maarten.lankhorst, javierm, dri-devel, mripard, daniel,
	linux-tegra, airlied, linux-arm-kernel

On Wed, May 24, 2023 at 11:21:39AM +0200, Thomas Zimmermann wrote:
> For framebuffers in I/O and system memory, add macros that set
> struct fb_ops to the respective callback functions.
> 
> For deferred I/O, add macros that generate callback functions with
> damage handling. Add initializer macros that set struct fb_ops to
> the generated callbacks.
> 
> These macros can remove a lot boilerplate code from fbdev drivers.
> The drivers are supposed to use the macro that is required for its
> framebuffer. Each macro is split into smaller helpers, so that
> drivers with non-standard callbacks can pick and customize callbacks
> as needed. There are individual helper macros for read/write, mmap
> and drawing.
> 
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
I am not a fan of public functions/macros names __something.
But I see it used in so many places, so maybe it is just me.
And everything looks consistent, so OK.

With the white space issues fixed:
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>

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

* Re: [PATCH v4 03/13] drm/armada: Use regular fbdev I/O helpers
  2023-05-24  9:21   ` Thomas Zimmermann
                       ` (2 preceding siblings ...)
  (?)
@ 2023-05-29 19:24     ` Sam Ravnborg
  -1 siblings, 0 replies; 134+ messages in thread
From: Sam Ravnborg @ 2023-05-29 19:24 UTC (permalink / raw)
  To: Thomas Zimmermann
  Cc: daniel, airlied, maarten.lankhorst, mripard, javierm, dri-devel,
	linux-arm-kernel, linux-samsung-soc, intel-gfx, linux-arm-msm,
	freedreno, amd-gfx, linux-tegra, Russell King

On Wed, May 24, 2023 at 11:21:40AM +0200, Thomas Zimmermann wrote:
> 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.
> 
> v4:
> 	* use initializer macros for struct fb_ops
> v2:
> 	* use FB_IO_HELPERS option
> 
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: Russell King <linux@armlinux.org.uk>
Acked-by: Sam Ravnborg <sam@ravnborg.org>

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

* Re: [PATCH v4 03/13] drm/armada: Use regular fbdev I/O helpers
@ 2023-05-29 19:24     ` Sam Ravnborg
  0 siblings, 0 replies; 134+ messages in thread
From: Sam Ravnborg @ 2023-05-29 19:24 UTC (permalink / raw)
  To: Thomas Zimmermann
  Cc: freedreno, linux-samsung-soc, amd-gfx, linux-arm-msm, intel-gfx,
	javierm, dri-devel, Russell King, linux-tegra, linux-arm-kernel

On Wed, May 24, 2023 at 11:21:40AM +0200, Thomas Zimmermann wrote:
> 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.
> 
> v4:
> 	* use initializer macros for struct fb_ops
> v2:
> 	* use FB_IO_HELPERS option
> 
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: Russell King <linux@armlinux.org.uk>
Acked-by: Sam Ravnborg <sam@ravnborg.org>

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

* Re: [Intel-gfx] [PATCH v4 03/13] drm/armada: Use regular fbdev I/O helpers
@ 2023-05-29 19:24     ` Sam Ravnborg
  0 siblings, 0 replies; 134+ messages in thread
From: Sam Ravnborg @ 2023-05-29 19:24 UTC (permalink / raw)
  To: Thomas Zimmermann
  Cc: freedreno, linux-samsung-soc, amd-gfx, linux-arm-msm, intel-gfx,
	javierm, dri-devel, Russell King, mripard, daniel, linux-tegra,
	airlied, linux-arm-kernel

On Wed, May 24, 2023 at 11:21:40AM +0200, Thomas Zimmermann wrote:
> 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.
> 
> v4:
> 	* use initializer macros for struct fb_ops
> v2:
> 	* use FB_IO_HELPERS option
> 
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: Russell King <linux@armlinux.org.uk>
Acked-by: Sam Ravnborg <sam@ravnborg.org>

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

* Re: [PATCH v4 03/13] drm/armada: Use regular fbdev I/O helpers
@ 2023-05-29 19:24     ` Sam Ravnborg
  0 siblings, 0 replies; 134+ messages in thread
From: Sam Ravnborg @ 2023-05-29 19:24 UTC (permalink / raw)
  To: Thomas Zimmermann
  Cc: freedreno, linux-samsung-soc, amd-gfx, linux-arm-msm, intel-gfx,
	maarten.lankhorst, javierm, dri-devel, Russell King, mripard,
	daniel, linux-tegra, airlied, linux-arm-kernel

On Wed, May 24, 2023 at 11:21:40AM +0200, Thomas Zimmermann wrote:
> 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.
> 
> v4:
> 	* use initializer macros for struct fb_ops
> v2:
> 	* use FB_IO_HELPERS option
> 
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: Russell King <linux@armlinux.org.uk>
Acked-by: Sam Ravnborg <sam@ravnborg.org>

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

* Re: [PATCH v4 03/13] drm/armada: Use regular fbdev I/O helpers
@ 2023-05-29 19:24     ` Sam Ravnborg
  0 siblings, 0 replies; 134+ messages in thread
From: Sam Ravnborg @ 2023-05-29 19:24 UTC (permalink / raw)
  To: Thomas Zimmermann
  Cc: daniel, airlied, maarten.lankhorst, mripard, javierm, dri-devel,
	linux-arm-kernel, linux-samsung-soc, intel-gfx, linux-arm-msm,
	freedreno, amd-gfx, linux-tegra, Russell King

On Wed, May 24, 2023 at 11:21:40AM +0200, Thomas Zimmermann wrote:
> 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.
> 
> v4:
> 	* use initializer macros for struct fb_ops
> v2:
> 	* use FB_IO_HELPERS option
> 
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: Russell King <linux@armlinux.org.uk>
Acked-by: Sam Ravnborg <sam@ravnborg.org>

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

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

* Re: [PATCH v4 13/13] drm/i915: Implement dedicated fbdev I/O helpers
  2023-05-24  9:21   ` Thomas Zimmermann
                       ` (2 preceding siblings ...)
  (?)
@ 2023-05-29 19:36     ` Sam Ravnborg
  -1 siblings, 0 replies; 134+ messages in thread
From: Sam Ravnborg @ 2023-05-29 19:36 UTC (permalink / raw)
  To: Thomas Zimmermann
  Cc: daniel, airlied, maarten.lankhorst, mripard, javierm, dri-devel,
	linux-arm-kernel, linux-samsung-soc, intel-gfx, linux-arm-msm,
	freedreno, amd-gfx, linux-tegra, Jani Nikula, Joonas Lahtinen,
	Rodrigo Vivi, Tvrtko Ursulin, Ville Syrjälä

Hi Thomas,

On Wed, May 24, 2023 at 11:21:50AM +0200, Thomas Zimmermann wrote:
> Implement dedicated fbdev helpers for framebuffer I/O instead
> of using DRM's helpers. Use an fbdev generator macro for
> deferred I/O to create the fbdev callbacks. i915 was the only
> caller of the DRM helpers, so remove them from the helper module.
> 
> i915's fbdev emulation is still incomplete as it doesn't implement
> deferred I/O and damage handling for mmaped pages.
> 
> v4:
> 	* generate deferred-I/O helpers
> 	* use initializer macros for fb_ops
> v2:
> 	* use FB_IO_HELPERS options
> 
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
> Cc: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
> ---
>  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 |  14 +--
>  include/drm/drm_fb_helper.h                |  39 --------
>  5 files changed, 9 insertions(+), 155 deletions(-)
> 
> diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
> index 92a782827b7b..bb2e48cc6cd6 100644
> --- a/drivers/gpu/drm/Kconfig
> +++ b/drivers/gpu/drm/Kconfig
> @@ -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
> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> index bab6b252f02a..9978147bbc8a 100644
> --- a/drivers/gpu/drm/drm_fb_helper.c
> +++ b/drivers/gpu/drm/drm_fb_helper.c
> @@ -736,113 +736,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_cfb_read - Implements struct &fb_ops.fb_read for I/O 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_cfb_read(struct fb_info *info, char __user *buf,
> -			       size_t count, loff_t *ppos)
> -{
> -	return fb_io_read(info, buf, count, ppos);
> -}
> -EXPORT_SYMBOL(drm_fb_helper_cfb_read);
> -
> -/**
> - * drm_fb_helper_cfb_write - Implements struct &fb_ops.fb_write for I/O 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_cfb_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_io_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));
> -	}

The generated helpers do not have the if (helper->funcs->fb_dirty)
check.
Is this implemented somewhere else that I missed?

	Sam


> -
> -	return ret;
> -}
> -EXPORT_SYMBOL(drm_fb_helper_cfb_write);
> -
> -/**
> - * drm_fb_helper_cfb_fillrect - wrapper around cfb_fillrect
> - * @info: fbdev registered by the helper
> - * @rect: info about rectangle to fill
> - *
> - * A wrapper around cfb_fillrect implemented by fbdev core
> - */
> -void drm_fb_helper_cfb_fillrect(struct fb_info *info,
> -				const struct fb_fillrect *rect)
> -{
> -	struct drm_fb_helper *helper = info->par;
> -
> -	cfb_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_cfb_fillrect);
> -
> -/**
> - * drm_fb_helper_cfb_copyarea - wrapper around cfb_copyarea
> - * @info: fbdev registered by the helper
> - * @area: info about area to copy
> - *
> - * A wrapper around cfb_copyarea implemented by fbdev core
> - */
> -void drm_fb_helper_cfb_copyarea(struct fb_info *info,
> -				const struct fb_copyarea *area)
> -{
> -	struct drm_fb_helper *helper = info->par;
> -
> -	cfb_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_cfb_copyarea);
> -
> -/**
> - * drm_fb_helper_cfb_imageblit - wrapper around cfb_imageblit
> - * @info: fbdev registered by the helper
> - * @image: info about image to blit
> - *
> - * A wrapper around cfb_imageblit implemented by fbdev core
> - */
> -void drm_fb_helper_cfb_imageblit(struct fb_info *info,
> -				 const struct fb_image *image)
> -{
> -	struct drm_fb_helper *helper = info->par;
> -
> -	cfb_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_cfb_imageblit);
> -
>  /**
>   * drm_fb_helper_set_suspend - wrapper around fb_set_suspend
>   * @fb_helper: driver-allocated fbdev helper, can be NULL
> diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig
> index e4f4d2e3fdfe..01b5a8272a27 100644
> --- a/drivers/gpu/drm/i915/Kconfig
> +++ b/drivers/gpu/drm/i915/Kconfig
> @@ -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
> diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
> index aab1ae74a8f7..eccaceaf8b9d 100644
> --- a/drivers/gpu/drm/i915/display/intel_fbdev.c
> +++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
> @@ -28,6 +28,7 @@
>  #include <linux/console.h>
>  #include <linux/delay.h>
>  #include <linux/errno.h>
> +#include <linux/fb.h>
>  #include <linux/init.h>
>  #include <linux/kernel.h>
>  #include <linux/mm.h>
> @@ -84,6 +85,10 @@ static void intel_fbdev_invalidate(struct intel_fbdev *ifbdev)
>  	intel_frontbuffer_invalidate(to_frontbuffer(ifbdev), ORIGIN_CPU);
>  }
>  
> +FB_GEN_DEFAULT_DEFERRED_IO_OPS(intel_fbdev,
> +			       drm_fb_helper_damage_range,
> +			       drm_fb_helper_damage_area)
> +
>  static int intel_fbdev_set_par(struct fb_info *info)
>  {
>  	struct intel_fbdev *ifbdev = to_intel_fbdev(info->par);
> @@ -132,15 +137,12 @@ static int intel_fbdev_mmap(struct fb_info *info, struct vm_area_struct *vma)
>  
>  static const struct fb_ops intelfb_ops = {
>  	.owner = THIS_MODULE,
> +	__FB_DEFAULT_DEFERRED_OPS_RDWR(intel_fbdev),
>  	DRM_FB_HELPER_DEFAULT_OPS,
>  	.fb_set_par = intel_fbdev_set_par,
> -	.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_pan_display = intel_fbdev_pan_display,
>  	.fb_blank = intel_fbdev_blank,
> +	.fb_pan_display = intel_fbdev_pan_display,
> +	__FB_DEFAULT_DEFERRED_OPS_DRAW(intel_fbdev),
>  	.fb_mmap = intel_fbdev_mmap,
>  };
>  
> diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
> index b50fd0c0b713..4863b0f8299e 100644
> --- a/include/drm/drm_fb_helper.h
> +++ b/include/drm/drm_fb_helper.h
> @@ -258,18 +258,6 @@ void drm_fb_helper_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u3
>  
>  void 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);
> @@ -385,33 +373,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)
>  {
> -- 
> 2.40.1

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

* Re: [PATCH v4 13/13] drm/i915: Implement dedicated fbdev I/O helpers
@ 2023-05-29 19:36     ` Sam Ravnborg
  0 siblings, 0 replies; 134+ messages in thread
From: Sam Ravnborg @ 2023-05-29 19:36 UTC (permalink / raw)
  To: Thomas Zimmermann
  Cc: daniel, airlied, maarten.lankhorst, mripard, javierm, dri-devel,
	linux-arm-kernel, linux-samsung-soc, intel-gfx, linux-arm-msm,
	freedreno, amd-gfx, linux-tegra, Jani Nikula, Joonas Lahtinen,
	Rodrigo Vivi, Tvrtko Ursulin, Ville Syrjälä

Hi Thomas,

On Wed, May 24, 2023 at 11:21:50AM +0200, Thomas Zimmermann wrote:
> Implement dedicated fbdev helpers for framebuffer I/O instead
> of using DRM's helpers. Use an fbdev generator macro for
> deferred I/O to create the fbdev callbacks. i915 was the only
> caller of the DRM helpers, so remove them from the helper module.
> 
> i915's fbdev emulation is still incomplete as it doesn't implement
> deferred I/O and damage handling for mmaped pages.
> 
> v4:
> 	* generate deferred-I/O helpers
> 	* use initializer macros for fb_ops
> v2:
> 	* use FB_IO_HELPERS options
> 
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
> Cc: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
> ---
>  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 |  14 +--
>  include/drm/drm_fb_helper.h                |  39 --------
>  5 files changed, 9 insertions(+), 155 deletions(-)
> 
> diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
> index 92a782827b7b..bb2e48cc6cd6 100644
> --- a/drivers/gpu/drm/Kconfig
> +++ b/drivers/gpu/drm/Kconfig
> @@ -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
> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> index bab6b252f02a..9978147bbc8a 100644
> --- a/drivers/gpu/drm/drm_fb_helper.c
> +++ b/drivers/gpu/drm/drm_fb_helper.c
> @@ -736,113 +736,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_cfb_read - Implements struct &fb_ops.fb_read for I/O 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_cfb_read(struct fb_info *info, char __user *buf,
> -			       size_t count, loff_t *ppos)
> -{
> -	return fb_io_read(info, buf, count, ppos);
> -}
> -EXPORT_SYMBOL(drm_fb_helper_cfb_read);
> -
> -/**
> - * drm_fb_helper_cfb_write - Implements struct &fb_ops.fb_write for I/O 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_cfb_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_io_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));
> -	}

The generated helpers do not have the if (helper->funcs->fb_dirty)
check.
Is this implemented somewhere else that I missed?

	Sam


> -
> -	return ret;
> -}
> -EXPORT_SYMBOL(drm_fb_helper_cfb_write);
> -
> -/**
> - * drm_fb_helper_cfb_fillrect - wrapper around cfb_fillrect
> - * @info: fbdev registered by the helper
> - * @rect: info about rectangle to fill
> - *
> - * A wrapper around cfb_fillrect implemented by fbdev core
> - */
> -void drm_fb_helper_cfb_fillrect(struct fb_info *info,
> -				const struct fb_fillrect *rect)
> -{
> -	struct drm_fb_helper *helper = info->par;
> -
> -	cfb_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_cfb_fillrect);
> -
> -/**
> - * drm_fb_helper_cfb_copyarea - wrapper around cfb_copyarea
> - * @info: fbdev registered by the helper
> - * @area: info about area to copy
> - *
> - * A wrapper around cfb_copyarea implemented by fbdev core
> - */
> -void drm_fb_helper_cfb_copyarea(struct fb_info *info,
> -				const struct fb_copyarea *area)
> -{
> -	struct drm_fb_helper *helper = info->par;
> -
> -	cfb_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_cfb_copyarea);
> -
> -/**
> - * drm_fb_helper_cfb_imageblit - wrapper around cfb_imageblit
> - * @info: fbdev registered by the helper
> - * @image: info about image to blit
> - *
> - * A wrapper around cfb_imageblit implemented by fbdev core
> - */
> -void drm_fb_helper_cfb_imageblit(struct fb_info *info,
> -				 const struct fb_image *image)
> -{
> -	struct drm_fb_helper *helper = info->par;
> -
> -	cfb_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_cfb_imageblit);
> -
>  /**
>   * drm_fb_helper_set_suspend - wrapper around fb_set_suspend
>   * @fb_helper: driver-allocated fbdev helper, can be NULL
> diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig
> index e4f4d2e3fdfe..01b5a8272a27 100644
> --- a/drivers/gpu/drm/i915/Kconfig
> +++ b/drivers/gpu/drm/i915/Kconfig
> @@ -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
> diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
> index aab1ae74a8f7..eccaceaf8b9d 100644
> --- a/drivers/gpu/drm/i915/display/intel_fbdev.c
> +++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
> @@ -28,6 +28,7 @@
>  #include <linux/console.h>
>  #include <linux/delay.h>
>  #include <linux/errno.h>
> +#include <linux/fb.h>
>  #include <linux/init.h>
>  #include <linux/kernel.h>
>  #include <linux/mm.h>
> @@ -84,6 +85,10 @@ static void intel_fbdev_invalidate(struct intel_fbdev *ifbdev)
>  	intel_frontbuffer_invalidate(to_frontbuffer(ifbdev), ORIGIN_CPU);
>  }
>  
> +FB_GEN_DEFAULT_DEFERRED_IO_OPS(intel_fbdev,
> +			       drm_fb_helper_damage_range,
> +			       drm_fb_helper_damage_area)
> +
>  static int intel_fbdev_set_par(struct fb_info *info)
>  {
>  	struct intel_fbdev *ifbdev = to_intel_fbdev(info->par);
> @@ -132,15 +137,12 @@ static int intel_fbdev_mmap(struct fb_info *info, struct vm_area_struct *vma)
>  
>  static const struct fb_ops intelfb_ops = {
>  	.owner = THIS_MODULE,
> +	__FB_DEFAULT_DEFERRED_OPS_RDWR(intel_fbdev),
>  	DRM_FB_HELPER_DEFAULT_OPS,
>  	.fb_set_par = intel_fbdev_set_par,
> -	.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_pan_display = intel_fbdev_pan_display,
>  	.fb_blank = intel_fbdev_blank,
> +	.fb_pan_display = intel_fbdev_pan_display,
> +	__FB_DEFAULT_DEFERRED_OPS_DRAW(intel_fbdev),
>  	.fb_mmap = intel_fbdev_mmap,
>  };
>  
> diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
> index b50fd0c0b713..4863b0f8299e 100644
> --- a/include/drm/drm_fb_helper.h
> +++ b/include/drm/drm_fb_helper.h
> @@ -258,18 +258,6 @@ void drm_fb_helper_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u3
>  
>  void 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);
> @@ -385,33 +373,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)
>  {
> -- 
> 2.40.1

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

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

* Re: [PATCH v4 13/13] drm/i915: Implement dedicated fbdev I/O helpers
@ 2023-05-29 19:36     ` Sam Ravnborg
  0 siblings, 0 replies; 134+ messages in thread
From: Sam Ravnborg @ 2023-05-29 19:36 UTC (permalink / raw)
  To: Thomas Zimmermann
  Cc: freedreno, linux-samsung-soc, Tvrtko Ursulin, amd-gfx,
	linux-arm-msm, intel-gfx, javierm, dri-devel, Rodrigo Vivi,
	linux-tegra, linux-arm-kernel

Hi Thomas,

On Wed, May 24, 2023 at 11:21:50AM +0200, Thomas Zimmermann wrote:
> Implement dedicated fbdev helpers for framebuffer I/O instead
> of using DRM's helpers. Use an fbdev generator macro for
> deferred I/O to create the fbdev callbacks. i915 was the only
> caller of the DRM helpers, so remove them from the helper module.
> 
> i915's fbdev emulation is still incomplete as it doesn't implement
> deferred I/O and damage handling for mmaped pages.
> 
> v4:
> 	* generate deferred-I/O helpers
> 	* use initializer macros for fb_ops
> v2:
> 	* use FB_IO_HELPERS options
> 
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
> Cc: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
> ---
>  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 |  14 +--
>  include/drm/drm_fb_helper.h                |  39 --------
>  5 files changed, 9 insertions(+), 155 deletions(-)
> 
> diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
> index 92a782827b7b..bb2e48cc6cd6 100644
> --- a/drivers/gpu/drm/Kconfig
> +++ b/drivers/gpu/drm/Kconfig
> @@ -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
> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> index bab6b252f02a..9978147bbc8a 100644
> --- a/drivers/gpu/drm/drm_fb_helper.c
> +++ b/drivers/gpu/drm/drm_fb_helper.c
> @@ -736,113 +736,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_cfb_read - Implements struct &fb_ops.fb_read for I/O 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_cfb_read(struct fb_info *info, char __user *buf,
> -			       size_t count, loff_t *ppos)
> -{
> -	return fb_io_read(info, buf, count, ppos);
> -}
> -EXPORT_SYMBOL(drm_fb_helper_cfb_read);
> -
> -/**
> - * drm_fb_helper_cfb_write - Implements struct &fb_ops.fb_write for I/O 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_cfb_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_io_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));
> -	}

The generated helpers do not have the if (helper->funcs->fb_dirty)
check.
Is this implemented somewhere else that I missed?

	Sam


> -
> -	return ret;
> -}
> -EXPORT_SYMBOL(drm_fb_helper_cfb_write);
> -
> -/**
> - * drm_fb_helper_cfb_fillrect - wrapper around cfb_fillrect
> - * @info: fbdev registered by the helper
> - * @rect: info about rectangle to fill
> - *
> - * A wrapper around cfb_fillrect implemented by fbdev core
> - */
> -void drm_fb_helper_cfb_fillrect(struct fb_info *info,
> -				const struct fb_fillrect *rect)
> -{
> -	struct drm_fb_helper *helper = info->par;
> -
> -	cfb_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_cfb_fillrect);
> -
> -/**
> - * drm_fb_helper_cfb_copyarea - wrapper around cfb_copyarea
> - * @info: fbdev registered by the helper
> - * @area: info about area to copy
> - *
> - * A wrapper around cfb_copyarea implemented by fbdev core
> - */
> -void drm_fb_helper_cfb_copyarea(struct fb_info *info,
> -				const struct fb_copyarea *area)
> -{
> -	struct drm_fb_helper *helper = info->par;
> -
> -	cfb_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_cfb_copyarea);
> -
> -/**
> - * drm_fb_helper_cfb_imageblit - wrapper around cfb_imageblit
> - * @info: fbdev registered by the helper
> - * @image: info about image to blit
> - *
> - * A wrapper around cfb_imageblit implemented by fbdev core
> - */
> -void drm_fb_helper_cfb_imageblit(struct fb_info *info,
> -				 const struct fb_image *image)
> -{
> -	struct drm_fb_helper *helper = info->par;
> -
> -	cfb_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_cfb_imageblit);
> -
>  /**
>   * drm_fb_helper_set_suspend - wrapper around fb_set_suspend
>   * @fb_helper: driver-allocated fbdev helper, can be NULL
> diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig
> index e4f4d2e3fdfe..01b5a8272a27 100644
> --- a/drivers/gpu/drm/i915/Kconfig
> +++ b/drivers/gpu/drm/i915/Kconfig
> @@ -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
> diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
> index aab1ae74a8f7..eccaceaf8b9d 100644
> --- a/drivers/gpu/drm/i915/display/intel_fbdev.c
> +++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
> @@ -28,6 +28,7 @@
>  #include <linux/console.h>
>  #include <linux/delay.h>
>  #include <linux/errno.h>
> +#include <linux/fb.h>
>  #include <linux/init.h>
>  #include <linux/kernel.h>
>  #include <linux/mm.h>
> @@ -84,6 +85,10 @@ static void intel_fbdev_invalidate(struct intel_fbdev *ifbdev)
>  	intel_frontbuffer_invalidate(to_frontbuffer(ifbdev), ORIGIN_CPU);
>  }
>  
> +FB_GEN_DEFAULT_DEFERRED_IO_OPS(intel_fbdev,
> +			       drm_fb_helper_damage_range,
> +			       drm_fb_helper_damage_area)
> +
>  static int intel_fbdev_set_par(struct fb_info *info)
>  {
>  	struct intel_fbdev *ifbdev = to_intel_fbdev(info->par);
> @@ -132,15 +137,12 @@ static int intel_fbdev_mmap(struct fb_info *info, struct vm_area_struct *vma)
>  
>  static const struct fb_ops intelfb_ops = {
>  	.owner = THIS_MODULE,
> +	__FB_DEFAULT_DEFERRED_OPS_RDWR(intel_fbdev),
>  	DRM_FB_HELPER_DEFAULT_OPS,
>  	.fb_set_par = intel_fbdev_set_par,
> -	.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_pan_display = intel_fbdev_pan_display,
>  	.fb_blank = intel_fbdev_blank,
> +	.fb_pan_display = intel_fbdev_pan_display,
> +	__FB_DEFAULT_DEFERRED_OPS_DRAW(intel_fbdev),
>  	.fb_mmap = intel_fbdev_mmap,
>  };
>  
> diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
> index b50fd0c0b713..4863b0f8299e 100644
> --- a/include/drm/drm_fb_helper.h
> +++ b/include/drm/drm_fb_helper.h
> @@ -258,18 +258,6 @@ void drm_fb_helper_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u3
>  
>  void 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);
> @@ -385,33 +373,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)
>  {
> -- 
> 2.40.1

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

* Re: [Intel-gfx] [PATCH v4 13/13] drm/i915: Implement dedicated fbdev I/O helpers
@ 2023-05-29 19:36     ` Sam Ravnborg
  0 siblings, 0 replies; 134+ messages in thread
From: Sam Ravnborg @ 2023-05-29 19:36 UTC (permalink / raw)
  To: Thomas Zimmermann
  Cc: freedreno, linux-samsung-soc, amd-gfx, linux-arm-msm, intel-gfx,
	javierm, dri-devel, mripard, daniel, Rodrigo Vivi, linux-tegra,
	airlied, linux-arm-kernel

Hi Thomas,

On Wed, May 24, 2023 at 11:21:50AM +0200, Thomas Zimmermann wrote:
> Implement dedicated fbdev helpers for framebuffer I/O instead
> of using DRM's helpers. Use an fbdev generator macro for
> deferred I/O to create the fbdev callbacks. i915 was the only
> caller of the DRM helpers, so remove them from the helper module.
> 
> i915's fbdev emulation is still incomplete as it doesn't implement
> deferred I/O and damage handling for mmaped pages.
> 
> v4:
> 	* generate deferred-I/O helpers
> 	* use initializer macros for fb_ops
> v2:
> 	* use FB_IO_HELPERS options
> 
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
> Cc: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
> ---
>  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 |  14 +--
>  include/drm/drm_fb_helper.h                |  39 --------
>  5 files changed, 9 insertions(+), 155 deletions(-)
> 
> diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
> index 92a782827b7b..bb2e48cc6cd6 100644
> --- a/drivers/gpu/drm/Kconfig
> +++ b/drivers/gpu/drm/Kconfig
> @@ -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
> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> index bab6b252f02a..9978147bbc8a 100644
> --- a/drivers/gpu/drm/drm_fb_helper.c
> +++ b/drivers/gpu/drm/drm_fb_helper.c
> @@ -736,113 +736,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_cfb_read - Implements struct &fb_ops.fb_read for I/O 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_cfb_read(struct fb_info *info, char __user *buf,
> -			       size_t count, loff_t *ppos)
> -{
> -	return fb_io_read(info, buf, count, ppos);
> -}
> -EXPORT_SYMBOL(drm_fb_helper_cfb_read);
> -
> -/**
> - * drm_fb_helper_cfb_write - Implements struct &fb_ops.fb_write for I/O 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_cfb_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_io_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));
> -	}

The generated helpers do not have the if (helper->funcs->fb_dirty)
check.
Is this implemented somewhere else that I missed?

	Sam


> -
> -	return ret;
> -}
> -EXPORT_SYMBOL(drm_fb_helper_cfb_write);
> -
> -/**
> - * drm_fb_helper_cfb_fillrect - wrapper around cfb_fillrect
> - * @info: fbdev registered by the helper
> - * @rect: info about rectangle to fill
> - *
> - * A wrapper around cfb_fillrect implemented by fbdev core
> - */
> -void drm_fb_helper_cfb_fillrect(struct fb_info *info,
> -				const struct fb_fillrect *rect)
> -{
> -	struct drm_fb_helper *helper = info->par;
> -
> -	cfb_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_cfb_fillrect);
> -
> -/**
> - * drm_fb_helper_cfb_copyarea - wrapper around cfb_copyarea
> - * @info: fbdev registered by the helper
> - * @area: info about area to copy
> - *
> - * A wrapper around cfb_copyarea implemented by fbdev core
> - */
> -void drm_fb_helper_cfb_copyarea(struct fb_info *info,
> -				const struct fb_copyarea *area)
> -{
> -	struct drm_fb_helper *helper = info->par;
> -
> -	cfb_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_cfb_copyarea);
> -
> -/**
> - * drm_fb_helper_cfb_imageblit - wrapper around cfb_imageblit
> - * @info: fbdev registered by the helper
> - * @image: info about image to blit
> - *
> - * A wrapper around cfb_imageblit implemented by fbdev core
> - */
> -void drm_fb_helper_cfb_imageblit(struct fb_info *info,
> -				 const struct fb_image *image)
> -{
> -	struct drm_fb_helper *helper = info->par;
> -
> -	cfb_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_cfb_imageblit);
> -
>  /**
>   * drm_fb_helper_set_suspend - wrapper around fb_set_suspend
>   * @fb_helper: driver-allocated fbdev helper, can be NULL
> diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig
> index e4f4d2e3fdfe..01b5a8272a27 100644
> --- a/drivers/gpu/drm/i915/Kconfig
> +++ b/drivers/gpu/drm/i915/Kconfig
> @@ -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
> diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
> index aab1ae74a8f7..eccaceaf8b9d 100644
> --- a/drivers/gpu/drm/i915/display/intel_fbdev.c
> +++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
> @@ -28,6 +28,7 @@
>  #include <linux/console.h>
>  #include <linux/delay.h>
>  #include <linux/errno.h>
> +#include <linux/fb.h>
>  #include <linux/init.h>
>  #include <linux/kernel.h>
>  #include <linux/mm.h>
> @@ -84,6 +85,10 @@ static void intel_fbdev_invalidate(struct intel_fbdev *ifbdev)
>  	intel_frontbuffer_invalidate(to_frontbuffer(ifbdev), ORIGIN_CPU);
>  }
>  
> +FB_GEN_DEFAULT_DEFERRED_IO_OPS(intel_fbdev,
> +			       drm_fb_helper_damage_range,
> +			       drm_fb_helper_damage_area)
> +
>  static int intel_fbdev_set_par(struct fb_info *info)
>  {
>  	struct intel_fbdev *ifbdev = to_intel_fbdev(info->par);
> @@ -132,15 +137,12 @@ static int intel_fbdev_mmap(struct fb_info *info, struct vm_area_struct *vma)
>  
>  static const struct fb_ops intelfb_ops = {
>  	.owner = THIS_MODULE,
> +	__FB_DEFAULT_DEFERRED_OPS_RDWR(intel_fbdev),
>  	DRM_FB_HELPER_DEFAULT_OPS,
>  	.fb_set_par = intel_fbdev_set_par,
> -	.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_pan_display = intel_fbdev_pan_display,
>  	.fb_blank = intel_fbdev_blank,
> +	.fb_pan_display = intel_fbdev_pan_display,
> +	__FB_DEFAULT_DEFERRED_OPS_DRAW(intel_fbdev),
>  	.fb_mmap = intel_fbdev_mmap,
>  };
>  
> diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
> index b50fd0c0b713..4863b0f8299e 100644
> --- a/include/drm/drm_fb_helper.h
> +++ b/include/drm/drm_fb_helper.h
> @@ -258,18 +258,6 @@ void drm_fb_helper_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u3
>  
>  void 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);
> @@ -385,33 +373,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)
>  {
> -- 
> 2.40.1

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

* Re: [PATCH v4 13/13] drm/i915: Implement dedicated fbdev I/O helpers
@ 2023-05-29 19:36     ` Sam Ravnborg
  0 siblings, 0 replies; 134+ messages in thread
From: Sam Ravnborg @ 2023-05-29 19:36 UTC (permalink / raw)
  To: Thomas Zimmermann
  Cc: Jani Nikula, freedreno, linux-samsung-soc, Tvrtko Ursulin,
	amd-gfx, linux-arm-msm, intel-gfx, Joonas Lahtinen,
	maarten.lankhorst, javierm, dri-devel, Ville Syrjälä,
	mripard, daniel, Rodrigo Vivi, linux-tegra, airlied,
	linux-arm-kernel

Hi Thomas,

On Wed, May 24, 2023 at 11:21:50AM +0200, Thomas Zimmermann wrote:
> Implement dedicated fbdev helpers for framebuffer I/O instead
> of using DRM's helpers. Use an fbdev generator macro for
> deferred I/O to create the fbdev callbacks. i915 was the only
> caller of the DRM helpers, so remove them from the helper module.
> 
> i915's fbdev emulation is still incomplete as it doesn't implement
> deferred I/O and damage handling for mmaped pages.
> 
> v4:
> 	* generate deferred-I/O helpers
> 	* use initializer macros for fb_ops
> v2:
> 	* use FB_IO_HELPERS options
> 
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
> Cc: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
> ---
>  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 |  14 +--
>  include/drm/drm_fb_helper.h                |  39 --------
>  5 files changed, 9 insertions(+), 155 deletions(-)
> 
> diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
> index 92a782827b7b..bb2e48cc6cd6 100644
> --- a/drivers/gpu/drm/Kconfig
> +++ b/drivers/gpu/drm/Kconfig
> @@ -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
> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> index bab6b252f02a..9978147bbc8a 100644
> --- a/drivers/gpu/drm/drm_fb_helper.c
> +++ b/drivers/gpu/drm/drm_fb_helper.c
> @@ -736,113 +736,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_cfb_read - Implements struct &fb_ops.fb_read for I/O 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_cfb_read(struct fb_info *info, char __user *buf,
> -			       size_t count, loff_t *ppos)
> -{
> -	return fb_io_read(info, buf, count, ppos);
> -}
> -EXPORT_SYMBOL(drm_fb_helper_cfb_read);
> -
> -/**
> - * drm_fb_helper_cfb_write - Implements struct &fb_ops.fb_write for I/O 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_cfb_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_io_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));
> -	}

The generated helpers do not have the if (helper->funcs->fb_dirty)
check.
Is this implemented somewhere else that I missed?

	Sam


> -
> -	return ret;
> -}
> -EXPORT_SYMBOL(drm_fb_helper_cfb_write);
> -
> -/**
> - * drm_fb_helper_cfb_fillrect - wrapper around cfb_fillrect
> - * @info: fbdev registered by the helper
> - * @rect: info about rectangle to fill
> - *
> - * A wrapper around cfb_fillrect implemented by fbdev core
> - */
> -void drm_fb_helper_cfb_fillrect(struct fb_info *info,
> -				const struct fb_fillrect *rect)
> -{
> -	struct drm_fb_helper *helper = info->par;
> -
> -	cfb_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_cfb_fillrect);
> -
> -/**
> - * drm_fb_helper_cfb_copyarea - wrapper around cfb_copyarea
> - * @info: fbdev registered by the helper
> - * @area: info about area to copy
> - *
> - * A wrapper around cfb_copyarea implemented by fbdev core
> - */
> -void drm_fb_helper_cfb_copyarea(struct fb_info *info,
> -				const struct fb_copyarea *area)
> -{
> -	struct drm_fb_helper *helper = info->par;
> -
> -	cfb_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_cfb_copyarea);
> -
> -/**
> - * drm_fb_helper_cfb_imageblit - wrapper around cfb_imageblit
> - * @info: fbdev registered by the helper
> - * @image: info about image to blit
> - *
> - * A wrapper around cfb_imageblit implemented by fbdev core
> - */
> -void drm_fb_helper_cfb_imageblit(struct fb_info *info,
> -				 const struct fb_image *image)
> -{
> -	struct drm_fb_helper *helper = info->par;
> -
> -	cfb_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_cfb_imageblit);
> -
>  /**
>   * drm_fb_helper_set_suspend - wrapper around fb_set_suspend
>   * @fb_helper: driver-allocated fbdev helper, can be NULL
> diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig
> index e4f4d2e3fdfe..01b5a8272a27 100644
> --- a/drivers/gpu/drm/i915/Kconfig
> +++ b/drivers/gpu/drm/i915/Kconfig
> @@ -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
> diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
> index aab1ae74a8f7..eccaceaf8b9d 100644
> --- a/drivers/gpu/drm/i915/display/intel_fbdev.c
> +++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
> @@ -28,6 +28,7 @@
>  #include <linux/console.h>
>  #include <linux/delay.h>
>  #include <linux/errno.h>
> +#include <linux/fb.h>
>  #include <linux/init.h>
>  #include <linux/kernel.h>
>  #include <linux/mm.h>
> @@ -84,6 +85,10 @@ static void intel_fbdev_invalidate(struct intel_fbdev *ifbdev)
>  	intel_frontbuffer_invalidate(to_frontbuffer(ifbdev), ORIGIN_CPU);
>  }
>  
> +FB_GEN_DEFAULT_DEFERRED_IO_OPS(intel_fbdev,
> +			       drm_fb_helper_damage_range,
> +			       drm_fb_helper_damage_area)
> +
>  static int intel_fbdev_set_par(struct fb_info *info)
>  {
>  	struct intel_fbdev *ifbdev = to_intel_fbdev(info->par);
> @@ -132,15 +137,12 @@ static int intel_fbdev_mmap(struct fb_info *info, struct vm_area_struct *vma)
>  
>  static const struct fb_ops intelfb_ops = {
>  	.owner = THIS_MODULE,
> +	__FB_DEFAULT_DEFERRED_OPS_RDWR(intel_fbdev),
>  	DRM_FB_HELPER_DEFAULT_OPS,
>  	.fb_set_par = intel_fbdev_set_par,
> -	.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_pan_display = intel_fbdev_pan_display,
>  	.fb_blank = intel_fbdev_blank,
> +	.fb_pan_display = intel_fbdev_pan_display,
> +	__FB_DEFAULT_DEFERRED_OPS_DRAW(intel_fbdev),
>  	.fb_mmap = intel_fbdev_mmap,
>  };
>  
> diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
> index b50fd0c0b713..4863b0f8299e 100644
> --- a/include/drm/drm_fb_helper.h
> +++ b/include/drm/drm_fb_helper.h
> @@ -258,18 +258,6 @@ void drm_fb_helper_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u3
>  
>  void 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);
> @@ -385,33 +373,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)
>  {
> -- 
> 2.40.1

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

* Re: [PATCH v4 00/13] drm/fbdev: Remove DRM's helpers for fbdev I/O
  2023-05-24  9:21 ` [Intel-gfx] " Thomas Zimmermann
                     ` (2 preceding siblings ...)
  (?)
@ 2023-05-29 19:37   ` Sam Ravnborg
  -1 siblings, 0 replies; 134+ messages in thread
From: Sam Ravnborg @ 2023-05-29 19:37 UTC (permalink / raw)
  To: Thomas Zimmermann
  Cc: daniel, airlied, maarten.lankhorst, mripard, javierm, dri-devel,
	linux-arm-kernel, linux-samsung-soc, intel-gfx, linux-arm-msm,
	freedreno, amd-gfx, linux-tegra

Hi Thomas.

> v4:
> 	* use initializer and generator macros for struct fb_ops
> 	* partially support damage handling in msm (Dmitri)

I like the macros. They make it simpler and we do not spread the _cfb_
misname to more files.


> v3:
> 	* fix Kconfig options (Jingfeng)
> 	* minimize changes to exynos (Sam)
> v2:
> 	* simplify Kconfig handling (Sam)
> 
> Thomas Zimmermann (13):
>   fbdev: Add Kconfig options to select different fb_ops helpers
>   fbdev: Add initializer macros for struct fb_ops


>   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
These are all:
Acked-by: Sam Ravnborg <sam@ravnborg.org>

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

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

* Re: [PATCH v4 00/13] drm/fbdev: Remove DRM's helpers for fbdev I/O
@ 2023-05-29 19:37   ` Sam Ravnborg
  0 siblings, 0 replies; 134+ messages in thread
From: Sam Ravnborg @ 2023-05-29 19:37 UTC (permalink / raw)
  To: Thomas Zimmermann
  Cc: daniel, airlied, maarten.lankhorst, mripard, javierm, dri-devel,
	linux-arm-kernel, linux-samsung-soc, intel-gfx, linux-arm-msm,
	freedreno, amd-gfx, linux-tegra

Hi Thomas.

> v4:
> 	* use initializer and generator macros for struct fb_ops
> 	* partially support damage handling in msm (Dmitri)

I like the macros. They make it simpler and we do not spread the _cfb_
misname to more files.


> v3:
> 	* fix Kconfig options (Jingfeng)
> 	* minimize changes to exynos (Sam)
> v2:
> 	* simplify Kconfig handling (Sam)
> 
> Thomas Zimmermann (13):
>   fbdev: Add Kconfig options to select different fb_ops helpers
>   fbdev: Add initializer macros for struct fb_ops


>   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
These are all:
Acked-by: Sam Ravnborg <sam@ravnborg.org>

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

* Re: [PATCH v4 00/13] drm/fbdev: Remove DRM's helpers for fbdev I/O
@ 2023-05-29 19:37   ` Sam Ravnborg
  0 siblings, 0 replies; 134+ messages in thread
From: Sam Ravnborg @ 2023-05-29 19:37 UTC (permalink / raw)
  To: Thomas Zimmermann
  Cc: freedreno, linux-samsung-soc, amd-gfx, linux-arm-msm, intel-gfx,
	javierm, dri-devel, linux-tegra, linux-arm-kernel

Hi Thomas.

> v4:
> 	* use initializer and generator macros for struct fb_ops
> 	* partially support damage handling in msm (Dmitri)

I like the macros. They make it simpler and we do not spread the _cfb_
misname to more files.


> v3:
> 	* fix Kconfig options (Jingfeng)
> 	* minimize changes to exynos (Sam)
> v2:
> 	* simplify Kconfig handling (Sam)
> 
> Thomas Zimmermann (13):
>   fbdev: Add Kconfig options to select different fb_ops helpers
>   fbdev: Add initializer macros for struct fb_ops


>   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
These are all:
Acked-by: Sam Ravnborg <sam@ravnborg.org>

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

* Re: [Intel-gfx] [PATCH v4 00/13] drm/fbdev: Remove DRM's helpers for fbdev I/O
@ 2023-05-29 19:37   ` Sam Ravnborg
  0 siblings, 0 replies; 134+ messages in thread
From: Sam Ravnborg @ 2023-05-29 19:37 UTC (permalink / raw)
  To: Thomas Zimmermann
  Cc: freedreno, linux-samsung-soc, amd-gfx, linux-arm-msm, intel-gfx,
	javierm, dri-devel, mripard, daniel, linux-tegra, airlied,
	linux-arm-kernel

Hi Thomas.

> v4:
> 	* use initializer and generator macros for struct fb_ops
> 	* partially support damage handling in msm (Dmitri)

I like the macros. They make it simpler and we do not spread the _cfb_
misname to more files.


> v3:
> 	* fix Kconfig options (Jingfeng)
> 	* minimize changes to exynos (Sam)
> v2:
> 	* simplify Kconfig handling (Sam)
> 
> Thomas Zimmermann (13):
>   fbdev: Add Kconfig options to select different fb_ops helpers
>   fbdev: Add initializer macros for struct fb_ops


>   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
These are all:
Acked-by: Sam Ravnborg <sam@ravnborg.org>

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

* Re: [PATCH v4 00/13] drm/fbdev: Remove DRM's helpers for fbdev I/O
@ 2023-05-29 19:37   ` Sam Ravnborg
  0 siblings, 0 replies; 134+ messages in thread
From: Sam Ravnborg @ 2023-05-29 19:37 UTC (permalink / raw)
  To: Thomas Zimmermann
  Cc: freedreno, linux-samsung-soc, amd-gfx, linux-arm-msm, intel-gfx,
	maarten.lankhorst, javierm, dri-devel, mripard, daniel,
	linux-tegra, airlied, linux-arm-kernel

Hi Thomas.

> v4:
> 	* use initializer and generator macros for struct fb_ops
> 	* partially support damage handling in msm (Dmitri)

I like the macros. They make it simpler and we do not spread the _cfb_
misname to more files.


> v3:
> 	* fix Kconfig options (Jingfeng)
> 	* minimize changes to exynos (Sam)
> v2:
> 	* simplify Kconfig handling (Sam)
> 
> Thomas Zimmermann (13):
>   fbdev: Add Kconfig options to select different fb_ops helpers
>   fbdev: Add initializer macros for struct fb_ops


>   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
These are all:
Acked-by: Sam Ravnborg <sam@ravnborg.org>

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

* Re: [PATCH v4 11/13] drm/fb-helper: Export helpers for marking damage areas
  2023-05-24  9:21   ` Thomas Zimmermann
                       ` (2 preceding siblings ...)
  (?)
@ 2023-05-29 19:38     ` Sam Ravnborg
  -1 siblings, 0 replies; 134+ messages in thread
From: Sam Ravnborg @ 2023-05-29 19:38 UTC (permalink / raw)
  To: Thomas Zimmermann
  Cc: daniel, airlied, maarten.lankhorst, mripard, javierm, dri-devel,
	linux-arm-kernel, linux-samsung-soc, intel-gfx, linux-arm-msm,
	freedreno, amd-gfx, linux-tegra

On Wed, May 24, 2023 at 11:21:48AM +0200, Thomas Zimmermann wrote:
> Export 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.
> 
> v4:
> 	* update interfaces
> 
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>

Assuming there is a good answer why there is no dirty check:
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>

> ---
>  drivers/gpu/drm/drm_fb_helper.c | 22 ++++++++++++++++++++++
>  include/drm/drm_fb_helper.h     |  3 +++
>  2 files changed, 25 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> index f0e9549b6bd7..cb03099fd2e3 100644
> --- a/drivers/gpu/drm/drm_fb_helper.c
> +++ b/drivers/gpu/drm/drm_fb_helper.c
> @@ -670,6 +670,28 @@ 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 fb_info *info, off_t off, size_t len)
> +{
> +	struct drm_fb_helper *fb_helper = info->par;
> +	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);
> +
> +/* Don't use in new code. */
> +void drm_fb_helper_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u32 height)
> +{
> +	struct drm_fb_helper *fb_helper = info->par;
> +
> +	drm_fb_helper_damage(fb_helper, x, y, width, height);
> +}
> +EXPORT_SYMBOL(drm_fb_helper_damage_area);
> +
>  /**
>   * drm_fb_helper_deferred_io() - fbdev deferred_io callback function
>   * @info: fb_info struct pointer
> diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
> index 72032c354a30..7d5804882be7 100644
> --- a/include/drm/drm_fb_helper.h
> +++ b/include/drm/drm_fb_helper.h
> @@ -253,6 +253,9 @@ 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_range(struct fb_info *info, off_t off, size_t len);
> +void drm_fb_helper_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u32 height);
> +
>  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,
> -- 
> 2.40.1

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

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

* Re: [PATCH v4 11/13] drm/fb-helper: Export helpers for marking damage areas
@ 2023-05-29 19:38     ` Sam Ravnborg
  0 siblings, 0 replies; 134+ messages in thread
From: Sam Ravnborg @ 2023-05-29 19:38 UTC (permalink / raw)
  To: Thomas Zimmermann
  Cc: daniel, airlied, maarten.lankhorst, mripard, javierm, dri-devel,
	linux-arm-kernel, linux-samsung-soc, intel-gfx, linux-arm-msm,
	freedreno, amd-gfx, linux-tegra

On Wed, May 24, 2023 at 11:21:48AM +0200, Thomas Zimmermann wrote:
> Export 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.
> 
> v4:
> 	* update interfaces
> 
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>

Assuming there is a good answer why there is no dirty check:
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>

> ---
>  drivers/gpu/drm/drm_fb_helper.c | 22 ++++++++++++++++++++++
>  include/drm/drm_fb_helper.h     |  3 +++
>  2 files changed, 25 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> index f0e9549b6bd7..cb03099fd2e3 100644
> --- a/drivers/gpu/drm/drm_fb_helper.c
> +++ b/drivers/gpu/drm/drm_fb_helper.c
> @@ -670,6 +670,28 @@ 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 fb_info *info, off_t off, size_t len)
> +{
> +	struct drm_fb_helper *fb_helper = info->par;
> +	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);
> +
> +/* Don't use in new code. */
> +void drm_fb_helper_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u32 height)
> +{
> +	struct drm_fb_helper *fb_helper = info->par;
> +
> +	drm_fb_helper_damage(fb_helper, x, y, width, height);
> +}
> +EXPORT_SYMBOL(drm_fb_helper_damage_area);
> +
>  /**
>   * drm_fb_helper_deferred_io() - fbdev deferred_io callback function
>   * @info: fb_info struct pointer
> diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
> index 72032c354a30..7d5804882be7 100644
> --- a/include/drm/drm_fb_helper.h
> +++ b/include/drm/drm_fb_helper.h
> @@ -253,6 +253,9 @@ 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_range(struct fb_info *info, off_t off, size_t len);
> +void drm_fb_helper_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u32 height);
> +
>  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,
> -- 
> 2.40.1

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

* Re: [PATCH v4 11/13] drm/fb-helper: Export helpers for marking damage areas
@ 2023-05-29 19:38     ` Sam Ravnborg
  0 siblings, 0 replies; 134+ messages in thread
From: Sam Ravnborg @ 2023-05-29 19:38 UTC (permalink / raw)
  To: Thomas Zimmermann
  Cc: freedreno, linux-samsung-soc, amd-gfx, linux-arm-msm, intel-gfx,
	javierm, dri-devel, linux-tegra, linux-arm-kernel

On Wed, May 24, 2023 at 11:21:48AM +0200, Thomas Zimmermann wrote:
> Export 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.
> 
> v4:
> 	* update interfaces
> 
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>

Assuming there is a good answer why there is no dirty check:
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>

> ---
>  drivers/gpu/drm/drm_fb_helper.c | 22 ++++++++++++++++++++++
>  include/drm/drm_fb_helper.h     |  3 +++
>  2 files changed, 25 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> index f0e9549b6bd7..cb03099fd2e3 100644
> --- a/drivers/gpu/drm/drm_fb_helper.c
> +++ b/drivers/gpu/drm/drm_fb_helper.c
> @@ -670,6 +670,28 @@ 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 fb_info *info, off_t off, size_t len)
> +{
> +	struct drm_fb_helper *fb_helper = info->par;
> +	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);
> +
> +/* Don't use in new code. */
> +void drm_fb_helper_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u32 height)
> +{
> +	struct drm_fb_helper *fb_helper = info->par;
> +
> +	drm_fb_helper_damage(fb_helper, x, y, width, height);
> +}
> +EXPORT_SYMBOL(drm_fb_helper_damage_area);
> +
>  /**
>   * drm_fb_helper_deferred_io() - fbdev deferred_io callback function
>   * @info: fb_info struct pointer
> diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
> index 72032c354a30..7d5804882be7 100644
> --- a/include/drm/drm_fb_helper.h
> +++ b/include/drm/drm_fb_helper.h
> @@ -253,6 +253,9 @@ 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_range(struct fb_info *info, off_t off, size_t len);
> +void drm_fb_helper_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u32 height);
> +
>  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,
> -- 
> 2.40.1

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

* Re: [Intel-gfx] [PATCH v4 11/13] drm/fb-helper: Export helpers for marking damage areas
@ 2023-05-29 19:38     ` Sam Ravnborg
  0 siblings, 0 replies; 134+ messages in thread
From: Sam Ravnborg @ 2023-05-29 19:38 UTC (permalink / raw)
  To: Thomas Zimmermann
  Cc: freedreno, linux-samsung-soc, amd-gfx, linux-arm-msm, intel-gfx,
	javierm, dri-devel, mripard, daniel, linux-tegra, airlied,
	linux-arm-kernel

On Wed, May 24, 2023 at 11:21:48AM +0200, Thomas Zimmermann wrote:
> Export 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.
> 
> v4:
> 	* update interfaces
> 
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>

Assuming there is a good answer why there is no dirty check:
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>

> ---
>  drivers/gpu/drm/drm_fb_helper.c | 22 ++++++++++++++++++++++
>  include/drm/drm_fb_helper.h     |  3 +++
>  2 files changed, 25 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> index f0e9549b6bd7..cb03099fd2e3 100644
> --- a/drivers/gpu/drm/drm_fb_helper.c
> +++ b/drivers/gpu/drm/drm_fb_helper.c
> @@ -670,6 +670,28 @@ 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 fb_info *info, off_t off, size_t len)
> +{
> +	struct drm_fb_helper *fb_helper = info->par;
> +	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);
> +
> +/* Don't use in new code. */
> +void drm_fb_helper_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u32 height)
> +{
> +	struct drm_fb_helper *fb_helper = info->par;
> +
> +	drm_fb_helper_damage(fb_helper, x, y, width, height);
> +}
> +EXPORT_SYMBOL(drm_fb_helper_damage_area);
> +
>  /**
>   * drm_fb_helper_deferred_io() - fbdev deferred_io callback function
>   * @info: fb_info struct pointer
> diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
> index 72032c354a30..7d5804882be7 100644
> --- a/include/drm/drm_fb_helper.h
> +++ b/include/drm/drm_fb_helper.h
> @@ -253,6 +253,9 @@ 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_range(struct fb_info *info, off_t off, size_t len);
> +void drm_fb_helper_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u32 height);
> +
>  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,
> -- 
> 2.40.1

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

* Re: [PATCH v4 11/13] drm/fb-helper: Export helpers for marking damage areas
@ 2023-05-29 19:38     ` Sam Ravnborg
  0 siblings, 0 replies; 134+ messages in thread
From: Sam Ravnborg @ 2023-05-29 19:38 UTC (permalink / raw)
  To: Thomas Zimmermann
  Cc: freedreno, linux-samsung-soc, amd-gfx, linux-arm-msm, intel-gfx,
	maarten.lankhorst, javierm, dri-devel, mripard, daniel,
	linux-tegra, airlied, linux-arm-kernel

On Wed, May 24, 2023 at 11:21:48AM +0200, Thomas Zimmermann wrote:
> Export 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.
> 
> v4:
> 	* update interfaces
> 
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>

Assuming there is a good answer why there is no dirty check:
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>

> ---
>  drivers/gpu/drm/drm_fb_helper.c | 22 ++++++++++++++++++++++
>  include/drm/drm_fb_helper.h     |  3 +++
>  2 files changed, 25 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> index f0e9549b6bd7..cb03099fd2e3 100644
> --- a/drivers/gpu/drm/drm_fb_helper.c
> +++ b/drivers/gpu/drm/drm_fb_helper.c
> @@ -670,6 +670,28 @@ 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 fb_info *info, off_t off, size_t len)
> +{
> +	struct drm_fb_helper *fb_helper = info->par;
> +	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);
> +
> +/* Don't use in new code. */
> +void drm_fb_helper_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u32 height)
> +{
> +	struct drm_fb_helper *fb_helper = info->par;
> +
> +	drm_fb_helper_damage(fb_helper, x, y, width, height);
> +}
> +EXPORT_SYMBOL(drm_fb_helper_damage_area);
> +
>  /**
>   * drm_fb_helper_deferred_io() - fbdev deferred_io callback function
>   * @info: fb_info struct pointer
> diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
> index 72032c354a30..7d5804882be7 100644
> --- a/include/drm/drm_fb_helper.h
> +++ b/include/drm/drm_fb_helper.h
> @@ -253,6 +253,9 @@ 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_range(struct fb_info *info, off_t off, size_t len);
> +void drm_fb_helper_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u32 height);
> +
>  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,
> -- 
> 2.40.1

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

* Re: [PATCH v4 13/13] drm/i915: Implement dedicated fbdev I/O helpers
  2023-05-24  9:21   ` Thomas Zimmermann
                       ` (2 preceding siblings ...)
  (?)
@ 2023-05-29 19:41     ` Sam Ravnborg
  -1 siblings, 0 replies; 134+ messages in thread
From: Sam Ravnborg @ 2023-05-29 19:41 UTC (permalink / raw)
  To: Thomas Zimmermann
  Cc: daniel, airlied, maarten.lankhorst, mripard, javierm, dri-devel,
	linux-arm-kernel, linux-samsung-soc, intel-gfx, linux-arm-msm,
	freedreno, amd-gfx, linux-tegra, Jani Nikula, Joonas Lahtinen,
	Rodrigo Vivi, Tvrtko Ursulin, Ville Syrjälä

Hi Thomas,

On Wed, May 24, 2023 at 11:21:50AM +0200, Thomas Zimmermann wrote:
> Implement dedicated fbdev helpers for framebuffer I/O instead
> of using DRM's helpers. Use an fbdev generator macro for
> deferred I/O to create the fbdev callbacks. i915 was the only
> caller of the DRM helpers, so remove them from the helper module.
> 
> i915's fbdev emulation is still incomplete as it doesn't implement
> deferred I/O and damage handling for mmaped pages.
> 
> v4:
> 	* generate deferred-I/O helpers
> 	* use initializer macros for fb_ops
> v2:
> 	* use FB_IO_HELPERS options
> 
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
> Cc: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
> ---
>  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 |  14 +--
>  include/drm/drm_fb_helper.h                |  39 --------
>  5 files changed, 9 insertions(+), 155 deletions(-)

Nice diffstat!
Assuming there is a good explanation on the dirty check:
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>

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

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

* Re: [PATCH v4 13/13] drm/i915: Implement dedicated fbdev I/O helpers
@ 2023-05-29 19:41     ` Sam Ravnborg
  0 siblings, 0 replies; 134+ messages in thread
From: Sam Ravnborg @ 2023-05-29 19:41 UTC (permalink / raw)
  To: Thomas Zimmermann
  Cc: freedreno, linux-samsung-soc, Tvrtko Ursulin, amd-gfx,
	linux-arm-msm, intel-gfx, javierm, dri-devel, Rodrigo Vivi,
	linux-tegra, linux-arm-kernel

Hi Thomas,

On Wed, May 24, 2023 at 11:21:50AM +0200, Thomas Zimmermann wrote:
> Implement dedicated fbdev helpers for framebuffer I/O instead
> of using DRM's helpers. Use an fbdev generator macro for
> deferred I/O to create the fbdev callbacks. i915 was the only
> caller of the DRM helpers, so remove them from the helper module.
> 
> i915's fbdev emulation is still incomplete as it doesn't implement
> deferred I/O and damage handling for mmaped pages.
> 
> v4:
> 	* generate deferred-I/O helpers
> 	* use initializer macros for fb_ops
> v2:
> 	* use FB_IO_HELPERS options
> 
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
> Cc: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
> ---
>  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 |  14 +--
>  include/drm/drm_fb_helper.h                |  39 --------
>  5 files changed, 9 insertions(+), 155 deletions(-)

Nice diffstat!
Assuming there is a good explanation on the dirty check:
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>

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

* Re: [Intel-gfx] [PATCH v4 13/13] drm/i915: Implement dedicated fbdev I/O helpers
@ 2023-05-29 19:41     ` Sam Ravnborg
  0 siblings, 0 replies; 134+ messages in thread
From: Sam Ravnborg @ 2023-05-29 19:41 UTC (permalink / raw)
  To: Thomas Zimmermann
  Cc: freedreno, linux-samsung-soc, amd-gfx, linux-arm-msm, intel-gfx,
	javierm, dri-devel, mripard, daniel, Rodrigo Vivi, linux-tegra,
	airlied, linux-arm-kernel

Hi Thomas,

On Wed, May 24, 2023 at 11:21:50AM +0200, Thomas Zimmermann wrote:
> Implement dedicated fbdev helpers for framebuffer I/O instead
> of using DRM's helpers. Use an fbdev generator macro for
> deferred I/O to create the fbdev callbacks. i915 was the only
> caller of the DRM helpers, so remove them from the helper module.
> 
> i915's fbdev emulation is still incomplete as it doesn't implement
> deferred I/O and damage handling for mmaped pages.
> 
> v4:
> 	* generate deferred-I/O helpers
> 	* use initializer macros for fb_ops
> v2:
> 	* use FB_IO_HELPERS options
> 
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
> Cc: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
> ---
>  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 |  14 +--
>  include/drm/drm_fb_helper.h                |  39 --------
>  5 files changed, 9 insertions(+), 155 deletions(-)

Nice diffstat!
Assuming there is a good explanation on the dirty check:
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>

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

* Re: [PATCH v4 13/13] drm/i915: Implement dedicated fbdev I/O helpers
@ 2023-05-29 19:41     ` Sam Ravnborg
  0 siblings, 0 replies; 134+ messages in thread
From: Sam Ravnborg @ 2023-05-29 19:41 UTC (permalink / raw)
  To: Thomas Zimmermann
  Cc: Jani Nikula, freedreno, linux-samsung-soc, Tvrtko Ursulin,
	amd-gfx, linux-arm-msm, intel-gfx, Joonas Lahtinen,
	maarten.lankhorst, javierm, dri-devel, Ville Syrjälä,
	mripard, daniel, Rodrigo Vivi, linux-tegra, airlied,
	linux-arm-kernel

Hi Thomas,

On Wed, May 24, 2023 at 11:21:50AM +0200, Thomas Zimmermann wrote:
> Implement dedicated fbdev helpers for framebuffer I/O instead
> of using DRM's helpers. Use an fbdev generator macro for
> deferred I/O to create the fbdev callbacks. i915 was the only
> caller of the DRM helpers, so remove them from the helper module.
> 
> i915's fbdev emulation is still incomplete as it doesn't implement
> deferred I/O and damage handling for mmaped pages.
> 
> v4:
> 	* generate deferred-I/O helpers
> 	* use initializer macros for fb_ops
> v2:
> 	* use FB_IO_HELPERS options
> 
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
> Cc: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
> ---
>  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 |  14 +--
>  include/drm/drm_fb_helper.h                |  39 --------
>  5 files changed, 9 insertions(+), 155 deletions(-)

Nice diffstat!
Assuming there is a good explanation on the dirty check:
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>

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

* Re: [PATCH v4 13/13] drm/i915: Implement dedicated fbdev I/O helpers
@ 2023-05-29 19:41     ` Sam Ravnborg
  0 siblings, 0 replies; 134+ messages in thread
From: Sam Ravnborg @ 2023-05-29 19:41 UTC (permalink / raw)
  To: Thomas Zimmermann
  Cc: daniel, airlied, maarten.lankhorst, mripard, javierm, dri-devel,
	linux-arm-kernel, linux-samsung-soc, intel-gfx, linux-arm-msm,
	freedreno, amd-gfx, linux-tegra, Jani Nikula, Joonas Lahtinen,
	Rodrigo Vivi, Tvrtko Ursulin, Ville Syrjälä

Hi Thomas,

On Wed, May 24, 2023 at 11:21:50AM +0200, Thomas Zimmermann wrote:
> Implement dedicated fbdev helpers for framebuffer I/O instead
> of using DRM's helpers. Use an fbdev generator macro for
> deferred I/O to create the fbdev callbacks. i915 was the only
> caller of the DRM helpers, so remove them from the helper module.
> 
> i915's fbdev emulation is still incomplete as it doesn't implement
> deferred I/O and damage handling for mmaped pages.
> 
> v4:
> 	* generate deferred-I/O helpers
> 	* use initializer macros for fb_ops
> v2:
> 	* use FB_IO_HELPERS options
> 
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
> Cc: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
> ---
>  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 |  14 +--
>  include/drm/drm_fb_helper.h                |  39 --------
>  5 files changed, 9 insertions(+), 155 deletions(-)

Nice diffstat!
Assuming there is a good explanation on the dirty check:
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>

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

* Re: [PATCH v4 13/13] drm/i915: Implement dedicated fbdev I/O helpers
  2023-05-29 19:36     ` Sam Ravnborg
  (?)
  (?)
@ 2023-05-30  4:02       ` Sui Jingfeng
  -1 siblings, 0 replies; 134+ messages in thread
From: Sui Jingfeng @ 2023-05-30  4:02 UTC (permalink / raw)
  To: Sam Ravnborg, Thomas Zimmermann
  Cc: daniel, airlied, maarten.lankhorst, mripard, javierm, dri-devel,
	linux-arm-kernel, linux-samsung-soc, intel-gfx, linux-arm-msm,
	freedreno, amd-gfx, linux-tegra, Jani Nikula, Joonas Lahtinen,
	Rodrigo Vivi, Tvrtko Ursulin, Ville Syrjälä

Hi,

On 2023/5/30 03:36, Sam Ravnborg wrote:
> Hi Thomas,
>
> On Wed, May 24, 2023 at 11:21:50AM +0200, Thomas Zimmermann wrote:
>> Implement dedicated fbdev helpers for framebuffer I/O instead
>> of using DRM's helpers. Use an fbdev generator macro for
>> deferred I/O to create the fbdev callbacks. i915 was the only
>> caller of the DRM helpers, so remove them from the helper module.
>>
>> i915's fbdev emulation is still incomplete as it doesn't implement
>> deferred I/O and damage handling for mmaped pages.
>>
>> v4:
>> 	* generate deferred-I/O helpers
>> 	* use initializer macros for fb_ops
>> v2:
>> 	* use FB_IO_HELPERS options
>>
>> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
>> Cc: Jani Nikula <jani.nikula@linux.intel.com>
>> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
>> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
>> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
>> Cc: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
>> ---
>>   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 |  14 +--
>>   include/drm/drm_fb_helper.h                |  39 --------
>>   5 files changed, 9 insertions(+), 155 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
>> index 92a782827b7b..bb2e48cc6cd6 100644
>> --- a/drivers/gpu/drm/Kconfig
>> +++ b/drivers/gpu/drm/Kconfig
>> @@ -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
>> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
>> index bab6b252f02a..9978147bbc8a 100644
>> --- a/drivers/gpu/drm/drm_fb_helper.c
>> +++ b/drivers/gpu/drm/drm_fb_helper.c
>> @@ -736,113 +736,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_cfb_read - Implements struct &fb_ops.fb_read for I/O 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_cfb_read(struct fb_info *info, char __user *buf,
>> -			       size_t count, loff_t *ppos)
>> -{
>> -	return fb_io_read(info, buf, count, ppos);
>> -}
>> -EXPORT_SYMBOL(drm_fb_helper_cfb_read);
>> -
>> -/**
>> - * drm_fb_helper_cfb_write - Implements struct &fb_ops.fb_write for I/O 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_cfb_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_io_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));
>> -	}
> The generated helpers do not have the if (helper->funcs->fb_dirty)
> check.

Nice catch!

If I understand this correctly, fb_io_write() will write directly to the 
ultimate

destination. There no need to check if (helper->funcs->fb_dirty) anymore.

code inside the curly brace of  `if (helper->funcs->fb_dirty) { }`  can 
be delete safely .


This could turn out to be an optimization. This is a benefit of 
untangled implement.

previously this is a generic (tangled) implement, which intended to be 
used by both

the UMA device driver and non-UMA device(with dedicate VRAM) driver.


drm_fbdev_generic always has a shadow screen buffer allocated in system RAM,

  it always has the fb_dirty hooked, so this could be an optimization 
for fbdev_generic

by eliminate if (helper->funcs->fb_dirty) check.


while dma helper based driver could switch to drm_fbdev_dma, they writing

to gem buffer directly, no shadow buffer is needed.


With those patch, device driver with dedicated video memory can also 
choose FB_CFB_*

to update (iomem)framebuffer directly, despite slower.


> Is this implemented somewhere else that I missed?
>
> 	Sam
>
drm_fb_helper_fb_dirty() function has a check:

```

     if (drm_WARN_ON_ONCE(dev, !helper->funcs->fb_dirty))
         return;
```

Not sure if this is a little bit too late......

>> -
>> -	return ret;
>> -}
>> -EXPORT_SYMBOL(drm_fb_helper_cfb_write);
>> -
>> -/**
>> - * drm_fb_helper_cfb_fillrect - wrapper around cfb_fillrect
>> - * @info: fbdev registered by the helper
>> - * @rect: info about rectangle to fill
>> - *
>> - * A wrapper around cfb_fillrect implemented by fbdev core
>> - */
>> -void drm_fb_helper_cfb_fillrect(struct fb_info *info,
>> -				const struct fb_fillrect *rect)
>> -{
>> -	struct drm_fb_helper *helper = info->par;
>> -
>> -	cfb_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_cfb_fillrect);
>> -
>> -/**
>> - * drm_fb_helper_cfb_copyarea - wrapper around cfb_copyarea
>> - * @info: fbdev registered by the helper
>> - * @area: info about area to copy
>> - *
>> - * A wrapper around cfb_copyarea implemented by fbdev core
>> - */
>> -void drm_fb_helper_cfb_copyarea(struct fb_info *info,
>> -				const struct fb_copyarea *area)
>> -{
>> -	struct drm_fb_helper *helper = info->par;
>> -
>> -	cfb_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_cfb_copyarea);
>> -
>> -/**
>> - * drm_fb_helper_cfb_imageblit - wrapper around cfb_imageblit
>> - * @info: fbdev registered by the helper
>> - * @image: info about image to blit
>> - *
>> - * A wrapper around cfb_imageblit implemented by fbdev core
>> - */
>> -void drm_fb_helper_cfb_imageblit(struct fb_info *info,
>> -				 const struct fb_image *image)
>> -{
>> -	struct drm_fb_helper *helper = info->par;
>> -
>> -	cfb_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_cfb_imageblit);
>> -
>>   /**
>>    * drm_fb_helper_set_suspend - wrapper around fb_set_suspend
>>    * @fb_helper: driver-allocated fbdev helper, can be NULL
>> diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig
>> index e4f4d2e3fdfe..01b5a8272a27 100644
>> --- a/drivers/gpu/drm/i915/Kconfig
>> +++ b/drivers/gpu/drm/i915/Kconfig
>> @@ -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
>> diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
>> index aab1ae74a8f7..eccaceaf8b9d 100644
>> --- a/drivers/gpu/drm/i915/display/intel_fbdev.c
>> +++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
>> @@ -28,6 +28,7 @@
>>   #include <linux/console.h>
>>   #include <linux/delay.h>
>>   #include <linux/errno.h>
>> +#include <linux/fb.h>
>>   #include <linux/init.h>
>>   #include <linux/kernel.h>
>>   #include <linux/mm.h>
>> @@ -84,6 +85,10 @@ static void intel_fbdev_invalidate(struct intel_fbdev *ifbdev)
>>   	intel_frontbuffer_invalidate(to_frontbuffer(ifbdev), ORIGIN_CPU);
>>   }
>>   
>> +FB_GEN_DEFAULT_DEFERRED_IO_OPS(intel_fbdev,
>> +			       drm_fb_helper_damage_range,
>> +			       drm_fb_helper_damage_area)
>> +
>>   static int intel_fbdev_set_par(struct fb_info *info)
>>   {
>>   	struct intel_fbdev *ifbdev = to_intel_fbdev(info->par);
>> @@ -132,15 +137,12 @@ static int intel_fbdev_mmap(struct fb_info *info, struct vm_area_struct *vma)
>>   
>>   static const struct fb_ops intelfb_ops = {
>>   	.owner = THIS_MODULE,
>> +	__FB_DEFAULT_DEFERRED_OPS_RDWR(intel_fbdev),
>>   	DRM_FB_HELPER_DEFAULT_OPS,
>>   	.fb_set_par = intel_fbdev_set_par,
>> -	.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_pan_display = intel_fbdev_pan_display,
>>   	.fb_blank = intel_fbdev_blank,
>> +	.fb_pan_display = intel_fbdev_pan_display,
>> +	__FB_DEFAULT_DEFERRED_OPS_DRAW(intel_fbdev),
>>   	.fb_mmap = intel_fbdev_mmap,
>>   };
>>   
>> diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
>> index b50fd0c0b713..4863b0f8299e 100644
>> --- a/include/drm/drm_fb_helper.h
>> +++ b/include/drm/drm_fb_helper.h
>> @@ -258,18 +258,6 @@ void drm_fb_helper_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u3
>>   
>>   void 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);
>> @@ -385,33 +373,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)
>>   {
>> -- 
>> 2.40.1
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v4 13/13] drm/i915: Implement dedicated fbdev I/O helpers
@ 2023-05-30  4:02       ` Sui Jingfeng
  0 siblings, 0 replies; 134+ messages in thread
From: Sui Jingfeng @ 2023-05-30  4:02 UTC (permalink / raw)
  To: Sam Ravnborg, Thomas Zimmermann
  Cc: freedreno, linux-samsung-soc, Tvrtko Ursulin, amd-gfx,
	linux-arm-msm, intel-gfx, javierm, dri-devel, Rodrigo Vivi,
	linux-tegra, linux-arm-kernel

Hi,

On 2023/5/30 03:36, Sam Ravnborg wrote:
> Hi Thomas,
>
> On Wed, May 24, 2023 at 11:21:50AM +0200, Thomas Zimmermann wrote:
>> Implement dedicated fbdev helpers for framebuffer I/O instead
>> of using DRM's helpers. Use an fbdev generator macro for
>> deferred I/O to create the fbdev callbacks. i915 was the only
>> caller of the DRM helpers, so remove them from the helper module.
>>
>> i915's fbdev emulation is still incomplete as it doesn't implement
>> deferred I/O and damage handling for mmaped pages.
>>
>> v4:
>> 	* generate deferred-I/O helpers
>> 	* use initializer macros for fb_ops
>> v2:
>> 	* use FB_IO_HELPERS options
>>
>> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
>> Cc: Jani Nikula <jani.nikula@linux.intel.com>
>> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
>> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
>> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
>> Cc: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
>> ---
>>   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 |  14 +--
>>   include/drm/drm_fb_helper.h                |  39 --------
>>   5 files changed, 9 insertions(+), 155 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
>> index 92a782827b7b..bb2e48cc6cd6 100644
>> --- a/drivers/gpu/drm/Kconfig
>> +++ b/drivers/gpu/drm/Kconfig
>> @@ -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
>> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
>> index bab6b252f02a..9978147bbc8a 100644
>> --- a/drivers/gpu/drm/drm_fb_helper.c
>> +++ b/drivers/gpu/drm/drm_fb_helper.c
>> @@ -736,113 +736,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_cfb_read - Implements struct &fb_ops.fb_read for I/O 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_cfb_read(struct fb_info *info, char __user *buf,
>> -			       size_t count, loff_t *ppos)
>> -{
>> -	return fb_io_read(info, buf, count, ppos);
>> -}
>> -EXPORT_SYMBOL(drm_fb_helper_cfb_read);
>> -
>> -/**
>> - * drm_fb_helper_cfb_write - Implements struct &fb_ops.fb_write for I/O 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_cfb_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_io_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));
>> -	}
> The generated helpers do not have the if (helper->funcs->fb_dirty)
> check.

Nice catch!

If I understand this correctly, fb_io_write() will write directly to the 
ultimate

destination. There no need to check if (helper->funcs->fb_dirty) anymore.

code inside the curly brace of  `if (helper->funcs->fb_dirty) { }`  can 
be delete safely .


This could turn out to be an optimization. This is a benefit of 
untangled implement.

previously this is a generic (tangled) implement, which intended to be 
used by both

the UMA device driver and non-UMA device(with dedicate VRAM) driver.


drm_fbdev_generic always has a shadow screen buffer allocated in system RAM,

  it always has the fb_dirty hooked, so this could be an optimization 
for fbdev_generic

by eliminate if (helper->funcs->fb_dirty) check.


while dma helper based driver could switch to drm_fbdev_dma, they writing

to gem buffer directly, no shadow buffer is needed.


With those patch, device driver with dedicated video memory can also 
choose FB_CFB_*

to update (iomem)framebuffer directly, despite slower.


> Is this implemented somewhere else that I missed?
>
> 	Sam
>
drm_fb_helper_fb_dirty() function has a check:

```

     if (drm_WARN_ON_ONCE(dev, !helper->funcs->fb_dirty))
         return;
```

Not sure if this is a little bit too late......

>> -
>> -	return ret;
>> -}
>> -EXPORT_SYMBOL(drm_fb_helper_cfb_write);
>> -
>> -/**
>> - * drm_fb_helper_cfb_fillrect - wrapper around cfb_fillrect
>> - * @info: fbdev registered by the helper
>> - * @rect: info about rectangle to fill
>> - *
>> - * A wrapper around cfb_fillrect implemented by fbdev core
>> - */
>> -void drm_fb_helper_cfb_fillrect(struct fb_info *info,
>> -				const struct fb_fillrect *rect)
>> -{
>> -	struct drm_fb_helper *helper = info->par;
>> -
>> -	cfb_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_cfb_fillrect);
>> -
>> -/**
>> - * drm_fb_helper_cfb_copyarea - wrapper around cfb_copyarea
>> - * @info: fbdev registered by the helper
>> - * @area: info about area to copy
>> - *
>> - * A wrapper around cfb_copyarea implemented by fbdev core
>> - */
>> -void drm_fb_helper_cfb_copyarea(struct fb_info *info,
>> -				const struct fb_copyarea *area)
>> -{
>> -	struct drm_fb_helper *helper = info->par;
>> -
>> -	cfb_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_cfb_copyarea);
>> -
>> -/**
>> - * drm_fb_helper_cfb_imageblit - wrapper around cfb_imageblit
>> - * @info: fbdev registered by the helper
>> - * @image: info about image to blit
>> - *
>> - * A wrapper around cfb_imageblit implemented by fbdev core
>> - */
>> -void drm_fb_helper_cfb_imageblit(struct fb_info *info,
>> -				 const struct fb_image *image)
>> -{
>> -	struct drm_fb_helper *helper = info->par;
>> -
>> -	cfb_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_cfb_imageblit);
>> -
>>   /**
>>    * drm_fb_helper_set_suspend - wrapper around fb_set_suspend
>>    * @fb_helper: driver-allocated fbdev helper, can be NULL
>> diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig
>> index e4f4d2e3fdfe..01b5a8272a27 100644
>> --- a/drivers/gpu/drm/i915/Kconfig
>> +++ b/drivers/gpu/drm/i915/Kconfig
>> @@ -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
>> diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
>> index aab1ae74a8f7..eccaceaf8b9d 100644
>> --- a/drivers/gpu/drm/i915/display/intel_fbdev.c
>> +++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
>> @@ -28,6 +28,7 @@
>>   #include <linux/console.h>
>>   #include <linux/delay.h>
>>   #include <linux/errno.h>
>> +#include <linux/fb.h>
>>   #include <linux/init.h>
>>   #include <linux/kernel.h>
>>   #include <linux/mm.h>
>> @@ -84,6 +85,10 @@ static void intel_fbdev_invalidate(struct intel_fbdev *ifbdev)
>>   	intel_frontbuffer_invalidate(to_frontbuffer(ifbdev), ORIGIN_CPU);
>>   }
>>   
>> +FB_GEN_DEFAULT_DEFERRED_IO_OPS(intel_fbdev,
>> +			       drm_fb_helper_damage_range,
>> +			       drm_fb_helper_damage_area)
>> +
>>   static int intel_fbdev_set_par(struct fb_info *info)
>>   {
>>   	struct intel_fbdev *ifbdev = to_intel_fbdev(info->par);
>> @@ -132,15 +137,12 @@ static int intel_fbdev_mmap(struct fb_info *info, struct vm_area_struct *vma)
>>   
>>   static const struct fb_ops intelfb_ops = {
>>   	.owner = THIS_MODULE,
>> +	__FB_DEFAULT_DEFERRED_OPS_RDWR(intel_fbdev),
>>   	DRM_FB_HELPER_DEFAULT_OPS,
>>   	.fb_set_par = intel_fbdev_set_par,
>> -	.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_pan_display = intel_fbdev_pan_display,
>>   	.fb_blank = intel_fbdev_blank,
>> +	.fb_pan_display = intel_fbdev_pan_display,
>> +	__FB_DEFAULT_DEFERRED_OPS_DRAW(intel_fbdev),
>>   	.fb_mmap = intel_fbdev_mmap,
>>   };
>>   
>> diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
>> index b50fd0c0b713..4863b0f8299e 100644
>> --- a/include/drm/drm_fb_helper.h
>> +++ b/include/drm/drm_fb_helper.h
>> @@ -258,18 +258,6 @@ void drm_fb_helper_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u3
>>   
>>   void 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);
>> @@ -385,33 +373,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)
>>   {
>> -- 
>> 2.40.1
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [Intel-gfx] [PATCH v4 13/13] drm/i915: Implement dedicated fbdev I/O helpers
@ 2023-05-30  4:02       ` Sui Jingfeng
  0 siblings, 0 replies; 134+ messages in thread
From: Sui Jingfeng @ 2023-05-30  4:02 UTC (permalink / raw)
  To: Sam Ravnborg, Thomas Zimmermann
  Cc: freedreno, linux-samsung-soc, amd-gfx, linux-arm-msm, intel-gfx,
	javierm, dri-devel, mripard, daniel, Rodrigo Vivi, linux-tegra,
	airlied, linux-arm-kernel

Hi,

On 2023/5/30 03:36, Sam Ravnborg wrote:
> Hi Thomas,
>
> On Wed, May 24, 2023 at 11:21:50AM +0200, Thomas Zimmermann wrote:
>> Implement dedicated fbdev helpers for framebuffer I/O instead
>> of using DRM's helpers. Use an fbdev generator macro for
>> deferred I/O to create the fbdev callbacks. i915 was the only
>> caller of the DRM helpers, so remove them from the helper module.
>>
>> i915's fbdev emulation is still incomplete as it doesn't implement
>> deferred I/O and damage handling for mmaped pages.
>>
>> v4:
>> 	* generate deferred-I/O helpers
>> 	* use initializer macros for fb_ops
>> v2:
>> 	* use FB_IO_HELPERS options
>>
>> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
>> Cc: Jani Nikula <jani.nikula@linux.intel.com>
>> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
>> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
>> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
>> Cc: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
>> ---
>>   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 |  14 +--
>>   include/drm/drm_fb_helper.h                |  39 --------
>>   5 files changed, 9 insertions(+), 155 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
>> index 92a782827b7b..bb2e48cc6cd6 100644
>> --- a/drivers/gpu/drm/Kconfig
>> +++ b/drivers/gpu/drm/Kconfig
>> @@ -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
>> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
>> index bab6b252f02a..9978147bbc8a 100644
>> --- a/drivers/gpu/drm/drm_fb_helper.c
>> +++ b/drivers/gpu/drm/drm_fb_helper.c
>> @@ -736,113 +736,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_cfb_read - Implements struct &fb_ops.fb_read for I/O 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_cfb_read(struct fb_info *info, char __user *buf,
>> -			       size_t count, loff_t *ppos)
>> -{
>> -	return fb_io_read(info, buf, count, ppos);
>> -}
>> -EXPORT_SYMBOL(drm_fb_helper_cfb_read);
>> -
>> -/**
>> - * drm_fb_helper_cfb_write - Implements struct &fb_ops.fb_write for I/O 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_cfb_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_io_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));
>> -	}
> The generated helpers do not have the if (helper->funcs->fb_dirty)
> check.

Nice catch!

If I understand this correctly, fb_io_write() will write directly to the 
ultimate

destination. There no need to check if (helper->funcs->fb_dirty) anymore.

code inside the curly brace of  `if (helper->funcs->fb_dirty) { }`  can 
be delete safely .


This could turn out to be an optimization. This is a benefit of 
untangled implement.

previously this is a generic (tangled) implement, which intended to be 
used by both

the UMA device driver and non-UMA device(with dedicate VRAM) driver.


drm_fbdev_generic always has a shadow screen buffer allocated in system RAM,

  it always has the fb_dirty hooked, so this could be an optimization 
for fbdev_generic

by eliminate if (helper->funcs->fb_dirty) check.


while dma helper based driver could switch to drm_fbdev_dma, they writing

to gem buffer directly, no shadow buffer is needed.


With those patch, device driver with dedicated video memory can also 
choose FB_CFB_*

to update (iomem)framebuffer directly, despite slower.


> Is this implemented somewhere else that I missed?
>
> 	Sam
>
drm_fb_helper_fb_dirty() function has a check:

```

     if (drm_WARN_ON_ONCE(dev, !helper->funcs->fb_dirty))
         return;
```

Not sure if this is a little bit too late......

>> -
>> -	return ret;
>> -}
>> -EXPORT_SYMBOL(drm_fb_helper_cfb_write);
>> -
>> -/**
>> - * drm_fb_helper_cfb_fillrect - wrapper around cfb_fillrect
>> - * @info: fbdev registered by the helper
>> - * @rect: info about rectangle to fill
>> - *
>> - * A wrapper around cfb_fillrect implemented by fbdev core
>> - */
>> -void drm_fb_helper_cfb_fillrect(struct fb_info *info,
>> -				const struct fb_fillrect *rect)
>> -{
>> -	struct drm_fb_helper *helper = info->par;
>> -
>> -	cfb_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_cfb_fillrect);
>> -
>> -/**
>> - * drm_fb_helper_cfb_copyarea - wrapper around cfb_copyarea
>> - * @info: fbdev registered by the helper
>> - * @area: info about area to copy
>> - *
>> - * A wrapper around cfb_copyarea implemented by fbdev core
>> - */
>> -void drm_fb_helper_cfb_copyarea(struct fb_info *info,
>> -				const struct fb_copyarea *area)
>> -{
>> -	struct drm_fb_helper *helper = info->par;
>> -
>> -	cfb_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_cfb_copyarea);
>> -
>> -/**
>> - * drm_fb_helper_cfb_imageblit - wrapper around cfb_imageblit
>> - * @info: fbdev registered by the helper
>> - * @image: info about image to blit
>> - *
>> - * A wrapper around cfb_imageblit implemented by fbdev core
>> - */
>> -void drm_fb_helper_cfb_imageblit(struct fb_info *info,
>> -				 const struct fb_image *image)
>> -{
>> -	struct drm_fb_helper *helper = info->par;
>> -
>> -	cfb_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_cfb_imageblit);
>> -
>>   /**
>>    * drm_fb_helper_set_suspend - wrapper around fb_set_suspend
>>    * @fb_helper: driver-allocated fbdev helper, can be NULL
>> diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig
>> index e4f4d2e3fdfe..01b5a8272a27 100644
>> --- a/drivers/gpu/drm/i915/Kconfig
>> +++ b/drivers/gpu/drm/i915/Kconfig
>> @@ -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
>> diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
>> index aab1ae74a8f7..eccaceaf8b9d 100644
>> --- a/drivers/gpu/drm/i915/display/intel_fbdev.c
>> +++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
>> @@ -28,6 +28,7 @@
>>   #include <linux/console.h>
>>   #include <linux/delay.h>
>>   #include <linux/errno.h>
>> +#include <linux/fb.h>
>>   #include <linux/init.h>
>>   #include <linux/kernel.h>
>>   #include <linux/mm.h>
>> @@ -84,6 +85,10 @@ static void intel_fbdev_invalidate(struct intel_fbdev *ifbdev)
>>   	intel_frontbuffer_invalidate(to_frontbuffer(ifbdev), ORIGIN_CPU);
>>   }
>>   
>> +FB_GEN_DEFAULT_DEFERRED_IO_OPS(intel_fbdev,
>> +			       drm_fb_helper_damage_range,
>> +			       drm_fb_helper_damage_area)
>> +
>>   static int intel_fbdev_set_par(struct fb_info *info)
>>   {
>>   	struct intel_fbdev *ifbdev = to_intel_fbdev(info->par);
>> @@ -132,15 +137,12 @@ static int intel_fbdev_mmap(struct fb_info *info, struct vm_area_struct *vma)
>>   
>>   static const struct fb_ops intelfb_ops = {
>>   	.owner = THIS_MODULE,
>> +	__FB_DEFAULT_DEFERRED_OPS_RDWR(intel_fbdev),
>>   	DRM_FB_HELPER_DEFAULT_OPS,
>>   	.fb_set_par = intel_fbdev_set_par,
>> -	.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_pan_display = intel_fbdev_pan_display,
>>   	.fb_blank = intel_fbdev_blank,
>> +	.fb_pan_display = intel_fbdev_pan_display,
>> +	__FB_DEFAULT_DEFERRED_OPS_DRAW(intel_fbdev),
>>   	.fb_mmap = intel_fbdev_mmap,
>>   };
>>   
>> diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
>> index b50fd0c0b713..4863b0f8299e 100644
>> --- a/include/drm/drm_fb_helper.h
>> +++ b/include/drm/drm_fb_helper.h
>> @@ -258,18 +258,6 @@ void drm_fb_helper_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u3
>>   
>>   void 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);
>> @@ -385,33 +373,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)
>>   {
>> -- 
>> 2.40.1
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v4 13/13] drm/i915: Implement dedicated fbdev I/O helpers
@ 2023-05-30  4:02       ` Sui Jingfeng
  0 siblings, 0 replies; 134+ messages in thread
From: Sui Jingfeng @ 2023-05-30  4:02 UTC (permalink / raw)
  To: Sam Ravnborg, Thomas Zimmermann
  Cc: Jani Nikula, freedreno, linux-samsung-soc, Tvrtko Ursulin,
	amd-gfx, linux-arm-msm, intel-gfx, Joonas Lahtinen,
	maarten.lankhorst, javierm, dri-devel, Ville Syrjälä,
	mripard, daniel, Rodrigo Vivi, linux-tegra, airlied,
	linux-arm-kernel

Hi,

On 2023/5/30 03:36, Sam Ravnborg wrote:
> Hi Thomas,
>
> On Wed, May 24, 2023 at 11:21:50AM +0200, Thomas Zimmermann wrote:
>> Implement dedicated fbdev helpers for framebuffer I/O instead
>> of using DRM's helpers. Use an fbdev generator macro for
>> deferred I/O to create the fbdev callbacks. i915 was the only
>> caller of the DRM helpers, so remove them from the helper module.
>>
>> i915's fbdev emulation is still incomplete as it doesn't implement
>> deferred I/O and damage handling for mmaped pages.
>>
>> v4:
>> 	* generate deferred-I/O helpers
>> 	* use initializer macros for fb_ops
>> v2:
>> 	* use FB_IO_HELPERS options
>>
>> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
>> Cc: Jani Nikula <jani.nikula@linux.intel.com>
>> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
>> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
>> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
>> Cc: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
>> ---
>>   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 |  14 +--
>>   include/drm/drm_fb_helper.h                |  39 --------
>>   5 files changed, 9 insertions(+), 155 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
>> index 92a782827b7b..bb2e48cc6cd6 100644
>> --- a/drivers/gpu/drm/Kconfig
>> +++ b/drivers/gpu/drm/Kconfig
>> @@ -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
>> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
>> index bab6b252f02a..9978147bbc8a 100644
>> --- a/drivers/gpu/drm/drm_fb_helper.c
>> +++ b/drivers/gpu/drm/drm_fb_helper.c
>> @@ -736,113 +736,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_cfb_read - Implements struct &fb_ops.fb_read for I/O 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_cfb_read(struct fb_info *info, char __user *buf,
>> -			       size_t count, loff_t *ppos)
>> -{
>> -	return fb_io_read(info, buf, count, ppos);
>> -}
>> -EXPORT_SYMBOL(drm_fb_helper_cfb_read);
>> -
>> -/**
>> - * drm_fb_helper_cfb_write - Implements struct &fb_ops.fb_write for I/O 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_cfb_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_io_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));
>> -	}
> The generated helpers do not have the if (helper->funcs->fb_dirty)
> check.

Nice catch!

If I understand this correctly, fb_io_write() will write directly to the 
ultimate

destination. There no need to check if (helper->funcs->fb_dirty) anymore.

code inside the curly brace of  `if (helper->funcs->fb_dirty) { }`  can 
be delete safely .


This could turn out to be an optimization. This is a benefit of 
untangled implement.

previously this is a generic (tangled) implement, which intended to be 
used by both

the UMA device driver and non-UMA device(with dedicate VRAM) driver.


drm_fbdev_generic always has a shadow screen buffer allocated in system RAM,

  it always has the fb_dirty hooked, so this could be an optimization 
for fbdev_generic

by eliminate if (helper->funcs->fb_dirty) check.


while dma helper based driver could switch to drm_fbdev_dma, they writing

to gem buffer directly, no shadow buffer is needed.


With those patch, device driver with dedicated video memory can also 
choose FB_CFB_*

to update (iomem)framebuffer directly, despite slower.


> Is this implemented somewhere else that I missed?
>
> 	Sam
>
drm_fb_helper_fb_dirty() function has a check:

```

     if (drm_WARN_ON_ONCE(dev, !helper->funcs->fb_dirty))
         return;
```

Not sure if this is a little bit too late......

>> -
>> -	return ret;
>> -}
>> -EXPORT_SYMBOL(drm_fb_helper_cfb_write);
>> -
>> -/**
>> - * drm_fb_helper_cfb_fillrect - wrapper around cfb_fillrect
>> - * @info: fbdev registered by the helper
>> - * @rect: info about rectangle to fill
>> - *
>> - * A wrapper around cfb_fillrect implemented by fbdev core
>> - */
>> -void drm_fb_helper_cfb_fillrect(struct fb_info *info,
>> -				const struct fb_fillrect *rect)
>> -{
>> -	struct drm_fb_helper *helper = info->par;
>> -
>> -	cfb_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_cfb_fillrect);
>> -
>> -/**
>> - * drm_fb_helper_cfb_copyarea - wrapper around cfb_copyarea
>> - * @info: fbdev registered by the helper
>> - * @area: info about area to copy
>> - *
>> - * A wrapper around cfb_copyarea implemented by fbdev core
>> - */
>> -void drm_fb_helper_cfb_copyarea(struct fb_info *info,
>> -				const struct fb_copyarea *area)
>> -{
>> -	struct drm_fb_helper *helper = info->par;
>> -
>> -	cfb_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_cfb_copyarea);
>> -
>> -/**
>> - * drm_fb_helper_cfb_imageblit - wrapper around cfb_imageblit
>> - * @info: fbdev registered by the helper
>> - * @image: info about image to blit
>> - *
>> - * A wrapper around cfb_imageblit implemented by fbdev core
>> - */
>> -void drm_fb_helper_cfb_imageblit(struct fb_info *info,
>> -				 const struct fb_image *image)
>> -{
>> -	struct drm_fb_helper *helper = info->par;
>> -
>> -	cfb_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_cfb_imageblit);
>> -
>>   /**
>>    * drm_fb_helper_set_suspend - wrapper around fb_set_suspend
>>    * @fb_helper: driver-allocated fbdev helper, can be NULL
>> diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig
>> index e4f4d2e3fdfe..01b5a8272a27 100644
>> --- a/drivers/gpu/drm/i915/Kconfig
>> +++ b/drivers/gpu/drm/i915/Kconfig
>> @@ -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
>> diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
>> index aab1ae74a8f7..eccaceaf8b9d 100644
>> --- a/drivers/gpu/drm/i915/display/intel_fbdev.c
>> +++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
>> @@ -28,6 +28,7 @@
>>   #include <linux/console.h>
>>   #include <linux/delay.h>
>>   #include <linux/errno.h>
>> +#include <linux/fb.h>
>>   #include <linux/init.h>
>>   #include <linux/kernel.h>
>>   #include <linux/mm.h>
>> @@ -84,6 +85,10 @@ static void intel_fbdev_invalidate(struct intel_fbdev *ifbdev)
>>   	intel_frontbuffer_invalidate(to_frontbuffer(ifbdev), ORIGIN_CPU);
>>   }
>>   
>> +FB_GEN_DEFAULT_DEFERRED_IO_OPS(intel_fbdev,
>> +			       drm_fb_helper_damage_range,
>> +			       drm_fb_helper_damage_area)
>> +
>>   static int intel_fbdev_set_par(struct fb_info *info)
>>   {
>>   	struct intel_fbdev *ifbdev = to_intel_fbdev(info->par);
>> @@ -132,15 +137,12 @@ static int intel_fbdev_mmap(struct fb_info *info, struct vm_area_struct *vma)
>>   
>>   static const struct fb_ops intelfb_ops = {
>>   	.owner = THIS_MODULE,
>> +	__FB_DEFAULT_DEFERRED_OPS_RDWR(intel_fbdev),
>>   	DRM_FB_HELPER_DEFAULT_OPS,
>>   	.fb_set_par = intel_fbdev_set_par,
>> -	.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_pan_display = intel_fbdev_pan_display,
>>   	.fb_blank = intel_fbdev_blank,
>> +	.fb_pan_display = intel_fbdev_pan_display,
>> +	__FB_DEFAULT_DEFERRED_OPS_DRAW(intel_fbdev),
>>   	.fb_mmap = intel_fbdev_mmap,
>>   };
>>   
>> diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
>> index b50fd0c0b713..4863b0f8299e 100644
>> --- a/include/drm/drm_fb_helper.h
>> +++ b/include/drm/drm_fb_helper.h
>> @@ -258,18 +258,6 @@ void drm_fb_helper_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u3
>>   
>>   void 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);
>> @@ -385,33 +373,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)
>>   {
>> -- 
>> 2.40.1
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v4 13/13] drm/i915: Implement dedicated fbdev I/O helpers
  2023-05-29 19:36     ` Sam Ravnborg
  (?)
  (?)
@ 2023-05-30  7:12       ` Thomas Zimmermann
  -1 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-30  7:12 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: freedreno, linux-samsung-soc, Tvrtko Ursulin, amd-gfx,
	linux-arm-msm, intel-gfx, javierm, dri-devel, Rodrigo Vivi,
	linux-tegra, linux-arm-kernel


[-- Attachment #1.1: Type: text/plain, Size: 11628 bytes --]

Hi

Am 29.05.23 um 21:36 schrieb Sam Ravnborg:
> Hi Thomas,
> 
> On Wed, May 24, 2023 at 11:21:50AM +0200, Thomas Zimmermann wrote:
>> Implement dedicated fbdev helpers for framebuffer I/O instead
>> of using DRM's helpers. Use an fbdev generator macro for
>> deferred I/O to create the fbdev callbacks. i915 was the only
>> caller of the DRM helpers, so remove them from the helper module.
>>
>> i915's fbdev emulation is still incomplete as it doesn't implement
>> deferred I/O and damage handling for mmaped pages.
>>
>> v4:
>> 	* generate deferred-I/O helpers
>> 	* use initializer macros for fb_ops
>> v2:
>> 	* use FB_IO_HELPERS options
>>
>> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
>> Cc: Jani Nikula <jani.nikula@linux.intel.com>
>> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
>> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
>> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
>> Cc: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
>> ---
>>   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 |  14 +--
>>   include/drm/drm_fb_helper.h                |  39 --------
>>   5 files changed, 9 insertions(+), 155 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
>> index 92a782827b7b..bb2e48cc6cd6 100644
>> --- a/drivers/gpu/drm/Kconfig
>> +++ b/drivers/gpu/drm/Kconfig
>> @@ -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
>> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
>> index bab6b252f02a..9978147bbc8a 100644
>> --- a/drivers/gpu/drm/drm_fb_helper.c
>> +++ b/drivers/gpu/drm/drm_fb_helper.c
>> @@ -736,113 +736,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_cfb_read - Implements struct &fb_ops.fb_read for I/O 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_cfb_read(struct fb_info *info, char __user *buf,
>> -			       size_t count, loff_t *ppos)
>> -{
>> -	return fb_io_read(info, buf, count, ppos);
>> -}
>> -EXPORT_SYMBOL(drm_fb_helper_cfb_read);
>> -
>> -/**
>> - * drm_fb_helper_cfb_write - Implements struct &fb_ops.fb_write for I/O 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_cfb_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_io_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));
>> -	}
> 
> The generated helpers do not have the if (helper->funcs->fb_dirty)
> check.
> Is this implemented somewhere else that I missed?

It's not needed any longer.  We used to test if the fbdev code needs 
damage handling by looking for a fb_dirty callback. If so, we ran the 
damage handling code.

With the patchset applied, the fbdev code that does not need damage 
handling calls fb_{io,sys}_write() directly.  The fbdev code that needs 
damage handling (generic, i915, msm) uses the generator macro that 
creates necessary the calls unconditionally.  We know each case at build 
time.

(I think I have to move the msm patch after patch 10/13 to make it 
bisectable.)

AFAICT the missing test for fb_dirty is also one of the reasons why 
there's a difference in performance.

Hopefully, this answers your question?

Best regards
Thomas

> 
> 	Sam
> 
> 
>> -
>> -	return ret;
>> -}
>> -EXPORT_SYMBOL(drm_fb_helper_cfb_write);
>> -
>> -/**
>> - * drm_fb_helper_cfb_fillrect - wrapper around cfb_fillrect
>> - * @info: fbdev registered by the helper
>> - * @rect: info about rectangle to fill
>> - *
>> - * A wrapper around cfb_fillrect implemented by fbdev core
>> - */
>> -void drm_fb_helper_cfb_fillrect(struct fb_info *info,
>> -				const struct fb_fillrect *rect)
>> -{
>> -	struct drm_fb_helper *helper = info->par;
>> -
>> -	cfb_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_cfb_fillrect);
>> -
>> -/**
>> - * drm_fb_helper_cfb_copyarea - wrapper around cfb_copyarea
>> - * @info: fbdev registered by the helper
>> - * @area: info about area to copy
>> - *
>> - * A wrapper around cfb_copyarea implemented by fbdev core
>> - */
>> -void drm_fb_helper_cfb_copyarea(struct fb_info *info,
>> -				const struct fb_copyarea *area)
>> -{
>> -	struct drm_fb_helper *helper = info->par;
>> -
>> -	cfb_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_cfb_copyarea);
>> -
>> -/**
>> - * drm_fb_helper_cfb_imageblit - wrapper around cfb_imageblit
>> - * @info: fbdev registered by the helper
>> - * @image: info about image to blit
>> - *
>> - * A wrapper around cfb_imageblit implemented by fbdev core
>> - */
>> -void drm_fb_helper_cfb_imageblit(struct fb_info *info,
>> -				 const struct fb_image *image)
>> -{
>> -	struct drm_fb_helper *helper = info->par;
>> -
>> -	cfb_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_cfb_imageblit);
>> -
>>   /**
>>    * drm_fb_helper_set_suspend - wrapper around fb_set_suspend
>>    * @fb_helper: driver-allocated fbdev helper, can be NULL
>> diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig
>> index e4f4d2e3fdfe..01b5a8272a27 100644
>> --- a/drivers/gpu/drm/i915/Kconfig
>> +++ b/drivers/gpu/drm/i915/Kconfig
>> @@ -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
>> diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
>> index aab1ae74a8f7..eccaceaf8b9d 100644
>> --- a/drivers/gpu/drm/i915/display/intel_fbdev.c
>> +++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
>> @@ -28,6 +28,7 @@
>>   #include <linux/console.h>
>>   #include <linux/delay.h>
>>   #include <linux/errno.h>
>> +#include <linux/fb.h>
>>   #include <linux/init.h>
>>   #include <linux/kernel.h>
>>   #include <linux/mm.h>
>> @@ -84,6 +85,10 @@ static void intel_fbdev_invalidate(struct intel_fbdev *ifbdev)
>>   	intel_frontbuffer_invalidate(to_frontbuffer(ifbdev), ORIGIN_CPU);
>>   }
>>   
>> +FB_GEN_DEFAULT_DEFERRED_IO_OPS(intel_fbdev,
>> +			       drm_fb_helper_damage_range,
>> +			       drm_fb_helper_damage_area)
>> +
>>   static int intel_fbdev_set_par(struct fb_info *info)
>>   {
>>   	struct intel_fbdev *ifbdev = to_intel_fbdev(info->par);
>> @@ -132,15 +137,12 @@ static int intel_fbdev_mmap(struct fb_info *info, struct vm_area_struct *vma)
>>   
>>   static const struct fb_ops intelfb_ops = {
>>   	.owner = THIS_MODULE,
>> +	__FB_DEFAULT_DEFERRED_OPS_RDWR(intel_fbdev),
>>   	DRM_FB_HELPER_DEFAULT_OPS,
>>   	.fb_set_par = intel_fbdev_set_par,
>> -	.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_pan_display = intel_fbdev_pan_display,
>>   	.fb_blank = intel_fbdev_blank,
>> +	.fb_pan_display = intel_fbdev_pan_display,
>> +	__FB_DEFAULT_DEFERRED_OPS_DRAW(intel_fbdev),
>>   	.fb_mmap = intel_fbdev_mmap,
>>   };
>>   
>> diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
>> index b50fd0c0b713..4863b0f8299e 100644
>> --- a/include/drm/drm_fb_helper.h
>> +++ b/include/drm/drm_fb_helper.h
>> @@ -258,18 +258,6 @@ void drm_fb_helper_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u3
>>   
>>   void 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);
>> @@ -385,33 +373,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)
>>   {
>> -- 
>> 2.40.1

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

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

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

* Re: [PATCH v4 13/13] drm/i915: Implement dedicated fbdev I/O helpers
@ 2023-05-30  7:12       ` Thomas Zimmermann
  0 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-30  7:12 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: freedreno, linux-samsung-soc, Tvrtko Ursulin, amd-gfx,
	linux-arm-msm, intel-gfx, javierm, dri-devel, Rodrigo Vivi,
	linux-tegra, linux-arm-kernel


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

Hi

Am 29.05.23 um 21:36 schrieb Sam Ravnborg:
> Hi Thomas,
> 
> On Wed, May 24, 2023 at 11:21:50AM +0200, Thomas Zimmermann wrote:
>> Implement dedicated fbdev helpers for framebuffer I/O instead
>> of using DRM's helpers. Use an fbdev generator macro for
>> deferred I/O to create the fbdev callbacks. i915 was the only
>> caller of the DRM helpers, so remove them from the helper module.
>>
>> i915's fbdev emulation is still incomplete as it doesn't implement
>> deferred I/O and damage handling for mmaped pages.
>>
>> v4:
>> 	* generate deferred-I/O helpers
>> 	* use initializer macros for fb_ops
>> v2:
>> 	* use FB_IO_HELPERS options
>>
>> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
>> Cc: Jani Nikula <jani.nikula@linux.intel.com>
>> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
>> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
>> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
>> Cc: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
>> ---
>>   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 |  14 +--
>>   include/drm/drm_fb_helper.h                |  39 --------
>>   5 files changed, 9 insertions(+), 155 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
>> index 92a782827b7b..bb2e48cc6cd6 100644
>> --- a/drivers/gpu/drm/Kconfig
>> +++ b/drivers/gpu/drm/Kconfig
>> @@ -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
>> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
>> index bab6b252f02a..9978147bbc8a 100644
>> --- a/drivers/gpu/drm/drm_fb_helper.c
>> +++ b/drivers/gpu/drm/drm_fb_helper.c
>> @@ -736,113 +736,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_cfb_read - Implements struct &fb_ops.fb_read for I/O 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_cfb_read(struct fb_info *info, char __user *buf,
>> -			       size_t count, loff_t *ppos)
>> -{
>> -	return fb_io_read(info, buf, count, ppos);
>> -}
>> -EXPORT_SYMBOL(drm_fb_helper_cfb_read);
>> -
>> -/**
>> - * drm_fb_helper_cfb_write - Implements struct &fb_ops.fb_write for I/O 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_cfb_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_io_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));
>> -	}
> 
> The generated helpers do not have the if (helper->funcs->fb_dirty)
> check.
> Is this implemented somewhere else that I missed?

It's not needed any longer.  We used to test if the fbdev code needs 
damage handling by looking for a fb_dirty callback. If so, we ran the 
damage handling code.

With the patchset applied, the fbdev code that does not need damage 
handling calls fb_{io,sys}_write() directly.  The fbdev code that needs 
damage handling (generic, i915, msm) uses the generator macro that 
creates necessary the calls unconditionally.  We know each case at build 
time.

(I think I have to move the msm patch after patch 10/13 to make it 
bisectable.)

AFAICT the missing test for fb_dirty is also one of the reasons why 
there's a difference in performance.

Hopefully, this answers your question?

Best regards
Thomas

> 
> 	Sam
> 
> 
>> -
>> -	return ret;
>> -}
>> -EXPORT_SYMBOL(drm_fb_helper_cfb_write);
>> -
>> -/**
>> - * drm_fb_helper_cfb_fillrect - wrapper around cfb_fillrect
>> - * @info: fbdev registered by the helper
>> - * @rect: info about rectangle to fill
>> - *
>> - * A wrapper around cfb_fillrect implemented by fbdev core
>> - */
>> -void drm_fb_helper_cfb_fillrect(struct fb_info *info,
>> -				const struct fb_fillrect *rect)
>> -{
>> -	struct drm_fb_helper *helper = info->par;
>> -
>> -	cfb_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_cfb_fillrect);
>> -
>> -/**
>> - * drm_fb_helper_cfb_copyarea - wrapper around cfb_copyarea
>> - * @info: fbdev registered by the helper
>> - * @area: info about area to copy
>> - *
>> - * A wrapper around cfb_copyarea implemented by fbdev core
>> - */
>> -void drm_fb_helper_cfb_copyarea(struct fb_info *info,
>> -				const struct fb_copyarea *area)
>> -{
>> -	struct drm_fb_helper *helper = info->par;
>> -
>> -	cfb_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_cfb_copyarea);
>> -
>> -/**
>> - * drm_fb_helper_cfb_imageblit - wrapper around cfb_imageblit
>> - * @info: fbdev registered by the helper
>> - * @image: info about image to blit
>> - *
>> - * A wrapper around cfb_imageblit implemented by fbdev core
>> - */
>> -void drm_fb_helper_cfb_imageblit(struct fb_info *info,
>> -				 const struct fb_image *image)
>> -{
>> -	struct drm_fb_helper *helper = info->par;
>> -
>> -	cfb_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_cfb_imageblit);
>> -
>>   /**
>>    * drm_fb_helper_set_suspend - wrapper around fb_set_suspend
>>    * @fb_helper: driver-allocated fbdev helper, can be NULL
>> diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig
>> index e4f4d2e3fdfe..01b5a8272a27 100644
>> --- a/drivers/gpu/drm/i915/Kconfig
>> +++ b/drivers/gpu/drm/i915/Kconfig
>> @@ -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
>> diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
>> index aab1ae74a8f7..eccaceaf8b9d 100644
>> --- a/drivers/gpu/drm/i915/display/intel_fbdev.c
>> +++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
>> @@ -28,6 +28,7 @@
>>   #include <linux/console.h>
>>   #include <linux/delay.h>
>>   #include <linux/errno.h>
>> +#include <linux/fb.h>
>>   #include <linux/init.h>
>>   #include <linux/kernel.h>
>>   #include <linux/mm.h>
>> @@ -84,6 +85,10 @@ static void intel_fbdev_invalidate(struct intel_fbdev *ifbdev)
>>   	intel_frontbuffer_invalidate(to_frontbuffer(ifbdev), ORIGIN_CPU);
>>   }
>>   
>> +FB_GEN_DEFAULT_DEFERRED_IO_OPS(intel_fbdev,
>> +			       drm_fb_helper_damage_range,
>> +			       drm_fb_helper_damage_area)
>> +
>>   static int intel_fbdev_set_par(struct fb_info *info)
>>   {
>>   	struct intel_fbdev *ifbdev = to_intel_fbdev(info->par);
>> @@ -132,15 +137,12 @@ static int intel_fbdev_mmap(struct fb_info *info, struct vm_area_struct *vma)
>>   
>>   static const struct fb_ops intelfb_ops = {
>>   	.owner = THIS_MODULE,
>> +	__FB_DEFAULT_DEFERRED_OPS_RDWR(intel_fbdev),
>>   	DRM_FB_HELPER_DEFAULT_OPS,
>>   	.fb_set_par = intel_fbdev_set_par,
>> -	.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_pan_display = intel_fbdev_pan_display,
>>   	.fb_blank = intel_fbdev_blank,
>> +	.fb_pan_display = intel_fbdev_pan_display,
>> +	__FB_DEFAULT_DEFERRED_OPS_DRAW(intel_fbdev),
>>   	.fb_mmap = intel_fbdev_mmap,
>>   };
>>   
>> diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
>> index b50fd0c0b713..4863b0f8299e 100644
>> --- a/include/drm/drm_fb_helper.h
>> +++ b/include/drm/drm_fb_helper.h
>> @@ -258,18 +258,6 @@ void drm_fb_helper_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u3
>>   
>>   void 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);
>> @@ -385,33 +373,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)
>>   {
>> -- 
>> 2.40.1

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

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

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

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

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

* Re: [PATCH v4 13/13] drm/i915: Implement dedicated fbdev I/O helpers
@ 2023-05-30  7:12       ` Thomas Zimmermann
  0 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-30  7:12 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Tvrtko Ursulin, linux-samsung-soc, linux-arm-msm, intel-gfx,
	javierm, amd-gfx, dri-devel, Rodrigo Vivi, linux-tegra,
	freedreno, linux-arm-kernel


[-- Attachment #1.1: Type: text/plain, Size: 11628 bytes --]

Hi

Am 29.05.23 um 21:36 schrieb Sam Ravnborg:
> Hi Thomas,
> 
> On Wed, May 24, 2023 at 11:21:50AM +0200, Thomas Zimmermann wrote:
>> Implement dedicated fbdev helpers for framebuffer I/O instead
>> of using DRM's helpers. Use an fbdev generator macro for
>> deferred I/O to create the fbdev callbacks. i915 was the only
>> caller of the DRM helpers, so remove them from the helper module.
>>
>> i915's fbdev emulation is still incomplete as it doesn't implement
>> deferred I/O and damage handling for mmaped pages.
>>
>> v4:
>> 	* generate deferred-I/O helpers
>> 	* use initializer macros for fb_ops
>> v2:
>> 	* use FB_IO_HELPERS options
>>
>> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
>> Cc: Jani Nikula <jani.nikula@linux.intel.com>
>> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
>> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
>> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
>> Cc: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
>> ---
>>   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 |  14 +--
>>   include/drm/drm_fb_helper.h                |  39 --------
>>   5 files changed, 9 insertions(+), 155 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
>> index 92a782827b7b..bb2e48cc6cd6 100644
>> --- a/drivers/gpu/drm/Kconfig
>> +++ b/drivers/gpu/drm/Kconfig
>> @@ -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
>> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
>> index bab6b252f02a..9978147bbc8a 100644
>> --- a/drivers/gpu/drm/drm_fb_helper.c
>> +++ b/drivers/gpu/drm/drm_fb_helper.c
>> @@ -736,113 +736,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_cfb_read - Implements struct &fb_ops.fb_read for I/O 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_cfb_read(struct fb_info *info, char __user *buf,
>> -			       size_t count, loff_t *ppos)
>> -{
>> -	return fb_io_read(info, buf, count, ppos);
>> -}
>> -EXPORT_SYMBOL(drm_fb_helper_cfb_read);
>> -
>> -/**
>> - * drm_fb_helper_cfb_write - Implements struct &fb_ops.fb_write for I/O 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_cfb_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_io_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));
>> -	}
> 
> The generated helpers do not have the if (helper->funcs->fb_dirty)
> check.
> Is this implemented somewhere else that I missed?

It's not needed any longer.  We used to test if the fbdev code needs 
damage handling by looking for a fb_dirty callback. If so, we ran the 
damage handling code.

With the patchset applied, the fbdev code that does not need damage 
handling calls fb_{io,sys}_write() directly.  The fbdev code that needs 
damage handling (generic, i915, msm) uses the generator macro that 
creates necessary the calls unconditionally.  We know each case at build 
time.

(I think I have to move the msm patch after patch 10/13 to make it 
bisectable.)

AFAICT the missing test for fb_dirty is also one of the reasons why 
there's a difference in performance.

Hopefully, this answers your question?

Best regards
Thomas

> 
> 	Sam
> 
> 
>> -
>> -	return ret;
>> -}
>> -EXPORT_SYMBOL(drm_fb_helper_cfb_write);
>> -
>> -/**
>> - * drm_fb_helper_cfb_fillrect - wrapper around cfb_fillrect
>> - * @info: fbdev registered by the helper
>> - * @rect: info about rectangle to fill
>> - *
>> - * A wrapper around cfb_fillrect implemented by fbdev core
>> - */
>> -void drm_fb_helper_cfb_fillrect(struct fb_info *info,
>> -				const struct fb_fillrect *rect)
>> -{
>> -	struct drm_fb_helper *helper = info->par;
>> -
>> -	cfb_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_cfb_fillrect);
>> -
>> -/**
>> - * drm_fb_helper_cfb_copyarea - wrapper around cfb_copyarea
>> - * @info: fbdev registered by the helper
>> - * @area: info about area to copy
>> - *
>> - * A wrapper around cfb_copyarea implemented by fbdev core
>> - */
>> -void drm_fb_helper_cfb_copyarea(struct fb_info *info,
>> -				const struct fb_copyarea *area)
>> -{
>> -	struct drm_fb_helper *helper = info->par;
>> -
>> -	cfb_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_cfb_copyarea);
>> -
>> -/**
>> - * drm_fb_helper_cfb_imageblit - wrapper around cfb_imageblit
>> - * @info: fbdev registered by the helper
>> - * @image: info about image to blit
>> - *
>> - * A wrapper around cfb_imageblit implemented by fbdev core
>> - */
>> -void drm_fb_helper_cfb_imageblit(struct fb_info *info,
>> -				 const struct fb_image *image)
>> -{
>> -	struct drm_fb_helper *helper = info->par;
>> -
>> -	cfb_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_cfb_imageblit);
>> -
>>   /**
>>    * drm_fb_helper_set_suspend - wrapper around fb_set_suspend
>>    * @fb_helper: driver-allocated fbdev helper, can be NULL
>> diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig
>> index e4f4d2e3fdfe..01b5a8272a27 100644
>> --- a/drivers/gpu/drm/i915/Kconfig
>> +++ b/drivers/gpu/drm/i915/Kconfig
>> @@ -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
>> diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
>> index aab1ae74a8f7..eccaceaf8b9d 100644
>> --- a/drivers/gpu/drm/i915/display/intel_fbdev.c
>> +++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
>> @@ -28,6 +28,7 @@
>>   #include <linux/console.h>
>>   #include <linux/delay.h>
>>   #include <linux/errno.h>
>> +#include <linux/fb.h>
>>   #include <linux/init.h>
>>   #include <linux/kernel.h>
>>   #include <linux/mm.h>
>> @@ -84,6 +85,10 @@ static void intel_fbdev_invalidate(struct intel_fbdev *ifbdev)
>>   	intel_frontbuffer_invalidate(to_frontbuffer(ifbdev), ORIGIN_CPU);
>>   }
>>   
>> +FB_GEN_DEFAULT_DEFERRED_IO_OPS(intel_fbdev,
>> +			       drm_fb_helper_damage_range,
>> +			       drm_fb_helper_damage_area)
>> +
>>   static int intel_fbdev_set_par(struct fb_info *info)
>>   {
>>   	struct intel_fbdev *ifbdev = to_intel_fbdev(info->par);
>> @@ -132,15 +137,12 @@ static int intel_fbdev_mmap(struct fb_info *info, struct vm_area_struct *vma)
>>   
>>   static const struct fb_ops intelfb_ops = {
>>   	.owner = THIS_MODULE,
>> +	__FB_DEFAULT_DEFERRED_OPS_RDWR(intel_fbdev),
>>   	DRM_FB_HELPER_DEFAULT_OPS,
>>   	.fb_set_par = intel_fbdev_set_par,
>> -	.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_pan_display = intel_fbdev_pan_display,
>>   	.fb_blank = intel_fbdev_blank,
>> +	.fb_pan_display = intel_fbdev_pan_display,
>> +	__FB_DEFAULT_DEFERRED_OPS_DRAW(intel_fbdev),
>>   	.fb_mmap = intel_fbdev_mmap,
>>   };
>>   
>> diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
>> index b50fd0c0b713..4863b0f8299e 100644
>> --- a/include/drm/drm_fb_helper.h
>> +++ b/include/drm/drm_fb_helper.h
>> @@ -258,18 +258,6 @@ void drm_fb_helper_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u3
>>   
>>   void 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);
>> @@ -385,33 +373,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)
>>   {
>> -- 
>> 2.40.1

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

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

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

* Re: [Intel-gfx] [PATCH v4 13/13] drm/i915: Implement dedicated fbdev I/O helpers
@ 2023-05-30  7:12       ` Thomas Zimmermann
  0 siblings, 0 replies; 134+ messages in thread
From: Thomas Zimmermann @ 2023-05-30  7:12 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: linux-samsung-soc, linux-arm-msm, intel-gfx, javierm, amd-gfx,
	dri-devel, Rodrigo Vivi, linux-tegra, freedreno,
	linux-arm-kernel


[-- Attachment #1.1: Type: text/plain, Size: 11628 bytes --]

Hi

Am 29.05.23 um 21:36 schrieb Sam Ravnborg:
> Hi Thomas,
> 
> On Wed, May 24, 2023 at 11:21:50AM +0200, Thomas Zimmermann wrote:
>> Implement dedicated fbdev helpers for framebuffer I/O instead
>> of using DRM's helpers. Use an fbdev generator macro for
>> deferred I/O to create the fbdev callbacks. i915 was the only
>> caller of the DRM helpers, so remove them from the helper module.
>>
>> i915's fbdev emulation is still incomplete as it doesn't implement
>> deferred I/O and damage handling for mmaped pages.
>>
>> v4:
>> 	* generate deferred-I/O helpers
>> 	* use initializer macros for fb_ops
>> v2:
>> 	* use FB_IO_HELPERS options
>>
>> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
>> Cc: Jani Nikula <jani.nikula@linux.intel.com>
>> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
>> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
>> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
>> Cc: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
>> ---
>>   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 |  14 +--
>>   include/drm/drm_fb_helper.h                |  39 --------
>>   5 files changed, 9 insertions(+), 155 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
>> index 92a782827b7b..bb2e48cc6cd6 100644
>> --- a/drivers/gpu/drm/Kconfig
>> +++ b/drivers/gpu/drm/Kconfig
>> @@ -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
>> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
>> index bab6b252f02a..9978147bbc8a 100644
>> --- a/drivers/gpu/drm/drm_fb_helper.c
>> +++ b/drivers/gpu/drm/drm_fb_helper.c
>> @@ -736,113 +736,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_cfb_read - Implements struct &fb_ops.fb_read for I/O 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_cfb_read(struct fb_info *info, char __user *buf,
>> -			       size_t count, loff_t *ppos)
>> -{
>> -	return fb_io_read(info, buf, count, ppos);
>> -}
>> -EXPORT_SYMBOL(drm_fb_helper_cfb_read);
>> -
>> -/**
>> - * drm_fb_helper_cfb_write - Implements struct &fb_ops.fb_write for I/O 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_cfb_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_io_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));
>> -	}
> 
> The generated helpers do not have the if (helper->funcs->fb_dirty)
> check.
> Is this implemented somewhere else that I missed?

It's not needed any longer.  We used to test if the fbdev code needs 
damage handling by looking for a fb_dirty callback. If so, we ran the 
damage handling code.

With the patchset applied, the fbdev code that does not need damage 
handling calls fb_{io,sys}_write() directly.  The fbdev code that needs 
damage handling (generic, i915, msm) uses the generator macro that 
creates necessary the calls unconditionally.  We know each case at build 
time.

(I think I have to move the msm patch after patch 10/13 to make it 
bisectable.)

AFAICT the missing test for fb_dirty is also one of the reasons why 
there's a difference in performance.

Hopefully, this answers your question?

Best regards
Thomas

> 
> 	Sam
> 
> 
>> -
>> -	return ret;
>> -}
>> -EXPORT_SYMBOL(drm_fb_helper_cfb_write);
>> -
>> -/**
>> - * drm_fb_helper_cfb_fillrect - wrapper around cfb_fillrect
>> - * @info: fbdev registered by the helper
>> - * @rect: info about rectangle to fill
>> - *
>> - * A wrapper around cfb_fillrect implemented by fbdev core
>> - */
>> -void drm_fb_helper_cfb_fillrect(struct fb_info *info,
>> -				const struct fb_fillrect *rect)
>> -{
>> -	struct drm_fb_helper *helper = info->par;
>> -
>> -	cfb_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_cfb_fillrect);
>> -
>> -/**
>> - * drm_fb_helper_cfb_copyarea - wrapper around cfb_copyarea
>> - * @info: fbdev registered by the helper
>> - * @area: info about area to copy
>> - *
>> - * A wrapper around cfb_copyarea implemented by fbdev core
>> - */
>> -void drm_fb_helper_cfb_copyarea(struct fb_info *info,
>> -				const struct fb_copyarea *area)
>> -{
>> -	struct drm_fb_helper *helper = info->par;
>> -
>> -	cfb_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_cfb_copyarea);
>> -
>> -/**
>> - * drm_fb_helper_cfb_imageblit - wrapper around cfb_imageblit
>> - * @info: fbdev registered by the helper
>> - * @image: info about image to blit
>> - *
>> - * A wrapper around cfb_imageblit implemented by fbdev core
>> - */
>> -void drm_fb_helper_cfb_imageblit(struct fb_info *info,
>> -				 const struct fb_image *image)
>> -{
>> -	struct drm_fb_helper *helper = info->par;
>> -
>> -	cfb_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_cfb_imageblit);
>> -
>>   /**
>>    * drm_fb_helper_set_suspend - wrapper around fb_set_suspend
>>    * @fb_helper: driver-allocated fbdev helper, can be NULL
>> diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig
>> index e4f4d2e3fdfe..01b5a8272a27 100644
>> --- a/drivers/gpu/drm/i915/Kconfig
>> +++ b/drivers/gpu/drm/i915/Kconfig
>> @@ -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
>> diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
>> index aab1ae74a8f7..eccaceaf8b9d 100644
>> --- a/drivers/gpu/drm/i915/display/intel_fbdev.c
>> +++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
>> @@ -28,6 +28,7 @@
>>   #include <linux/console.h>
>>   #include <linux/delay.h>
>>   #include <linux/errno.h>
>> +#include <linux/fb.h>
>>   #include <linux/init.h>
>>   #include <linux/kernel.h>
>>   #include <linux/mm.h>
>> @@ -84,6 +85,10 @@ static void intel_fbdev_invalidate(struct intel_fbdev *ifbdev)
>>   	intel_frontbuffer_invalidate(to_frontbuffer(ifbdev), ORIGIN_CPU);
>>   }
>>   
>> +FB_GEN_DEFAULT_DEFERRED_IO_OPS(intel_fbdev,
>> +			       drm_fb_helper_damage_range,
>> +			       drm_fb_helper_damage_area)
>> +
>>   static int intel_fbdev_set_par(struct fb_info *info)
>>   {
>>   	struct intel_fbdev *ifbdev = to_intel_fbdev(info->par);
>> @@ -132,15 +137,12 @@ static int intel_fbdev_mmap(struct fb_info *info, struct vm_area_struct *vma)
>>   
>>   static const struct fb_ops intelfb_ops = {
>>   	.owner = THIS_MODULE,
>> +	__FB_DEFAULT_DEFERRED_OPS_RDWR(intel_fbdev),
>>   	DRM_FB_HELPER_DEFAULT_OPS,
>>   	.fb_set_par = intel_fbdev_set_par,
>> -	.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_pan_display = intel_fbdev_pan_display,
>>   	.fb_blank = intel_fbdev_blank,
>> +	.fb_pan_display = intel_fbdev_pan_display,
>> +	__FB_DEFAULT_DEFERRED_OPS_DRAW(intel_fbdev),
>>   	.fb_mmap = intel_fbdev_mmap,
>>   };
>>   
>> diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
>> index b50fd0c0b713..4863b0f8299e 100644
>> --- a/include/drm/drm_fb_helper.h
>> +++ b/include/drm/drm_fb_helper.h
>> @@ -258,18 +258,6 @@ void drm_fb_helper_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u3
>>   
>>   void 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);
>> @@ -385,33 +373,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)
>>   {
>> -- 
>> 2.40.1

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

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

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

* Re: [PATCH v4 13/13] drm/i915: Implement dedicated fbdev I/O helpers
  2023-05-30  7:12       ` Thomas Zimmermann
  (?)
  (?)
@ 2023-05-30 15:37         ` Sam Ravnborg
  -1 siblings, 0 replies; 134+ messages in thread
From: Sam Ravnborg @ 2023-05-30 15:37 UTC (permalink / raw)
  To: Thomas Zimmermann
  Cc: freedreno, linux-samsung-soc, Tvrtko Ursulin, amd-gfx,
	linux-arm-msm, intel-gfx, javierm, dri-devel, Rodrigo Vivi,
	linux-tegra, linux-arm-kernel

Hi Thomas,

> > > -	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));
> > > -	}
> > 
> > The generated helpers do not have the if (helper->funcs->fb_dirty)
> > check.
> > Is this implemented somewhere else that I missed?
> 
> It's not needed any longer.  We used to test if the fbdev code needs damage
> handling by looking for a fb_dirty callback. If so, we ran the damage
> handling code.
> 
> With the patchset applied, the fbdev code that does not need damage handling
> calls fb_{io,sys}_write() directly.  The fbdev code that needs damage
> handling (generic, i915, msm) uses the generator macro that creates
> necessary the calls unconditionally.  We know each case at build time.
> 
> (I think I have to move the msm patch after patch 10/13 to make it
> bisectable.)
> 
> AFAICT the missing test for fb_dirty is also one of the reasons why there's
> a difference in performance.
> 
> Hopefully, this answers your question?
Makes perfect sense - thanks.
That also implies that my conditional r-b's are now OK.

	Sam

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

* Re: [PATCH v4 13/13] drm/i915: Implement dedicated fbdev I/O helpers
@ 2023-05-30 15:37         ` Sam Ravnborg
  0 siblings, 0 replies; 134+ messages in thread
From: Sam Ravnborg @ 2023-05-30 15:37 UTC (permalink / raw)
  To: Thomas Zimmermann
  Cc: freedreno, linux-samsung-soc, Tvrtko Ursulin, amd-gfx,
	linux-arm-msm, intel-gfx, javierm, dri-devel, Rodrigo Vivi,
	linux-tegra, linux-arm-kernel

Hi Thomas,

> > > -	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));
> > > -	}
> > 
> > The generated helpers do not have the if (helper->funcs->fb_dirty)
> > check.
> > Is this implemented somewhere else that I missed?
> 
> It's not needed any longer.  We used to test if the fbdev code needs damage
> handling by looking for a fb_dirty callback. If so, we ran the damage
> handling code.
> 
> With the patchset applied, the fbdev code that does not need damage handling
> calls fb_{io,sys}_write() directly.  The fbdev code that needs damage
> handling (generic, i915, msm) uses the generator macro that creates
> necessary the calls unconditionally.  We know each case at build time.
> 
> (I think I have to move the msm patch after patch 10/13 to make it
> bisectable.)
> 
> AFAICT the missing test for fb_dirty is also one of the reasons why there's
> a difference in performance.
> 
> Hopefully, this answers your question?
Makes perfect sense - thanks.
That also implies that my conditional r-b's are now OK.

	Sam

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

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

* Re: [PATCH v4 13/13] drm/i915: Implement dedicated fbdev I/O helpers
@ 2023-05-30 15:37         ` Sam Ravnborg
  0 siblings, 0 replies; 134+ messages in thread
From: Sam Ravnborg @ 2023-05-30 15:37 UTC (permalink / raw)
  To: Thomas Zimmermann
  Cc: Tvrtko Ursulin, linux-samsung-soc, linux-arm-msm, intel-gfx,
	javierm, amd-gfx, dri-devel, Rodrigo Vivi, linux-tegra,
	freedreno, linux-arm-kernel

Hi Thomas,

> > > -	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));
> > > -	}
> > 
> > The generated helpers do not have the if (helper->funcs->fb_dirty)
> > check.
> > Is this implemented somewhere else that I missed?
> 
> It's not needed any longer.  We used to test if the fbdev code needs damage
> handling by looking for a fb_dirty callback. If so, we ran the damage
> handling code.
> 
> With the patchset applied, the fbdev code that does not need damage handling
> calls fb_{io,sys}_write() directly.  The fbdev code that needs damage
> handling (generic, i915, msm) uses the generator macro that creates
> necessary the calls unconditionally.  We know each case at build time.
> 
> (I think I have to move the msm patch after patch 10/13 to make it
> bisectable.)
> 
> AFAICT the missing test for fb_dirty is also one of the reasons why there's
> a difference in performance.
> 
> Hopefully, this answers your question?
Makes perfect sense - thanks.
That also implies that my conditional r-b's are now OK.

	Sam

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

* Re: [Intel-gfx] [PATCH v4 13/13] drm/i915: Implement dedicated fbdev I/O helpers
@ 2023-05-30 15:37         ` Sam Ravnborg
  0 siblings, 0 replies; 134+ messages in thread
From: Sam Ravnborg @ 2023-05-30 15:37 UTC (permalink / raw)
  To: Thomas Zimmermann
  Cc: linux-samsung-soc, linux-arm-msm, intel-gfx, javierm, amd-gfx,
	dri-devel, Rodrigo Vivi, linux-tegra, freedreno,
	linux-arm-kernel

Hi Thomas,

> > > -	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));
> > > -	}
> > 
> > The generated helpers do not have the if (helper->funcs->fb_dirty)
> > check.
> > Is this implemented somewhere else that I missed?
> 
> It's not needed any longer.  We used to test if the fbdev code needs damage
> handling by looking for a fb_dirty callback. If so, we ran the damage
> handling code.
> 
> With the patchset applied, the fbdev code that does not need damage handling
> calls fb_{io,sys}_write() directly.  The fbdev code that needs damage
> handling (generic, i915, msm) uses the generator macro that creates
> necessary the calls unconditionally.  We know each case at build time.
> 
> (I think I have to move the msm patch after patch 10/13 to make it
> bisectable.)
> 
> AFAICT the missing test for fb_dirty is also one of the reasons why there's
> a difference in performance.
> 
> Hopefully, this answers your question?
Makes perfect sense - thanks.
That also implies that my conditional r-b's are now OK.

	Sam

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

end of thread, other threads:[~2023-05-30 15:39 UTC | newest]

Thread overview: 134+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-24  9:21 [PATCH v4 00/13] drm/fbdev: Remove DRM's helpers for fbdev I/O Thomas Zimmermann
2023-05-24  9:21 ` Thomas Zimmermann
2023-05-24  9:21 ` Thomas Zimmermann
2023-05-24  9:21 ` [Intel-gfx] " Thomas Zimmermann
2023-05-24  9:21 ` [Intel-gfx] [PATCH v4 01/13] fbdev: Add Kconfig options to select different fb_ops helpers Thomas Zimmermann
2023-05-24  9:21   ` Thomas Zimmermann
2023-05-24  9:21   ` Thomas Zimmermann
2023-05-24  9:21   ` Thomas Zimmermann
2023-05-24 20:46   ` [v4,01/13] " Sui Jingfeng
2023-05-24 20:46     ` [Intel-gfx] [v4, 01/13] " Sui Jingfeng
2023-05-24 20:46     ` Sui Jingfeng
2023-05-29 19:17   ` [PATCH v4 " Sam Ravnborg
2023-05-29 19:17     ` Sam Ravnborg
2023-05-29 19:17     ` [Intel-gfx] " Sam Ravnborg
2023-05-29 19:17     ` Sam Ravnborg
2023-05-29 19:17     ` Sam Ravnborg
2023-05-24  9:21 ` [PATCH v4 02/13] fbdev: Add initializer macros for struct fb_ops Thomas Zimmermann
2023-05-24  9:21   ` Thomas Zimmermann
2023-05-24  9:21   ` Thomas Zimmermann
2023-05-24  9:21   ` [Intel-gfx] " Thomas Zimmermann
2023-05-24 20:57   ` [v4,02/13] " Sui Jingfeng
2023-05-24 20:57     ` [Intel-gfx] [v4, 02/13] " Sui Jingfeng
2023-05-24 20:57     ` [v4,02/13] " Sui Jingfeng
2023-05-26 12:38     ` Thomas Zimmermann
2023-05-26 12:38       ` [Intel-gfx] [v4, 02/13] " Thomas Zimmermann
2023-05-26 12:38       ` [v4,02/13] " Thomas Zimmermann
2023-05-26 12:38       ` Thomas Zimmermann
2023-05-29 19:23   ` [PATCH v4 02/13] " Sam Ravnborg
2023-05-29 19:23     ` Sam Ravnborg
2023-05-29 19:23     ` [Intel-gfx] " Sam Ravnborg
2023-05-29 19:23     ` Sam Ravnborg
2023-05-29 19:23     ` Sam Ravnborg
2023-05-24  9:21 ` [Intel-gfx] [PATCH v4 03/13] drm/armada: Use regular fbdev I/O helpers Thomas Zimmermann
2023-05-24  9:21   ` Thomas Zimmermann
2023-05-24  9:21   ` Thomas Zimmermann
2023-05-24  9:21   ` Thomas Zimmermann
2023-05-29 19:24   ` Sam Ravnborg
2023-05-29 19:24     ` Sam Ravnborg
2023-05-29 19:24     ` Sam Ravnborg
2023-05-29 19:24     ` [Intel-gfx] " Sam Ravnborg
2023-05-29 19:24     ` Sam Ravnborg
2023-05-24  9:21 ` [Intel-gfx] [PATCH v4 04/13] drm/exynos: " Thomas Zimmermann
2023-05-24  9:21   ` Thomas Zimmermann
2023-05-24  9:21   ` Thomas Zimmermann
2023-05-24  9:21   ` Thomas Zimmermann
2023-05-24  9:21   ` Thomas Zimmermann
2023-05-24  9:21 ` [Intel-gfx] [PATCH v4 05/13] drm/gma500: " Thomas Zimmermann
2023-05-24  9:21   ` Thomas Zimmermann
2023-05-24  9:21   ` Thomas Zimmermann
2023-05-24  9:21   ` Thomas Zimmermann
2023-05-24  9:21   ` Thomas Zimmermann
2023-05-24  9:21 ` [Intel-gfx] [PATCH v4 06/13] drm/radeon: " Thomas Zimmermann
2023-05-24  9:21   ` Thomas Zimmermann
2023-05-24  9:21   ` Thomas Zimmermann
2023-05-24  9:21   ` Thomas Zimmermann
2023-05-24  9:21 ` [Intel-gfx] [PATCH v4 07/13] drm/fbdev-dma: " Thomas Zimmermann
2023-05-24  9:21   ` Thomas Zimmermann
2023-05-24  9:21   ` Thomas Zimmermann
2023-05-24  9:21   ` Thomas Zimmermann
2023-05-24  9:21 ` [Intel-gfx] [PATCH v4 08/13] drm/msm: " Thomas Zimmermann
2023-05-24  9:21   ` Thomas Zimmermann
2023-05-24  9:21   ` Thomas Zimmermann
2023-05-24  9:21   ` Thomas Zimmermann
2023-05-24  9:21   ` Thomas Zimmermann
2023-05-24  9:21 ` [Intel-gfx] [PATCH v4 09/13] drm/omapdrm: " Thomas Zimmermann
2023-05-24  9:21   ` Thomas Zimmermann
2023-05-24  9:21   ` Thomas Zimmermann
2023-05-24  9:21   ` Thomas Zimmermann
2023-05-24  9:21 ` [Intel-gfx] [PATCH v4 10/13] drm/tegra: " Thomas Zimmermann
2023-05-24  9:21   ` Thomas Zimmermann
2023-05-24  9:21   ` Thomas Zimmermann
2023-05-24  9:21   ` Thomas Zimmermann
2023-05-24  9:21 ` [Intel-gfx] [PATCH v4 11/13] drm/fb-helper: Export helpers for marking damage areas Thomas Zimmermann
2023-05-24  9:21   ` Thomas Zimmermann
2023-05-24  9:21   ` Thomas Zimmermann
2023-05-24  9:21   ` Thomas Zimmermann
2023-05-29 19:38   ` Sam Ravnborg
2023-05-29 19:38     ` Sam Ravnborg
2023-05-29 19:38     ` [Intel-gfx] " Sam Ravnborg
2023-05-29 19:38     ` Sam Ravnborg
2023-05-29 19:38     ` Sam Ravnborg
2023-05-24  9:21 ` [PATCH v4 12/13] drm/fbdev-generic: Implement dedicated fbdev I/O helpers Thomas Zimmermann
2023-05-24  9:21   ` [Intel-gfx] " Thomas Zimmermann
2023-05-24  9:21   ` Thomas Zimmermann
2023-05-24  9:21   ` Thomas Zimmermann
2023-05-24 20:23   ` [v4,12/13] " Sui Jingfeng
2023-05-24 20:23     ` [Intel-gfx] [v4, 12/13] " Sui Jingfeng
2023-05-24 20:23     ` [v4,12/13] " Sui Jingfeng
2023-05-26 12:44     ` Thomas Zimmermann
2023-05-26 12:44       ` Thomas Zimmermann
2023-05-26 12:44       ` [Intel-gfx] [v4, 12/13] " Thomas Zimmermann
2023-05-26 12:44       ` [v4,12/13] " Thomas Zimmermann
2023-05-25  2:46   ` Sui Jingfeng
2023-05-25  2:46     ` [Intel-gfx] [v4, 12/13] " Sui Jingfeng
2023-05-25  2:46     ` [v4,12/13] " Sui Jingfeng
2023-05-24  9:21 ` [Intel-gfx] [PATCH v4 13/13] drm/i915: " Thomas Zimmermann
2023-05-24  9:21   ` Thomas Zimmermann
2023-05-24  9:21   ` Thomas Zimmermann
2023-05-24  9:21   ` Thomas Zimmermann
2023-05-24  9:21   ` Thomas Zimmermann
2023-05-24 21:25   ` [v4,13/13] " Sui Jingfeng
2023-05-24 21:25     ` [Intel-gfx] [v4, 13/13] " Sui Jingfeng
2023-05-24 21:25     ` [v4,13/13] " Sui Jingfeng
2023-05-29 19:36   ` [PATCH v4 13/13] " Sam Ravnborg
2023-05-29 19:36     ` Sam Ravnborg
2023-05-29 19:36     ` [Intel-gfx] " Sam Ravnborg
2023-05-29 19:36     ` Sam Ravnborg
2023-05-29 19:36     ` Sam Ravnborg
2023-05-30  4:02     ` Sui Jingfeng
2023-05-30  4:02       ` Sui Jingfeng
2023-05-30  4:02       ` [Intel-gfx] " Sui Jingfeng
2023-05-30  4:02       ` Sui Jingfeng
2023-05-30  7:12     ` Thomas Zimmermann
2023-05-30  7:12       ` [Intel-gfx] " Thomas Zimmermann
2023-05-30  7:12       ` Thomas Zimmermann
2023-05-30  7:12       ` Thomas Zimmermann
2023-05-30 15:37       ` Sam Ravnborg
2023-05-30 15:37         ` [Intel-gfx] " Sam Ravnborg
2023-05-30 15:37         ` Sam Ravnborg
2023-05-30 15:37         ` Sam Ravnborg
2023-05-29 19:41   ` Sam Ravnborg
2023-05-29 19:41     ` Sam Ravnborg
2023-05-29 19:41     ` Sam Ravnborg
2023-05-29 19:41     ` [Intel-gfx] " Sam Ravnborg
2023-05-29 19:41     ` Sam Ravnborg
2023-05-24 19:25 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/fbdev: Remove DRM's helpers for fbdev I/O (rev4) Patchwork
2023-05-24 19:26 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2023-05-24 19:41 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-05-25 12:44 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2023-05-29 19:37 ` [PATCH v4 00/13] drm/fbdev: Remove DRM's helpers for fbdev I/O Sam Ravnborg
2023-05-29 19:37   ` Sam Ravnborg
2023-05-29 19:37   ` [Intel-gfx] " Sam Ravnborg
2023-05-29 19:37   ` Sam Ravnborg
2023-05-29 19:37   ` Sam Ravnborg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.