[PATCH RFC 0/6] AFBC fixes for MediaTek DRM

zoan37 agentzoan at gmail.com
Mon Oct 12 19:32:22 PDT 2026


Hi Nícolas,

On Fri, Jan 9, 2026, Nícolas F. R. A. Prado wrote:
> I received a suggestion that the Lx_2ND_SUBBUF bit in OVL is not needed
> when cropping is not enabled, and that removing it should fix the extra
> pixels after the image described in 2.a., and perhaps even fix AFBC not
> working with MT8188, though I haven't had time to test it.

I tried this on an MT8189 Chromebook (Lenovo IdeaPad Slim 3 Chromebook,
board "quigon" of the skywalker family), and the suggestion holds there.

Setup: next-20261008 with the posted MT8189 display series and this
board's DT, plus patches 1-4 and 6 of this RFC (5 is MT8188-only; the
MT8189 OVL uses the MT8195 data). AFBC announced on OVL0 only, which
drives the internal 1920x1200 eDP panel. Mesa 26.2.4 Panfrost
(Mali-G57), Hyprland. The compositor picked AFBC 32x8|SPLIT|SPARSE for
both the 1920x1200 primary plane and the 512x512 cursor plane.

With the series as posted, I see what you list as 2.a: the top 4 rows
are missing, and stray pixels show up after the image (here right below
the cursor, on the cursor plane). On top of that, the IOMMU reports read
faults from the display side while AFBC layers are on:

  mtk-iommu 1e802000.iommu: fault type=0x5 iova=0xfad06000 pa=0x0 master=0x21810410(larb=1 port=4) layer=1 read

(always larb 1 port 4, two different iovas, presumably one per plane)

With OVL_PITCH_MSB_2ND_SUBBUF left out of DISP_REG_OVL_PITCH_MSB for
these layers, the picture is correct (nothing missing at the top, no
stray pixels) and there are no faults. I made the bit switchable at
runtime to check that it is the cause: with the bit off, 0 faults in
30 s; set again, 20 faults in the next 10 s and the artifacts are back;
off again, the faults stop once both planes have been updated.

What I run now sets it only when the layer is cropped, going by the
suggestion:

	bool cropped = pending->clip_left || pending->clip_right ||
		       pending->clip_top || pending->clip_bottom;

	mtk_ddp_write_relaxed(cmdq_pkt,
			      (cropped ? OVL_PITCH_MSB_2ND_SUBBUF : 0) | pitch_msb,
			      &ovl->cmdq_reg, ovl->regs, DISP_REG_OVL_PITCH_MSB(idx));

I haven't been able to exercise a cropped AFBC layer here (the
compositor only uses full-screen and cursor planes), so I can't say
whether the bit is right in that case. I also haven't tried the
resolutions from 2.b/2.c or the external pipeline (OVL1).

I can test a v2 on MT8189. The board's patches and notes are at
https://github.com/zoan37/lenovo-slim3-chromebook-omarchy

The testing was done with help from an AI assistant (Claude).

Thanks,
zoan37



More information about the linux-arm-kernel mailing list