From patchwork Tue Feb 9 16:24:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 379360 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp375079jah; Tue, 9 Feb 2021 08:27:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJzA9EkQ89Xg40oGKev+B8gGgn+hmJ111GZir//lS0f0w8R4HeFHIi/JdGGtejuOknjmSKBP X-Received: by 2002:a17:906:a2da:: with SMTP id by26mr23919568ejb.191.1612888050605; Tue, 09 Feb 2021 08:27:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612888050; cv=none; d=google.com; s=arc-20160816; b=V2M0zlqXQZvJ9z5Iv+lqsB+5dU6LAIPBxblNlF9EiN/LcufOLO1WtLBRlHJVjIgSwV DwEkGlSQB5DgFPO7iaqXOSHQbqt2oTjsku4R172k93XfRlvoCnYZAqdSz+mJxlPTQmlQ suzOp7az3LpEcMKSEXGMe5xaJxrGccA0Klw8Mqq3O29HJRXf0sYb4c56HRPiVI1m7LHi SCURD521V19g+2UpoRP/5G6D8ESHS5o+gVJsuhPDgTV+wfFwyh4uO4kQ8mLbrcWO02nX SYoXdEuxChhtKy0O5TNxWyQgDKL0MV33UP6QEb5d5BuHZ6WIPyRvTtpq9TmoICSguTup dXkg== 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=RpRFBI7aKbXuZDTdplO4uMlEuZf03cJC9y/EwRGqErk=; b=Cjx/GMOkqwHQWHMW1eRP2h+nbNAF8NVzcM6FOwyKKHPkd+LfkSHVL9GKdxT0JdjQwZ csNXqTh7LWGCKBaZRh9yHL2c2YbB+fLl2T/48Qetwug8OPXffHNCmbvVJoNfgxBHaP8j gLKArHdZy9yD3eKQQpfgR0pFObNYKLX/3WEjdCfji9qPqZeYfQYC/oanswbPsASUBWnH lVWHnaChLhvyP9l6o5IXPNcppGN8shXmtOSzqqf78cCC3eYQMheHzyjgUf0EmqkrrXwD pa3JdRhGPwfHdcP3wI5OCR0xGe0dOC7cgtmP1u+eoHs1/awbgu/OwyGMiv+57HLVFW4K xmEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TyUxia1h; 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 x23si14071262ejv.558.2021.02.09.08.27.30; Tue, 09 Feb 2021 08:27:30 -0800 (PST) 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=TyUxia1h; 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 S232473AbhBIQ0W (ORCPT + 16 others); Tue, 9 Feb 2021 11:26:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232833AbhBIQ0K (ORCPT ); Tue, 9 Feb 2021 11:26:10 -0500 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CA89C061788 for ; Tue, 9 Feb 2021 08:24:49 -0800 (PST) Received: by mail-wr1-x42e.google.com with SMTP id r21so6462314wrr.9 for ; Tue, 09 Feb 2021 08:24:49 -0800 (PST) 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=RpRFBI7aKbXuZDTdplO4uMlEuZf03cJC9y/EwRGqErk=; b=TyUxia1hD3NL+J2VrBNXDjo25wR7eUhQYezop+YWKD1SZvz88brr4tvYsjqbAoX4h9 BwupS6bzf5vSW3L5jqgNQOiB/wFf68ZdH6kPXttsXhbo/8fOD+McPuumr/Tm3osGAqUu Uw3OzWQrJFYV9qRE8EIXAv0WgFlJi/sz8ZBUVMTJQFGRi5DDVNdg7MMDlUJQU0Q7uTsH 8wuBxE7sSwmeF5XE9RiPfYMik9lNm5mTeT+UMQcChhVXh4dZYiyYvO83ZI9D55+Y+4ap BAjLFHOrcMBYOLiMTtjH+CawRITezWzT0d5L4Cpcib55+VWzf5OBR1EBTP+SlLHe4ZbO JyNA== 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=RpRFBI7aKbXuZDTdplO4uMlEuZf03cJC9y/EwRGqErk=; b=GhTM2VwUNsABVDZjJVdzpKTxEEqSOgE2Vhs/gN/Vpvi3ikWMxWipla/pVZI1c92jZp qj/NlUbwsd7kzciIIUGUKmaSMi7UjxLULGubvpE2v4Isn/oTSC2/PXB9b+/zJ4FNujib uVra/4eV8BOm1OquNj4BPR5Lh6Bxluxgy12BwsazXqSpICAjwaTCPnLuWKy50I7I6sdQ CxMhk7ffIC/YIme9B/TxiEFo3cZYUCzxIst95WhDPFOZH7R9xojLuTxFX2xkXQBnx9hR brx0LXygrfykjlpTJfePmfRCUizqYRRJduxlT8uJmRPlzvHpXCFEVQk+Qhvf57/LnsVd MvOg== X-Gm-Message-State: AOAM533BkCkyki7ARsBhgLSlP8TFFCkvqF9HgK8fN9rzi/vzrybrVHH6 K6b0O3IMuOYAXcr7nA979MIQIQ== X-Received: by 2002:adf:ea12:: with SMTP id q18mr12760655wrm.79.1612887888332; Tue, 09 Feb 2021 08:24:48 -0800 (PST) Received: from localhost.localdomain (hst-221-125.medicom.bg. [84.238.221.125]) by smtp.gmail.com with ESMTPSA id w8sm45210wrm.21.2021.02.09.08.24.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Feb 2021 08:24:47 -0800 (PST) From: Stanimir Varbanov To: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: Hans Verkuil , Ezequiel Garcia , Nicolas Dufresne , Stanimir Varbanov Subject: [PATCH v5 1/5] v4l: Add new Colorimetry Class Date: Tue, 9 Feb 2021 18:24:21 +0200 Message-Id: <20210209162425.3970393-2-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210209162425.3970393-1-stanimir.varbanov@linaro.org> References: <20210209162425.3970393-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 Reviewed-by: Hans Verkuil diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c index 016cf6204cbb..335cf354f51b 100644 --- a/drivers/media/v4l2-core/v4l2-ctrls.c +++ b/drivers/media/v4l2-core/v4l2-ctrls.c @@ -1201,6 +1201,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; } @@ -1389,8 +1393,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 039c0d7add1b..a41039559193 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 */ @@ -1657,6 +1658,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