From patchwork Thu Sep 15 18:04:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Longerbeam X-Patchwork-Id: 9334957 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 EC7B5607FD for ; Fri, 16 Sep 2016 01:11:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DE12329E7F for ; Fri, 16 Sep 2016 01:11:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D236C29E82; Fri, 16 Sep 2016 01:11:28 +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_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, 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 3C9B829E7F for ; Fri, 16 Sep 2016 01:11:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D01F76E96A; Fri, 16 Sep 2016 01:11:18 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf0-x242.google.com (mail-pf0-x242.google.com [IPv6:2607:f8b0:400e:c00::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1FAE86E901 for ; Thu, 15 Sep 2016 18:04:31 +0000 (UTC) Received: by mail-pf0-x242.google.com with SMTP id 21so1064672pfy.1 for ; Thu, 15 Sep 2016 11:04:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=MAQeqnyvZsRsrxTMw5fW5tw0afuqrIO3rDsO9XewMaA=; b=Rl9tk3AR7Awj6rGS3UQ1mKNQceG+UVI7ve8NQNRX1O0vj88AfaRKj+4jmf53oMFosW mmQDEEr3QQ1GcyskoRoFBkp807UG9HSdg8XN9GPDFmD8C9TOv5dAueRtrjYmBRVvgRPm BVEvIuZsc9CbeIhUlzjyFrF7wQAFddFkCNomN6Jf2tpYRxc3hWVxCX/RatsYZWAwbJ7L fOe3ZVDOMcmkzbxI2uEyZGVt2BKrodUi/fkV1/3bRNywcjWs1dsILqbYiuogfp5C7ZsD vL9olyuJNPCMluDKFcRD0T7dTUwjnYk7eElhCxCe45jJb4tREMA9Cp6NBxtd3AboXpY6 4dWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=MAQeqnyvZsRsrxTMw5fW5tw0afuqrIO3rDsO9XewMaA=; b=Y8FO/iqCmZnPHucUA+X59UGwYykffAolwx1d0Ouxy97XxVOsjnb/HJDk9oD0vom4jD 1SmIWf4SR7vRYbnd4LtohkwTxv7t35mfxSh3+HhM0wqQn5i4uImlkYOAh9TfjnvDkqAf PITFiIEdlaqFuMol0nNuyb+oQSvu23Jdf1tyemqvqKW5F+2zZS+W7LH5cIcWdSRX7s9f 1eyTsQA4wHcEhaRlpDKIgvbJUJwEa+/3N1DD3gXC4dD1ZLJ5V/6Hs8Nrzcf7ePpIyUAg 1AFFRj9iWBAIzjx+6fRq9GH3KKoFSu1LoOqtkX8S/ochn4R/+xtEDiD2QJYLDu/n82n0 MFIQ== X-Gm-Message-State: AE9vXwMK1AXbRIQXwiBhTPhUowJezaeItTOPLBvShVK7V3Z7K9Ljj4Wk2/WvE+ziJo1o8g== X-Received: by 10.98.65.139 with SMTP id g11mr16590343pfd.145.1473962670024; Thu, 15 Sep 2016 11:04:30 -0700 (PDT) Received: from majic.world.mentorg.com (c-73-241-2-21.hsd1.ca.comcast.net. [73.241.2.21]) by smtp.googlemail.com with ESMTPSA id k80sm8506142pfk.27.2016.09.15.11.04.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 15 Sep 2016 11:04:29 -0700 (PDT) From: Steve Longerbeam X-Google-Original-From: Steve Longerbeam To: p.zabel@pengutronix.de, plagnioj@jcrosoft.com, tomi.valkeinen@ti.com Subject: [PATCH v5 1/2] gpu: ipu-v3: Add ipu_rot_mode_is_irt() Date: Thu, 15 Sep 2016 11:04:11 -0700 Message-Id: <1473962652-16820-2-git-send-email-steve_longerbeam@mentor.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1473962652-16820-1-git-send-email-steve_longerbeam@mentor.com> References: <1473962652-16820-1-git-send-email-steve_longerbeam@mentor.com> X-Mailman-Approved-At: Fri, 16 Sep 2016 01:09:16 +0000 Cc: linux-fbdev@vger.kernel.org, Steve Longerbeam , dri-devel@lists.freedesktop.org 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: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Add a macro that returns boolean true if the given ipu_rotate_mode requires the use of the Image Rotator. Signed-off-by: Steve Longerbeam --- drivers/gpu/ipu-v3/ipu-ic.c | 2 +- include/video/imx-ipu-v3.h | 22 +++++++++++++++------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/ipu-v3/ipu-ic.c b/drivers/gpu/ipu-v3/ipu-ic.c index 1a37afc..321eb98 100644 --- a/drivers/gpu/ipu-v3/ipu-ic.c +++ b/drivers/gpu/ipu-v3/ipu-ic.c @@ -619,7 +619,7 @@ int ipu_ic_task_idma_init(struct ipu_ic *ic, struct ipuv3_channel *channel, ipu_ic_write(ic, ic_idmac_2, IC_IDMAC_2); ipu_ic_write(ic, ic_idmac_3, IC_IDMAC_3); - if (rot >= IPU_ROTATE_90_RIGHT) + if (ipu_rot_mode_is_irt(rot)) ic->rotation = true; unlock: diff --git a/include/video/imx-ipu-v3.h b/include/video/imx-ipu-v3.h index c3de740..fbbbecf 100644 --- a/include/video/imx-ipu-v3.h +++ b/include/video/imx-ipu-v3.h @@ -63,17 +63,25 @@ enum ipu_csi_dest { /* * Enumeration of IPU rotation modes */ +#define IPU_ROT_BIT_VFLIP (1 << 0) +#define IPU_ROT_BIT_HFLIP (1 << 1) +#define IPU_ROT_BIT_90 (1 << 2) + enum ipu_rotate_mode { IPU_ROTATE_NONE = 0, - IPU_ROTATE_VERT_FLIP, - IPU_ROTATE_HORIZ_FLIP, - IPU_ROTATE_180, - IPU_ROTATE_90_RIGHT, - IPU_ROTATE_90_RIGHT_VFLIP, - IPU_ROTATE_90_RIGHT_HFLIP, - IPU_ROTATE_90_LEFT, + IPU_ROTATE_VERT_FLIP = IPU_ROT_BIT_VFLIP, + IPU_ROTATE_HORIZ_FLIP = IPU_ROT_BIT_HFLIP, + IPU_ROTATE_180 = (IPU_ROT_BIT_VFLIP | IPU_ROT_BIT_HFLIP), + IPU_ROTATE_90_RIGHT = IPU_ROT_BIT_90, + IPU_ROTATE_90_RIGHT_VFLIP = (IPU_ROT_BIT_90 | IPU_ROT_BIT_VFLIP), + IPU_ROTATE_90_RIGHT_HFLIP = (IPU_ROT_BIT_90 | IPU_ROT_BIT_HFLIP), + IPU_ROTATE_90_LEFT = (IPU_ROT_BIT_90 | + IPU_ROT_BIT_VFLIP | IPU_ROT_BIT_HFLIP), }; +/* 90-degree rotations require the IRT unit */ +#define ipu_rot_mode_is_irt(m) (((m) & IPU_ROT_BIT_90) != 0) + enum ipu_color_space { IPUV3_COLORSPACE_RGB, IPUV3_COLORSPACE_YUV,