Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2b68504b authored by Mika Kahola's avatar Mika Kahola Committed by Ville Syrjälä
Browse files

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: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: default avatarRamalingam C <ramalingam.c@intel.com>
Signed-off-by: default avatarMika Kahola <mika.kahola@intel.com>
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1507630626-23806-3-git-send-email-mika.kahola@intel.com
parent 0d5f6625
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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;
+2 −1
Original line number Diff line number Diff line
@@ -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);
+7 −5
Original line number Diff line number Diff line
@@ -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;
}