From patchwork Mon Jul 17 10:33:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Todor Tomov X-Patchwork-Id: 107884 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp4340294qge; Mon, 17 Jul 2017 03:35:09 -0700 (PDT) X-Received: by 10.98.192.10 with SMTP id x10mr18652634pff.1.1500287709270; Mon, 17 Jul 2017 03:35:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500287709; cv=none; d=google.com; s=arc-20160816; b=lIQMwJIakx2gT/L8mqUguzUg68lf0Jr1K7Hjzxo7C3AAQ2Mc2I4r1VIF0yluR84K1/ QmwTqXRotRh8Uo3j2kgkgUKBb30BWndmjljPJ2S6BURk5ihprjPWGGzP1VseLOTN8030 oiuWMvbC37EuAJtdYvyx412r7ggRFRr5Y/30dP/WJCDDoZhrwQtO9IlqtZR9HI9Jjbvt m9he2+cjLpE5DFFN4AkR1FHoBhWipNmUYglutYj6FMUtAt0idAczd6Bh+ZZ88YTc10aG pFVPHzPajSLFhKAOXqbuDB3rlwWWSIisabiVedVoHLKiZ2IA2FyAXJlnWWqqeZ7U2mhj LZXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=ixuJMmyzADljPN9apqW4IBOfUA9AaYDndcLOCUfien8=; b=gf/LuqGOs6bgszJnCaznRe/bERqnCRn0CLXyTr9tluzViAUkgw43rM+7Qtqz0zKbrT RUM40Itc7xtROWnw3KF0sM7HPH3xx05V2p3LQbmtZZJ9HC5AepEBU+TRxwccbCaCl/HR BeGc3S86pH1hkHNgTYMfYrsf+7s9n72A7SBqRm+zoBD45pRC03DozT5Y2NG3Gn8bwRKg nMPC/8sCFiQFLuVKLc+Yf68e8/JPKRuq50uOeWbW7DQti4vbMyvTUdAsH/+Dr8KsqN/X 5izyAgb8YseQp05wcUuU1dibz6AWh//0ViJ6jyot/r/WDx3HbUtdG/zG0YDEJkaVbEFk RjaA== 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 b2si12423549pfg.187.2017.07.17.03.35.08; Mon, 17 Jul 2017 03:35:09 -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 S1751403AbdGQKfF (ORCPT + 25 others); Mon, 17 Jul 2017 06:35:05 -0400 Received: from ns.mm-sol.com ([37.157.136.199]:36030 "EHLO extserv.mm-sol.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751300AbdGQKe7 (ORCPT ); Mon, 17 Jul 2017 06:34:59 -0400 Received: from mms-0439.qualcomm.mm-sol.com (unknown [37.157.136.206]) by extserv.mm-sol.com (Postfix) with ESMTPSA id E4183CBE0; Mon, 17 Jul 2017 13:34:57 +0300 (EEST) From: Todor Tomov To: mchehab@kernel.org, hans.verkuil@cisco.com, javier@osg.samsung.com, s.nawrocki@samsung.com, sakari.ailus@iki.fi, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: Todor Tomov Subject: [PATCH v3 02/23] [media] v4l2-mediabus: Add helper functions Date: Mon, 17 Jul 2017 13:33:28 +0300 Message-Id: <1500287629-23703-3-git-send-email-todor.tomov@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1500287629-23703-1-git-send-email-todor.tomov@linaro.org> References: <1500287629-23703-1-git-send-email-todor.tomov@linaro.org> 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(+) -- 2.7.4 diff --git a/include/media/v4l2-mediabus.h b/include/media/v4l2-mediabus.h index 34cc99e..125afcd 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_mp_fmt, + const struct v4l2_mbus_framefmt *mbus_fmt) +{ + pix_mp_fmt->width = mbus_fmt->width; + pix_mp_fmt->height = mbus_fmt->height; + pix_mp_fmt->field = mbus_fmt->field; + pix_mp_fmt->colorspace = mbus_fmt->colorspace; + pix_mp_fmt->ycbcr_enc = mbus_fmt->ycbcr_enc; + pix_mp_fmt->quantization = mbus_fmt->quantization; + pix_mp_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_mp_fmt) +{ + mbus_fmt->width = pix_mp_fmt->width; + mbus_fmt->height = pix_mp_fmt->height; + mbus_fmt->field = pix_mp_fmt->field; + mbus_fmt->colorspace = pix_mp_fmt->colorspace; + mbus_fmt->ycbcr_enc = pix_mp_fmt->ycbcr_enc; + mbus_fmt->quantization = pix_mp_fmt->quantization; + mbus_fmt->xfer_func = pix_mp_fmt->xfer_func; +} + #endif