Claude review: drm: lcdif: Wait for vblank before disabling DMA

Claude Code Review Bot
2026-03-31T06:48:35Z

Patch Review

This is the actual bug fix. Two issues:

**1. Malformed `Co-developed-by` tag (must fix):**

The trailer has:
```
Signed-off-by: Paul Kocialkowski <paulk@sys-base.io>
Co-developed-by: Lucas Stach <l.stach@pengutronix.de>
```

Per `Documentation/process/submitting-patches.rst`, every `Co-developed-by` **must** be immediately followed by a `Signed-off-by` from that same person. The correct form would be:

```
Co-developed-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Paul Kocialkowski <paulk@sys-base.io>
```

(The patch author's `Signed-off-by` should generally come last.)

**2. Duplicate error message (should fix):**

```c
if (ret)
drm_err(lcdif->drm, "Failed to disable controller!\n");
```

This exact same string appears for both the existing `CTRLDESCL0_5_EN` poll timeout and the new `CTRLDESCL0_5_SHADOW_LOAD_EN` poll timeout. If either fails, the log gives no indication of *which* step timed out. The new message should be distinct, e.g., `"Failed to wait for shadow load completion!\n"` or `"Timed out waiting for DMA frame completion!\n"`.

**3. Approach observation (minor):**

The technique of setting `SHADOW_LOAD_EN` and polling for hardware to clear it as a proxy for "frame DMA is complete" is clever. The comment in the code explains the rationale well. The 36000 µs timeout (~2 frames at 60 Hz) matches the existing timeout above and is reasonable.

One subtle question: after the first poll confirms `CTRLDESCL0_5_EN` is cleared, is the hardware guaranteed to still process a `SHADOW_LOAD_EN` request? If `EN` being cleared means the layer is fully off, the shadow load might never be consumed. This deserves verification against the hardware reference or NXP BSP behavior — though the fact that the NXP BSP uses a similar (if cruder) approach with a 25 ms sleep suggests the hardware does honor it.