[Intel-gfx] [PATCH 1/4] drm/i915: PLL macro cleanup and pipe assertion check

Chris Wilson chris at chris-wilson.co.uk
Wed Oct 5 20:43:53 CEST 2011


On Wed,  5 Oct 2011 10:25:18 -0700, Jesse Barnes <jbarnes at virtuousgeek.org> wrote:
> Add a macro for accessing the two pipe PLLs and add a check to make sure
> we don't access a non-existent one in the enable/disable functions.
> 
> Signed-off-by: Jesse Barnes <jbarnes at virtuousgeek.org>
> ---
>  drivers/gpu/drm/i915/i915_reg.h      |    6 +++---
>  drivers/gpu/drm/i915/intel_display.c |    6 ++++++
>  2 files changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> index 542453f..7659075 100644
> --- a/drivers/gpu/drm/i915/i915_reg.h
> +++ b/drivers/gpu/drm/i915/i915_reg.h
> @@ -2945,15 +2945,15 @@
>  
>  #define _PCH_DPLL_A              0xc6014
>  #define _PCH_DPLL_B              0xc6018
> -#define PCH_DPLL(pipe) _PIPE(pipe, _PCH_DPLL_A, _PCH_DPLL_B)
> +#define PCH_DPLL(pipe) (pipe == 0 ?  _PCH_DPLL_A : _PCH_DPLL_B)

If you check that pipe != 2 elsewhere why change these macros? What
might be a good addition is to use a compile-time assert in case we do
feed these an invalid enum pipe.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre



More information about the Intel-gfx mailing list