From: Jani Nikula <jani.nikula@linux.intel.com>
To: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
Lucas De Marchi <lucas.demarchi@intel.com>,
intel-gfx@lists.freedesktop.org
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: Re: [PATCH 4/5] drm/i915: add helper IS_GEN_* macros
Date: Thu, 01 Nov 2018 13:29:54 +0200 [thread overview]
Message-ID: <874ld1kpcd.fsf@intel.com> (raw)
In-Reply-To: <751c15aa-18b0-58be-45e6-3738773bbd0a@linux.intel.com>
On Thu, 01 Nov 2018, Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> wrote:
> On 01/11/2018 08:35, Lucas De Marchi wrote:
>> 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@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)
>
> Interesting :), I have at some point floated a similar patch and there
> was overwhelming dislike of the GT suffix, since we have GT2 GT3 etc..
> as established acronyms for GPU configurations.
To be honest even *without* the GPU GT clash, I think GT/GE/LT/LE are a
cognitive burden. Not a big one, but still less natural than >/>=/</<=.
Feels like assembly.
Not that I have better alternatives. IS_GEN_AFTER for GT,
IS_GEN_OR_LATER for GE? Feels a bit contrived?
> Furthermore, I am pretty sure I've done it using the gen bitmask so
> hypothetical checks like IS_GEN_LT(5) || IS_GEN_RANGE(8, 9) could still
> be compile time optimized to a single conditional. That would also now
> become more difficult due removal of GEN_FOREVER.
>
> To summarise, I don't see a advantage of hiding this in macros if we are
> not getting the above benefit.
Agreed. I didn't realize the GEN_FOREVER removal was merged already, I
wish you'd chimed in there. Of course, we can bring it back.
BR,
Jani.
>
> Regards,
>
> Tvrtko
>
>> +#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.
>> *
>>
--
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2018-11-01 11:29 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-01 8:35 [PATCH 0/5] Make GEN macros more similar Lucas De Marchi
2018-11-01 8:35 ` [PATCH 1/5] drm/i915: let IS_GEN receive 1 or 2 arguments Lucas De Marchi
2018-11-01 8:35 ` [PATCH 2/5] drm/i915: replace IS_GEN<N> with IS_GEN(..., N) Lucas De Marchi
2018-11-01 11:17 ` Jani Nikula
2018-11-01 13:27 ` Ville Syrjälä
2018-11-01 11:35 ` Tvrtko Ursulin
2018-11-01 17:00 ` Lucas De Marchi
2018-11-01 8:35 ` [PATCH 3/5] drm/i915: merge gen checks to use range Lucas De Marchi
2018-11-01 11:18 ` Jani Nikula
2018-11-01 11:31 ` Tvrtko Ursulin
2018-11-02 18:10 ` Lucas De Marchi
2018-11-02 19:19 ` Rodrigo Vivi
2018-11-02 19:47 ` Lucas De Marchi
2018-11-02 22:12 ` Rodrigo Vivi
2018-11-02 22:28 ` Lucas De Marchi
2018-11-02 22:47 ` Rodrigo Vivi
2018-11-01 8:35 ` [PATCH 4/5] drm/i915: add helper IS_GEN_* macros Lucas De Marchi
2018-11-01 11:04 ` Tvrtko Ursulin
2018-11-01 11:29 ` Jani Nikula [this message]
2018-11-01 8:35 ` [PATCH 5/5] RFC: drm/i915: convert a few cases to the " Lucas De Marchi
2018-11-01 9:30 ` ✗ Fi.CI.CHECKPATCH: warning for Make GEN macros more similar Patchwork
2018-11-01 9:32 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-11-01 9:57 ` ✗ Fi.CI.BAT: failure " 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=874ld1kpcd.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=lucas.demarchi@intel.com \
--cc=rodrigo.vivi@intel.com \
--cc=tvrtko.ursulin@linux.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.