Skip to content

drm/vc4: fkms: Don't put BCM2712 buffers behind the HVS IOMMU - #7769

Merged
pelwell merged 1 commit into
raspberrypi:rpi-6.18.yfrom
popcornmix:fkms-2712-iommu
Nov 17, 2026
Merged

pelwell merged 1 commit into
raspberrypi:rpi-6.18.yfrom
popcornmix:fkms-2712-iommu

Conversation

@popcornmix

Copy link
Copy Markdown
Collaborator

With dtoverlay=vc4-fkms-v3d on Pi 5 the screen shows random memory once the vc4 driver loads.

vc4_drm_bind() copies the HVS node's DMA configuration onto the vc4 device and sets a 36-bit DMA mask on BCM2712. That attaches the device to the HVS IOMMU (late IOMMU probe at driver bind, something fishy here!), so buffers get 36-bit IOVAs. The firmware's set-plane call only takes a 32-bit address and the firmware scans out without the IOMMU, so the HVS reads the wrong memory.

This change:

  • uses a 32-bit DMA mask whenever firmware KMS is in use
  • skips the HVS DMA configuration for firmware KMS on BCM2712 only (Pi 3/4 firmware KMS still need it for the 0xc0000000 bus alias)
  • adds raspberrypi,rpi-firmware-kms-2712 to firmware_kms(), so the firmware display driver is no longer sent NOTIFY_DISPLAY_DONE under firmware KMS on Pi 5

Tested with fkms on Pi 3B+, Pi 4B and Pi 5; the picture is correct on all three.

  • Pi 5 (labwc desktop, 1080p): the IOMMU warning is gone and the framebuffer is allocated at 0x0d800000 (CMA).
  • Pi 4: the framebuffer keeps its 0xc0000000 bus alias (0xcf700000), as before.

vc4_drm_bind() copies the DMA configuration of the HVS node to the
vc4 device and gives BCM2712 a 36-bit DMA mask. With firmware KMS this
puts the buffers behind the HVS IOMMU at 36-bit IOVAs, but the
firmware's set-plane call only takes a 32-bit address and scans out
without the IOMMU, so the display shows random memory.

Skip the HVS DMA configuration and keep a 32-bit mask when firmware
KMS is used on BCM2712, and recognise the 2712 firmware KMS node in
firmware_kms() so the firmware display driver isn't told to stop.

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
@popcornmix

Copy link
Copy Markdown
Collaborator Author

I know we don't strongly support this, but it used to work and testing if anything bad happens with suspend/resume using fkms showed this had broken, and had a fairly simple fix.

@pelwell
pelwell merged commit 12d52e2 into raspberrypi:rpi-6.18.y Nov 17, 2026
12 checks passed
@popcornmix
popcornmix deleted the fkms-2712-iommu branch November 17, 2026 20:02
popcornmix added a commit to raspberrypi/firmware that referenced this pull request Nov 18, 2026
See: raspberrypi/linux#7766

kernel: drm/vc4: fkms: Don't put BCM2712 buffers behind the HVS IOMMU
See: raspberrypi/linux#7769

kernel: drm/vc4: Fix plane scaling edge cases that corrupt other planes
See: raspberrypi/linux#7702

kernel: clocksource/drivers/bcm2835_timer: Detect missed compare matches
See: raspberrypi/linux#7765
popcornmix added a commit to raspberrypi/rpi-firmware that referenced this pull request Nov 18, 2026
See: raspberrypi/linux#7766

kernel: drm/vc4: fkms: Don't put BCM2712 buffers behind the HVS IOMMU
See: raspberrypi/linux#7769

kernel: drm/vc4: Fix plane scaling edge cases that corrupt other planes
See: raspberrypi/linux#7702

kernel: clocksource/drivers/bcm2835_timer: Detect missed compare matches
See: raspberrypi/linux#7765
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants