On Wed, 05 Oct 2011 19:43:53 +0100 Chris Wilson <ch...@chris-wilson.co.uk> wrote:
> On Wed, 5 Oct 2011 10:25:18 -0700, Jesse Barnes <jbar...@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 <jbar...@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. Belt & suspenders; I added the checks and fixes at different times too. But a compile time check would be good for this one. In future PCH parts we'll have more PLLs to drive pipes, but they'll be at a different offset so we'll need new macro anyway. -- Jesse Barnes, Intel Open Source Technology Center
signature.asc
Description: PGP signature
_______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx