Skip to content

Commit 8435576

Browse files
StanFox1984Manasi Navare
authored andcommitted
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: Manasi Navare <manasi.d.navare@intel.com> Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com> Signed-off-by: Manasi Navare <manasi.d.navare@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20200519131117.17190-6-stanislav.lisovskiy@intel.com
1 parent cf12976 commit 8435576

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

drivers/gpu/drm/i915/display/intel_display.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,13 @@ enum plane_id {
187187
for ((__p) = PLANE_PRIMARY; (__p) < I915_MAX_PLANES; (__p)++) \
188188
for_each_if((__crtc)->plane_ids_mask & BIT(__p))
189189

190+
#define for_each_dbuf_slice_in_mask(__slice, __mask) \
191+
for ((__slice) = DBUF_S1; (__slice) < I915_MAX_DBUF_SLICES; (__slice)++) \
192+
for_each_if((BIT(__slice)) & (__mask))
193+
194+
#define for_each_dbuf_slice(__slice) \
195+
for_each_dbuf_slice_in_mask(__slice, BIT(I915_MAX_DBUF_SLICES) - 1)
196+
190197
enum port {
191198
PORT_NONE = -1,
192199

drivers/gpu/drm/i915/display/intel_display_power.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ intel_display_power_put_async(struct drm_i915_private *i915,
314314
enum dbuf_slice {
315315
DBUF_S1,
316316
DBUF_S2,
317+
I915_MAX_DBUF_SLICES
317318
};
318319

319320
void gen9_dbuf_slices_update(struct drm_i915_private *dev_priv,

0 commit comments

Comments
 (0)