From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jesse Barnes Subject: Re: [PATCH 5/8] drm/i915: retrieve current fb config into new plane_config structure at init v7 Date: Tue, 17 Dec 2013 13:03:06 -0800 Message-ID: <20131217130306.06cb4b09@jbarnes-desktop> References: <1387240469-932-1-git-send-email-jbarnes@virtuousgeek.org> <1387240469-932-5-git-send-email-jbarnes@virtuousgeek.org> <20131217100312.GB27858@nuc-i3427.alporthouse.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from oproxy19-pub.mail.unifiedlayer.com (oproxy19-pub.mail.unifiedlayer.com [70.40.200.33]) by gabe.freedesktop.org (Postfix) with SMTP id 90982FD23F for ; Tue, 17 Dec 2013 13:01:13 -0800 (PST) In-Reply-To: <20131217100312.GB27858@nuc-i3427.alporthouse.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: Chris Wilson Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Tue, 17 Dec 2013 10:03:12 +0000 Chris Wilson wrote: > On Mon, Dec 16, 2013 at 04:34:26PM -0800, Jesse Barnes wrote: > > + if (INTEL_INFO(dev)->gen >= 4) { > > + if (plane_config->tiled) > > + offset = I915_READ(DSPTILEOFF(plane)); > > + else > > + offset = I915_READ(DSPLINOFF(plane)); > > + base = I915_READ(DSPSURF(plane)) & 0xfffff000; > > + } else { > > + base = I915_READ(DSPADDR(plane)); > > + } > > + > > + val = I915_READ(PIPESRC(pipe)); > > + plane_config->fb->base.width = ((val >> 16) & 0xfff) + 1; > > + plane_config->fb->base.height = ((val >> 0) & 0xfff) + 1; > > + > > + val = I915_READ(DSPSTRIDE(pipe)); > > + plane_config->fb->base.pitches[0] = val & 0xffffff80; > > + > > + plane_config->size = ALIGN(plane_config->fb->base.pitches[0] * > > + plane_config->fb->base.height, PAGE_SIZE); > > This underestimates the size of a tiled framebuffer. Height should be > aligned to 1,16,64 depending on tiling. Fixed, thanks. -- Jesse Barnes, Intel Open Source Technology Center