Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>,
	dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v3 4/4] drm/i915: Implement proper clipping for video sprites
Date: Tue, 16 Apr 2013 17:20:15 +0300	[thread overview]
Message-ID: <20130416142015.GK4469@intel.com> (raw)
In-Reply-To: <20130416133702.GA13387@cantiga.alporthouse.com>

On Tue, Apr 16, 2013 at 02:37:24PM +0100, Chris Wilson wrote:
> On Tue, Apr 16, 2013 at 01:47:22PM +0300, ville.syrjala@linux.intel.com wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > Properly clip the source when the destination gets clipped
> > by the pipe dimensions.
> > 
> > Sadly the video sprite hardware is rather limited so it can't do proper
> > sub-pixel postitioning. Resort to truncating the source coordinates to
> > (macro)pixel boundary.
> > 
> > The scaling checks are done using the relaxed drm_region functions.
> > That means that the src/dst regions are reduced in size in order to keep
> > the scaling factor within the limits.
> > 
> > Also do some additional checking against various hardware limits.
> > 
> > v2: Truncate src coords instead of rounding to avoid increasing src
> >     viewport size, and adapt to changes in drm_calc_{h,v}scale().
> > v3: Adapt to drm_region->drm_rect rename. Fix misaligned crtc_w for
> >     packed YUV formats when scaling isn't supported.
> > 
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Skipping to the end, use of drm_rect looks good.
> 
> The one ugly that stood out is:
> 
> >  	/*
> >  	 * If the sprite is completely covering the primary plane,
> >  	 * we can disable the primary and save power.
> >  	 */
> > -	if ((crtc_x == 0) && (crtc_y == 0) &&
> > +	if (visible &&
> > +	    (crtc_x == 0) && (crtc_y == 0) &&
> >  	    (crtc_w == primary_w) && (crtc_h == primary_h))
> >  		disable_primary = true;
> 
> which would be
>   disable_primary = drm_rect_equals(&dst, &clip);
>   BUG_ON(disable_primary && !visible);
> with a little bit of massaging of crtc/dst.

Yeah, looks nicer. I'll add drm_rect_equals() to our repertoire.

-- 
Ville Syrjälä
Intel OTC

  reply	other threads:[~2013-04-16 14:20 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-16 10:47 [PATCH] drm: drm_rect and clipping for intel sprite planes ville.syrjala
2013-04-16 10:47 ` [PATCH v5 1/4] drm: Add struct drm_rect and assorted utility functions ville.syrjala
2013-04-16 10:47 ` [PATCH v3 2/4] drm: Add drm_rect_calc_{hscale, vscale}() " ville.syrjala
2013-04-16 13:42   ` Chris Wilson
2013-04-16 14:14     ` Ville Syrjälä
2013-04-16 14:49       ` Chris Wilson
2013-04-16 15:16         ` Ville Syrjälä
2013-04-16 15:27           ` Chris Wilson
2013-04-19  8:04             ` [PATCH 1/3] drm: Add drm_rect_equals() ville.syrjala
2013-04-19  8:04               ` [PATCH v4 2/3] drm/i915: Implement proper clipping for video sprites ville.syrjala
2013-04-19  8:04               ` [PATCH 3/3] drm/i915: Relax the sprite scaling limits checks ville.syrjala
2013-04-16 10:47 ` [PATCH v3 3/4] drm: Add drm_rect_debug_print() ville.syrjala
2013-04-16 10:47 ` [PATCH v3 4/4] drm/i915: Implement proper clipping for video sprites ville.syrjala
2013-04-16 13:37   ` Chris Wilson
2013-04-16 14:20     ` Ville Syrjälä [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-03-27 15:46 [PATCH v3 1/4] drm: Add struct drm_rect and assorted utility functions ville.syrjala
2013-03-27 15:46 ` [PATCH v3 4/4] drm/i915: Implement proper clipping for video sprites ville.syrjala

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=20130416142015.GK4469@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=dri-devel@lists.freedesktop.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox