From patchwork Fri Jul 7 08:18:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Todor Tomov X-Patchwork-Id: 107187 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp3113225qge; Fri, 7 Jul 2017 01:18:45 -0700 (PDT) X-Received: by 10.99.116.26 with SMTP id p26mr228618pgc.17.1499415524945; Fri, 07 Jul 2017 01:18:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499415524; cv=none; d=google.com; s=arc-20160816; b=IKSAA73Q8GorzQwSj97OXx92ASmaD4x5LAM3Nv2PzLIYoSwDADwRuxfWhU+6NbvPOW O6CYs4IKsgAmIV7lQ9/gpSnBghWfgJ2LVoErBqwm92SQxmtP86ZUtAJz+nr3I1lUHEvR O9+ahba4P5Jik9BktgtgT9bCnbG8RqvAn2LWhEr6wXGhuxDC4NJ7HQj13xgVtE3T9oaS mHjBvUx4OkAAQXw8sGS6XvkuWWWVXHisKICsSIAx5KzB2HqNjIiRBbV30NpYea/sVqG4 wi4s7zoUInXJOvtonhdD+fz5OitDIf2rT/jzHddHWSsCjylQRIOZH/4m1aH//6VcRxhd CPNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=XqFVv76I9ulO470ivD34AyLuS8c6CK+3JlOidLq+rSE=; b=pBGkyfMnpG0NGbIO/zBhl4+GwLp3THKAPBVragpfrJGWT7VLnJsYhYPcvi+upivpsO Q8SSGqOoGt91hj7bQRXdRKTFqyN1XREzolqB5RE9Pqmu1xU9YuxW+aMVJ1uGPmeyYj8G 95TZBKHQuXGVGbgsrJ2ppX4TvVcHQUHpMDHZxZasly82HdLJ75txMxDIImCWzCGFoYNv 3AXbOTGxU6cK5oYjikavWUHRBO3O0NFTyGjeF/EdA8spMxbvF/wrtkh76aHBfEedCmCE +k4MSbwPjbKmlJt37Q+6R3kdqxQ/viWh561sTm1d1Xm6Q+YnPZk8rmwjtB2ugosLRFaG 6SvA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u8si2019660plh.55.2017.07.07.01.18.44; Fri, 07 Jul 2017 01:18:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752588AbdGGISa (ORCPT + 25 others); Fri, 7 Jul 2017 04:18:30 -0400 Received: from ns.mm-sol.com ([37.157.136.199]:45720 "EHLO extserv.mm-sol.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750977AbdGGIS2 (ORCPT ); Fri, 7 Jul 2017 04:18:28 -0400 Received: from mms-0439.qualcomm.mm-sol.com (unknown [37.157.136.206]) by extserv.mm-sol.com (Postfix) with ESMTPSA id 5AD91CBB7; Fri, 7 Jul 2017 11:18:21 +0300 (EEST) From: Todor Tomov To: hansverk@cisco.com, mchehab@kernel.org Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Todor Tomov Subject: [PATCH] [media] v4l2-mediabus: Add helper functions Date: Fri, 7 Jul 2017 11:18:07 +0300 Message-Id: <1499415487-15785-1-git-send-email-todor.tomov@linaro.org> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add helper functions for mbus to/from mplane pixel format conversion. Signed-off-by: Todor Tomov --- include/media/v4l2-mediabus.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) -- 1.9.1 diff --git a/include/media/v4l2-mediabus.h b/include/media/v4l2-mediabus.h index 34cc99e..f97fd4a 100644 --- a/include/media/v4l2-mediabus.h +++ b/include/media/v4l2-mediabus.h @@ -113,4 +113,30 @@ static inline void v4l2_fill_mbus_format(struct v4l2_mbus_framefmt *mbus_fmt, mbus_fmt->code = code; } +static inline void v4l2_fill_pix_format_mplane( + struct v4l2_pix_format_mplane *pix_fmt, + const struct v4l2_mbus_framefmt *mbus_fmt) +{ + pix_fmt->width = mbus_fmt->width; + pix_fmt->height = mbus_fmt->height; + pix_fmt->field = mbus_fmt->field; + pix_fmt->colorspace = mbus_fmt->colorspace; + pix_fmt->ycbcr_enc = mbus_fmt->ycbcr_enc; + pix_fmt->quantization = mbus_fmt->quantization; + pix_fmt->xfer_func = mbus_fmt->xfer_func; +} + +static inline void v4l2_fill_mbus_format_mplane( + struct v4l2_mbus_framefmt *mbus_fmt, + const struct v4l2_pix_format_mplane *pix_fmt) +{ + mbus_fmt->width = pix_fmt->width; + mbus_fmt->height = pix_fmt->height; + mbus_fmt->field = pix_fmt->field; + mbus_fmt->colorspace = pix_fmt->colorspace; + mbus_fmt->ycbcr_enc = pix_fmt->ycbcr_enc; + mbus_fmt->quantization = pix_fmt->quantization; + mbus_fmt->xfer_func = pix_fmt->xfer_func; +} + #endif