HDMI's extension to EDID contains a flag which is used by sinks to
signal that they support "CinemaVRR". When CinemaVRR is enabled, some
VRR is possible even if the minimum VRR range is set to 0.

Parse it from the SCDS and store it in the sink's drm_hdmi_info.

Signed-off-by: Nicolas Frattaroli <[email protected]>
---
 drivers/gpu/drm/drm_edid.c  | 7 ++++++-
 include/drm/drm_connector.h | 3 +++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index a1494028e0f5..cc6f2ba8c9f4 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -6314,6 +6314,11 @@ static void drm_parse_vrr_info(struct drm_display_info 
*info, const u8 *hf_scds)
        struct drm_monitor_range_info *range = &info->monitor_range;
        const int pld_len = cea_db_payload_len(hf_scds);
 
+       if (pld_len < 9)
+               return;
+
+       info->hdmi.cinema_vrr = !!(hf_scds[8] & DRM_EDID_CINEMA_VRR);
+
        if (pld_len < 10)
                return;
 
@@ -6392,7 +6397,7 @@ static void drm_parse_hdmi_forum_scds(struct 
drm_connector *connector,
 
        drm_parse_vrr_info(info, hf_scds);
 
-       if (info->monitor_range.min_vfreq > 0)
+       if (info->monitor_range.min_vfreq > 0 || hdmi->cinema_vrr)
                hdmi->vrr_capable = true;
        else
                hdmi->vrr_capable = false;
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index b18684d039d5..b147b8474f1a 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -383,6 +383,9 @@ struct drm_hdmi_info {
 
        /** @vrr_capable: The sink supports variable refresh rate */
        bool vrr_capable;
+
+       /** @cinema_vrr: The sink supports "CinemaVRR" */
+       bool cinema_vrr;
 };
 
 /**

-- 
2.55.0

Reply via email to