[Intel-gfx] [PATCH 1/4] drm/i915: PLL macro cleanup and pipe assertion check
Jesse Barnes
jbarnes at virtuousgeek.org
Wed Oct 5 20:48:45 CEST 2011
On Wed, 05 Oct 2011 19:43:53 +0100
Chris Wilson <chris at chris-wilson.co.uk> wrote:
> 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.
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20111005/d5ee824f/attachment.sig>
More information about the Intel-gfx
mailing list