From patchwork Fri Oct 31 22:54:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Longerbeam X-Patchwork-Id: 5207811 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8CFBF9F318 for ; Fri, 31 Oct 2014 23:57:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BF78E2010E for ; Fri, 31 Oct 2014 23:57:35 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id EFA1B20120 for ; Fri, 31 Oct 2014 23:57:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 63A8A6E87E; Fri, 31 Oct 2014 16:56:59 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pd0-f174.google.com (mail-pd0-f174.google.com [209.85.192.174]) by gabe.freedesktop.org (Postfix) with ESMTP id 861006E84E for ; Fri, 31 Oct 2014 15:57:16 -0700 (PDT) Received: by mail-pd0-f174.google.com with SMTP id p10so8051385pdj.19 for ; Fri, 31 Oct 2014 15:57:16 -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=cyoR3yEI226HxWrGhx+IrtFkkfLvyKZjll9V2pJ26IM=; b=Gvl1oxcPg1Cyqzq4vhqBTJNQ04PTb6KINUXQRZ7sbIWxtySFvOBJ0dQwYTgNz/E6ys 7EyXwNJ4no3P8vrB1PH5DOyQ6nAMQKdfjzCmomEijlBN+iQU7Go3xY3vybmxP2NaVTh0 2Bj/Mt3EGpSgoas2VUdbXnF3ej28U0vd+ZFDp4Wfvs5VS565dGM1gyE1pwVXkNM7p1i8 clmBZj25u5T+XBfvzYsc9AvqSsgGDullUUXk/IRGFxrjfZO6T6NrV1HgYG+qDgilfrCW pVILof4f8xq5Y0IcrikvewrE8RHVi1LxPr1kpRJ2ZiJTOzzXUb3t17slmLeFlafxbGZv RY7Q== X-Received: by 10.67.30.34 with SMTP id kb2mr27082737pad.97.1414796236430; Fri, 31 Oct 2014 15:57:16 -0700 (PDT) Received: from mothership.mgc.mentorg.com (c-50-152-159-227.hsd1.ca.comcast.net. [50.152.159.227]) by mx.google.com with ESMTPSA id ev8sm10870656pdb.28.2014.10.31.15.57.15 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 31 Oct 2014 15:57:15 -0700 (PDT) From: Steve Longerbeam X-Google-Original-From: Steve Longerbeam To: dri-devel@lists.freedesktop.org Subject: [PATCH 34/72] gpu: ipu-v3: Add ipu_drm_fourcc_is_planar() Date: Fri, 31 Oct 2014 15:54:17 -0700 Message-Id: <1414796095-10107-35-git-send-email-steve_longerbeam@mentor.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1414796095-10107-1-git-send-email-steve_longerbeam@mentor.com> References: <1414796095-10107-1-git-send-email-steve_longerbeam@mentor.com> X-Mailman-Approved-At: Fri, 31 Oct 2014 16:56:31 -0700 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-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Adds ipu_drm_fourcc_is_planar(), which is equivalent to ipu_pixelformat_is_planar() but accepts a drm fourcc format. Signed-off-by: Steve Longerbeam --- drivers/gpu/ipu-v3/ipu-common.c | 18 ++++++++++++++++++ include/video/imx-ipu-v3.h | 1 + 2 files changed, 19 insertions(+) diff --git a/drivers/gpu/ipu-v3/ipu-common.c b/drivers/gpu/ipu-v3/ipu-common.c index ebafcf2..b1f0feb 100644 --- a/drivers/gpu/ipu-v3/ipu-common.c +++ b/drivers/gpu/ipu-v3/ipu-common.c @@ -153,6 +153,24 @@ bool ipu_pixelformat_is_planar(u32 pixelformat) } EXPORT_SYMBOL_GPL(ipu_pixelformat_is_planar); +bool ipu_drm_fourcc_is_planar(u32 drm_fourcc) +{ + switch (drm_fourcc) { + case DRM_FORMAT_YUV420: + case DRM_FORMAT_YVU420: + case DRM_FORMAT_YUV422: + case DRM_FORMAT_YVU422: + case DRM_FORMAT_NV12: + case DRM_FORMAT_NV21: + case DRM_FORMAT_NV16: + case DRM_FORMAT_NV61: + return true; + } + + return false; +} +EXPORT_SYMBOL_GPL(ipu_drm_fourcc_is_planar); + enum ipu_color_space ipu_mbus_code_to_colorspace(u32 mbus_code) { switch (mbus_code & 0xf000) { diff --git a/include/video/imx-ipu-v3.h b/include/video/imx-ipu-v3.h index 5aaa08d..f48ded6 100644 --- a/include/video/imx-ipu-v3.h +++ b/include/video/imx-ipu-v3.h @@ -380,6 +380,7 @@ enum ipu_color_space ipu_pixelformat_to_colorspace(u32 pixelformat); enum ipu_color_space ipu_mbus_code_to_colorspace(u32 mbus_code); int ipu_stride_to_bytes(u32 pixel_stride, u32 pixelformat); bool ipu_pixelformat_is_planar(u32 pixelformat); +bool ipu_drm_fourcc_is_planar(u32 drm_fourcc); int ipu_degrees_to_rot_mode(enum ipu_rotate_mode *mode, int degrees, bool hflip, bool vflip); int ipu_rot_mode_to_degrees(int *degrees, enum ipu_rotate_mode mode,