@@ -167,6 +167,8 @@ void omap_framebuffer_update_scanout(struct drm_framebuffer *fb,
uint32_t w = win->src_w;
uint32_t h = win->src_h;
+ /* note: DRM rotates counter-clockwise, TILER + DSS rotates clockwise */
+
switch (win->rotation & DRM_ROTATE_MASK) {
default:
dev_err(fb->dev->dev, "invalid rotation: %02x",
@@ -201,6 +203,15 @@ void omap_framebuffer_update_scanout(struct drm_framebuffer *fb,
if (orient & MASK_X_INVERT)
x += w - 1;
+ if (!(orient & MASK_XY_FLIP) && !(orient & MASK_Y_INVERT))
+ info->rotation = OMAP_DSS_ROT_0;
+ else if (!(orient & MASK_XY_FLIP) && (orient & MASK_Y_INVERT))
+ info->rotation = OMAP_DSS_ROT_180;
+ else if ((orient & MASK_XY_FLIP) && (orient & MASK_Y_INVERT))
+ info->rotation = OMAP_DSS_ROT_90;
+ else if ((orient & MASK_XY_FLIP) && !(orient & MASK_Y_INVERT))
+ info->rotation = OMAP_DSS_ROT_270;
+
omap_gem_rotated_paddr(plane->bo, orient, x, y, &info->paddr);
info->rotation_type = OMAP_DSS_ROT_TILER;
info->screen_width = omap_gem_tiled_stride(plane->bo, orient);
@@ -221,6 +232,7 @@ void omap_framebuffer_update_scanout(struct drm_framebuffer *fb,
info->paddr = get_linear_addr(plane, format, 0, x, y);
info->rotation_type = OMAP_DSS_ROT_DMA;
+ info->rotation = OMAP_DSS_ROT_0;
info->screen_width = plane->pitch;
}
omapdrm does not pass the rotation angle to dispc. We need to pass the rotation angle to fully support TILER rotation with YUV formats. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> --- drivers/gpu/drm/omapdrm/omap_fb.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)