aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMika Kahola <mika.kahola@intel.com>2017-10-10 06:17:03 -0400
committerVille Syrjälä <ville.syrjala@linux.intel.com>2017-10-10 11:15:06 -0400
commit2b68504be6b47fabd4d14c89bbea37a6fd0fd28c (patch)
treec0ede3887620734db3bf82fd6d11de194979c3ab
parent0d5f662575e542ed22b5054c2b0887f42271be5e (diff)
drm/i915: Remove I915_MAX_PIPES dependency for DDB allocation
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
-rw-r--r--drivers/gpu/drm/i915/intel_display.c5
-rw-r--r--drivers/gpu/drm/i915/intel_drv.h3
-rw-r--r--drivers/gpu/drm/i915/intel_pm.c12
3 files changed, 13 insertions, 7 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index cf13fba80d53..e03b0c3d6f9f 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -12215,7 +12215,10 @@ static void skl_update_crtcs(struct drm_atomic_state *state)
12215 if (updated & cmask || !cstate->base.active) 12215 if (updated & cmask || !cstate->base.active)
12216 continue; 12216 continue;
12217 12217
12218 if (skl_ddb_allocation_overlaps(entries, &cstate->wm.skl.ddb, i)) 12218 if (skl_ddb_allocation_overlaps(dev_priv,
12219 entries,
12220 &cstate->wm.skl.ddb,
12221 i))
12219 continue; 12222 continue;
12220 12223
12221 updated |= cmask; 12224 updated |= cmask;
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 0cab667fff57..ceb3b8284c86 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -1893,7 +1893,8 @@ int intel_enable_sagv(struct drm_i915_private *dev_priv);
1893int intel_disable_sagv(struct drm_i915_private *dev_priv); 1893int intel_disable_sagv(struct drm_i915_private *dev_priv);
1894bool skl_wm_level_equals(const struct skl_wm_level *l1, 1894bool skl_wm_level_equals(const struct skl_wm_level *l1,
1895 const struct skl_wm_level *l2); 1895 const struct skl_wm_level *l2);
1896bool skl_ddb_allocation_overlaps(const struct skl_ddb_entry **entries, 1896bool skl_ddb_allocation_overlaps(struct drm_i915_private *dev_priv,
1897 const struct skl_ddb_entry **entries,
1897 const struct skl_ddb_entry *ddb, 1898 const struct skl_ddb_entry *ddb,
1898 int ignore); 1899 int ignore);
1899bool ilk_disable_lp_wm(struct drm_device *dev); 1900bool ilk_disable_lp_wm(struct drm_device *dev);
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 9d0ca2656a23..39acfadb5a21 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -4820,16 +4820,18 @@ static inline bool skl_ddb_entries_overlap(const struct skl_ddb_entry *a,
4820 return a->start < b->end && b->start < a->end; 4820 return a->start < b->end && b->start < a->end;
4821} 4821}
4822 4822
4823bool skl_ddb_allocation_overlaps(const struct skl_ddb_entry **entries, 4823bool skl_ddb_allocation_overlaps(struct drm_i915_private *dev_priv,
4824 const struct skl_ddb_entry **entries,
4824 const struct skl_ddb_entry *ddb, 4825 const struct skl_ddb_entry *ddb,
4825 int ignore) 4826 int ignore)
4826{ 4827{
4827 int i; 4828 enum pipe pipe;
4828 4829
4829 for (i = 0; i < I915_MAX_PIPES; i++) 4830 for_each_pipe(dev_priv, pipe) {
4830 if (i != ignore && entries[i] && 4831 if (pipe != ignore && entries[pipe] &&
4831 skl_ddb_entries_overlap(ddb, entries[i])) 4832 skl_ddb_entries_overlap(ddb, entries[pipe]))
4832 return true; 4833 return true;
4834 }
4833 4835
4834 return false; 4836 return false;
4835} 4837}