[PATCH 4/5] drm/i915: add helper IS_GEN_* macros

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 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

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux