From patchwork Thu May 4 10:23:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 9711347 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9C52B60235 for ; Thu, 4 May 2017 10:23:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7CDDB28663 for ; Thu, 4 May 2017 10:23:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 71A5E28686; Thu, 4 May 2017 10:23:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8679228663 for ; Thu, 4 May 2017 10:23:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B18756E4A2; Thu, 4 May 2017 10:23:43 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from lelnx193.ext.ti.com (lelnx193.ext.ti.com [198.47.27.77]) by gabe.freedesktop.org (Postfix) with ESMTPS id CF05E89996 for ; Thu, 4 May 2017 10:23:41 +0000 (UTC) Received: from dflxv15.itg.ti.com ([128.247.5.124]) by lelnx193.ext.ti.com (8.15.1/8.15.1) with ESMTP id v44ANdeR018027; Thu, 4 May 2017 05:23:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1493893419; bh=RfAYOuQCmDutLE3zkZ3EuwqT9AvvC1mR7yRNHewdPE4=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=j0Tzo8SGxS3bTjbjcjU6rRhKusJiIM+kpq1edlaPYqMWeqCx2xlcAvVuP6xT9pxqC R2YwB8GZ4BUO8V5lQ03LlYRiXkFk5qYYBR8Jpz2Te0iG7QqmiNqmNPknKr4HSuV/PJ A2rae0BdzPnKC+r+T3hpMfxJSRwz3yCJcuxrrNcI= Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id v44ANdQi014136; Thu, 4 May 2017 05:23:39 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.294.0; Thu, 4 May 2017 05:23:38 -0500 Received: from deskari.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id v44ANZsB019135; Thu, 4 May 2017 05:23:37 -0500 From: Tomi Valkeinen To: , Laurent Pinchart Subject: [PATCH 01/16] drm/omap: fix passing rotation parameter to dispc Date: Thu, 4 May 2017 13:23:17 +0300 Message-ID: <1493893412-12178-2-git-send-email-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1493893412-12178-1-git-send-email-tomi.valkeinen@ti.com> References: <1493893412-12178-1-git-send-email-tomi.valkeinen@ti.com> MIME-Version: 1.0 Cc: Tomi Valkeinen , Jyri Sarha X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 --- drivers/gpu/drm/omapdrm/omap_fb.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/gpu/drm/omapdrm/omap_fb.c b/drivers/gpu/drm/omapdrm/omap_fb.c index 2dca19a0c2ff..4e434b2097ec 100644 --- a/drivers/gpu/drm/omapdrm/omap_fb.c +++ b/drivers/gpu/drm/omapdrm/omap_fb.c @@ -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; }