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

From: Xilin Wu

Date: Wed Sep 30 2026 - 11:08:16 EST


On 9/30/2026 9:26 PM, Dmitry Baryshkov wrote:
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?

The boot failure occurred with the later max bpc patch in this series applied. I'll drop the "restores boot" sentence and describe this as preparatory support instead.



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?


Yes, that makes sense. I'll advertise the MSM DP/eDP capability through bridge->max_bpc and let drm_bridge_connector_init() attach the property for non-HDMI bridges with max_bpc > 8. I'll also handle state creation and bpc defaults there, following the HDMI path.

Thanks for the suggestion.


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




--
Best regards,
Xilin Wu <sophon@xxxxxxxxx>