]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915/fbc: Extract intel_fbc_stolen_end()
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 10 Jun 2021 18:32:35 +0000 (21:32 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 24 Jun 2021 18:48:52 +0000 (21:48 +0300)
Declutter find_compression_limit() a bit by extracting
intel_fbc_stolen_end().

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210610183237.3920-8-ville.syrjala@linux.intel.com
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
drivers/gpu/drm/i915/display/intel_fbc.c

index 31ac1163f55b7b6d39ecbc107f15a8cdf3090b07..6415f2cfd1ac6bff2b4a266719142bb82beafbd1 100644 (file)
@@ -423,13 +423,8 @@ static u64 intel_fbc_cfb_base_max(struct drm_i915_private *i915)
                return BIT_ULL(32);
 }
 
-static int find_compression_limit(struct drm_i915_private *dev_priv,
-                                 unsigned int size,
-                                 unsigned int fb_cpp)
+static u64 intel_fbc_stolen_end(struct drm_i915_private *dev_priv)
 {
-       struct intel_fbc *fbc = &dev_priv->fbc;
-       int compression_limit = 1;
-       int ret;
        u64 end;
 
        /* The FBC hardware for BDW/SKL doesn't have access to the stolen
@@ -442,7 +437,17 @@ static int find_compression_limit(struct drm_i915_private *dev_priv,
        else
                end = U64_MAX;
 
-       end = min(end, intel_fbc_cfb_base_max(dev_priv));
+       return min(end, intel_fbc_cfb_base_max(dev_priv));
+}
+
+static int find_compression_limit(struct drm_i915_private *dev_priv,
+                                 unsigned int size,
+                                 unsigned int fb_cpp)
+{
+       struct intel_fbc *fbc = &dev_priv->fbc;
+       u64 end = intel_fbc_stolen_end(dev_priv);
+       int compression_limit = 1;
+       int ret;
 
        /* HACK: This code depends on what we will do in *_enable_fbc. If that
         * code changes, this code needs to change as well.