drm/i915: add HAS_ASYNC_FLIPS feature macro
authorJani Nikula <jani.nikula@intel.com>
Mon, 23 Aug 2021 12:25:32 +0000 (15:25 +0300)
committerJani Nikula <jani.nikula@intel.com>
Tue, 24 Aug 2021 17:47:03 +0000 (20:47 +0300)
This will be needed in multiple places soon.

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/08bf0f72435a4f9acb0ef31b82ca312b048c6bf6.1629721467.git.jani.nikula@intel.com
drivers/gpu/drm/i915/display/intel_display.c
drivers/gpu/drm/i915/i915_drv.h

index eea9553..d93a2d6 100644 (file)
@@ -977,11 +977,6 @@ static unsigned int intel_linear_alignment(const struct drm_i915_private *dev_pr
                return 0;
 }
 
-static bool has_async_flips(struct drm_i915_private *i915)
-{
-       return DISPLAY_VER(i915) >= 5;
-}
-
 unsigned int intel_surf_alignment(const struct drm_framebuffer *fb,
                                  int color_plane)
 {
@@ -1015,7 +1010,7 @@ unsigned int intel_surf_alignment(const struct drm_framebuffer *fb,
        case DRM_FORMAT_MOD_LINEAR:
                return intel_linear_alignment(dev_priv);
        case I915_FORMAT_MOD_X_TILED:
-               if (has_async_flips(dev_priv))
+               if (HAS_ASYNC_FLIPS(dev_priv))
                        return 256 * 1024;
                return 0;
        case I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS:
@@ -12161,7 +12156,7 @@ static void intel_mode_config_init(struct drm_i915_private *i915)
 
        mode_config->funcs = &intel_mode_funcs;
 
-       mode_config->async_page_flip = has_async_flips(i915);
+       mode_config->async_page_flip = HAS_ASYNC_FLIPS(i915);
 
        /*
         * Maximum framebuffer dimensions, chosen to match
index 0a2b630..106f218 100644 (file)
@@ -1721,6 +1721,8 @@ IS_SUBPLATFORM(const struct drm_i915_private *i915,
 
 #define HAS_VRR(i915)  (GRAPHICS_VER(i915) >= 12)
 
+#define HAS_ASYNC_FLIPS(i915)          (DISPLAY_VER(i915) >= 5)
+
 /* Only valid when HAS_DISPLAY() is true */
 #define INTEL_DISPLAY_ENABLED(dev_priv) \
        (drm_WARN_ON(&(dev_priv)->drm, !HAS_DISPLAY(dev_priv)), !(dev_priv)->params.disable_display)