Re: [PATCH 1/3] drm/i915: rename macro parameter(ring) to (engine)

Chris Wilson
2016-07-20T17:28:32Z

On Wed, Jul 20, 2016 at 06:16:05PM +0100, Dave Gordon wrote:
> 'ring' is an old deprecated term for a GPU engine. Here we make the
> terminology more consistent by renaming the 'ring' parameter of lots of
> macros that calculate addresses within the MMIO space of an engine.
>
> Signed-off-by: Dave Gordon <david.s.gordon@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>

> ---
> drivers/gpu/drm/i915/i915_reg.h | 14 +++++++-------
> drivers/gpu/drm/i915/intel_lrc.h | 16 ++++++++--------
> drivers/gpu/drm/i915/intel_ringbuffer.h | 24 ++++++++++++------------
> 3 files changed, 27 insertions(+), 27 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> index 8bfde75..559c9d7 100644
> --- a/drivers/gpu/drm/i915/i915_reg.h
> +++ b/drivers/gpu/drm/i915/i915_reg.h
> @@ -186,13 +186,13 @@ static inline bool i915_mmio_reg_valid(i915_reg_t reg)
> #define GEN9_GRDOM_GUC (1 << 5)
> #define GEN8_GRDOM_MEDIA2 (1 << 7)
>
> -#define RING_PP_DIR_BASE(ring) _MMIO((ring)->mmio_base+0x228)
> -#define RING_PP_DIR_BASE_READ(ring) _MMIO((ring)->mmio_base+0x518)
> -#define RING_PP_DIR_DCLV(ring) _MMIO((ring)->mmio_base+0x220)
> +#define RING_PP_DIR_BASE(engine) _MMIO((engine)->mmio_base+0x228)
> +#define RING_PP_DIR_BASE_READ(engine) _MMIO((engine)->mmio_base+0x518)
> +#define RING_PP_DIR_DCLV(engine) _MMIO((engine)->mmio_base+0x220)
> #define PP_DIR_DCLV_2G 0xffffffff

Since these registers don't refer to the actual ring buffer, but the
state of the engine itself, I was thinking about updating the RING_
prefix as well. I didn't think it is worth it atm.
-Chris

--
Chris Wilson, Intel Open Source Technology Centre