From: Roy Chan <roy.c...@amd.com>

[Why]
Check if the eDP sink supports the dynamic backlight control

[How]
Query the dynamic backlight capability in DPCD (eDP case only)

Signed-off-by: Roy Chan <roy.c...@amd.com>
Acked-by: Bindu Ramamurthy <bind...@amd.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 7 +++++++
 drivers/gpu/drm/amd/display/dc/dc.h              | 1 +
 2 files changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c 
b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
index 6c60c1fdebdc..c9f4f2d3bed6 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
@@ -3740,6 +3740,7 @@ void detect_edp_sink_caps(struct dc_link *link)
        uint32_t entry;
        uint32_t link_rate_in_khz;
        enum dc_link_rate link_rate = LINK_RATE_UNKNOWN;
+       uint8_t backlight_adj_cap;
 
        retrieve_link_cap(link);
        link->dpcd_caps.edp_supported_link_rates_count = 0;
@@ -3770,6 +3771,12 @@ void detect_edp_sink_caps(struct dc_link *link)
        }
        link->verified_link_cap = link->reported_link_cap;
 
+       core_link_read_dpcd(link, DP_EDP_BACKLIGHT_ADJUSTMENT_CAP,
+                                               &backlight_adj_cap, 
sizeof(backlight_adj_cap));
+
+       link->dpcd_caps.dynamic_backlight_capable_edp =
+                               (backlight_adj_cap & 
DP_EDP_DYNAMIC_BACKLIGHT_CAP) ? true:false;
+
        dc_link_set_default_brightness_aux(link);
 }
 
diff --git a/drivers/gpu/drm/amd/display/dc/dc.h 
b/drivers/gpu/drm/amd/display/dc/dc.h
index 4c57cf099b5e..52e819678ecd 100644
--- a/drivers/gpu/drm/amd/display/dc/dc.h
+++ b/drivers/gpu/drm/amd/display/dc/dc.h
@@ -1091,6 +1091,7 @@ struct dpcd_caps {
        bool panel_mode_edp;
        bool dpcd_display_control_capable;
        bool ext_receiver_cap_field_present;
+       bool dynamic_backlight_capable_edp;
        union dpcd_fec_capability fec_cap;
        struct dpcd_dsc_capabilities dsc_caps;
        struct dc_lttpr_caps lttpr_caps;
-- 
2.25.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to