]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/i915/dp: Modify compressed bpp limitations for ultrajoiner
authorAnkit Nautiyal <ankit.k.nautiyal@intel.com>
Mon, 30 Sep 2024 16:35:45 +0000 (22:05 +0530)
committerAnkit Nautiyal <ankit.k.nautiyal@intel.com>
Tue, 1 Oct 2024 09:04:55 +0000 (14:34 +0530)
Add compressed bpp limitations for ultrajoiner.

v2: Fix the case for 1 pipe. (Ankit)
v3: Refactor existing helper separately and add only ultrajoiner
limitation. (Ville)
v4: Separate out function for ultrajoiner_ram_bits.
v5: Make the helper function more concise. (Ville)

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

index a85527a55dc06c5ebc04399ac0d1d35c8051a1e7..d8a4a6fa15142654b64c8e1816a6a3249c8b4bc1 100644 (file)
@@ -896,25 +896,31 @@ static u32 small_joiner_ram_max_bpp(struct intel_display *display,
        return max_bpp;
 }
 
+static int ultrajoiner_ram_bits(void)
+{
+       return 4 * 72 * 512;
+}
+
+static u32 ultrajoiner_ram_max_bpp(u32 mode_hdisplay)
+{
+       return ultrajoiner_ram_bits() / mode_hdisplay;
+}
+
 static
 u32 get_max_compressed_bpp_with_joiner(struct drm_i915_private *i915,
                                       u32 mode_clock, u32 mode_hdisplay,
                                       int num_joined_pipes)
 {
        struct intel_display *display = to_intel_display(&i915->drm);
-       u32 max_bpp_small_joiner_ram;
+       u32 max_bpp = small_joiner_ram_max_bpp(display, mode_hdisplay, num_joined_pipes);
 
-       max_bpp_small_joiner_ram = small_joiner_ram_max_bpp(display, mode_hdisplay,
-                                                           num_joined_pipes);
-
-       if (num_joined_pipes == 2) {
-               u32 max_bpp_bigjoiner = bigjoiner_bw_max_bpp(display, mode_clock,
-                                                            num_joined_pipes);
-
-               return min(max_bpp_small_joiner_ram, max_bpp_bigjoiner);
-       }
+       if (num_joined_pipes > 1)
+               max_bpp = min(max_bpp, bigjoiner_bw_max_bpp(display, mode_clock,
+                                                           num_joined_pipes));
+       if (num_joined_pipes == 4)
+               max_bpp = min(max_bpp, ultrajoiner_ram_max_bpp(mode_hdisplay));
 
-       return max_bpp_small_joiner_ram;
+       return max_bpp;
 }
 
 u16 intel_dp_dsc_get_max_compressed_bpp(struct drm_i915_private *i915,