From: Jani Nikula <jani.nikula@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: jani.nikula@intel.com
Subject: [PATCH 0/3] drm/i915: introduce macros to define register contents
Date: Wed, 3 Oct 2018 19:05:20 +0300 [thread overview]
Message-ID: <cover.1538582156.git.jani.nikula@intel.com> (raw)
Actual serious v1 after the RFC [1].
The major change is to add local wrappers or versions of the BIT(),
GENMASK(), and FIELD_PREP() macros for i915_reg.h to ensure u32 type and
integer constant expressions.
It's a bit of a meh but does provide an opportunity for unified local
naming of the macros. After some back and forth, REG_BIT(),
REG_FIELD_MASK() and REG_FIELD() are what I settled on, but I guess I
expect some bikeshedding...
The big loss is the build-time checking of the defined field values;
FIELD_PREP() does it in a way that prohibits macro use in e.g. case
labels.
bloat-o-meter indicates slight increase, unsurprising due to the added
masking to avoid the values overflowing their fields. The changed sample
is too small to make any big conclusions though.
add/remove: 0/0 grow/shrink: 3/0 up/down: 81/0 (81)
Function old new delta
intel_dp_init_panel_power_sequencer_registers 863 912 +49
intel_pre_enable_lvds 618 646 +28
intel_pps_readout_hw_state 385 389 +4
Total: Before=1106128, After=1106209, chg +0.01%
BR,
Jani.
[1] https://patchwork.freedesktop.org/series/50267/
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Jani Nikula (3):
drm/i915: introduce REG_BIT() and REG_FIELD_MASK() to define register
contents
drm/i915: deprecate _SHIFT in favor of FIELD_GET() and _MASK
drm/i915: introduce REG_FIELD() to define register field values
drivers/gpu/drm/i915/i915_reg.h | 129 ++++++++++++++++++++------------------
drivers/gpu/drm/i915/intel_dp.c | 42 +++++--------
drivers/gpu/drm/i915/intel_lvds.c | 40 ++++++------
3 files changed, 104 insertions(+), 107 deletions(-)
--
2.11.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next reply other threads:[~2018-10-03 16:05 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-03 16:05 Jani Nikula [this message]
2018-10-03 16:05 ` [PATCH 1/3] drm/i915: introduce REG_BIT() and REG_FIELD_MASK() to define register contents Jani Nikula
2018-10-03 16:54 ` Rodrigo Vivi
2018-10-03 18:26 ` Manasi Navare
2018-10-04 6:38 ` Jani Nikula
2018-10-03 16:05 ` [PATCH 2/3] drm/i915: deprecate _SHIFT in favor of FIELD_GET() and _MASK Jani Nikula
2018-10-03 16:05 ` [PATCH 3/3] drm/i915: introduce REG_FIELD() to define register field values Jani Nikula
2018-10-03 16:13 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: introduce macros to define register contents Patchwork
2018-10-03 16:15 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-10-03 16:36 ` ✓ Fi.CI.BAT: success " Patchwork
2018-10-04 7:37 ` ✓ 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=cover.1538582156.git.jani.nikula@intel.com \
--to=jani.nikula@intel.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).