]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915: Remove I915_MAX_PIPES dependency for DDB allocation
authorMika Kahola <mika.kahola@intel.com>
Tue, 10 Oct 2017 10:17:03 +0000 (13:17 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 10 Oct 2017 15:15:06 +0000 (18:15 +0300)
Remove dependency for I915_MAX_PIPES by replacing it with
for_each_pipe() macro.

v2: use 'enum pipe pipe' instead of 'i'

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1507630626-23806-3-git-send-email-mika.kahola@intel.com
drivers/gpu/drm/i915/intel_display.c
drivers/gpu/drm/i915/intel_drv.h
drivers/gpu/drm/i915/intel_pm.c

index cf13fba80d53083715634a2d203bafbb5f61aaa9..e03b0c3d6f9f679413841e5f27ffafcccea99540 100644 (file)
@@ -12215,7 +12215,10 @@ static void skl_update_crtcs(struct drm_atomic_state *state)
                        if (updated & cmask || !cstate->base.active)
                                continue;
 
-                       if (skl_ddb_allocation_overlaps(entries, &cstate->wm.skl.ddb, i))
+                       if (skl_ddb_allocation_overlaps(dev_priv,
+                                                       entries,
+                                                       &cstate->wm.skl.ddb,
+                                                       i))
                                continue;
 
                        updated |= cmask;
index 0cab667fff575f76f3aaa67030d4a7be6324a2ed..ceb3b8284c86a960bdf29e8e8c44f81ad2bd4dd2 100644 (file)
@@ -1893,7 +1893,8 @@ int intel_enable_sagv(struct drm_i915_private *dev_priv);
 int intel_disable_sagv(struct drm_i915_private *dev_priv);
 bool skl_wm_level_equals(const struct skl_wm_level *l1,
                         const struct skl_wm_level *l2);
-bool skl_ddb_allocation_overlaps(const struct skl_ddb_entry **entries,
+bool skl_ddb_allocation_overlaps(struct drm_i915_private *dev_priv,
+                                const struct skl_ddb_entry **entries,
                                 const struct skl_ddb_entry *ddb,
                                 int ignore);
 bool ilk_disable_lp_wm(struct drm_device *dev);
index 9d0ca2656a2345939c4b9cc3bbf8ea603f6ad1e8..39acfadb5a2184721cbf9eea26b4281dee64edcd 100644 (file)
@@ -4820,16 +4820,18 @@ static inline bool skl_ddb_entries_overlap(const struct skl_ddb_entry *a,
        return a->start < b->end && b->start < a->end;
 }
 
-bool skl_ddb_allocation_overlaps(const struct skl_ddb_entry **entries,
+bool skl_ddb_allocation_overlaps(struct drm_i915_private *dev_priv,
+                                const struct skl_ddb_entry **entries,
                                 const struct skl_ddb_entry *ddb,
                                 int ignore)
 {
-       int i;
+       enum pipe pipe;
 
-       for (i = 0; i < I915_MAX_PIPES; i++)
-               if (i != ignore && entries[i] &&
-                   skl_ddb_entries_overlap(ddb, entries[i]))
+       for_each_pipe(dev_priv, pipe) {
+               if (pipe != ignore && entries[pipe] &&
+                   skl_ddb_entries_overlap(ddb, entries[pipe]))
                        return true;
+       }
 
        return false;
 }