All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lucas De Marchi <lucas.demarchi@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: [PATCH v2 1/7] Revert "drm/i915: Kill GEN_FOREVER"
Date: Tue,  6 Nov 2018 13:51:17 -0800	[thread overview]
Message-ID: <20181106215123.27568-2-lucas.demarchi@intel.com> (raw)
In-Reply-To: <20181106215123.27568-1-lucas.demarchi@intel.com>

This reverts commit 5bc0e89ff1bee1566bd2fbd1142dce001c068aeb.

The macro was added and then never used so it was removed. However
after removal it was noticed that it was actually something that should
indeed be useful to out gen check macros to make use of.

Let's get the define back and start using it in follow up changes.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
---
 drivers/gpu/drm/i915/i915_drv.h | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 2a88a7eb871b..8839a34f7648 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -2360,12 +2360,20 @@ intel_info(const struct drm_i915_private *dev_priv)
 #define REVID_FOREVER		0xff
 #define INTEL_REVID(dev_priv)	((dev_priv)->drm.pdev->revision)
 
+#define GEN_FOREVER (0)
+
 #define INTEL_GEN_MASK(s, e) ( \
 	BUILD_BUG_ON_ZERO(!__builtin_constant_p(s)) + \
 	BUILD_BUG_ON_ZERO(!__builtin_constant_p(e)) + \
-	GENMASK((e) - 1, (s) - 1))
+	GENMASK((e) != GEN_FOREVER ? (e) - 1 : BITS_PER_LONG - 1, \
+		(s) != GEN_FOREVER ? (s) - 1 : 0) \
+)
 
-/* Returns true if Gen is in inclusive range [Start, End] */
+/*
+ * Returns true if Gen is in inclusive range [Start, End].
+ *
+ * Use GEN_FOREVER for unbound start and or end.
+ */
 #define IS_GEN(dev_priv, s, e) \
 	(!!((dev_priv)->info.gen_mask & INTEL_GEN_MASK((s), (e))))
 
-- 
2.19.1.1.g56c4683e68

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

  reply	other threads:[~2018-11-06 21:51 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-06 21:51 [PATCH v2 0/7] Make GEN macros more similar Lucas De Marchi
2018-11-06 21:51 ` Lucas De Marchi [this message]
2018-11-21 22:22   ` [PATCH v2 1/7] Revert "drm/i915: Kill GEN_FOREVER" Rodrigo Vivi
2018-11-06 21:51 ` [PATCH v2 2/7] drm/i915: Rename IS_GEN to GT_RANGE Lucas De Marchi
2018-11-28  8:02   ` Jani Nikula
2018-11-28  9:27     ` Joonas Lahtinen
2018-11-28 17:04     ` Rodrigo Vivi
2018-11-28 17:34     ` Lucas De Marchi
2018-11-06 21:51 ` [PATCH v2 3/7] drm/i915: replace IS_GEN<N> with GT_GEN(..., N) Lucas De Marchi
2018-11-21 22:20   ` Rodrigo Vivi
2018-11-23 12:42     ` Jani Nikula
2018-11-26 18:49       ` Rodrigo Vivi
2018-11-27  8:31         ` Jani Nikula
2018-11-28  0:09           ` Rodrigo Vivi
2018-11-06 21:51 ` [PATCH v2 4/7] drm/i915: rename IS_GEN9_* to GT_GEN9_* Lucas De Marchi
2018-11-21 22:22   ` Rodrigo Vivi
2018-11-06 21:51 ` [PATCH v2 5/7] drm/i915: replace gen checks using operators by GT_GEN/GT_GEN_RANGE Lucas De Marchi
2018-11-06 21:51 ` [PATCH v2 6/7] drm/i915: merge gen checks to use range Lucas De Marchi
2018-11-21 22:24   ` Rodrigo Vivi
2018-11-06 21:51 ` [PATCH v2 7/7] drm/i915: remove INTEL_GEN macro Lucas De Marchi
2018-11-07 10:05 ` [PATCH v2 0/7] Make GEN macros more similar Tvrtko Ursulin
2018-11-08  0:57   ` Lucas De Marchi
2018-11-08 11:23     ` Tvrtko Ursulin
2018-11-19 22:20       ` Lucas De Marchi
2018-11-20 13:40         ` Tvrtko Ursulin
2018-11-21 22:19         ` Rodrigo Vivi
2018-11-22  8:54           ` Tvrtko Ursulin
2018-11-26 18:46             ` Rodrigo Vivi
2018-11-27  8:37               ` Jani Nikula
2018-11-27  9:36                 ` Lucas De Marchi
2018-11-27 11:35                   ` Tvrtko Ursulin
2018-11-28  0:19                     ` Rodrigo Vivi
2018-11-28 17:22                       ` Lucas De Marchi
2018-11-23 12:44         ` Jani Nikula
2018-11-07 14:10 ` ✗ Fi.CI.CHECKPATCH: warning for Make GEN macros more similar (rev2) Patchwork
2018-11-07 14:14 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-11-07 14:30 ` ✓ Fi.CI.BAT: success " Patchwork
2018-11-07 21:17 ` ✓ Fi.CI.IGT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181106215123.27568-2-lucas.demarchi@intel.com \
    --to=lucas.demarchi@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=rodrigo.vivi@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.