From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: drm/rockchip: dw_hdmi: Propagate bus format to display driver Date: Sat, 16 May 2026 16:14:40 +1000 Message-ID: In-Reply-To: <20260510183114.1248840-11-jonas@kwiboo.se> References: <20260510183114.1248840-1-jonas@kwiboo.se> <20260510183114.1248840-11-jonas@kwiboo.se> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Patch Review **Status: Bug found** This patch reads the negotiated bus format from the bridge state and maps it to the rockchip output mode (AAAA or YUV420). **Bug**: In `dw_hdmi_rockchip_get_bus_format()`: ```c bridge_state = drm_atomic_get_bridge_state(conn_state->state, bridge); if (!bridge_state) return 0; ``` `drm_atomic_get_bridge_state()` returns `ERR_CAST()` on failure (i.e., `ERR_PTR`), **not** NULL. This NULL check will never catch an error. The code will proceed with an `ERR_PTR` value in `bridge_state` and dereference it, causing a crash. This should be: ```c if (IS_ERR(bridge_state)) return 0; ``` Or better, since this is called from `atomic_check`, the error should be propagated: ```c if (IS_ERR(bridge_state)) return PTR_ERR(bridge_state); ``` But that would require changing the return type of `dw_hdmi_rockchip_get_bus_format()` to handle errors. The simplest safe fix is to use `IS_ERR(bridge_state)`. **Minor**: The commit message has a typo: "inpact" should be "impact". **Additional note**: The `__free(drm_bridge_put)` cleanup annotation on `bridge` is a nice use of scope-based resource management for the bridge reference obtained from `drm_bridge_chain_get_first_bridge()`. The `MEDIA_BUS_FMT_FIXED` fallthrough to `MEDIA_BUS_FMT_RGB888_1X24` is the right default behavior. The switch covers RGB, YCbCr 4:4:4, and YCbCr 4:2:0 at both 8 and 10 bit depths. The `s->bus_format = bus_format` assignment correctly propagates the format to `rockchip_crtc_state`, which has the `bus_format` field (verified in `rockchip_drm_drv.h`). --- Generated by Claude Code Patch Reviewer