[PATCH v4 0/9] drm/meson: add a second RGB plane on G12A

From: Guillaume La Roque

Date: Fri Dec 04 2026 - 03:11:15 EST


VD1 only accepts YUV buffers. Add OSD2 as a second RGB plane on G12A,
G12B and SM1.

OSD2 supports linear 32-bit RGB buffers, alpha blending and clipping.
Scaling, AFBC and interlaced output are not supported.

Tested on VIM3 with modetest and atomic KMS tests: 1080p, 720p, clipping,
framebuffer offsets, alpha and enable/disable cycles. Canvas pitch limits
and devices-only suspend/resume also pass. On v2, a green 100x100 OSD2
plane at (1000,600) was checked against a border drawn by the primary
plane.

Runtime testing is limited to VIM3 (G12B); G12A and SM1 are untested.

Based on drm-misc-next at a5646fb87c1c.
Built for arm64 with Clang and W=1.

---
Changes in v4:
- Reject unaligned OSD1 framebuffer offsets.
- Publish page-flip events with the pending updates and clear pending
OSD1 updates when the plane is disabled.
- Link to v3: https://patch.msgid.link/20261203-meson-g12a-osd2-v3-0-2cf76729b5d5@xxxxxxxxxxxx

Changes in v3:
- Rebase onto drm-misc-next.
- Link to v2: https://patch.msgid.link/20261203-meson-g12a-osd2-v2-0-8a4a57d32e20@xxxxxxxxxxxx

Changes in v2:
- Address Neil's comments and add his Reviewed-by tags.
- Keep the AFBC preparation in the OSD2 patch.
- Lock the legacy CRTC disable path against the IRQ.
- Split out the OSD1 pending-update fix, which also applies to older SoCs.
- Bypass the OSD2 RGB-to-YUV matrix on DSI.
- Flush OSD2 only when its plane is part of the atomic commit.
- Document the DIN0/DIN3 bypass paths and check an offset overlay on VIM3.
- Link to v1: https://patch.msgid.link/20261130-meson-g12a-osd2-v1-0-aa982300c20e@xxxxxxxxxxxx

---
Guillaume La Roque (9):
drm/meson: honor framebuffer offsets for the primary plane
drm/meson: isolate primary plane scaler setup
drm/meson: keep RGB scanout state per OSD
drm/meson: parameterize the G12A OSD color matrix setup
drm/meson: handle primary plane zpos allocation failure
drm/meson: select RGB plane registers by OSD index
drm/meson: serialize OSD state updates with the IRQ
drm/meson: publish pending OSD updates with the flip event
drm/meson: add a linear RGB overlay on G12A OSD2

drivers/gpu/drm/meson/meson_crtc.c | 172 +++++++++----
drivers/gpu/drm/meson/meson_drv.c | 25 +-
drivers/gpu/drm/meson/meson_drv.h | 45 +++-
drivers/gpu/drm/meson/meson_encoder_dsi.c | 2 +
drivers/gpu/drm/meson/meson_osd_afbcd.c | 36 +--
drivers/gpu/drm/meson/meson_plane.c | 408 +++++++++++++++++++-----------
drivers/gpu/drm/meson/meson_plane.h | 2 +-
drivers/gpu/drm/meson/meson_registers.h | 5 +
drivers/gpu/drm/meson/meson_viu.c | 52 ++--
9 files changed, 495 insertions(+), 252 deletions(-)
---
base-commit: a5646fb87c1c70c9da9f2f173029d5b6cd4773cf
base-tree: https://gitlab.freedesktop.org/drm/misc/kernel.git drm-misc-next
change-id: 20261124-meson-g12a-osd2-24b18a3c10c8

Best regards,
--
Guillaume La Roque <glaroque@xxxxxxxxxxxx>