Files
linux/drivers
Nick Hollinghurst 57b981b838 drm: Add RP1 DPI driver
Add support for the RP1 DPI hardware.

Signed-off-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com>

drm/rp1: depends on, instead of select, MFD_RP1

According to kconfig-language.txt [1], select should be used only for
"non-visible symbols ... and for symbols with no dependencies". Since
MFD_RP1 both is visible and has a dependency, "select" should not be
used and "depends on" should be used instead.

In particular, this fixes the build of this kernel tree on NixOS, where
its kernel config system will try to answer 'M' to as many config as
possible.

[1] https://www.kernel.org/doc/html/latest/kbuild/kconfig-language.html

Signed-off-by: Ratchanan Srirattanamet <peathot@hotmail.com>

drm: rp1: VEC and DPI drivers: Fix bug #5901

Rework probe() to use devm_drm_dev_alloc(), embedding the DRM
device in the DPI or VEC device as now seems to be recommended.

Change order of resource allocation and driver initialization.
This prevents it trying to write to an unmapped register during
clean-up, which previously could crash.

Signed-off-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com>

drm: rp1: dpi: Add support for MEDIA_BUS_FMT_RGB565_1X24_CPADHI

This new format corresponds to the Raspberry Pi legacy DPI mode 3.

Signed-off-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com>

drm: rp1: rp1-dpi: Add DRM_FORMAT_ARGB8888 and DRM_FORMAT_ABGR8888

Android requires this.
As the underlying hardware doesn't support alpha blending,
we ignore the alpha value.

Signed-off-by: Jan Kehren <jan.kehren@emteria.com>

drm: rp1: rp1-dpi: Add interlaced modes and PIO program to fix VSYNC

Implement interlaced modes by wobbling the base pointer and VFP width
for every field. This results in correct pixels but incorrect VSYNC.

Now use PIO to generate a fixed-up VSYNC by sampling DE and HSYNC.
This requires DPI's DE output to be mapped to GPIO1, which we check.

When DE is not exposed, the internal fixup is disabled. VSYNC/GPIO2
becomes a modified signal, designed to help an external device or
PIO program synthesize CSYNC or VSYNC.

Signed-off-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com>

drm: rp1: rp1-dpi: Fix optional dependency on RP1_PIO

Add optional dependency to Kconfig, and conditionally compile
PIO-dependent code. Add a mode validation function to reject
interlaced modes when RP1_PIO is not present.

Signed-off-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com>

drm: rp1: rp1-dpi: Add "rgb_order" property (to match VC4 DPI)

As on VC4, the OF property overrides the order implied by media
bus format. Only 4 of the 6 possible orders are supported. New
add-on hardware designs should not rely on this "legacy" feature.

Signed-off-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com>

drm/rp1: DPI interlace: Improve precision of PIO-generated VSYNC

Instead of trying to minimize the delay between seeing HSYNC edge
and asserting VSYNC, try to predict the next HSYNC edge precisely.
This eliminates the round-trip delay but introduces mode-dependent
rounding error. HSYNC->VSYNC lag reduced from ~30ns to -5ns..+10ns
(plus up to 5ns synchronization jitter as before).

This may benefit e.g. SCART HATs, particularly those that generate
Composite Sync using a XNOR gate.

Signed-off-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com>

drm/rp1-dpi: Run DRM default client setup

Call drm_client_setup() to run the kernel's default client setup
for DRM. Set fbdev_probe in struct drm_driver, so that the client
setup can start the common fbdev client.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>

drm/rp1/rp1_dpi: Move Composite Sync generation into the kernel

Move RP1 DPI's PIO-assisted Composite Sync generation code,
previously released as a separate utility, into the kernel driver.
There are 3 variants for progressive, generic interlaced and TV-
style interlaced CSync, alongside the existing VSync fixup.

Check that all of GPIOs 1-3 are mapped to DPI, so PIO won't try
to snoop on a missing output, or override another device's pins.

Add "force_csync" module parameter, for convenience of testing,
as few tools can set DRM_MODE_FLAG_CSYNC.

Signed-off-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com>
Signed-off-by: Phil Elwell <phil@raspberrypi.com>

drm: rp1: Enable VEC->GPIO output; cosmetic change to registers

In the VEC driver, enable mapping VEC (not DPI) to DPI GPIOs.
This is to support VEC output over GPIO on Raspberry Pi CM5.
It is harmless as DPI and VEC could not be used concurrently,
and the output is anyway conditional on pinctrl.

Also, tweak the style of VIDEO_OUT_CFG register definitions
(in both DPI and VEC drivers) to be more Linux-friendly.

Signed-off-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com>
2025-11-24 14:23:18 +00:00
..
2025-11-24 14:23:17 +00:00
2025-11-24 14:23:18 +00:00
2025-11-24 14:23:18 +00:00
2025-10-01 00:00:45 +00:00
2025-09-29 00:17:22 +02:00
2025-11-24 14:23:06 +00:00
2025-11-24 14:07:35 +00:00
2025-11-24 14:23:17 +00:00
2025-11-24 14:07:36 +00:00
2025-11-24 14:23:17 +00:00
2025-09-22 09:35:21 -04:00
2025-11-24 14:07:37 +00:00
2025-11-24 14:23:11 +00:00
2025-11-24 14:23:18 +00:00
2025-11-17 16:58:25 -08:00
2025-11-24 14:23:13 +00:00
2025-11-24 14:23:17 +00:00
2025-10-01 07:24:43 -04:00