From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 891E8E7E0B9 for ; Mon, 9 Feb 2026 09:57:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F381610E3AE; Mon, 9 Feb 2026 09:57:41 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=microchip.com header.i=@microchip.com header.b="WjBB5FRg"; dkim-atps=neutral Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by gabe.freedesktop.org (Postfix) with ESMTPS id 41C0610E3AE for ; Mon, 9 Feb 2026 09:57:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1770631060; x=1802167060; h=from:subject:date:message-id:mime-version: content-transfer-encoding:to:cc; bh=3vJBi65zjQr9zwXIJ042XY0LXmk+DQOt0/Gvj3YLFWA=; b=WjBB5FRg1/VGhlXKi4aKobJFg0nG0L64r5szT1pFjPOMgFtrlKd7CbXw +zCdfOgRoiel2YlsCrUWKq2SgZjAJHQJ038JxJMGbc4aYkGA/88oRU4P4 L8eHb00jjCg769Yxeu74zrFed/pkYi+ATuIBNH6d8c+H2/2ZjVgdoZnQ1 uFp4Ul1M6uL6PPH2onKAm+uHhHMB1OslrtHhPfKhHxHFIBk1fj3HSdzDz v4ZLoP6F4QsGqAPDdWRpoRydH/1KRVFC2NuJwHsce+U2dZoMALmkPzqtZ MrtCYeOyRl4z4KPNoVVMfb6hXljhZ1IotlzM5Fesr18btkKWMZVl8cR2d g==; X-CSE-ConnectionGUID: ndl2L5WnRr+m1f1i6lcTaw== X-CSE-MsgGUID: 3rNjupS5QO2sdybTg4p4pA== X-IronPort-AV: E=Sophos;i="6.21,281,1763449200"; d="scan'208";a="60386960" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa1.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2026 02:57:39 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.87.151) by chn-vm-ex3.mchp-main.com (10.10.87.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.2.2562.35; Mon, 9 Feb 2026 02:57:09 -0700 Received: from ROU-LL-M19942.mpu32.int (10.10.85.11) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2507.58 via Frontend Transport; Mon, 9 Feb 2026 02:57:06 -0700 From: Cyrille Pitchen Subject: [PATCH v7 0/5] drm/microchip: add GFX2D support for SAM9X60 and SAM9X75 Date: Mon, 9 Feb 2026 10:56:43 +0100 Message-ID: <20260209-cpitchen-mainline_gfx2d-v7-0-0c12e64a0950@microchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAFuviWkC/4XNy2rDMBCF4VcJWldFM5JHUld9j1KCrEssqC/Yw SQEv3vlQIspNl3+B+abB5vimOPE3k4PNsY5T7nvSuiXE/ON6y6R51CaocBKWADuh3z1Tex463L 3lbt4vqQbBk4kIVpZoUualethjCnfnvLHZ+kmT9d+vD8fzbCu/5szcMGDTq4GJw3E+N5mP/a+y cOr71u2ujNuLXNsYbHIJ+dtqIgA9yz5awGgOrbkagmdjFdCo6E9S/1YJAp2bKliJQQhFLggldy zqq0lj62qWNYHV5vkyNp6z6KNheLYomKBA/IBgha1+Wsty/INnroz0j4CAAA= X-Change-ID: 20250911-cpitchen-mainline_gfx2d-6631e9352af7 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: , , , , Cyrille Pitchen , Conor Dooley X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=5771; i=cyrille.pitchen@microchip.com; h=from:subject:message-id; bh=3vJBi65zjQr9zwXIJ042XY0LXmk+DQOt0/Gvj3YLFWA=; b=owGbwMvMwCXmf6yzKqEsVIbxtFoSQ2bn+qwLGwvVeKe0aNhfthEJ33myNj9jx9pNTY/rFdOa/ 1mFmod0lLIwiHExyIopshx6s7U38/irx3avRKVg5rAygQxh4OIUgInMN2X4K/CAR2cRE2e20zTO Bhfr8y7b1DZ4K24ov63brCAonR2ZwfCT8arqlNzUg0yKXzeGRjhGhywyV2FLX3Je+svXpWeLY1f zAAA= X-Developer-Key: i=cyrille.pitchen@microchip.com; a=openpgp; fpr=7A21115D7D6026585D0E183E0EF12AA1BFAC073D X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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. Moreover, the patches have also been rebased on the WIP 'linux-6.18-mchp' branch of the https://github.com/linux4microchip/linux.git repository then tested on a sam9x75-curiosity board. 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 --- Changes in v7: - Rebased onto the 'drm-misc-next' branch on 2026-02-09. - Rewored patch 2: + Reworked the former valid_pixel_format() function into the new mchp_gfx2d_valid_buffer_params() function, which is called from both the mchp_gfx2d_ioctl_{alloc,import}_buffer() functions and now checks the `width` and `stride` parameters in addition to the `format` one. + Added the mchp_gfx2d_valid_size() function, which is called from both the mchp_gfx2d_ioctl_{alloc,import}_buffer() functions and checks (`stride` * `height`) against `size` as suggested by Daniel Stone. - Link to v6: https://lore.kernel.org/r/20260120-cpitchen-mainline_gfx2d-v6-0-1a16cd1d70b8@microchip.com Changes in v6: - Shrank the size of the register set in the device tree from 0x4000 down to 0x100 (patches 1, 3 and 4). - Collected Reviewed-by and Acked-by tags from Nicolas Ferre on patches 1 and 5. - Rebased onto the 'drm-misc-next' branch on 2026-01-20. - Link to v5: https://lore.kernel.org/r/20260113-cpitchen-mainline_gfx2d-v5-0-9cdab8fa699b@microchip.com Changes in v5: - Fixed compilation issues in patch 2: + Included from mchp_gfx2d_cmd.c, mchp_gfx2d_drv.c and mchp_gfx2d_gem.c. + Replaced '.remove_new' with '.remove' in definition of 'struct platform_driver mchp_gfx2d_platform_driver' to match the latest definition of 'struct platform_driver'. + Removed the '.date' member from the definition of 'struct drm_driver mchp_gfx2d_drm_driver' since this 'date' member has been removed from 'struct drm_driver'. - Fixed typos in doxygen documentations of two functions: + mchp_gfx2d_process_completed_commands() + mchp_gfx2d_init_command_queue() - Link to v4: https://lore.kernel.org/r/20260112-cpitchen-mainline_gfx2d-v4-0-f210041ad343@microchip.com Changes in v4: - Rebased onto the 'drm-misc-next' branch on 2026-01-12. - Link to v3: https://lore.kernel.org/r/20251124-cpitchen-mainline_gfx2d-v3-0-607f8c407286@microchip.com Changes in v3: - Collected Acked-by tag from Conor Dooley on patch 1 - Rebased onto the 'drm-misc-next' branch on 2025-11-24. - Link to v2: https://lore.kernel.org/r/20250918-cpitchen-mainline_gfx2d-v2-0-6cfac9d56612@microchip.com Changes in v2: - Renamed microchip,gfx2d.yaml into microchip,sam9x60-gfx2d.yaml. - Removed the 'clock-names' property from the DT bindings. - Renamed the GPU node from 'gfx2d' to 'gpu' in sam9x{60,7}.dtsi files. - Link to v1: https://lore.kernel.org/r/20250911-cpitchen-mainline_gfx2d-v1-0-d7fab1a381ee@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 .../bindings/gpu/microchip,sam9x60-gfx2d.yaml | 46 + MAINTAINERS | 10 + arch/arm/boot/dts/microchip/sam9x60.dtsi | 8 + arch/arm/boot/dts/microchip/sam9x7.dtsi | 8 + arch/arm/configs/at91_dt_defconfig | 1 + drivers/gpu/drm/Kconfig | 1 + 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 | 1809 ++++++++++++++++++++ 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 | 264 +++ drivers/gpu/drm/microchip/mchp_gfx2d_gem.h | 90 + drivers/gpu/drm/microchip/mchp_gfx2d_ioctl.c | 302 ++++ drivers/gpu/drm/microchip/mchp_gfx2d_ioctl.h | 17 + include/uapi/drm/microchip_drm.h | 286 ++++ 18 files changed, 3523 insertions(+) --- base-commit: f2edbafc6cb905caec2b231e8e2226b4c75daad9 change-id: 20250911-cpitchen-mainline_gfx2d-6631e9352af7 Best regards, -- Cyrille Pitchen