[Intel-gfx] [RFC 24/28] drm/i915: Use IS_GEN in intel_fb_pitch_limit
Tvrtko Ursulin
tvrtko.ursulin at linux.intel.com
Wed Apr 14 11:50:24 UTC 2021
From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
---
drivers/gpu/drm/i915/intel_display.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
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
--
2.27.0
More information about the Intel-gfx
mailing list