diff mbox series

[RFC,24/28] drm/i915: Use IS_GEN in intel_fb_pitch_limit

Message ID 20210414115028.168504-25-tvrtko.ursulin@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series Old platform/gen kconfig options series | expand

Commit Message

Tvrtko Ursulin April 14, 2021, 11:50 a.m. UTC
From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index f7a3cefaaaed..5d1d67a7c368 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -13848,23 +13848,22 @@  static
 u32 intel_fb_pitch_limit(struct drm_i915_private *dev_priv,
 			 uint64_t fb_modifier, uint32_t pixel_format)
 {
-	u32 gen = INTEL_GEN(dev_priv);
-
-	if (gen >= 9) {
+	if (IS_GEN(dev_priv, 9, GEN_FOREVER)) {
 		int cpp = drm_format_plane_cpp(pixel_format, 0);
 
 		/* "The stride in bytes must not exceed the of the size of 8K
 		 *  pixels and 32K bytes."
 		 */
 		return min(8192 * cpp, 32768);
-	} else if (gen >= 5 && !HAS_GMCH_DISPLAY(dev_priv)) {
+	} else if (IS_GEN(dev_priv, 5, GEN_FOREVER) &&
+		   !HAS_GMCH_DISPLAY(dev_priv)) {
 		return 32*1024;
-	} else if (gen >= 4) {
+	} else if (IS_GEN(dev_priv, 4, GEN_FOREVER)) {
 		if (fb_modifier == I915_FORMAT_MOD_X_TILED)
 			return 16*1024;
 		else
 			return 32*1024;
-	} else if (gen >= 3) {
+	} else if (IS_GEN(dev_priv, 3, GEN_FOREVER)) {
 		if (fb_modifier == I915_FORMAT_MOD_X_TILED)
 			return 8*1024;
 		else