From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tomi Valkeinen Subject: Re: [PATCH] drm/omap: fix plane rotation Date: Tue, 8 Apr 2014 08:57:21 +0300 Message-ID: <53438FC1.5010400@ti.com> References: <1396722831-22761-1-git-send-email-notasas@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1877585124==" Return-path: Received: from bear.ext.ti.com (bear.ext.ti.com [192.94.94.41]) by gabe.freedesktop.org (Postfix) with ESMTP id 0BF406E83D for ; Mon, 7 Apr 2014 22:57:25 -0700 (PDT) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Rob Clark , Grazvydas Ignotas Cc: "dri-devel@lists.freedesktop.org" List-Id: dri-devel@lists.freedesktop.org --===============1877585124== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="0t4GwdtP2jB9PK2Xk4An6Upkp8N6XjHUm" --0t4GwdtP2jB9PK2Xk4An6Upkp8N6XjHUm Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 08/04/14 01:12, Rob Clark wrote: > On Mon, Apr 7, 2014 at 5:41 PM, Grazvydas Ignotas w= rote: >> Gra=C5=BEvydas >> >> >> On Mon, Apr 7, 2014 at 8:17 PM, Rob Clark wrote:= >>> On Mon, Apr 7, 2014 at 6:32 AM, Grazvydas Ignotas = wrote: >>>> On Sun, Apr 6, 2014 at 12:45 AM, Rob Clark wro= te: >>>>> On Sat, Apr 5, 2014 at 2:33 PM, Grazvydas Ignotas wrote: >>>>>> Plane rotation with omapdrm is currently broken. >>>>>> It seems omap_plane_mode_set() expects width and height in screen >>>>>> coordinates, so pass it like that. >>>>>> >>>>>> Cc: Rob Clark >>>>>> Signed-off-by: Grazvydas Ignotas >>>>>> --- >>>>>> drivers/gpu/drm/omapdrm/omap_plane.c | 8 ++++++++ >>>>>> 1 file changed, 8 insertions(+) >>>>>> >>>>>> diff --git a/drivers/gpu/drm/omapdrm/omap_plane.c b/drivers/gpu/dr= m/omapdrm/omap_plane.c >>>>>> index 370580c..5611f15 100644 >>>>>> --- a/drivers/gpu/drm/omapdrm/omap_plane.c >>>>>> +++ b/drivers/gpu/drm/omapdrm/omap_plane.c >>>>>> @@ -253,6 +253,14 @@ static int omap_plane_update(struct drm_plane= *plane, >>>>>> >>>>>> drm_framebuffer_reference(fb); >>>>>> >>>>>> + /* omap_plane_mode_set() takes adjusted src */ >>>>>> + switch (omap_plane->win.rotation & 0xf) { >>>>>> + case BIT(DRM_ROTATE_90): >>>>>> + case BIT(DRM_ROTATE_270): >>>>>> + swap(src_w, src_h); >>>>>> + break; >>>>>> + } >>>>>> + >>>>> >>>>> hmm, I think that the better thing would be to do this in >>>>> omap_framebuffer_update_scanout(). In fact we do already swap >>>>> src_w/src_h there. Only we don't swap the width/height parameters = we >>>>> pass down to omapdss. Not quite sure if something changed in omapd= ss >>>>> with regards to rotation_type, but keeping it with the rest of the >>>>> rotation related maths in _update_scanout() seems cleaner. >>>> >>>> But then it has to know somehow if apply was triggered from >>>> omap_crtc_mode_set() or omap_plane_update(). The problem is >>>> omap_crtc_mode_set() passes rotated width/height (and crtc rotation >>>> works correctly), but omap_plane_update() uses unrotated width/heigh= t >>>> (so plane rotation is currently broken). >>> >>> >>> Something still seems a bit suspicious.. drm core is not swapping >>> width/height for crtc (other than for validating the configuration...= >>> which might also be needed for planes). I guess it is getting >>> already-rotated width/height from userspace. So probably we want to >>> do the same for planes, so it might be a good idea to move >>> crtc->invert_dimensions into plane. >> >> OK I guess I said it wrong.. >> The display I have is 1080x1920 portrait panel. >> For omap_crtc_mode_set(), hdisplay is always 1080 and vdisplay, is >> 1920, regardless of rotation. That is passed over to >> omap_plane_mode_set() and everything works. >=20 > ahh, ok, that makes much more sense.. (sorry, it's been a long time > since I looked at rotation) >=20 > Reviewed-by: Rob Clark I can queue this up in my omapdrm fixes branch. I already have a few ther= e. Tomi --0t4GwdtP2jB9PK2Xk4An6Upkp8N6XjHUm Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.14 (GNU/Linux) iQIcBAEBAgAGBQJTQ4/BAAoJEPo9qoy8lh71KAcQAJh1teucGmim6+jAgN7ia9xa /8UD7Aifl08WwPE/eClYsY4E27gLCrbIn7mWuVcLsdhrC6AZSagLU2WWt0u7RbuD fCxuoOD/yMFp/We0z+TodnVTt4QEAHfngm4eseVvgaviQJz6yWD3sBSy/eUFePRp gBpPzTZFPAOeSTLQnA1ZeL0PHhMC9eXiAPiKU2/Nu1nKHhDWvGHOwy2sbX67Enl1 me0hsbnfl3YvIRopE2tk8uRSV2NryZinVBPF+5O6hYeRaFPz8A8RlybovXlQRtTK rwPtuj84yRO4KP+MEVcyi5HnimufJFvFLS0aQdbINJ8RGKD/mfyvKzdHPaMD7Awf 9JRECMtBt1MQMiRmbGnDrX5kXnjUK/KkLbL0P4oFJlkdc7PDx7DCdlBKLaFkB3KV 9eMfTwthzZu/2wlTdU5VvhMcHLcPF49a2XH7/+NkKPApNRD0CJfA3eEzGoc3a09/ AeXgTZHHIBw66RDvKJB2JSBfEfD+fASglPlnFagNkRsWnf/RFU1cHHy2ZOb2Oejj XHpZZyBWft8CR1dRw3A2beXqvJ7711WVYLHWv3mRJJpYpLlTqssFu8rOpMmpuzaQ Wq7FTyQFj6vHQz+OOMUHTvtx4/HaV6Fcj7KvVmeIT4LsY7Y+rCY0sDFnhxUNsMuu hp1hQAQpfeyhNYtsmrwb =tUbg -----END PGP SIGNATURE----- --0t4GwdtP2jB9PK2Xk4An6Upkp8N6XjHUm-- --===============1877585124== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel --===============1877585124==--