]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/i915/dp: Extract helper to get the hdisplay limit
authorAnkit Nautiyal <ankit.k.nautiyal@intel.com>
Mon, 2 Feb 2026 10:37:17 +0000 (16:07 +0530)
committerAnkit Nautiyal <ankit.k.nautiyal@intel.com>
Tue, 3 Feb 2026 08:17:02 +0000 (13:47 +0530)
Separate out function to get the hdisplay limit for a given platform.

v2: Rename the helper to intel_dp_max_hdisplay_per_pipe(). (Imre)

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
Link: https://patch.msgid.link/20260202103731.357416-4-ankit.k.nautiyal@intel.com
drivers/gpu/drm/i915/display/intel_dp.c

index fee95eea6757fdd62197c636297b5ada9462c53e..8dcbc4b76a1a8bbfc3cc078fbbf731bc916926cf 100644 (file)
@@ -1371,6 +1371,12 @@ intel_dp_mode_valid_downstream(struct intel_connector *connector,
        return MODE_OK;
 }
 
+static
+int intel_dp_max_hdisplay_per_pipe(struct intel_display *display)
+{
+       return DISPLAY_VER(display) >= 30 ? 6144 : 5120;
+}
+
 static
 bool intel_dp_needs_joiner(struct intel_dp *intel_dp,
                           struct intel_connector *connector,
@@ -1378,17 +1384,14 @@ bool intel_dp_needs_joiner(struct intel_dp *intel_dp,
                           int num_joined_pipes)
 {
        struct intel_display *display = to_intel_display(intel_dp);
-       int hdisplay_limit;
 
        if (!intel_dp_has_joiner(intel_dp))
                return false;
 
        num_joined_pipes /= 2;
 
-       hdisplay_limit = DISPLAY_VER(display) >= 30 ? 6144 : 5120;
-
        return clock > num_joined_pipes * display->cdclk.max_dotclk_freq ||
-              hdisplay > num_joined_pipes * hdisplay_limit;
+              hdisplay > num_joined_pipes * intel_dp_max_hdisplay_per_pipe(display);
 }
 
 int intel_dp_num_joined_pipes(struct intel_dp *intel_dp,