From 303b0de1b8fd9f33a8cbfa935e0885c53fe9f78c Mon Sep 17 00:00:00 2001 From: Damon Ding Date: Wed, 16 Jul 2025 14:22:21 +0800 Subject: [PATCH] drm/bridge: analogix_dp: Add &analogix_dp_plat_data.disable_psr to check whether to disable PSR First of all, since the PSR feature can help to reduce the power consumption, the Source device, which can support PSR function, should enable PSR if the PSR capability of Sink device is detected rather than depending on the user to add 'support-psr' DTS property manually. Different platforms that use the same Analogix DP bridge driver may have different methods for parsing the PSR capability. Therefore, add a new flag &analogix_dp_plat_data.disable_psr to disable PSR forcely, which set in the platform side, should be more reasonable. If the user truly does not want to enable PSR function or the Panel has something wrong with it, the property 'rockchip,disable-psr' will be helpful. Fixes: 9622f2d0f10a ("drm/bridge: analogix_dp: disable PSR feature by default") Change-Id: Id2fce34857df80de5a1ec97f342709a6e2840ed4 Signed-off-by: Damon Ding --- drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 2 +- drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 1 + include/drm/bridge/analogix_dp.h | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c index 7432329d9d9f..64d38350fc07 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c @@ -191,7 +191,7 @@ static bool analogix_dp_detect_sink_psr(struct analogix_dp_device *dp) unsigned char psr_version; int ret; - if (!device_property_read_bool(dp->dev, "support-psr")) + if (dp->plat_data->disable_psr) return 0; ret = drm_dp_dpcd_readb(&dp->aux, DP_PSR_SUPPORT, &psr_version); diff --git a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c index d511922e7619..158a1c3b148e 100644 --- a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c +++ b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c @@ -733,6 +733,7 @@ static int rockchip_dp_probe(struct platform_device *pdev) dp->plat_data.convert_to_origin_mode = drm_mode_convert_to_origin_mode; dp->plat_data.skip_connector = rockchip_dp_skip_connector(bridge); dp->plat_data.bridge = bridge; + dp->plat_data.disable_psr = device_property_read_bool(dp->dev, "rockchip,disable-psr"); ret = rockchip_dp_of_probe(dp); if (ret < 0) diff --git a/include/drm/bridge/analogix_dp.h b/include/drm/bridge/analogix_dp.h index 35484105d7f0..00661612d4c7 100644 --- a/include/drm/bridge/analogix_dp.h +++ b/include/drm/bridge/analogix_dp.h @@ -53,6 +53,8 @@ struct analogix_dp_plat_data { bool dual_connector_split; bool left_display; + bool disable_psr; + u8 max_bpc; struct analogix_dp_device *left;