From patchwork Tue Mar 23 13:40:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 406883 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp4464443jai; Tue, 23 Mar 2021 06:41:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxp9nRVF6cNUZlo0eYVfXW3tkHVw4iknaqWdpEDlObx4FnD1/jZ24fTlhqC7P9Jeq0f/gR2 X-Received: by 2002:a17:906:fcb2:: with SMTP id qw18mr4825507ejb.434.1616506901925; Tue, 23 Mar 2021 06:41:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616506901; cv=none; d=google.com; s=arc-20160816; b=CWDWf5jMNAJR+DJyfNlx5Q5NKEdMnuXMrtPu12tTdeFumms4x1y+VLXLZ86rvmYYwX J6z4bJKCydNcFRFuwdFmMqGw3USeORs6Nfn5WG2CdrzlRvYfuJNJD9wvREymFzOX0qAH 4DMe3dtnqJdqCI5WhzS+8paLgyMYfQl/3Iy9k3/gerQvAxTg61yInifMVmfELqSIKLi5 UnyVkc8Pabasf+HaKlH3/ERm0ER7A5M/57e8R142xxcRMR9CLYdb3Okyw1m97zCwFcor 8gskSbiIWO4UYrPSUlGSJ+T2oOrOrDMA5Ot3v+AJzI11b0N9kKqAChpAc28G2sZnnHNl zaxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=bWnwL0ZcjEdnfAaSRAFj18yj0nciW8rO6g63xs68f0I=; b=p9k9UVQZSOOIuY6qCzjThoSuOt9Dwhiq1fZmYU92AvXOAWVG1K3IFqqCAvh8Mq1l/S /R24+r4A2ajZeDtV1mj+H9eJi0X1VMfbwYzul4qJbgPT+M2mVpam45WwxzsabQMvAqZE TjQBdOG+bC4DX0hriJ2GNwlWscoRqY4R1puiWDjvrRJWlWLZbbYpvyNQFTh99G7Cp0bu /SHv+m3CfNzyyi9kRWmKSYjd1GeJ0CH42DZqVkzkRZJcERgx/b9oF+7evRq7ZMjZPmy1 FpfCfkevOvsBDfsq6/rPMB/HydizrlJpcM81S+fDtZHAp2v2AdumtVoD+jok7w+bro9o LpZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UusK0uE1; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gv29si12878544ejc.61.2021.03.23.06.41.41; Tue, 23 Mar 2021 06:41:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UusK0uE1; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230154AbhCWNlI (ORCPT + 17 others); Tue, 23 Mar 2021 09:41:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231267AbhCWNk5 (ORCPT ); Tue, 23 Mar 2021 09:40:57 -0400 Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9A72C0613D8 for ; Tue, 23 Mar 2021 06:40:56 -0700 (PDT) Received: by mail-ed1-x52e.google.com with SMTP id j3so23454673edp.11 for ; Tue, 23 Mar 2021 06:40:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bWnwL0ZcjEdnfAaSRAFj18yj0nciW8rO6g63xs68f0I=; b=UusK0uE1BnnxrgAkJcosy9NdDXlFZ5AlsBnQwjIfrXGz6sOl/xkAUR9LsJn03uKVZZ 1O6p92+BjLQsfg6HMLJo7ihUk6emG0+M91CkGvPUoH7mEwZINk/Tsy3+yItQFKZdLNfu pTc/9uySiOEzJ+THfXjoh4NnmqRCX3rlztfnV+hhwphklqUQLrX7TbWzr59Sndk9GCdf JH2QqLa7v0Z+2PZOllvxyNZaOkhc6f+RPV8p3SeTR/FDqNyXuy/eNnIn6nBAl5qrKf4H 7TqzId6wFXj4dBTEW9DtekAxrw+kBkMP/iU1/Nr0l9hGGNSWLhVqbP3eQUoaAv966lpB 5FJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bWnwL0ZcjEdnfAaSRAFj18yj0nciW8rO6g63xs68f0I=; b=EYC+sermLxgHGMG0IDcgMM102efd1AtuTi4htCkJFVJtnH90ljzygYR+Dv2VysLoNK Ve5kHbw4Somlqtvv6xywpCsP73hcbucVZpcqHGkQkwqkDHWguQ7qzOKY7Zv0MzPsLgrI yvUTedSiwcPqrebWlLgvjQilEAbXDBzGvOIyZpXzT3KqAhSpyIfDtiKWZLYZIlKaahb2 7ogxGe9YK7SA+zpf3FGzXwAzKo3m4+j0A+N0s3deJKAHbh6PwOKNLz+SJHOL6g2yJ6TI +u1SfPormNeMYPVfhgQ/LD8u1lIjjuBGfRanPwJjYyUVxLNpI6BF0XkjtLADeIfF5vrX QomQ== X-Gm-Message-State: AOAM5333D97yGeliV/oQkRrWcXjmYiRYRVaglN4tYWVodXAT1D/fdaNr B7jhoqUD9pCoFQfViA5jJVOBWg== X-Received: by 2002:a05:6402:1c86:: with SMTP id cy6mr4603404edb.276.1616506855521; Tue, 23 Mar 2021 06:40:55 -0700 (PDT) Received: from localhost.localdomain (hst-221-13.medicom.bg. [84.238.221.13]) by smtp.gmail.com with ESMTPSA id r10sm11207317eju.66.2021.03.23.06.40.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Mar 2021 06:40:55 -0700 (PDT) From: Stanimir Varbanov To: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: hverkuil-cisco@xs4all.nl, ezequiel@collabora.com, nicolas.dufresne@collabora.com, Stanimir Varbanov Subject: [PATCH v6 1/5] v4l: Add new Colorimetry Class Date: Tue, 23 Mar 2021 15:40:36 +0200 Message-Id: <20210323134040.943757-2-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210323134040.943757-1-stanimir.varbanov@linaro.org> References: <20210323134040.943757-1-stanimir.varbanov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Add Colorimetry control class for colorimetry controls Signed-off-by: Stanimir Varbanov --- drivers/media/v4l2-core/v4l2-ctrls.c | 7 ++++++- include/uapi/linux/v4l2-controls.h | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) -- 2.25.1 diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c index ca50e21e2838..41ded74c6764 100644 --- a/drivers/media/v4l2-core/v4l2-ctrls.c +++ b/drivers/media/v4l2-core/v4l2-ctrls.c @@ -1204,6 +1204,10 @@ const char *v4l2_ctrl_get_name(u32 id) case V4L2_CID_STATELESS_H264_SLICE_PARAMS: return "H264 Slice Parameters"; case V4L2_CID_STATELESS_H264_DECODE_PARAMS: return "H264 Decode Parameters"; case V4L2_CID_STATELESS_FWHT_PARAMS: return "FWHT Stateless Parameters"; + + /* Colorimetry controls */ + /* Keep the order of the 'case's the same as in v4l2-controls.h! */ + case V4L2_CID_COLORIMETRY_CLASS: return "Colorimetry Controls"; default: return NULL; } @@ -1395,8 +1399,9 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type, case V4L2_CID_RF_TUNER_CLASS: case V4L2_CID_DETECT_CLASS: case V4L2_CID_CODEC_STATELESS_CLASS: + case V4L2_CID_COLORIMETRY_CLASS: *type = V4L2_CTRL_TYPE_CTRL_CLASS; - /* You can neither read not write these */ + /* You can neither read nor write these */ *flags |= V4L2_CTRL_FLAG_READ_ONLY | V4L2_CTRL_FLAG_WRITE_ONLY; *min = *max = *step = *def = 0; break; diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h index 6f8c08507bf4..038c722ca4d2 100644 --- a/include/uapi/linux/v4l2-controls.h +++ b/include/uapi/linux/v4l2-controls.h @@ -66,6 +66,7 @@ #define V4L2_CTRL_CLASS_RF_TUNER 0x00a20000 /* RF tuner controls */ #define V4L2_CTRL_CLASS_DETECT 0x00a30000 /* Detection controls */ #define V4L2_CTRL_CLASS_CODEC_STATELESS 0x00a40000 /* Stateless codecs controls */ +#define V4L2_CTRL_CLASS_COLORIMETRY 0x00a50000 /* Colorimetry controls */ /* User-class control IDs */ @@ -1661,6 +1662,9 @@ struct v4l2_ctrl_fwht_params { __u32 quantization; }; +#define V4L2_CID_COLORIMETRY_CLASS_BASE (V4L2_CTRL_CLASS_COLORIMETRY | 0x900) +#define V4L2_CID_COLORIMETRY_CLASS (V4L2_CTRL_CLASS_COLORIMETRY | 1) + /* MPEG-compression definitions kept for backwards compatibility */ #ifndef __KERNEL__ #define V4L2_CTRL_CLASS_MPEG V4L2_CTRL_CLASS_CODEC