intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] drm/i915: introduce macros to define register contents
@ 2018-10-03 16:05 Jani Nikula
  2018-10-03 16:05 ` [PATCH 1/3] drm/i915: introduce REG_BIT() and REG_FIELD_MASK() " Jani Nikula
                   ` (6 more replies)
  0 siblings, 7 replies; 11+ messages in thread
From: Jani Nikula @ 2018-10-03 16:05 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-10-04  7:37 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-03 16:05 [PATCH 0/3] drm/i915: introduce macros to define register contents Jani Nikula
2018-10-03 16:05 ` [PATCH 1/3] drm/i915: introduce REG_BIT() and REG_FIELD_MASK() " 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

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).