From patchwork Wed Jun 17 23:40:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 11611529 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E899E618 for ; Thu, 18 Jun 2020 07:18:09 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C7BB521532 for ; Thu, 18 Jun 2020 07:18:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BEku1n40" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C7BB521532 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AFB5C6EAC9; Thu, 18 Jun 2020 07:17:33 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lj1-x244.google.com (mail-lj1-x244.google.com [IPv6:2a00:1450:4864:20::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 98A146E16D for ; Wed, 17 Jun 2020 23:41:03 +0000 (UTC) Received: by mail-lj1-x244.google.com with SMTP id y11so5002126ljm.9 for ; Wed, 17 Jun 2020 16:41:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xltqyEfwrx8qT/CORRGTWXmzlbt9i4EassNZ2G9y7tE=; b=BEku1n40/Xnsjf59bRGYdTjZwuEud3inCy82ivQq2zFfIDTBIX85BM/9nR3smARZoV iaFwihC/aAe4vO2pJBovuMPuEOVeDPjQOqTOgrnh0WAjgKQ21CEh6+Zog4OAtQYG46to cEscvGvVVlVXW7vE2KT1cCd/ERsIInyY0S/ZgeFI4BqE/JRaXM1rs4RAUdq0L22pbWRk vffAMF/f2nQk0kVBKzC0Nqs4oL45s1+9SwmoCIcSWebPLHTAF6u/CaWGG1Ho/Y35Hnam 16Zw9dt8qSZ9zJVImUtI/bfP4EDauQu/MyWtES2ZDcZ7i1xVTkWmVCN4OEBIykxHBAfj yJDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xltqyEfwrx8qT/CORRGTWXmzlbt9i4EassNZ2G9y7tE=; b=sSc/e3fWuSFFGJZa9FnmYB1rqEy/s0/+kt7OumbSOqTDRLT5+5ht+rLf00bR6udGLY pNv76GBQUQJ5Oj5I+b9Vk1ohG+Qw8DLIqdegyHViB19E125YQAYeSOTya0B1FU1rGBD+ ARBmybg/J1I7VoMkqQzbuGjtXE1a38dYEw/7kxqEQ8TgcAFaGack8r6NIqa//J0ksRlC KG4J/TWJuny58eJTOoo4QbKfCQQqeFmgx4wpTswy/7vhmp4Y66YC+mzimEAT3KzV2q+9 873jNK5uMhY4bsYbBlw8DfkwXAMEeFXvz74XPNiR7V9jvm/EMrqi3FOoFqNR9ycLHPOg B/nQ== X-Gm-Message-State: AOAM533Kjhyqlghy4xc5OBDg+jbpspUgwjfUiILUJufRAJW38ZXFkGj8 1SqlQLe4RKxXS0J5wcY7K38= X-Google-Smtp-Source: ABdhPJzFPcMwk85WsfMjXGVdLczf/bH01bsX9EzaXAeWYS4zo/ADuFMsPuQVPLGoV7fmgcVzpYYJfg== X-Received: by 2002:a2e:b4c1:: with SMTP id r1mr881604ljm.370.1592437262021; Wed, 17 Jun 2020 16:41:02 -0700 (PDT) Received: from localhost.localdomain (79-139-237-54.dynamic.spd-mgts.ru. [79.139.237.54]) by smtp.gmail.com with ESMTPSA id c8sm287871lfc.46.2020.06.17.16.41.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 16:41:01 -0700 (PDT) From: Dmitry Osipenko To: Thierry Reding , Thomas Zimmermann , Derek Basehore , Sam Ravnborg , Laurent Pinchart , Sean Paul , Daniel Vetter , =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= , Emil Velikov , Daniel Stone Subject: [PATCH v3 1/3] drm/tegra: plane: Rename bottom_up to reflect_y Date: Thu, 18 Jun 2020 02:40:38 +0300 Message-Id: <20200617234040.1094-2-digetx@gmail.com> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200617234040.1094-1-digetx@gmail.com> References: <20200617234040.1094-1-digetx@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 18 Jun 2020 07:17:31 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This makes the naming consistent with the DRM core. Signed-off-by: Dmitry Osipenko --- drivers/gpu/drm/tegra/dc.c | 10 +++++----- drivers/gpu/drm/tegra/dc.h | 2 +- drivers/gpu/drm/tegra/plane.c | 2 +- drivers/gpu/drm/tegra/plane.h | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c index 04d6848d19fc..bb92c1ed44e9 100644 --- a/drivers/gpu/drm/tegra/dc.c +++ b/drivers/gpu/drm/tegra/dc.c @@ -404,7 +404,7 @@ static void tegra_dc_setup_window(struct tegra_plane *plane, tegra_plane_writel(plane, window->stride[0], DC_WIN_LINE_STRIDE); } - if (window->bottom_up) + if (window->reflect_y) v_offset += window->src.h - 1; tegra_plane_writel(plane, h_offset, DC_WINBUF_ADDR_H_OFFSET); @@ -470,7 +470,7 @@ static void tegra_dc_setup_window(struct tegra_plane *plane, value |= COLOR_EXPAND; } - if (window->bottom_up) + if (window->reflect_y) value |= V_DIRECTION; if (tegra_plane_use_horizontal_filtering(plane, window)) { @@ -642,9 +642,9 @@ static int tegra_plane_atomic_check(struct drm_plane *plane, rotation = drm_rotation_simplify(state->rotation, rotation); if (rotation & DRM_MODE_REFLECT_Y) - plane_state->bottom_up = true; + plane_state->reflect_y = true; else - plane_state->bottom_up = false; + plane_state->reflect_y = false; /* * Tegra doesn't support different strides for U and V planes so we @@ -706,7 +706,7 @@ static void tegra_plane_atomic_update(struct drm_plane *plane, window.dst.w = drm_rect_width(&plane->state->dst); window.dst.h = drm_rect_height(&plane->state->dst); window.bits_per_pixel = fb->format->cpp[0] * 8; - window.bottom_up = tegra_fb_is_bottom_up(fb) || state->bottom_up; + window.reflect_y = tegra_fb_is_bottom_up(fb) || state->reflect_y; /* copy from state */ window.zpos = plane->state->normalized_zpos; diff --git a/drivers/gpu/drm/tegra/dc.h b/drivers/gpu/drm/tegra/dc.h index 3d8ddccd758f..98e1b625168e 100644 --- a/drivers/gpu/drm/tegra/dc.h +++ b/drivers/gpu/drm/tegra/dc.h @@ -136,7 +136,7 @@ struct tegra_dc_window { unsigned int stride[2]; unsigned long base[3]; unsigned int zpos; - bool bottom_up; + bool reflect_y; struct tegra_bo_tiling tiling; u32 format; diff --git a/drivers/gpu/drm/tegra/plane.c b/drivers/gpu/drm/tegra/plane.c index 9ccfb56e9b01..e05ef6013a97 100644 --- a/drivers/gpu/drm/tegra/plane.c +++ b/drivers/gpu/drm/tegra/plane.c @@ -61,7 +61,7 @@ tegra_plane_atomic_duplicate_state(struct drm_plane *plane) copy->tiling = state->tiling; copy->format = state->format; copy->swap = state->swap; - copy->bottom_up = state->bottom_up; + copy->reflect_y = state->reflect_y; copy->opaque = state->opaque; for (i = 0; i < 2; i++) diff --git a/drivers/gpu/drm/tegra/plane.h b/drivers/gpu/drm/tegra/plane.h index a158a915109a..8047fc916d8c 100644 --- a/drivers/gpu/drm/tegra/plane.h +++ b/drivers/gpu/drm/tegra/plane.h @@ -46,7 +46,7 @@ struct tegra_plane_state { u32 format; u32 swap; - bool bottom_up; + bool reflect_y; /* used for legacy blending support only */ struct tegra_plane_legacy_blending_state blending[2]; From patchwork Wed Jun 17 23:40:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 11611559 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9774C618 for ; Thu, 18 Jun 2020 07:18:43 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 76BA121532 for ; Thu, 18 Jun 2020 07:18:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UGFppwtD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 76BA121532 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 557006EB1F; Thu, 18 Jun 2020 07:17:38 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lj1-x244.google.com (mail-lj1-x244.google.com [IPv6:2a00:1450:4864:20::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id AE20B6E16D for ; Wed, 17 Jun 2020 23:41:04 +0000 (UTC) Received: by mail-lj1-x244.google.com with SMTP id i27so4961608ljb.12 for ; Wed, 17 Jun 2020 16:41:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lirhIx0iRlu3vfHaJJDD4eWpH3fBzn3WOnUPZr0Pdc8=; b=UGFppwtD0S5aRu9OWJnC+hJtvi9i+WRb8+BaxEQnvQ9nBaBQYWzUVtupwJFIvS4YAx sqE1UFcQKsTgRkcprPyaOb7GMTJmXZwCqNvxmqpkS6bkNacwLTVv2wF8z0uBtWYyAyAt XwCGFzgtqDGS2/iRx7p2vNFmJ2I5s6ffcKxgnAAfJziw7WZV9+RSWFXhwq1tq55IExpq 7S4TvBNbV4gKMUp468nQRIgs2h0lFGXIOnIUPZHwWYl0bheD2opdfw1UJJ/KGuBv+9IW UvaKTavhUU65GB5kzn7eCIe9+m9kqz8kJx6ntzazRhYt2nSOUmfGWTASYjVU2Aw/VbfZ BGjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lirhIx0iRlu3vfHaJJDD4eWpH3fBzn3WOnUPZr0Pdc8=; b=ZIMtBYXpiPeRBBpcZiX9eiL7STD+cCVHOlxUi31KKX33E6f56Rc8OLafldZugqAAQj JWz2cDPkBarBBHoZypF4t1ohkFoK65/mjeXJcvHbPcX0xJVkY7o6QRBOin7mUij9OVgF t6BG6JHFZS/rBNp4xPbpPkOR52imywXpoV/1oVLGH+fqDJaU6IzWVpTPxwK1ASy9CWhT 9FE2XVCKMr+LhiK2UJzc2QEUKQ3zVpc9xkzAwbzi3U7oHb57VfQaNKz+75sa2ufIIKFG nDoB+hRbU6RbEfyRte8rJAUcbyEBLv1Hg7sLgM+wKl9O+vlv+qeGTDYer8Q5cz5wRh1k bC6g== X-Gm-Message-State: AOAM5327LEU/aQtHj087ygWHvJtA/OHCyxp5bOtkMQHq3fXHb89TJbOc uTA2XXeXtyV4Q8zV3tA98iA= X-Google-Smtp-Source: ABdhPJwbNPhhk36ZR70FeX2ugPoqhRhe7oYpCWKRrs0eFMjwGmC3mutK7RmOplQMyq6VuXvzu9kQDA== X-Received: by 2002:a2e:7c03:: with SMTP id x3mr778161ljc.227.1592437263111; Wed, 17 Jun 2020 16:41:03 -0700 (PDT) Received: from localhost.localdomain (79-139-237-54.dynamic.spd-mgts.ru. [79.139.237.54]) by smtp.gmail.com with ESMTPSA id c8sm287871lfc.46.2020.06.17.16.41.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 16:41:02 -0700 (PDT) From: Dmitry Osipenko To: Thierry Reding , Thomas Zimmermann , Derek Basehore , Sam Ravnborg , Laurent Pinchart , Sean Paul , Daniel Vetter , =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= , Emil Velikov , Daniel Stone Subject: [PATCH v3 2/3] drm/tegra: plane: Support horizontal reflection Date: Thu, 18 Jun 2020 02:40:39 +0300 Message-Id: <20200617234040.1094-3-digetx@gmail.com> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200617234040.1094-1-digetx@gmail.com> References: <20200617234040.1094-1-digetx@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 18 Jun 2020 07:17:31 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Support horizontal reflection mode which will allow to support 180° rotation mode when combined with the vertical reflection. Signed-off-by: Dmitry Osipenko --- drivers/gpu/drm/tegra/dc.c | 38 +++++++++++++++++++++++++++++------ drivers/gpu/drm/tegra/dc.h | 1 + drivers/gpu/drm/tegra/plane.c | 1 + drivers/gpu/drm/tegra/plane.h | 1 + 4 files changed, 35 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c index bb92c1ed44e9..f8149dc3b1b4 100644 --- a/drivers/gpu/drm/tegra/dc.c +++ b/drivers/gpu/drm/tegra/dc.c @@ -368,6 +368,12 @@ static void tegra_dc_setup_window(struct tegra_plane *plane, h_size = window->src.w * bpp; v_size = window->src.h; + if (window->reflect_x) + h_offset += (window->src.w - 1) * bpp; + + if (window->reflect_y) + v_offset += window->src.h - 1; + value = V_PRESCALED_SIZE(v_size) | H_PRESCALED_SIZE(h_size); tegra_plane_writel(plane, value, DC_WIN_PRESCALED_SIZE); @@ -404,9 +410,6 @@ static void tegra_dc_setup_window(struct tegra_plane *plane, tegra_plane_writel(plane, window->stride[0], DC_WIN_LINE_STRIDE); } - if (window->reflect_y) - v_offset += window->src.h - 1; - tegra_plane_writel(plane, h_offset, DC_WINBUF_ADDR_H_OFFSET); tegra_plane_writel(plane, v_offset, DC_WINBUF_ADDR_V_OFFSET); @@ -470,6 +473,9 @@ static void tegra_dc_setup_window(struct tegra_plane *plane, value |= COLOR_EXPAND; } + if (window->reflect_x) + value |= H_DIRECTION; + if (window->reflect_y) value |= V_DIRECTION; @@ -601,7 +607,10 @@ static int tegra_plane_atomic_check(struct drm_plane *plane, struct drm_plane_state *state) { struct tegra_plane_state *plane_state = to_tegra_plane_state(state); - unsigned int rotation = DRM_MODE_ROTATE_0 | DRM_MODE_REFLECT_Y; + unsigned int supported_rotation = DRM_MODE_ROTATE_0 | + DRM_MODE_REFLECT_X | + DRM_MODE_REFLECT_Y; + unsigned int rotation = state->rotation; struct tegra_bo_tiling *tiling = &plane_state->tiling; struct tegra_plane *tegra = to_tegra_plane(plane); struct tegra_dc *dc = to_tegra_dc(state->crtc); @@ -639,7 +648,21 @@ static int tegra_plane_atomic_check(struct drm_plane *plane, return -EINVAL; } - rotation = drm_rotation_simplify(state->rotation, rotation); + /* + * Older userspace used custom BO flag in order to specify the Y + * reflection, while modern userspace uses the generic DRM rotation + * property in order to achieve the same result. The legacy BO flag + * duplicates the DRM rotation property when both are set. + */ + if (tegra_fb_is_bottom_up(state->fb)) + rotation |= DRM_MODE_REFLECT_Y; + + rotation = drm_rotation_simplify(rotation, supported_rotation); + + if (rotation & DRM_MODE_REFLECT_X) + plane_state->reflect_x = true; + else + plane_state->reflect_x = false; if (rotation & DRM_MODE_REFLECT_Y) plane_state->reflect_y = true; @@ -706,7 +729,8 @@ static void tegra_plane_atomic_update(struct drm_plane *plane, window.dst.w = drm_rect_width(&plane->state->dst); window.dst.h = drm_rect_height(&plane->state->dst); window.bits_per_pixel = fb->format->cpp[0] * 8; - window.reflect_y = tegra_fb_is_bottom_up(fb) || state->reflect_y; + window.reflect_x = state->reflect_x; + window.reflect_y = state->reflect_y; /* copy from state */ window.zpos = plane->state->normalized_zpos; @@ -792,6 +816,7 @@ static struct drm_plane *tegra_primary_plane_create(struct drm_device *drm, err = drm_plane_create_rotation_property(&plane->base, DRM_MODE_ROTATE_0, DRM_MODE_ROTATE_0 | + DRM_MODE_REFLECT_X | DRM_MODE_REFLECT_Y); if (err < 0) dev_err(dc->dev, "failed to create rotation property: %d\n", @@ -1080,6 +1105,7 @@ static struct drm_plane *tegra_dc_overlay_plane_create(struct drm_device *drm, err = drm_plane_create_rotation_property(&plane->base, DRM_MODE_ROTATE_0, DRM_MODE_ROTATE_0 | + DRM_MODE_REFLECT_X | DRM_MODE_REFLECT_Y); if (err < 0) dev_err(dc->dev, "failed to create rotation property: %d\n", diff --git a/drivers/gpu/drm/tegra/dc.h b/drivers/gpu/drm/tegra/dc.h index 98e1b625168e..051d03dcb9b0 100644 --- a/drivers/gpu/drm/tegra/dc.h +++ b/drivers/gpu/drm/tegra/dc.h @@ -136,6 +136,7 @@ struct tegra_dc_window { unsigned int stride[2]; unsigned long base[3]; unsigned int zpos; + bool reflect_x; bool reflect_y; struct tegra_bo_tiling tiling; diff --git a/drivers/gpu/drm/tegra/plane.c b/drivers/gpu/drm/tegra/plane.c index e05ef6013a97..4cd0461cc508 100644 --- a/drivers/gpu/drm/tegra/plane.c +++ b/drivers/gpu/drm/tegra/plane.c @@ -61,6 +61,7 @@ tegra_plane_atomic_duplicate_state(struct drm_plane *plane) copy->tiling = state->tiling; copy->format = state->format; copy->swap = state->swap; + copy->reflect_x = state->reflect_x; copy->reflect_y = state->reflect_y; copy->opaque = state->opaque; diff --git a/drivers/gpu/drm/tegra/plane.h b/drivers/gpu/drm/tegra/plane.h index 8047fc916d8c..c691dd79b27b 100644 --- a/drivers/gpu/drm/tegra/plane.h +++ b/drivers/gpu/drm/tegra/plane.h @@ -46,6 +46,7 @@ struct tegra_plane_state { u32 format; u32 swap; + bool reflect_x; bool reflect_y; /* used for legacy blending support only */ From patchwork Wed Jun 17 23:40:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 11611555 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 533A014B7 for ; Thu, 18 Jun 2020 07:18:40 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 31FBA21532 for ; Thu, 18 Jun 2020 07:18:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="B9nMsiI6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 31FBA21532 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6CFB86EB0F; Thu, 18 Jun 2020 07:17:36 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf1-x143.google.com (mail-lf1-x143.google.com [IPv6:2a00:1450:4864:20::143]) by gabe.freedesktop.org (Postfix) with ESMTPS id EBC596E16D for ; Wed, 17 Jun 2020 23:41:05 +0000 (UTC) Received: by mail-lf1-x143.google.com with SMTP id t74so2383717lff.2 for ; Wed, 17 Jun 2020 16:41:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pAxyB6C7aJlpOxagnpZfk3yhTf/LsEQQa81zSGYW43g=; b=B9nMsiI6lfN7t3LM1U/WpG+wTKt7bOM1IpIV2Ix76X0/HY/Yg9Oqqr903PuHP9lFuB RTREq0KBfW1XVVxk9rl39YWJtc81FtuhslgD61jto+JyxjrceZVMG+fIAc4Tu1xO3Tx4 s77pLBWBAOD902doRB8H+zla+jkalMJpQWef2qmIZgwrt/3cQSDnPX1c76cYLzUhQpoX IJVVd0dy2t9y0YmOPFQ7NzbrOeidSofir9I//r3ZjzCLl3SGGZlYsgtD8sBOXwBHe0zm Wvrx1ON+QOIJYfYXoGWYxgaacVdscXRs1IdH69uaRuJ1a6ORkFtnNGALZ30YzpClomt2 HMaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pAxyB6C7aJlpOxagnpZfk3yhTf/LsEQQa81zSGYW43g=; b=QAULBW/a/tyrnWYXP8rVf4Mz/OfsiE9qvu2GnuqaXTx8tImvp06f/HICy8ax1V83rr sSsKLWwXOuzcIrYSBawmrcRifkUK9OHw8+61gtQW5/yQnvFV+DvoEtHJGizYVWM7JVYb q8FFTQaKNS1cFN8Ne2mmJwTXCOVDuep4S2kYpGWZXUXbbcmqUpX+To0vxH07a4ycKzuD 3y/4+S6vDXuxG08LrshkmQmxPIRAgDoxFGRrmIlOCZA+Us9B5tfhYDOq+azL8RG0XoW9 U7ZNxyzjFjM8JEOqqEn5lH0nH9g0ESuEfURp3vhxnKuT/67NOac3kKMw2oY7fsT+U8WE wk+w== X-Gm-Message-State: AOAM532J0aOieMx+WI1SqeGi7bbVHHbEFHVMvm+5hdxLiMYM4AgUc72e jMPSAWz3CPHgEqJBEzM8bgw= X-Google-Smtp-Source: ABdhPJz5cDVUwKIFbHJvRRcZm/RgHQl0lqOLx6eYkfTVVUQv765IyixK8lF7EOCan5KXL+JrjhETlQ== X-Received: by 2002:a05:6512:10c8:: with SMTP id k8mr704401lfg.181.1592437264376; Wed, 17 Jun 2020 16:41:04 -0700 (PDT) Received: from localhost.localdomain (79-139-237-54.dynamic.spd-mgts.ru. [79.139.237.54]) by smtp.gmail.com with ESMTPSA id c8sm287871lfc.46.2020.06.17.16.41.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 16:41:03 -0700 (PDT) From: Dmitry Osipenko To: Thierry Reding , Thomas Zimmermann , Derek Basehore , Sam Ravnborg , Laurent Pinchart , Sean Paul , Daniel Vetter , =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= , Emil Velikov , Daniel Stone Subject: [PATCH v3 3/3] =?utf-8?q?drm/tegra=3A_plane=3A_Support_180=C2=B0_ro?= =?utf-8?q?tation?= Date: Thu, 18 Jun 2020 02:40:40 +0300 Message-Id: <20200617234040.1094-4-digetx@gmail.com> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200617234040.1094-1-digetx@gmail.com> References: <20200617234040.1094-1-digetx@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 18 Jun 2020 07:17:31 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Combining horizontal and vertical reflections gives us 180 degrees of rotation. Both reflection modes are already supported, and thus, we just need to mark the 180 rotation mode as supported. The 180 rotation mode is needed for devices like Nexus 7 tablet, which have display panel mounted upside-down. Signed-off-by: Dmitry Osipenko --- drivers/gpu/drm/tegra/dc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c index f8149dc3b1b4..1a9a5f8bba34 100644 --- a/drivers/gpu/drm/tegra/dc.c +++ b/drivers/gpu/drm/tegra/dc.c @@ -816,6 +816,7 @@ static struct drm_plane *tegra_primary_plane_create(struct drm_device *drm, err = drm_plane_create_rotation_property(&plane->base, DRM_MODE_ROTATE_0, DRM_MODE_ROTATE_0 | + DRM_MODE_ROTATE_180 | DRM_MODE_REFLECT_X | DRM_MODE_REFLECT_Y); if (err < 0) @@ -1105,6 +1106,7 @@ static struct drm_plane *tegra_dc_overlay_plane_create(struct drm_device *drm, err = drm_plane_create_rotation_property(&plane->base, DRM_MODE_ROTATE_0, DRM_MODE_ROTATE_0 | + DRM_MODE_ROTATE_180 | DRM_MODE_REFLECT_X | DRM_MODE_REFLECT_Y); if (err < 0)