Commit 8435576b authored by Stanislav Lisovskiy's avatar Stanislav Lisovskiy Committed by Manasi Navare

drm/i915: Introduce for_each_dbuf_slice_in_mask macro

We quite often need now to iterate only particular dbuf slices
in mask, whether they are active or related to particular crtc.

v2: - Minor code refactoring
v3: - Use enum for max slices instead of macro

Let's make our life a bit easier and use a macro for that.
Reviewed-by: default avatarManasi Navare <manasi.d.navare@intel.com>
Signed-off-by: default avatarStanislav Lisovskiy <stanislav.lisovskiy@intel.com>
Signed-off-by: default avatarManasi Navare <manasi.d.navare@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200519131117.17190-6-stanislav.lisovskiy@intel.com
parent cf129762
...@@ -187,6 +187,13 @@ enum plane_id { ...@@ -187,6 +187,13 @@ enum plane_id {
for ((__p) = PLANE_PRIMARY; (__p) < I915_MAX_PLANES; (__p)++) \ for ((__p) = PLANE_PRIMARY; (__p) < I915_MAX_PLANES; (__p)++) \
for_each_if((__crtc)->plane_ids_mask & BIT(__p)) for_each_if((__crtc)->plane_ids_mask & BIT(__p))
#define for_each_dbuf_slice_in_mask(__slice, __mask) \
for ((__slice) = DBUF_S1; (__slice) < I915_MAX_DBUF_SLICES; (__slice)++) \
for_each_if((BIT(__slice)) & (__mask))
#define for_each_dbuf_slice(__slice) \
for_each_dbuf_slice_in_mask(__slice, BIT(I915_MAX_DBUF_SLICES) - 1)
enum port { enum port {
PORT_NONE = -1, PORT_NONE = -1,
......
...@@ -314,6 +314,7 @@ intel_display_power_put_async(struct drm_i915_private *i915, ...@@ -314,6 +314,7 @@ intel_display_power_put_async(struct drm_i915_private *i915,
enum dbuf_slice { enum dbuf_slice {
DBUF_S1, DBUF_S1,
DBUF_S2, DBUF_S2,
I915_MAX_DBUF_SLICES
}; };
void gen9_dbuf_slices_update(struct drm_i915_private *dev_priv, void gen9_dbuf_slices_update(struct drm_i915_private *dev_priv,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment