All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Daniel Vetter <daniel@ffwll.ch>
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 13:46:59 +0200	[thread overview]
Message-ID: <20130108114659.GL29018@intel.com> (raw)
In-Reply-To: <20130108105957.GV5737@phenom.ffwll.local>

On Tue, Jan 08, 2013 at 11:59:57AM +0100, Daniel Vetter wrote:
> 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.

Yeah either we round, or we just reject the operation. Both options have
some merit, so I think we need some kind of user controlled knob to select
the mode.

The "proper clipping" patch in the atomic branch rounds to nearest
macropixel, and it also handles the scaling limitations in a fuzzy
manner. I still need to split that stuff out, and then we need to
figure out how the user is supposed to select the rounding mode
(a per plane property perhaps, or just a global flag?).

-- 
Ville Syrjälä
Intel OTC

      reply	other threads:[~2013-01-08 11:47 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
2013-01-08 11:46   ` Ville Syrjälä [this message]

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=20130108114659.GL29018@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=daniel.vetter@ffwll.com \
    --cc=daniel@ffwll.ch \
    --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.