Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Sagar Arun Kamble <sagar.a.kamble@intel.com>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: David Airlie <airlied@linux.ie>,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v5 11/11] drm/i915: Calling rotate and inverse rotate transformations after clipping
Date: Tue, 11 Feb 2014 17:02:31 +0530	[thread overview]
Message-ID: <1392118351.28501.21.camel@sagar-desktop> (raw)
In-Reply-To: <20140210133257.GK3891@intel.com>

[-- Attachment #1: Type: text/plain, Size: 3773 bytes --]

On Mon, 2014-02-10 at 15:32 +0200, Ville Syrjälä wrote:
> On Mon, Feb 10, 2014 at 01:01:18PM +0530, sagar.a.kamble@intel.com wrote:
> > From: Sagar Kamble <sagar.a.kamble@intel.com>
> > 
> > With clipped sprites these transformations are not working. these
> > functions transform complete sprite irrespective of clipping present.
> > This leads to invisible portion of sprite show up when rotate 180 if
> > it was out of visible area before.
> > 
> > v4: Moved rotate transform for source rectangle after clipping.
> > Added rotate and inverse rotate transform for destination rect.
> 
> Still NAK.
> 
> I just pushed rotation support to my glplane test app [1], and with
> with that my rotated clipping code works exactly as intended.
> 
> [1] git://gitorious.org/vsyrjala/glplane.git
I tried this app. I think I am considering 180 degree rotation of
clipped sprite plane differently. I have captured output with these
rotate transforms moved before(clip-rotated) and after(rotate-clipped)
clipping code.

Which is valid? Rotating entire sprite and then clipping or Rotating
clipped portion?

Reference and Rotated output is attached FYI.

If rotating entire sprite is correct then this patch 11/11 is not needed
and can be abandoned.

thanks,
Sagar
> > 
> > Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> > Cc: Jani Nikula <jani.nikula@linux.intel.com>
> > Cc: David Airlie <airlied@linux.ie>
> > Cc: dri-devel@lists.freedesktop.org
> > Cc: linux-kernel@vger.kernel.org
> > Cc: vijay.a.purushothaman@intel.com
> > Signed-off-by: Sagar Kamble <sagar.a.kamble@intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_sprite.c | 16 ++++++++++++----
> >  1 file changed, 12 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
> > index 62b9f84..799f6a9 100644
> > --- a/drivers/gpu/drm/i915/intel_sprite.c
> > +++ b/drivers/gpu/drm/i915/intel_sprite.c
> > @@ -769,9 +769,6 @@ intel_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
> >  	max_scale = intel_plane->max_downscale << 16;
> >  	min_scale = intel_plane->can_scale ? 1 : (1 << 16);
> >  
> > -	drm_rect_rotate(&src, fb->width << 16, fb->height << 16,
> > -			intel_plane->rotation);
> > -
> >  	hscale = drm_rect_calc_hscale_relaxed(&src, &dst, min_scale, max_scale);
> >  	BUG_ON(hscale < 0);
> >  
> > @@ -785,6 +782,13 @@ intel_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
> >  	crtc_w = drm_rect_width(&dst);
> >  	crtc_h = drm_rect_height(&dst);
> >  
> > +	drm_rect_rotate(&src, fb->width << 16, fb->height << 16,
> > +				intel_plane->rotation);
> > +
> > +	drm_rect_rotate(&dst, intel_crtc->config.pipe_src_w,
> > +				intel_crtc->config.pipe_src_h,
> > +				intel_plane->rotation);
> > +
> >  	if (visible) {
> >  		/* check again in case clipping clamped the results */
> >  		hscale = drm_rect_calc_hscale(&src, &dst, min_scale, max_scale);
> > @@ -811,7 +815,11 @@ intel_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
> >  				     drm_rect_height(&dst) * vscale - drm_rect_height(&src));
> >  
> >  		drm_rect_rotate_inv(&src, fb->width << 16, fb->height << 16,
> > -				    intel_plane->rotation);
> > +					intel_plane->rotation);
> > +
> > +		drm_rect_rotate_inv(&dst, intel_crtc->config.pipe_src_w,
> > +					intel_crtc->config.pipe_src_h,
> > +					intel_plane->rotation);
> >  
> >  		/* sanity check to make sure the src viewport wasn't enlarged */
> >  		WARN_ON(src.x1 < (int) src_x ||
> > -- 
> > 1.8.5
> > 
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
> 


[-- Attachment #2: 180-rotated-clip-rotated.png --]
[-- Type: image/png, Size: 711457 bytes --]

[-- Attachment #3: 180-rotated-rotate-clipped.png --]
[-- Type: image/png, Size: 828346 bytes --]

[-- Attachment #4: ref-clip-rotated.png --]
[-- Type: image/png, Size: 830797 bytes --]

[-- Attachment #5: ref-rotate-clipped.png --]
[-- Type: image/png, Size: 809112 bytes --]

[-- Attachment #6: Type: text/plain, Size: 159 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2014-02-11 11:32 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-10  7:31 [PATCH v5 00/11] Enabling 180 degree rotation for sprite and crtc planes sagar.a.kamble
2014-02-10  7:31 ` [PATCH v5 01/11] drm: Move DRM_ROTATE bits out of omapdrm into drm_crtc.h sagar.a.kamble
2014-02-10  7:31 ` [PATCH v5 02/11] drm: Add support_bits parameter to drm_property_create_bitmask() sagar.a.kamble
2014-02-10 13:43   ` Ville Syrjälä
2014-02-10 14:05     ` [PATCH v2 " ville.syrjala
2014-02-11 11:02       ` Sagar Arun Kamble
2014-02-10  7:31 ` [PATCH v5 03/11] drm: Add drm_mode_create_rotation_property() sagar.a.kamble
2014-02-10  7:31 ` [PATCH v5 04/11] drm/omap: Switch omapdrm over to drm_mode_create_rotation_property() sagar.a.kamble
2014-02-10  7:31 ` [PATCH v5 05/11] drm: Add drm_rect rotation functions sagar.a.kamble
2014-02-10  7:31 ` [PATCH v5 06/11] drm: Add drm_rotation_simplify() sagar.a.kamble
2014-02-10  7:31 ` [PATCH v5 07/11] drm/i915: Add 180 degree sprite rotation support sagar.a.kamble
2014-02-10 13:31   ` Ville Syrjälä
2014-02-10  7:31 ` [PATCH v5 08/11] drm/i915: Make intel_plane_restore() return an error sagar.a.kamble
2014-02-10  7:31 ` [PATCH v5 09/11] drm/i915: Add rotation property for sprites sagar.a.kamble
2014-02-10  7:31 ` [PATCH v5 10/11] drm/i915: Add 180 degree primary plane rotation support sagar.a.kamble
2014-02-10 13:32   ` Ville Syrjälä
2014-02-10  7:31 ` [PATCH v5 11/11] drm/i915: Calling rotate and inverse rotate transformations after clipping sagar.a.kamble
2014-02-10 13:32   ` [Intel-gfx] " Ville Syrjälä
2014-02-11 11:32     ` Sagar Arun Kamble [this message]
2014-02-11 11:59       ` Daniel Vetter
2014-02-11 12:09         ` Sagar Arun Kamble
2014-02-11 14:56       ` [Intel-gfx] " Ville Syrjälä
2014-02-11 17:36         ` Sagar Arun Kamble
2014-02-10 13:43 ` [PATCH v5 00/11] Enabling 180 degree rotation for sprite and crtc planes 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=1392118351.28501.21.camel@sagar-desktop \
    --to=sagar.a.kamble@intel.com \
    --cc=airlied@linux.ie \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ville.syrjala@linux.intel.com \
    /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