Re: [PATCH v2] drm/msm/dp: Return MODE_ERROR in dp_display and drop dead eDP check

From: Guodong Xu

Date: Sat Dec 05 2026 - 20:13:38 EST


Hi Ian,

On Tue, 1 Dec 2026 09:42:06 -0800, Ian Rogers wrote:
> msm_dp_display_mode_valid() and msm_edp_bridge_mode_valid() return
> enum drm_mode_status, yet both returned -EINVAL (-22) on an invalid
> parameter check for !dp || !mode_pclk_khz || !dp->connector.
>
> Today neither check can trigger because drm_mode_validate_basic()
> rejects mode->clock == 0 before bridge .mode_valid() runs, and dp and
> dp->connector are initialized before mode validation. Keep the guard in
> the shared msm_dp_display_mode_valid() helper but return MODE_ERROR
> instead of -EINVAL, and drop the unreachable check from the static
> msm_edp_bridge_mode_valid() callback.
>
> Found with Clang's -Wassign-enum on an x86_64 allyesconfig build; Gemini
> helped analyze the callers and prepare the patch and commit message.
> Compile-tested on dp_display.o and dp_drm.o with LLVM=1 W=1 (-Werror)
> and -Wassign-enum; not runtime-tested because Qualcomm Snapdragon
> DP/eDP hardware is not available.
>
> Signed-off-by: Ian Rogers <irogers@xxxxxxxxxx>

Reviewed-by: Guodong Xu <guodong.xu@xxxxxxxxxxxxxxxx>

Guodong