* [PATCH 0/5] drm/microchip: add GFX2D support for SAM9X60 and SAM9X75
@ 2025-09-11 15:26 Cyrille Pitchen
2025-09-11 15:26 ` [PATCH 1/5] dt-bindings: gpu: add bindings for the Microchip GFX2D GPU Cyrille Pitchen
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Cyrille Pitchen @ 2025-09-11 15:26 UTC (permalink / raw)
To: David Airlie, Simona Vetter, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Nicolas Ferre, Alexandre Belloni, Claudiu Beznea, Russell King
Cc: dri-devel, devicetree, linux-kernel, linux-arm-kernel,
Cyrille Pitchen
Hi all,
This series of patches adds GFX2D support.
The GFX2D is a 2D GPU embedded in some Microchip SoCs such as the
SAM9X60 and SAM9X75.
Patches have been developped on top the 'linux-6.12-mchp' branch of the
https://github.com/linux4microchip/linux.git repository and tested on
mainly on a sam9x75-curiosity board and also on a sam9x60-ek board.
Then patches have been rebased on top of the 'drm-misc-next' branch
of the https://gitlab.freedesktop.org/drm/misc/kernel.git repository
for mainlining.
About the tests, the GFX2D driver was used with the M2D (Multi 2D)
library: https://github.com/linux4sam/libm2d
This is an open source library that abstracts 2D GPUs like the Microchip
GFX2D (and later the Vivante GC520UL), providing graphics applications
of libraries with a unified API, inspired from OpenGL but focused on 2D
GPUs. The libm2d library itself relies on the libdrm library to send
commands to the relevant DRM driver in the Linux kernel.
M2D comes with a m2d_test program to run basic unitary tests.
In addition, libm2d has been integrated to two graphics frameworks:
- EGT: https://github.com/linux4sam/egt
- LVGL: https://github.com/lvgl/lvgl/pull/8729
BR,
Cyrille
Signed-off-by: Cyrille Pitchen <cyrille.pitchen@microchip.com>
---
Cyrille Pitchen (5):
dt-bindings: gpu: add bindings for the Microchip GFX2D GPU
drm/microchip: add a driver for the Microchip GFX2D GPU
ARM: dts: microchip: sam9x60: Add GFX2D GPU
ARM: dts: microchip: sam9x7: Add GFX2D GPU
ARM: configs: at91_dt_defconfig: enable GFX2D driver
.../devicetree/bindings/gpu/microchip,gfx2d.yaml | 53 +
MAINTAINERS | 10 +
arch/arm/boot/dts/microchip/sam9x60.dtsi | 9 +
arch/arm/boot/dts/microchip/sam9x7.dtsi | 9 +
arch/arm/configs/at91_dt_defconfig | 1 +
drivers/gpu/drm/Kconfig | 2 +
drivers/gpu/drm/Makefile | 1 +
drivers/gpu/drm/microchip/Kconfig | 21 +
drivers/gpu/drm/microchip/Makefile | 8 +
drivers/gpu/drm/microchip/mchp_gfx2d_cmd.c | 1808 ++++++++++++++++++++
drivers/gpu/drm/microchip/mchp_gfx2d_cmd.h | 169 ++
drivers/gpu/drm/microchip/mchp_gfx2d_drv.c | 350 ++++
drivers/gpu/drm/microchip/mchp_gfx2d_drv.h | 132 ++
drivers/gpu/drm/microchip/mchp_gfx2d_gem.c | 263 +++
drivers/gpu/drm/microchip/mchp_gfx2d_gem.h | 90 +
drivers/gpu/drm/microchip/mchp_gfx2d_ioctl.c | 274 +++
drivers/gpu/drm/microchip/mchp_gfx2d_ioctl.h | 17 +
include/uapi/drm/microchip_drm.h | 286 ++++
18 files changed, 3503 insertions(+)
---
base-commit: d2624d90a0b776db468e889cb079ff1d3edaccf3
change-id: 20250911-cpitchen-mainline_gfx2d-6631e9352af7
Best regards,
--
Cyrille Pitchen <cyrille.pitchen@microchip.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/5] dt-bindings: gpu: add bindings for the Microchip GFX2D GPU
2025-09-11 15:26 [PATCH 0/5] drm/microchip: add GFX2D support for SAM9X60 and SAM9X75 Cyrille Pitchen
@ 2025-09-11 15:26 ` Cyrille Pitchen
2025-09-11 18:05 ` Conor Dooley
2025-09-11 15:26 ` [PATCH 3/5] ARM: dts: microchip: sam9x60: Add " Cyrille Pitchen
` (2 subsequent siblings)
3 siblings, 1 reply; 6+ messages in thread
From: Cyrille Pitchen @ 2025-09-11 15:26 UTC (permalink / raw)
To: David Airlie, Simona Vetter, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Nicolas Ferre, Alexandre Belloni, Claudiu Beznea, Russell King
Cc: dri-devel, devicetree, linux-kernel, linux-arm-kernel,
Cyrille Pitchen
The Microchip GFX2D GPU is embedded in the SAM9X60 and SAM9X7 SoC family.
Describe how the GFX2D GPU is integrated in these SoCs, including
register space, interrupt and clock.
Signed-off-by: Cyrille Pitchen <cyrille.pitchen@microchip.com>
---
.../devicetree/bindings/gpu/microchip,gfx2d.yaml | 53 ++++++++++++++++++++++
1 file changed, 53 insertions(+)
diff --git a/Documentation/devicetree/bindings/gpu/microchip,gfx2d.yaml b/Documentation/devicetree/bindings/gpu/microchip,gfx2d.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..e416e13bc6627a0fef3c70625a6a3e2d91636ffc
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpu/microchip,gfx2d.yaml
@@ -0,0 +1,53 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/gpu/microchip,gfx2d.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Microchip GFX2D GPU
+
+maintainers:
+ - Cyrille Pitchen <cyrille.pitchen@microchip.com>
+
+properties:
+ compatible:
+ enum:
+ - microchip,sam9x60-gfx2d
+ - microchip,sam9x7-gfx2d
+
+ reg:
+ maxItems: 1
+
+ interrupts:
+ maxItems: 1
+
+ clocks:
+ maxItems: 1
+
+ clock-names:
+ items:
+ const: periph_clk
+ maxItems: 1
+
+required:
+ - compatible
+ - reg
+ - interrupts
+ - clocks
+ - clock-names
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/interrupt-controller/irq.h>
+ #include <dt-bindings/clock/at91.h>
+ gfx2d@f0018000 {
+ compatible = "microchip,sam9x60-gfx2d";
+ reg = <0xf0018000 0x4000>;
+ interrupts = <36 IRQ_TYPE_LEVEL_HIGH 0>;
+ clocks = <&pmc PMC_TYPE_PERIPHERAL 36>;
+ clock-names = "periph_clk";
+ };
+
+...
--
2.48.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/5] ARM: dts: microchip: sam9x60: Add GFX2D GPU
2025-09-11 15:26 [PATCH 0/5] drm/microchip: add GFX2D support for SAM9X60 and SAM9X75 Cyrille Pitchen
2025-09-11 15:26 ` [PATCH 1/5] dt-bindings: gpu: add bindings for the Microchip GFX2D GPU Cyrille Pitchen
@ 2025-09-11 15:26 ` Cyrille Pitchen
2025-09-11 15:26 ` [PATCH 4/5] ARM: dts: microchip: sam9x7: " Cyrille Pitchen
2025-09-11 15:26 ` [PATCH 5/5] ARM: configs: at91_dt_defconfig: enable GFX2D driver Cyrille Pitchen
3 siblings, 0 replies; 6+ messages in thread
From: Cyrille Pitchen @ 2025-09-11 15:26 UTC (permalink / raw)
To: David Airlie, Simona Vetter, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Nicolas Ferre, Alexandre Belloni, Claudiu Beznea, Russell King
Cc: dri-devel, devicetree, linux-kernel, linux-arm-kernel,
Cyrille Pitchen
Add support for the GFX2D GPU.
Signed-off-by: Cyrille Pitchen <cyrille.pitchen@microchip.com>
---
arch/arm/boot/dts/microchip/sam9x60.dtsi | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/arch/arm/boot/dts/microchip/sam9x60.dtsi b/arch/arm/boot/dts/microchip/sam9x60.dtsi
index b075865e6a7688005d471665459b3f6f1f26f7a4..6a177c008e1501e49d984a216e8d060f9dbc63cb 100644
--- a/arch/arm/boot/dts/microchip/sam9x60.dtsi
+++ b/arch/arm/boot/dts/microchip/sam9x60.dtsi
@@ -353,6 +353,15 @@ AT91_XDMAC_DT_PERID(26))>,
status = "disabled";
};
+ gpu: gfx2d@f0018000 {
+ compatible = "microchip,sam9x60-gfx2d";
+ reg = <0xf0018000 0x4000>;
+ interrupts = <36 IRQ_TYPE_LEVEL_HIGH 0>;
+ clocks = <&pmc PMC_TYPE_PERIPHERAL 36>;
+ clock-names = "periph_clk";
+ status = "disabled";
+ };
+
i2s: i2s@f001c000 {
compatible = "microchip,sam9x60-i2smcc";
reg = <0xf001c000 0x100>;
--
2.48.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 4/5] ARM: dts: microchip: sam9x7: Add GFX2D GPU
2025-09-11 15:26 [PATCH 0/5] drm/microchip: add GFX2D support for SAM9X60 and SAM9X75 Cyrille Pitchen
2025-09-11 15:26 ` [PATCH 1/5] dt-bindings: gpu: add bindings for the Microchip GFX2D GPU Cyrille Pitchen
2025-09-11 15:26 ` [PATCH 3/5] ARM: dts: microchip: sam9x60: Add " Cyrille Pitchen
@ 2025-09-11 15:26 ` Cyrille Pitchen
2025-09-11 15:26 ` [PATCH 5/5] ARM: configs: at91_dt_defconfig: enable GFX2D driver Cyrille Pitchen
3 siblings, 0 replies; 6+ messages in thread
From: Cyrille Pitchen @ 2025-09-11 15:26 UTC (permalink / raw)
To: David Airlie, Simona Vetter, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Nicolas Ferre, Alexandre Belloni, Claudiu Beznea, Russell King
Cc: dri-devel, devicetree, linux-kernel, linux-arm-kernel,
Cyrille Pitchen
Add support for the GFX2D GPU.
Signed-off-by: Cyrille Pitchen <cyrille.pitchen@microchip.com>
---
arch/arm/boot/dts/microchip/sam9x7.dtsi | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/arch/arm/boot/dts/microchip/sam9x7.dtsi b/arch/arm/boot/dts/microchip/sam9x7.dtsi
index 66c07e642c3e1a2272490ec311062dfdf291c1cc..f4b71a49e6c167a0c9ad89b0c58fadb1ed467a5d 100644
--- a/arch/arm/boot/dts/microchip/sam9x7.dtsi
+++ b/arch/arm/boot/dts/microchip/sam9x7.dtsi
@@ -271,6 +271,15 @@ AT91_XDMAC_DT_PERID(38))>,
status = "disabled";
};
+ gpu: gfx2d@f0018000 {
+ compatible = "microchip,sam9x7-gfx2d";
+ reg = <0xf0018000 0x4000>;
+ interrupts = <36 IRQ_TYPE_LEVEL_HIGH 0>;
+ clocks = <&pmc PMC_TYPE_PERIPHERAL 36>;
+ clock-names = "periph_clk";
+ status = "disabled";
+ };
+
i2s: i2s@f001c000 {
compatible = "microchip,sam9x7-i2smcc", "microchip,sam9x60-i2smcc";
reg = <0xf001c000 0x100>;
--
2.48.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 5/5] ARM: configs: at91_dt_defconfig: enable GFX2D driver
2025-09-11 15:26 [PATCH 0/5] drm/microchip: add GFX2D support for SAM9X60 and SAM9X75 Cyrille Pitchen
` (2 preceding siblings ...)
2025-09-11 15:26 ` [PATCH 4/5] ARM: dts: microchip: sam9x7: " Cyrille Pitchen
@ 2025-09-11 15:26 ` Cyrille Pitchen
3 siblings, 0 replies; 6+ messages in thread
From: Cyrille Pitchen @ 2025-09-11 15:26 UTC (permalink / raw)
To: David Airlie, Simona Vetter, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Nicolas Ferre, Alexandre Belloni, Claudiu Beznea, Russell King
Cc: dri-devel, devicetree, linux-kernel, linux-arm-kernel,
Cyrille Pitchen
The GFX2D GPU is embedded in both SAM9X60 and SAM9X75; enable the
driver to use it.
Signed-off-by: Cyrille Pitchen <cyrille.pitchen@microchip.com>
---
arch/arm/configs/at91_dt_defconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/configs/at91_dt_defconfig b/arch/arm/configs/at91_dt_defconfig
index ff13e1ecf4bb9545d6d2210b2f3059e6807779a0..85e9b52152aec6746f660dd0c299cd5aa12ce2ea 100644
--- a/arch/arm/configs/at91_dt_defconfig
+++ b/arch/arm/configs/at91_dt_defconfig
@@ -144,6 +144,7 @@ CONFIG_VIDEO_OV2640=m
CONFIG_VIDEO_OV7740=m
CONFIG_DRM=y
CONFIG_DRM_ATMEL_HLCDC=y
+CONFIG_DRM_MICROCHIP_GFX2D=y
CONFIG_DRM_MICROCHIP_LVDS_SERIALIZER=y
CONFIG_DRM_PANEL_SIMPLE=y
CONFIG_DRM_PANEL_EDP=y
--
2.48.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/5] dt-bindings: gpu: add bindings for the Microchip GFX2D GPU
2025-09-11 15:26 ` [PATCH 1/5] dt-bindings: gpu: add bindings for the Microchip GFX2D GPU Cyrille Pitchen
@ 2025-09-11 18:05 ` Conor Dooley
0 siblings, 0 replies; 6+ messages in thread
From: Conor Dooley @ 2025-09-11 18:05 UTC (permalink / raw)
To: Cyrille Pitchen
Cc: David Airlie, Simona Vetter, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Nicolas Ferre, Alexandre Belloni, Claudiu Beznea, Russell King,
dri-devel, devicetree, linux-kernel, linux-arm-kernel
[-- Attachment #1: Type: text/plain, Size: 2306 bytes --]
On Thu, Sep 11, 2025 at 05:26:25PM +0200, Cyrille Pitchen wrote:
> The Microchip GFX2D GPU is embedded in the SAM9X60 and SAM9X7 SoC family.
> Describe how the GFX2D GPU is integrated in these SoCs, including
> register space, interrupt and clock.
>
> Signed-off-by: Cyrille Pitchen <cyrille.pitchen@microchip.com>
> ---
> .../devicetree/bindings/gpu/microchip,gfx2d.yaml | 53 ++++++++++++++++++++++
> 1 file changed, 53 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/gpu/microchip,gfx2d.yaml b/Documentation/devicetree/bindings/gpu/microchip,gfx2d.yaml
> new file mode 100644
> index 0000000000000000000000000000000000000000..e416e13bc6627a0fef3c70625a6a3e2d91636ffc
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/gpu/microchip,gfx2d.yaml
Filename matching a compatible please.
> @@ -0,0 +1,53 @@
> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/gpu/microchip,gfx2d.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Microchip GFX2D GPU
> +
> +maintainers:
> + - Cyrille Pitchen <cyrille.pitchen@microchip.com>
> +
> +properties:
> + compatible:
> + enum:
> + - microchip,sam9x60-gfx2d
> + - microchip,sam9x7-gfx2d
> +
> + reg:
> + maxItems: 1
> +
> + interrupts:
> + maxItems: 1
> +
> + clocks:
> + maxItems: 1
> +
> + clock-names:
> + items:
> + const: periph_clk
> + maxItems: 1
Why do you need clock-names if you only have one clock?
If there's a reason to keep it, drop the _clk - it's redundant.
> +
> +required:
> + - compatible
> + - reg
> + - interrupts
> + - clocks
> + - clock-names
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + #include <dt-bindings/interrupt-controller/irq.h>
> + #include <dt-bindings/clock/at91.h>
> + gfx2d@f0018000 {
"gfx2d" is not a generic node name, I assume this should actually be
"gpu"?
Cheers,
Conor.
> + compatible = "microchip,sam9x60-gfx2d";
> + reg = <0xf0018000 0x4000>;
> + interrupts = <36 IRQ_TYPE_LEVEL_HIGH 0>;
> + clocks = <&pmc PMC_TYPE_PERIPHERAL 36>;
> + clock-names = "periph_clk";
> + };
> +
> +...
>
> --
> 2.48.1
>
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-09-11 18:05 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-11 15:26 [PATCH 0/5] drm/microchip: add GFX2D support for SAM9X60 and SAM9X75 Cyrille Pitchen
2025-09-11 15:26 ` [PATCH 1/5] dt-bindings: gpu: add bindings for the Microchip GFX2D GPU Cyrille Pitchen
2025-09-11 18:05 ` Conor Dooley
2025-09-11 15:26 ` [PATCH 3/5] ARM: dts: microchip: sam9x60: Add " Cyrille Pitchen
2025-09-11 15:26 ` [PATCH 4/5] ARM: dts: microchip: sam9x7: " Cyrille Pitchen
2025-09-11 15:26 ` [PATCH 5/5] ARM: configs: at91_dt_defconfig: enable GFX2D driver Cyrille Pitchen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox