From patchwork Fri Jul 3 18:02:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dafna Hirschfeld X-Patchwork-Id: 11642603 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A581714B7 for ; Fri, 3 Jul 2020 18:03:02 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7EBEC21D79 for ; Fri, 3 Jul 2020 18:03:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="zswncCyp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7EBEC21D79 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:To: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=BtEkKjB+NoZ2RTJFqJA+u35YHcExx8WhbPHrCyGOY18=; b=zswncCypfM0KivtZVn/gXTA/XT xmXUoqm0BDdnZ6/zuXvUSrf4feb5TGB/1zcLxfBZHFImg2onm6idy02ves+bxCUgohFqsfBYZXeTP jEW6i5zo8Vvi61ThnQJwm9ttxCj2HSOSpL4rkh9uz3FhEc7wvxVR2LIODwllAgGB+/FM9K5sHhzcl 93LNi81GhMZmoMYzVttIF5pkVK39Jnp2ecghJeOQKD5pLEFBsayw+cEudUNijGkLwbQRpxtV/+C8Q uWoxo9WamBpcsHqSF3Wy7Vj325B+gcX08T1fzpqrLmzfhU2/Omige1g7bt1vQk3Zf3QUlnjwAj0gT +KDWDsEA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jrQ1c-0003Kd-GZ; Fri, 03 Jul 2020 18:03:00 +0000 Received: from bhuna.collabora.co.uk ([2a00:1098:0:82:1000:25:2eeb:e3e3]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jrQ1U-0003FE-MO for linux-rockchip@lists.infradead.org; Fri, 03 Jul 2020 18:02:56 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: dafna) with ESMTPSA id 543162A65A5 From: Dafna Hirschfeld To: linux-media@vger.kernel.org, laurent.pinchart@ideasonboard.com Subject: [PATCH v4l-utils v5 3/4] v4l2-ctl: subdev: Add support for the CSC API in the subdevices Date: Fri, 3 Jul 2020 20:02:38 +0200 Message-Id: <20200703180239.25841-4-dafna.hirschfeld@collabora.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200703180239.25841-1-dafna.hirschfeld@collabora.com> References: <20200703180239.25841-1-dafna.hirschfeld@collabora.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200703_140252_857395_B6393663 X-CRM114-Status: UNSURE ( 8.72 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mchehab@kernel.org, dafna.hirschfeld@collabora.com, dafna3@gmail.com, tfiga@chromium.org, hverkuil@xs4all.nl, linux-rockchip@lists.infradead.org, helen.koike@collabora.com, sakari.ailus@linux.intel.com, kernel@collabora.com, ezequiel@collabora.com MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org The CSC API allows userspace to configure the colorspace, quantization, (ycbcr/hsv)_enc and xfer_func fields when setting the formats, so those fields are not read only in userspace. This patch adds support for this API in subevices. Signed-off-by: Dafna Hirschfeld --- utils/v4l2-ctl/v4l2-ctl-subdev.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/utils/v4l2-ctl/v4l2-ctl-subdev.cpp b/utils/v4l2-ctl/v4l2-ctl-subdev.cpp index c0f36eab..c6ec21a9 100644 --- a/utils/v4l2-ctl/v4l2-ctl-subdev.cpp +++ b/utils/v4l2-ctl/v4l2-ctl-subdev.cpp @@ -424,14 +424,22 @@ void subdev_set(cv4l_fd &_fd) fmt.format.code = ffmt.code; if (set_fmt & FmtField) fmt.format.field = ffmt.field; - if (set_fmt & FmtColorspace) + if (set_fmt & FmtColorspace) { fmt.format.colorspace = ffmt.colorspace; - if (set_fmt & FmtXferFunc) + fmt.format.flags |= V4L2_MBUS_FRAMEFMT_SET_CSC; + } + if (set_fmt & FmtXferFunc) { fmt.format.xfer_func = ffmt.xfer_func; - if (set_fmt & FmtYCbCr) + fmt.format.flags |= V4L2_MBUS_FRAMEFMT_SET_CSC; + } + if (set_fmt & FmtYCbCr) { fmt.format.ycbcr_enc = ffmt.ycbcr_enc; - if (set_fmt & FmtQuantization) + fmt.format.flags |= V4L2_MBUS_FRAMEFMT_SET_CSC; + } + if (set_fmt & FmtQuantization) { fmt.format.quantization = ffmt.quantization; + fmt.format.flags |= V4L2_MBUS_FRAMEFMT_SET_CSC; + } if (options[OptSetSubDevFormat]) printf("Note: --set-subdev-fmt is only for testing.\n"