All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org, Daniel Vetter <daniel.vetter@ffwll.com>
Subject: Re: [PATCH] drm/i915: Use pixel size for computing linear offsets into a sprite
Date: Tue, 8 Jan 2013 11:59:57 +0100	[thread overview]
Message-ID: <20130108105957.GV5737@phenom.ffwll.local> (raw)
In-Reply-To: <1355919262-16483-1-git-send-email-chris@chris-wilson.co.uk>

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 <damien.lespiau@intel.com>
> Date:   Fri Oct 26 18:20:12 2012 +0100
> 
>     drm/i915: adjust sprite base address
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Daniel Vetter <daniel.vetter@ffwll.com>
> Cc: Damien Lespiau <damien.lespiau@intel.com>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  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/intel_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 drm_framebuffer *fb,
>  	I915_WRITE(SPRSTRIDE(pipe), fb->pitches[0]);
>  	I915_WRITE(SPRPOS(pipe), (crtc_y << 16) | crtc_x);
>  
> -	linear_offset = y * fb->pitches[0] + x * (fb->bits_per_pixel / 8);
> +	linear_offset = 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

  parent reply	other threads:[~2013-01-08 10:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-19 12:14 [PATCH] drm/i915: Use pixel size for computing linear offsets into a sprite Chris Wilson
2012-12-19 12:22 ` Ville Syrjälä
2012-12-19 17:48 ` Ville Syrjälä
2013-01-09 13:20   ` Daniel Vetter
2013-01-08 10:59 ` Daniel Vetter [this message]
2013-01-08 11:46   ` Ville Syrjälä

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130108105957.GV5737@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=chris@chris-wilson.co.uk \
    --cc=daniel.vetter@ffwll.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.