drm/i915: Prefer IS_GEN<n> check with bitmask.
Whenever possible we should stick with IS_GEN<n> checks.
Bitmaks has been introduced on commit ae7617f0ef
("drm/i915:
Allow optimized platform checks") for efficiency.
Let's stick with it whenever possible.
This patch was generated with coccinelle:
spatch -sp_file is_gen.cocci *{c,h} --in-place
is_gen.cocci:
@gen2@ expression e; @@
-INTEL_GEN(e) == 2
+IS_GEN2(e)
@gen3@ expression e; @@
-INTEL_GEN(e) == 3
+IS_GEN3(e)
@gen4@ expression e; @@
-INTEL_GEN(e) == 4
+IS_GEN4(e)
@gen5@ expression e; @@
-INTEL_GEN(e) == 5
+IS_GEN5(e)
@gen6@ expression e; @@
-INTEL_GEN(e) == 6
+IS_GEN6(e)
@gen7@ expression e; @@
-INTEL_GEN(e) == 7
+IS_GEN7(e)
@gen8@ expression e; @@
-INTEL_GEN(e) == 8
+IS_GEN8(e)
@gen9@ expression e; @@
-INTEL_GEN(e) == 9
+IS_GEN9(e)
@gen10@ expression e; @@
-INTEL_GEN(e) == 10
+IS_GEN10(e)
@gen11@ expression e; @@
-INTEL_GEN(e) == 11
+IS_GEN11(e)
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20181026195143.20353-1-rodrigo.vivi@intel.com
This commit is contained in:
@@ -93,11 +93,11 @@ hangcheck_action_to_str(const enum intel_engine_hangcheck_action a)
|
||||
#define I915_MAX_SUBSLICES 8
|
||||
|
||||
#define instdone_slice_mask(dev_priv__) \
|
||||
(INTEL_GEN(dev_priv__) == 7 ? \
|
||||
(IS_GEN7(dev_priv__) ? \
|
||||
1 : INTEL_INFO(dev_priv__)->sseu.slice_mask)
|
||||
|
||||
#define instdone_subslice_mask(dev_priv__) \
|
||||
(INTEL_GEN(dev_priv__) == 7 ? \
|
||||
(IS_GEN7(dev_priv__) ? \
|
||||
1 : INTEL_INFO(dev_priv__)->sseu.subslice_mask[0])
|
||||
|
||||
#define for_each_instdone_slice_subslice(dev_priv__, slice__, subslice__) \
|
||||
|
مرجع در شماره جدید
Block a user