From: Chris Wilson Subject: Re: [PATCH 1/4] drm/i915: PLL macro cleanup and pipe assertion check Date: Wed, 05 Oct 2011 19:43:53 +0100 Message-ID: References: <1317835521-10183-1-git-send-email-jbarnes@virtuousgeek.org> <1317835521-10183-2-git-send-email-jbarnes@virtuousgeek.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id DC6309E930 for ; Wed, 5 Oct 2011 11:43:55 -0700 (PDT) In-Reply-To: <1317835521-10183-2-git-send-email-jbarnes@virtuousgeek.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Jesse Barnes , intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Wed, 5 Oct 2011 10:25:18 -0700, Jesse Barnes 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 > --- > 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