[PATCH 12/17] drm/i915/dp: Simplify the helper get_max_compressed_bpp_with_joiner

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Streamline the helper to get max compressed bpp for joiner case, to
effectively use num of pipes joined. This will make the addition of
ultrajoiner limitations easier and improve redability.

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@xxxxxxxxx>
---
 drivers/gpu/drm/i915/display/intel_dp.c | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 7db037f631f7..e7fe100ef8db 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -882,7 +882,8 @@ static u32 bigjoiner_bw_max_bpp(struct intel_display *display, u32 mode_clock,
 	return max_bpp;
 }
 
-static u32 small_joiner_ram_max_bpp(struct intel_display *display, u32 mode_hdisplay)
+static u32 small_joiner_ram_max_bpp(struct intel_display *display, u32 mode_hdisplay,
+				    int num_joined_pipes)
 {
 	struct drm_i915_private *i915 = to_i915(display->drm);
 	u32 max_bpp;
@@ -890,6 +891,8 @@ static u32 small_joiner_ram_max_bpp(struct intel_display *display, u32 mode_hdis
 	/* Small Joiner Check: output bpp <= joiner RAM (bits) / Horiz. width */
 	max_bpp = small_joiner_ram_size_bits(i915) / mode_hdisplay;
 
+	max_bpp *= num_joined_pipes;
+
 	return max_bpp;
 }
 
@@ -899,19 +902,12 @@ u32 get_max_compressed_bpp_with_joiner(struct drm_i915_private *i915,
 				       int num_joined_pipes)
 {
 	struct intel_display *display = to_intel_display(&i915->drm);
-	u32 max_bpp_small_joiner_ram;
-
-	max_bpp_small_joiner_ram = small_joiner_ram_max_bpp(display, mode_hdisplay);
-
-	if (num_joined_pipes == 2) {
-		u32 max_bpp_bigjoiner = bigjoiner_bw_max_bpp(display, mode_clock, num_joined_pipes);
-
-		max_bpp_small_joiner_ram *= 2;
+	u32 max_bpp;
 
-		return min(max_bpp_small_joiner_ram, max_bpp_bigjoiner);
-	}
+	max_bpp = small_joiner_ram_max_bpp(display, mode_hdisplay, num_joined_pipes);
+	max_bpp = min(max_bpp, bigjoiner_bw_max_bpp(display, mode_clock, num_joined_pipes));
 
-	return max_bpp_small_joiner_ram;
+	return max_bpp;
 }
 
 u16 intel_dp_dsc_get_max_compressed_bpp(struct drm_i915_private *i915,
-- 
2.45.2




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux