On Wed, 5 Oct 2011 10:25:18 -0700, Jesse Barnes <[email protected]> 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 <[email protected]> > --- > 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 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
