From: Daniel Vetter Subject: Re: [PATCH 1/3] drm/i915: Verify address field of PCBR register. Date: Mon, 9 Dec 2013 08:58:51 +0100 Message-ID: <20131209075851.GQ27344@phenom.ffwll.local> References: <1386490955-20608-1-git-send-email-deepak.s@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-ee0-f41.google.com (mail-ee0-f41.google.com [74.125.83.41]) by gabe.freedesktop.org (Postfix) with ESMTP id 1FCE1FB1F8 for ; Sun, 8 Dec 2013 23:58:02 -0800 (PST) Received: by mail-ee0-f41.google.com with SMTP id t10so1374963eei.28 for ; Sun, 08 Dec 2013 23:58:02 -0800 (PST) Content-Disposition: inline In-Reply-To: <1386490955-20608-1-git-send-email-deepak.s@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org To: deepak.s@intel.com Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Sun, Dec 08, 2013 at 01:52:35PM +0530, deepak.s@intel.com wrote: > From: Deepak S > > On VLV the PCBR register has other bits besides the pcbr address > field. Verify only address field setup by BIOS to make sure we don't > misinterpret the PCBR setup. > > Signed-off-by: Deepak S > --- > drivers/gpu/drm/i915/intel_pm.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c > index e6d98fe..2e1340f 100644 > --- a/drivers/gpu/drm/i915/intel_pm.c > +++ b/drivers/gpu/drm/i915/intel_pm.c > @@ -4036,7 +4036,12 @@ static void valleyview_setup_pctx(struct drm_device *dev) > int pctx_size = 24*1024; > > pcbr = I915_READ(VLV_PCBR); > - if (pcbr) { > + > + /* PCBR Format: Bits 31:12 - Base address of Process Context > + * Bits 11:1 - Reserved > + * Bit 0 - PCBR Lock > + * Check only address field if already setup by BIOS */ > + if (pcbr >> 12) { I'd just add a VLV_PCBR_ADDR_MASK #define and & it. That's a bit more the idiom we usually use, and also allows us to ditcht the comment. You could even add a VLV_PCBR_LOCK #define if you want. -Daniel > /* BIOS set it up already, grab the pre-alloc'd space */ > int pcbr_offset; > > -- > 1.8.4.2 > > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch