Claude review: drm: verisilicon: convert drm_format to vs_format in atomic_check

Claude Code Review Bot
2026-02-11T06:24:25Z

Overall Series Review

Subject: drm: verisilicon: convert drm_format to
vs_format in atomic_check
Author: Icenowy Zheng <zhengxingda@iscas.ac.cn>
Patches: 4
Reviewed: 2026-02-11T16:24:25.294866

---

This 3-patch series refactors the Verisilicon DRM driver to move DRM-to-hardware format conversion from `atomic_commit` to `atomic_check`, improving error handling by allowing validation to occur before the point of no return.

**Series Architecture:**
The refactoring follows a logical progression:
1. Patch 1: Makes format conversion function return error codes
2. Patch 2: Introduces plane state subclassing infrastructure
3. Patch 3: Moves format conversion to atomic_check and stores result in plane state

**Overall Assessment:**
- **Conceptually sound**: Moving validation to atomic_check is the correct DRM atomic design pattern
- **Good incremental approach**: Breaking changes into logical steps aids review and bisectability
- **Implementation concerns**: Several issues with state management and error handling (detailed below)

**Key Issues:**
1. Missing null pointer checks in patch 3 (fb can be NULL in atomic_check)
2. Patch 2's state management has a use-after-free pattern
3. Incomplete header includes across the series
4. Need verification that format values are properly preserved across state duplications