Re: [PATCH 01/13] drm/atomic: Handle max bpc properties before connector state allocation

From: Dmitry Baryshkov

Date: Wed Sep 30 2026 - 09:51:48 EST


On Wed, Sep 30, 2026 at 08:41:45PM +0800, Xilin Wu wrote:
> Bridge connectors can attach the max bpc property before their atomic
> state is allocated by drm_mode_config_reset(). Unconditionally updating
> connector->state in drm_connector_attach_max_bpc_property() dereferences
> a NULL pointer in this case. Adding max bpc support to MSM DP and eDP
> exposes this during display initialization, before a framebuffer console
> is available.
>
> Only update an existing state when attaching the property. Initialize
> max_requested_bpc and max_bpc from the property range when creating a
> connector state so that deferred allocation and subsequent resets both
> restore the default. Avoid leaving the bit depth at zero after reset,
> which would otherwise cause valid display configurations to be rejected.
>
> With MSM DP max bpc support applied, this also restores boot on the Lenovo
> Yoga Slim 7x.

Hmm?

>
> Assisted-by: LLM
> Signed-off-by: Xilin Wu <sophon@xxxxxxxxx>

Can we rather update drm_bridge_connector_init() to register this
property in non-HDMI cases if max_bpc is more than 8?

> ---
> drivers/gpu/drm/drm_atomic_state_helper.c | 5 +++++
> drivers/gpu/drm/drm_connector.c | 6 ++++--
> 2 files changed, 9 insertions(+), 2 deletions(-)
>

--
With best wishes
Dmitry