From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= Subject: Re: [Intel-gfx] [PATCH v5 11/11] drm/i915: Calling rotate and inverse rotate transformations after clipping Date: Mon, 10 Feb 2014 15:32:57 +0200 Message-ID: <20140210133257.GK3891@intel.com> References: <1392017478-4945-1-git-send-email-sagar.a.kamble@intel.com> <1392017478-4945-12-git-send-email-sagar.a.kamble@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline In-Reply-To: <1392017478-4945-12-git-send-email-sagar.a.kamble@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org To: sagar.a.kamble@intel.com Cc: Daniel Vetter , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Mon, Feb 10, 2014 at 01:01:18PM +0530, sagar.a.kamble@intel.com wrote: > From: Sagar Kamble > = > 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 > = > Cc: Daniel Vetter > Cc: Jani Nikula > Cc: David Airlie > Cc: dri-devel@lists.freedesktop.org > Cc: linux-kernel@vger.kernel.org > Cc: vijay.a.purushothaman@intel.com > Signed-off-by: Sagar Kamble > --- > 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/i= ntel_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 dr= m_crtc *crtc, > max_scale =3D intel_plane->max_downscale << 16; > min_scale =3D intel_plane->can_scale ? 1 : (1 << 16); > = > - drm_rect_rotate(&src, fb->width << 16, fb->height << 16, > - intel_plane->rotation); > - > hscale =3D drm_rect_calc_hscale_relaxed(&src, &dst, min_scale, max_scal= e); > BUG_ON(hscale < 0); > = > @@ -785,6 +782,13 @@ intel_update_plane(struct drm_plane *plane, struct d= rm_crtc *crtc, > crtc_w =3D drm_rect_width(&dst); > crtc_h =3D 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 =3D drm_rect_calc_hscale(&src, &dst, min_scale, max_scale); > @@ -811,7 +815,11 @@ intel_update_plane(struct drm_plane *plane, struct d= rm_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 -- = Ville Syrj=E4l=E4 Intel OTC