]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/i915/vrr: Check HAS_VRR() first in intel_vrr_is_capable()
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Mon, 20 Oct 2025 18:50:38 +0000 (21:50 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 24 Oct 2025 21:10:58 +0000 (00:10 +0300)
There's no point in doing all the other checks in
intel_vrr_is_capable() if the platform doesn't support VRR at all
Check HAS_VRR() before wasting time on the other checks.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20251020185038.4272-23-ville.syrjala@linux.intel.com
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
drivers/gpu/drm/i915/display/intel_vrr.c

index c28491b9002a1940c7e6d9ccde261b54cd23f28c..00cbc126fb3667370e18aaf3bd5d1976b37ae94e 100644 (file)
@@ -25,6 +25,9 @@ bool intel_vrr_is_capable(struct intel_connector *connector)
        const struct drm_display_info *info = &connector->base.display_info;
        struct intel_dp *intel_dp;
 
+       if (!HAS_VRR(display))
+               return false;
+
        /*
         * DP Sink is capable of VRR video timings if
         * Ignore MSA bit is set in DPCD.
@@ -49,8 +52,7 @@ bool intel_vrr_is_capable(struct intel_connector *connector)
                return false;
        }
 
-       return HAS_VRR(display) &&
-               info->monitor_range.max_vfreq - info->monitor_range.min_vfreq > 10;
+       return info->monitor_range.max_vfreq - info->monitor_range.min_vfreq > 10;
 }
 
 bool intel_vrr_is_in_range(struct intel_connector *connector, int vrefresh)