[Intel-gfx] [PATCH 4/5] drm/i915: add helper IS_GEN_* macros
Lucas De Marchi
lucas.demarchi at intel.com
Thu Nov 1 08:35:16 UTC 2018
This will allow us to make all gen comparisons simple gen comparisons
with the same kind of macro rather than resorting to a mix of IS_GEN(),
INTEL_GEN() >=, >, <=, <.
Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com>
---
drivers/gpu/drm/i915/i915_drv.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 8d22353a3da6..eb636dfe5228 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -2370,6 +2370,11 @@ intel_info(const struct drm_i915_private *dev_priv)
#define IS_GEN(dev_priv, ...) \
CONCATENATE(_IS_GEN_ARG, COUNT_ARGS(__VA_ARGS__))((dev_priv), ##__VA_ARGS__)
+#define IS_GEN_GT(dev_priv, g) (g > (dev_priv)->info.gen)
+#define IS_GEN_GE(dev_priv, g) (g >= (dev_priv)->info.gen)
+#define IS_GEN_LT(dev_priv, g) (g < (dev_priv)->info.gen)
+#define IS_GEN_LE(dev_priv, g) (g <= (dev_priv)->info.gen)
+
/*
* Return true if revision is in range [since,until] inclusive.
*
--
2.19.1.1.g56c4683e68
More information about the Intel-gfx
mailing list