Skip to content

drm: apple: iomfb: fix framebuffer retirement on DCP 14.7 - #583

Open
a-ramses wants to merge 2 commits into
AsahiLinux:asahi-wip-7.2from
a-ramses:draft/dcp-v14.7-fb-retirement
Open

drm: apple: iomfb: fix framebuffer retirement on DCP 14.7#583
a-ramses wants to merge 2 commits into
AsahiLinux:asahi-wip-7.2from
a-ramses:draft/dcp-v14.7-fb-retirement

Conversation

@a-ramses

Copy link
Copy Markdown

Summary

Fix framebuffer retirement with DCP firmware ABI 14.7 by:

  • moving the 0x234-byte A407 extension before the pointer-null flags to match the firmware layout;
  • enabling the existing swapped_out_fbs retirement logic for ABI 14.7.

Linux placed the null flags before the extension, so DCP did not process surface-clear requests. The workaround disabled framebuffer release for ABI 14.7.

Testing

Tested on T6030/M3 Pro:

  • 1,000 framebuffer replacements with 8 CRTC cycles;
  • 200 primary-plane disable/re-enable cycles;
  • all retained framebuffer references were released;
  • no DART/IOVA faults, failed swaps, aborts, panics, or SErrors.

@WhatAmISupposedToPutHere

Copy link
Copy Markdown
Member

Have you tested it with more than one plane active?

@chadmed chadmed left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please split this into two commits: one to fix the struct layout, and a revert commit for the hack. Also please ensure you have tested this with multiple active surfaces (e.g. with KWIN_USE_OVERLAYS=1).

Comment thread drivers/gpu/drm/apple/iomfb_template.h Outdated
u32 unkU32Ptr;
#endif
#if DCP_FW_VER >= DCP_FW_VERSION(14, 7, 0)
/*

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need this comment, the commit message and preprocessor directives both make this very obvious. Please drop it.

@a-ramses
a-ramses force-pushed the draft/dcp-v14.7-fb-retirement branch from f32b477 to ec3a947 Compare August 28, 2026 17:53
@a-ramses

Copy link
Copy Markdown
Author

Have you tested it with more than one plane active?

Tested with KWIN_USE_OVERLAYS=1.

plane[35]: plane-0
    crtc=crtc-0
    fb=55

plane[45]: plane-2
    crtc=crtc-0
    fb=61

plane_mask=5

No errors.

@chadmed

chadmed commented Aug 29, 2026

Copy link
Copy Markdown
Member

drm: apple: not drm/apple please.

@a-ramses a-ramses changed the title drm/apple: iomfb: fix framebuffer retirement on DCP 14.7 drm: apple: iomfb: fix framebuffer retirement on DCP 14.7 Aug 29, 2026
@chadmed

chadmed commented Aug 29, 2026

Copy link
Copy Markdown
Member

You need to change the commit line too :P

DCP 14.7 expects its 0x234-byte extension before the pointer-null
flags. Linux placed it after the flags, so DCP read the flags at the
old offsets and rejected surface-clear requests.

Move the extension before the pointer-null flags.

Signed-off-by: a-ramses <abdicheramzi@gmail.com>
This reverts commit 47508c0.

The DCP 14.7 request layout now matches the firmware, so surface-clear
requests work and stale framebuffer references can be retired again.

Signed-off-by: a-ramses <abdicheramzi@gmail.com>
@a-ramses
a-ramses force-pushed the draft/dcp-v14.7-fb-retirement branch from ec3a947 to cddf57e Compare August 29, 2026 13:01
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