From patchwork Sat Jun 7 21:56:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Longerbeam X-Patchwork-Id: 4316421 Return-Path: X-Original-To: patchwork-linux-media@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 5B1819F170 for ; Sat, 7 Jun 2014 21:59:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 822C720225 for ; Sat, 7 Jun 2014 21:59:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AB98020222 for ; Sat, 7 Jun 2014 21:59:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753304AbaFGV7O (ORCPT ); Sat, 7 Jun 2014 17:59:14 -0400 Received: from mail-pd0-f181.google.com ([209.85.192.181]:51257 "EHLO mail-pd0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753320AbaFGV5L (ORCPT ); Sat, 7 Jun 2014 17:57:11 -0400 Received: by mail-pd0-f181.google.com with SMTP id z10so3819365pdj.12 for ; Sat, 07 Jun 2014 14:57:11 -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=+ruCQnOvbFXgCdyTGVJyxDgh3A3O6/uV1XlnHq6iGTI=; b=B2goRuNWL0u+vhndTFr56RFBS7SVlb/0o17VJNCSh1cPIgtn1SjqvlRLrPRUhCUJwP PoedXo7DZVed8+023QM2JiWs/GdVl9gofyEQecJ0VGRHggwsyLPhznCYzK5CQWaEzTLA li30SSIBkkfHnQ58BiU+vAWuwJRM5e43Pf4JSZ0kYPO5O2zs3ej6byS2tQkh3NwDi5tH m+WJhAjIwXmdTNQFWWfj5wmZhck2gry8FM2G/y03VzClr4xiCDCvqbPcaXSlWIfKmupm z4s9y4l8ezimobwilePwFjXvM+ifuuY84cNeoqzReK5+F/FbVChViQLWXy30ryMOAERs bN5A== X-Received: by 10.68.164.100 with SMTP id yp4mr2477289pbb.136.1402178231419; Sat, 07 Jun 2014 14:57:11 -0700 (PDT) Received: from slongerb-fremont-linux.mgc.mentorg.com (c-98-248-118-71.hsd1.ca.comcast.net. [98.248.118.71]) by mx.google.com with ESMTPSA id fx5sm52769595pbb.62.2014.06.07.14.57.10 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 07 Jun 2014 14:57:10 -0700 (PDT) From: Steve Longerbeam X-Google-Original-From: Steve Longerbeam To: linux-media@vger.kernel.org Cc: Steve Longerbeam , Dmitry Eremin-Solenikov Subject: [PATCH 11/43] imx-drm: ipu-v3: Add helper function checking if pixfmt is planar Date: Sat, 7 Jun 2014 14:56:13 -0700 Message-Id: <1402178205-22697-12-git-send-email-steve_longerbeam@mentor.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1402178205-22697-1-git-send-email-steve_longerbeam@mentor.com> References: <1402178205-22697-1-git-send-email-steve_longerbeam@mentor.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 Add simple helper function returning true if passed pixel format is one of supported planar ones. Signed-off-by: Dmitry Eremin-Solenikov --- drivers/staging/imx-drm/ipu-v3/ipu-common.c | 12 ++++++++++++ include/linux/platform_data/imx-ipu-v3.h | 1 + 2 files changed, 13 insertions(+) diff --git a/drivers/staging/imx-drm/ipu-v3/ipu-common.c b/drivers/staging/imx-drm/ipu-v3/ipu-common.c index 02577cc..d005ed5 100644 --- a/drivers/staging/imx-drm/ipu-v3/ipu-common.c +++ b/drivers/staging/imx-drm/ipu-v3/ipu-common.c @@ -551,6 +551,18 @@ enum ipu_color_space ipu_pixelformat_to_colorspace(u32 pixelformat) } EXPORT_SYMBOL_GPL(ipu_pixelformat_to_colorspace); +bool ipu_pixelformat_is_planar(u32 pixelformat) +{ + switch (pixelformat) { + case V4L2_PIX_FMT_YUV420: + case V4L2_PIX_FMT_YVU420: + return true; + } + + return false; +} +EXPORT_SYMBOL_GPL(ipu_pixelformat_is_planar); + enum ipu_color_space ipu_mbus_code_to_colorspace(u32 mbus_code) { switch (mbus_code & 0xf000) { diff --git a/include/linux/platform_data/imx-ipu-v3.h b/include/linux/platform_data/imx-ipu-v3.h index ffcfe20..dcf2c57 100644 --- a/include/linux/platform_data/imx-ipu-v3.h +++ b/include/linux/platform_data/imx-ipu-v3.h @@ -467,6 +467,7 @@ int ipu_cpmem_set_image(struct ipu_ch_param __iomem *cpmem, enum ipu_color_space ipu_drm_fourcc_to_colorspace(u32 drm_fourcc); enum ipu_color_space ipu_pixelformat_to_colorspace(u32 pixelformat); enum ipu_color_space ipu_mbus_code_to_colorspace(u32 mbus_code); +bool ipu_pixelformat_is_planar(u32 pixelformat); 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,