From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH] drm/i915: Use pixel size for computing linear offsets into a sprite Date: Tue, 8 Jan 2013 11:59:57 +0100 Message-ID: <20130108105957.GV5737@phenom.ffwll.local> References: <1355919262-16483-1-git-send-email-chris@chris-wilson.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mail-wg0-f53.google.com (mail-wg0-f53.google.com [74.125.82.53]) by gabe.freedesktop.org (Postfix) with ESMTP id 94AEEE5F68 for ; Tue, 8 Jan 2013 02:58:01 -0800 (PST) Received: by mail-wg0-f53.google.com with SMTP id fn15so210457wgb.20 for ; Tue, 08 Jan 2013 02:58:00 -0800 (PST) Content-Disposition: inline In-Reply-To: <1355919262-16483-1-git-send-email-chris@chris-wilson.co.uk> 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: Chris Wilson Cc: intel-gfx@lists.freedesktop.org, Daniel Vetter List-Id: intel-gfx@lists.freedesktop.org On Wed, Dec 19, 2012 at 12:14:22PM +0000, Chris Wilson wrote: > This fixes an original bug in the sprite code that miscomputed the > source offset into a linear YUV packed framebuffer, that was magnified > into an oops with > = > commit 5a35e99e8162d6820013a56ad15ea8bf937af5a6 > Author: Damien Lespiau > Date: Fri Oct 26 18:20:12 2012 +0100 > = > drm/i915: adjust sprite base address > = > Signed-off-by: Chris Wilson > Cc: Daniel Vetter > Cc: Damien Lespiau > Cc: Ville Syrj=E4l=E4 > --- > drivers/gpu/drm/i915/intel_sprite.c | 10 ++++------ > 1 file changed, 4 insertions(+), 6 deletions(-) > = > diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/i= ntel_sprite.c > index 3e05d79..fef3cfb 100644 > --- a/drivers/gpu/drm/i915/intel_sprite.c > +++ b/drivers/gpu/drm/i915/intel_sprite.c > @@ -120,11 +120,10 @@ ivb_update_plane(struct drm_plane *plane, struct dr= m_framebuffer *fb, > I915_WRITE(SPRSTRIDE(pipe), fb->pitches[0]); > I915_WRITE(SPRPOS(pipe), (crtc_y << 16) | crtc_x); > = > - linear_offset =3D y * fb->pitches[0] + x * (fb->bits_per_pixel / 8); > + linear_offset =3D y * fb->pitches[0] + x * pixel_size; Shouldn't we round x to an even offset for packed yuv? Maybe even using drm_format_horz_chroma_subsampling ... The idea being that a generic client can't really know the resolution for our source offsets. -Daniel -- = Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch