drm/omap: fix plane rotation
authorGrazvydas Ignotas <notasas@gmail.com>
Sat, 5 Apr 2014 18:33:51 +0000 (21:33 +0300)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Mon, 14 Apr 2014 09:34:14 +0000 (12:34 +0300)
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.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
drivers/gpu/drm/omapdrm/omap_plane.c

index 046d5e660c04c428192b15ab268de39c8fff35a1..df1725247ccaa570675dc8c3fc79c1c75657b32a 100644 (file)
@@ -246,6 +246,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;
+       }
+
        return omap_plane_mode_set(plane, crtc, fb,
                        crtc_x, crtc_y, crtc_w, crtc_h,
                        src_x, src_y, src_w, src_h,