All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	Intel graphics driver community testing & development
	<intel-gfx@lists.freedesktop.org>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: Re: [PATCH 1/2] drm/i915: Introduce INTEL_GEN_MASK
Date: Fri, 08 Sep 2017 15:20:45 +0300	[thread overview]
Message-ID: <87d1714c0y.fsf@nikula.org> (raw)
In-Reply-To: <25c4ead3-f75f-0652-e409-73c9b6de9a9f@linux.intel.com>

On Fri, 08 Sep 2017, Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> wrote:
> On 08/09/2017 10:39, Jani Nikula wrote:
>> On Fri, 08 Sep 2017, Joonas Lahtinen <joonas.lahtinen@linux.intel.com> wrote:
>>> Split INTEL_GEN_MASK out of IS_GEN macro, and make it usable
>>> within static declarations (unlike combound statements).
>>>
>>> Cc: Jani Nikula <jani.nikula@intel.com>
>>> Cc: Chris Wilson <chris@chris-wilson.co.uk>
>>> Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
>>> ---
>>>   drivers/gpu/drm/i915/i915_drv.h | 22 ++++++++++------------
>>>   1 file changed, 10 insertions(+), 12 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
>>> index 63ca2ffcafef..c3f9d7d7b146 100644
>>> --- a/drivers/gpu/drm/i915/i915_drv.h
>>> +++ b/drivers/gpu/drm/i915/i915_drv.h
>>> @@ -2873,23 +2873,21 @@ intel_info(const struct drm_i915_private *dev_priv)
>>>   #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) != GEN_FOREVER ? (e) - 1 : BITS_PER_LONG - 1, \
>>> +	        (s) != GEN_FOREVER ? (s) - 1 : 0) \
>> 
>> Reviewed-by: Jani Nikula <jani.nikula@intel.com>
>> 
>> but I'd really like a patch on top to remove the -1 from here and
>> info->gen_mask.
>
> What is the objection on -1? It is hidden in the macros so you can only 
> see it if looking at disassembly or even lower level.

IMO it's unnecessary optimization that makes reviewing the patches at
hand a tiny bit harder. Multiply that by everyone who ever looks at the
guts of the macros, and wonders why gen_mask is really
gen_off_by_one_mask, and for what reason. Indeed I thought there must be
a reason, until I realized that in reality, there is none.

BR,
Jani.

>
> We could even make it -2, but AFAIR Chris wanted to keep the option for 
> supporting gen1 open. :)
>
> Regards,
>
> Tvrtko

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-09-08 12:21 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-08  9:29 [PATCH 1/2] drm/i915: Introduce INTEL_GEN_MASK Joonas Lahtinen
2017-09-08  9:29 ` [PATCH 2/2] drm/i915: Simplify i915_reg_read_ioctl Joonas Lahtinen
2017-09-08 10:13   ` Chris Wilson
2017-09-08 11:22     ` Joonas Lahtinen
2017-09-08 12:24   ` Ville Syrjälä
2017-09-11 10:49     ` Joonas Lahtinen
2017-09-11 12:19       ` Ville Syrjälä
2017-09-08  9:39 ` [PATCH 1/2] drm/i915: Introduce INTEL_GEN_MASK Jani Nikula
2017-09-08 11:28   ` Joonas Lahtinen
2017-09-08 11:41   ` Tvrtko Ursulin
2017-09-08 12:20     ` Jani Nikula [this message]
2017-09-08 10:15 ` ✗ Fi.CI.BAT: failure for series starting with [1/2] " 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=87d1714c0y.fsf@nikula.org \
    --to=jani.nikula@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=joonas.lahtinen@linux.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.