From: Jani Nikula <jani.nikula@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2 0/4] drm/i915: introduce macros to define register contents
Date: Wed, 27 Feb 2019 13:01:58 +0200 [thread overview]
Message-ID: <87r2bto5p5.fsf@intel.com> (raw)
In-Reply-To: <154772957218.12932.9314766615215925084@skylake-alporthouse-com>
On Thu, 17 Jan 2019, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> Quoting Jani Nikula (2019-01-17 12:13:59)
>> The v1 [1] kind of died down because the FIELD_PREP() build-time checks
>> were lost as it didn't evaluate to integer constant expression. I looked
>> at this again, and managed to include the checks in the local copy by
>> using BUILD_BUG_ON_ZERO() instead.
>>
>> On the naming bikeshedding department, I noticed a clash with regmap.h
>> REG_FIELD() and, since it all looked pretty verbose anyway, decided to
>> see if local _BIT(), _MASK(), and _FIELD() would stick.
>
> MMIO_BIT, MMIO_MASK, MMIO_FIELD
> #define MMIO_PREP(mask, val) FIELD_PREP(mask, val)
This would mean two wrappers/implementations for FIELD_PREP(), plus the
original.
> ?
>
> The leading underscore and the inconsistency with FIELD_PREP is getting
> to me.
Fair enough.
So we need constant expression and/or u32 implementations or wrappers
for BIT(), GENMASK(), and FIELD_PREP(). Do we want to use wrappers for
FIELD_PREP() and FIELD_GET() in code outside of the macro definitions?
Might be nice for consistency.
I'm not fond of the MMIO prefix here, mostly because these are not
strictly related to MMIO. Feels like conflating too much.
BIT
-> REG_BIT
-> I915_BIT
GENMASK
-> REG_MASK
-> REG_GENMASK
-> I915_MASK
-> I915_GENMASK
FIELD_PREP
-> REG_BITFIELD
-> REG_FIELD_PREP
-> I915_FIELD
-> I915_FIELD_PREP
-> I915_BITFIELD
FIELD_GET (not strictly needed)
-> REG_FIELD_GET
-> I915_FIELD_GET
Dunno, I kind of liked the short underscored versions, but if we're
going to make them longer, why not just prefix all the originals with
REG_ or I915_ and be done with it?
BR,
Jani.
--
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:[~2019-02-27 10:59 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-17 12:13 [PATCH v2 0/4] drm/i915: introduce macros to define register contents Jani Nikula
2019-01-17 12:14 ` [PATCH v2 1/4] drm/i915/dp: remove PANEL_POWER_OFF macro and its use Jani Nikula
2019-01-17 12:25 ` Mika Kuoppala
2019-01-18 13:42 ` Jani Nikula
2019-01-17 12:14 ` [PATCH v2 2/4] drm/i915: introduce _BIT() and _MASK() to define register contents Jani Nikula
2019-01-17 13:02 ` Mika Kuoppala
2019-01-17 12:14 ` [PATCH v2 3/4] drm/i915: deprecate _SHIFT in favor of FIELD_GET() and _MASK Jani Nikula
2019-01-17 12:14 ` [PATCH v2 4/4] drm/i915: introduce _FIELD() to define register field values Jani Nikula
2019-01-17 12:58 ` Chris Wilson
2019-01-17 12:52 ` [PATCH v2 0/4] drm/i915: introduce macros to define register contents Chris Wilson
2019-02-27 11:01 ` Jani Nikula [this message]
2019-02-27 11:20 ` Chris Wilson
2019-01-17 12:54 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: introduce macros to define register contents (rev2) Patchwork
2019-01-17 12:57 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-01-17 13:13 ` ✓ Fi.CI.BAT: success " Patchwork
2019-01-17 21:33 ` ✓ 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=87r2bto5p5.fsf@intel.com \
--to=jani.nikula@intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
/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.