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 From patchwork Tue Feb 9 16:24:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 379361 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp375108jah; Tue, 9 Feb 2021 08:27:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJxR2ihtbENCwlovwIUMmQmCus1Lhc+Y7IGLnCm+n1rns2ZqKgBl88El4qKpG3UqMYag77Pz X-Received: by 2002:aa7:d6d4:: with SMTP id x20mr24356399edr.8.1612888052224; Tue, 09 Feb 2021 08:27:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612888052; cv=none; d=google.com; s=arc-20160816; b=kWyTe0ExaJ8B9I8HL7sdLiqyMppPkoFykorEaY02H9CcLs9a09u4SHF9YNh9nIbmID 13RS2b8HDvu/hB+cIbDEHd+K6TcrxwGAVFvUwlTub1G9Aa2BV/cYWB/5ImgLEEBnF58j 00MQazOph2BkNoSHBmnNxL67j9LshG8NsGaCY8lqOKvmivReMSgz+IE9ffaJxP1JPxuA tbUzzVO7lqhVbvlXV6O8xhkfIPuG8yyPjPdvLtTQqdSnc+yYM92usbQcrNRArD46Twad wj36E3X24rdTUAoi3j/mqjc6fMem/2LUJWJ+X6zZAjHE/pxXWgshwGvpxqxXmxR/n/Cg 98Kg== 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=EI1EcA+D88VC2CjRtNWFjgy2Ge54caq8DUdTYfEpBQs=; b=AbHzKQowMBnHuZT4dgBCntICodsxeOlB9948vxbPpTh7B7xBK4B60p2C2ofSrA0/am tMB5uBKfeQqdF5IcFmjQR9Vdx9sJU7Ue6l1jV47sVqxgy+tcb6rRyFQ4gY5kU659nQEF Y6rNfUXk4gbGYD7L1PKwib4hCIMj05km1LJh5JXyZ422/kHe4v/anEsPtJz4RML8lBZS Krrgk/Kpc2qDwpYhmxYKosJJ5quA2WIEtX5nZ5iwXRE1peNb8DL/r3urU6IoRIlUFFSA A6moVCo6KBudlYmu+gm/lsp4nPAi/doRKhTzgDGr5LZANRsO72Bk9SL4d0YIEx1OGJ20 tW5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jHpgpy17; 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.31; Tue, 09 Feb 2021 08:27:32 -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=jHpgpy17; 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 S232868AbhBIQ02 (ORCPT + 16 others); Tue, 9 Feb 2021 11:26:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232846AbhBIQ0L (ORCPT ); Tue, 9 Feb 2021 11:26:11 -0500 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C502BC06178C for ; Tue, 9 Feb 2021 08:24:50 -0800 (PST) Received: by mail-wm1-x32f.google.com with SMTP id a16so2037129wmm.0 for ; Tue, 09 Feb 2021 08:24:50 -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=EI1EcA+D88VC2CjRtNWFjgy2Ge54caq8DUdTYfEpBQs=; b=jHpgpy17JbMvJLjyX/xNOcYywv0BRkfKBFJWNCtbWcr0Iedj5o8Eq/hb0tnaxvfa0b 4sOwopQ8iTAlAtSmC5ciNAip9dPKL8/LueZLmRmhlVA2Qx0STeVeDjcW1QFtzIRfTALz 5VHXF7g8FzrAA5b1WMRQda49bZNEWpBA6EL4ZBPEr8MWGNz505/wVi1+2IZY429fIcrs p47E4XSx6i8pkTQLRzgp+Ipm8iMy3P8vzM6zqB0LPR+Q0EdM8dlvofN89V4iCLchso7G +bluxF/nKN61Vg8Xuhs/cTii1cWFtW3e2NZXHydsYZXbIxh9+Fr/QUg9s0Lt65ZceBfZ 8ahQ== 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=EI1EcA+D88VC2CjRtNWFjgy2Ge54caq8DUdTYfEpBQs=; b=SaX/MaK0hxtolfkN33zCoS13Kjvv9+Tld754Q/PqEAG0Az/Tuzzob/Qr8GLCpfBrD4 F4+FDqZjWUg7bNvvpvsOdbQXcTfMJ9hz5hFSnytmjr8hdnB+IkiwO/+uL/ggkAgSqLx2 zMZS7V4pk09otF2sVtvhHQN6RzrI8FIu94ZbVSl6t0EPOfUm3ZY/DLyKGpfatxhco8sO UPWuHpKvP1Ll9SZSb1sMnhPHsCi1dvzU80YNVV7hQ7jU5c8W+rKxHjsfrxpAJWvfVTde 8cdwGrJXC0aAT0gjWjHT4Xxkb1U66n/z+R3DzyoU2Tb/cQlbPh0UfRIP5QtgKD8xUDhw T2ew== X-Gm-Message-State: AOAM5326G/Y1aASRJ/nuS1V38xTYtsthesGggqBBkwGQR3hZaaYpubI2 xN9YjE3H74mKfzyM16ElDSzYFA== X-Received: by 2002:a1c:e90d:: with SMTP id q13mr4192172wmc.136.1612887889436; Tue, 09 Feb 2021 08:24:49 -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.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Feb 2021 08:24:49 -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 2/5] docs: Document colorimetry class Date: Tue, 9 Feb 2021 18:24:22 +0200 Message-Id: <20210209162425.3970393-3-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 a document for ext control colorimetry class. Signed-off-by: Stanimir Varbanov --- .../userspace-api/media/v4l/common.rst | 1 + .../media/v4l/ext-ctrls-colorimetry.rst | 22 +++++++++++++++++++ .../media/v4l/vidioc-g-ext-ctrls.rst | 4 ++++ 3 files changed, 27 insertions(+) create mode 100644 Documentation/userspace-api/media/v4l/ext-ctrls-colorimetry.rst -- 2.25.1 Reviewed-by: Hans Verkuil diff --git a/Documentation/userspace-api/media/v4l/common.rst b/Documentation/userspace-api/media/v4l/common.rst index 8c263c5a85d8..ea0435182e44 100644 --- a/Documentation/userspace-api/media/v4l/common.rst +++ b/Documentation/userspace-api/media/v4l/common.rst @@ -51,6 +51,7 @@ applicable to all devices. ext-ctrls-fm-tx ext-ctrls-fm-rx ext-ctrls-detect + ext-ctrls-colorimetry fourcc format planar-apis diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-colorimetry.rst b/Documentation/userspace-api/media/v4l/ext-ctrls-colorimetry.rst new file mode 100644 index 000000000000..862f78b41b32 --- /dev/null +++ b/Documentation/userspace-api/media/v4l/ext-ctrls-colorimetry.rst @@ -0,0 +1,22 @@ +.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later + +.. _colorimetry-controls: + +***************************** +Colorimetry Control Reference +***************************** + +The Colorimetry class includes controls for High Dynamic Range +imaging for representing colors in digital images and video. The +controls should be used for video and image encoding and decoding +as well as in HDMI receivers and transmitters. + +Colorimetry Control IDs +----------------------- + +.. _colorimetry-control-id: + +``V4L2_CID_COLORIMETRY_CLASS (class)`` + The Colorimetry class descriptor. Calling + :ref:`VIDIOC_QUERYCTRL` for this control will + return a description of this control class. diff --git a/Documentation/userspace-api/media/v4l/vidioc-g-ext-ctrls.rst b/Documentation/userspace-api/media/v4l/vidioc-g-ext-ctrls.rst index b9c62affbb5a..8a95ebdd499a 100644 --- a/Documentation/userspace-api/media/v4l/vidioc-g-ext-ctrls.rst +++ b/Documentation/userspace-api/media/v4l/vidioc-g-ext-ctrls.rst @@ -394,6 +394,10 @@ still cause this situation. - 0xa40000 - The class containing stateless codec controls. These controls are described in :ref:`codec-stateless-controls`. + * - ``V4L2_CTRL_CLASS_COLORIMETRY`` + - 0xa50000 + - The class containing colorimetry controls. These controls are + described in :ref:`colorimetry-controls`. Return Value ============ From patchwork Tue Feb 9 16:24:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 379362 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp375158jah; Tue, 9 Feb 2021 08:27:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJzaQQ1yc5i8dAQfN2i/aYOMSG8ksQ4rWC+C/hGFzNM3izDPq7W+Pi2YYqcdYLY5UTDDqT6m X-Received: by 2002:a05:6402:1914:: with SMTP id e20mr23767871edz.89.1612888055807; Tue, 09 Feb 2021 08:27:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612888055; cv=none; d=google.com; s=arc-20160816; b=iTVF9FAnTQCij2CyDkEC43nr98YPo7agfO0I0x7HV3S8QhfEgONw9tBk0Soud+VxKN IONUXiL3yQrcVlAP45FefO2uIAHi4fAVBQJUEit6Agh7ACkrax/TajUv3XBaGGiGm+HP GT68tf8I6JTiYJd07CNPkTpocrTSzcPqgPPqnCf/SPnDdYwJhMWdQmMyPU2p1xk+865i 3bAwYCKuaDECJStE4/3xaxDJTF+vBQg0+jKXuzNRF4NKmut41j5FSUVSd7HY4u+e8KyK hICsu3fTpFlz797Ddr6FP4uuTRt61CyLG+Oio9i0peJt5DQJ573tfTRUCmFgfImfL9bY u6CA== 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=bvV9l3idMcOCZNBPZ+Exy5m2MrsijsTOhmlccZyo8g0=; b=PfdfA/bHOk62mez3FII9XB8DA76FShpYHYQ4AU1NgpoE00DntJoFLQrY+xww1XtvAA 691lX72utQtgQyQrM5juyh1VchjQYHz4oQupd5t3ZrwsMWtUpuZG9ob6h/TOWqpdyY5V yu3tDdoa1RuJXLrEMiOJ2b8yFKUHfcz7q/toaDdkl7+UKSBuSo+ByvQmE6ncxw+EA6O5 BIr31nArysOD0pbu2v7nonytbwMzanUg5h6rDjO7n/yY0uBUlA3F8/a95OTTWteyyXDl q37zNtI8djIogpG5694urMGY0NxpTFdG5rbWNV0Zx8DcFAjxSAWy8bmqLPCY3Y1BFHh2 nKUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GP0vxXfv; 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.35; Tue, 09 Feb 2021 08:27:35 -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=GP0vxXfv; 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 S232686AbhBIQ0i (ORCPT + 16 others); Tue, 9 Feb 2021 11:26:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232850AbhBIQ0M (ORCPT ); Tue, 9 Feb 2021 11:26:12 -0500 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD6F7C061794 for ; Tue, 9 Feb 2021 08:24:51 -0800 (PST) Received: by mail-wm1-x336.google.com with SMTP id f16so3760323wmq.5 for ; Tue, 09 Feb 2021 08:24:51 -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=bvV9l3idMcOCZNBPZ+Exy5m2MrsijsTOhmlccZyo8g0=; b=GP0vxXfv1NYbEWDz8d+hWGvGzifevppJGYWimBfZzB/kbtXQrmRq15mKk5yhOBtv02 /CzKb8pTIxivqlkdaigymuYdk+V3lGKz67M47frkQPpgdgEtuOsRaurjMTAUxQLrISV+ Ve7+h3w77LwaVILUDH3XYrSOEmKd4Es9Bar7mfiCyHjFVIfOF1TzHTab1rp6VCXwTc8L pod1n4Wb26vItGSkDddc3bm2W/17zv+AlY8rv1R9hSZUICLIKKjA1kmvYAnVO3lLyk99 yvE6yHOiQBsiJ0DObQZ8K0H8+rsQXxT9q0aps8ao0DvQTW53EGz9JfOhtt4azpD8gLVL vhXQ== 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=bvV9l3idMcOCZNBPZ+Exy5m2MrsijsTOhmlccZyo8g0=; b=LBs4FpNtalTk4ujicuWR0Sd33v8vuXQGmG/+i33VfMUrbTjgzZgkStnSE8LA6oBG7x 6sP2l0wJi6+uTXVS9hvFyb6/EhVfJRfkgkuLX/bjWSaF/nxgWwqnymi2mnlxfhMpasq1 Bv9KR8KryoP8w8aQBDp0bHliWyp1F3tCBQuRwgaJM+VYPJcmzupha6y5XBxsanz+0+0S jPneJADCBuz0CXP1szm3GcHrO5oWb8GWBphpaULyCCRxYsO2emwGdssmnUmbl08tzo45 WJwOTuBziQRYbDH6y5VB6lS3GWjiimmb/mGS1AKesmfUcLO5xwiLh4xcGKG37NGVGpMW c9Ow== X-Gm-Message-State: AOAM531VEaMdPUWxpHJbhD0MjptrkXSVIuruhvEmZ0Uum47V3PnLX25F IL2oXzz8fDLXO9Nf4ZFiB35sFA== X-Received: by 2002:a05:600c:2ca:: with SMTP id 10mr4221806wmn.151.1612887890505; Tue, 09 Feb 2021 08:24:50 -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.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Feb 2021 08:24:50 -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 3/5] v4l: Add HDR10 static metadata controls Date: Tue, 9 Feb 2021 18:24:23 +0200 Message-Id: <20210209162425.3970393-4-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 Introduce Content light level and Mastering display colour volume Colorimetry compound controls with relevant payload structures and validation. Signed-off-by: Stanimir Varbanov --- drivers/media/v4l2-core/v4l2-ctrls.c | 67 ++++++++++++++++++++++++++++ include/media/v4l2-ctrls.h | 4 ++ include/uapi/linux/v4l2-controls.h | 31 +++++++++++++ include/uapi/linux/videodev2.h | 3 ++ 4 files changed, 105 insertions(+) -- 2.25.1 diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c index 335cf354f51b..8bd3cf0e1e4f 100644 --- a/drivers/media/v4l2-core/v4l2-ctrls.c +++ b/drivers/media/v4l2-core/v4l2-ctrls.c @@ -1205,6 +1205,8 @@ const char *v4l2_ctrl_get_name(u32 id) /* Colorimetry controls */ /* Keep the order of the 'case's the same as in v4l2-controls.h! */ case V4L2_CID_COLORIMETRY_CLASS: return "Colorimetry Controls"; + case V4L2_CID_COLORIMETRY_HDR10_CLL_INFO: return "HDR10 Content Light Info"; + case V4L2_CID_COLORIMETRY_HDR10_MASTERING_DISPLAY: return "HDR10 Mastering Display"; default: return NULL; } @@ -1491,6 +1493,12 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type, *type = V4L2_CTRL_TYPE_AREA; *flags |= V4L2_CTRL_FLAG_READ_ONLY; break; + case V4L2_CID_COLORIMETRY_HDR10_CLL_INFO: + *type = V4L2_CTRL_TYPE_HDR10_CLL_INFO; + break; + case V4L2_CID_COLORIMETRY_HDR10_MASTERING_DISPLAY: + *type = V4L2_CTRL_TYPE_HDR10_MASTERING_DISPLAY; + break; default: *type = V4L2_CTRL_TYPE_INTEGER; break; @@ -1786,6 +1794,12 @@ static void std_log(const struct v4l2_ctrl *ctrl) case V4L2_CTRL_TYPE_FWHT_PARAMS: pr_cont("FWHT_PARAMS"); break; + case V4L2_CTRL_TYPE_HDR10_CLL_INFO: + pr_cont("HDR10_CLL_INFO"); + break; + case V4L2_CTRL_TYPE_HDR10_MASTERING_DISPLAY: + pr_cont("HDR10_MASTERING_DISPLAY"); + break; default: pr_cont("unknown type %d", ctrl->type); break; @@ -1838,6 +1852,7 @@ static int std_validate_compound(const struct v4l2_ctrl *ctrl, u32 idx, struct v4l2_ctrl_hevc_sps *p_hevc_sps; struct v4l2_ctrl_hevc_pps *p_hevc_pps; struct v4l2_ctrl_hevc_slice_params *p_hevc_slice_params; + struct v4l2_ctrl_hdr10_mastering_display *p_hdr10_mastering; struct v4l2_area *area; void *p = ptr.p + idx * ctrl->elem_size; unsigned int i; @@ -2133,6 +2148,52 @@ static int std_validate_compound(const struct v4l2_ctrl *ctrl, u32 idx, zero_padding(*p_hevc_slice_params); break; + case V4L2_CTRL_TYPE_HDR10_CLL_INFO: + break; + + case V4L2_CTRL_TYPE_HDR10_MASTERING_DISPLAY: + p_hdr10_mastering = p; + + for (i = 0; i < 3; ++i) { + if (p_hdr10_mastering->display_primaries_x[i] < + V4L2_HDR10_MASTERING_PRIMARIES_X_LOW || + p_hdr10_mastering->display_primaries_x[i] > + V4L2_HDR10_MASTERING_PRIMARIES_X_HIGH || + p_hdr10_mastering->display_primaries_y[i] < + V4L2_HDR10_MASTERING_PRIMARIES_Y_LOW || + p_hdr10_mastering->display_primaries_y[i] > + V4L2_HDR10_MASTERING_PRIMARIES_Y_HIGH) + return -EINVAL; + } + + if (p_hdr10_mastering->white_point_x < + V4L2_HDR10_MASTERING_WHITE_POINT_X_LOW || + p_hdr10_mastering->white_point_x > + V4L2_HDR10_MASTERING_WHITE_POINT_X_HIGH || + p_hdr10_mastering->white_point_y < + V4L2_HDR10_MASTERING_WHITE_POINT_Y_LOW || + p_hdr10_mastering->white_point_y > + V4L2_HDR10_MASTERING_WHITE_POINT_Y_HIGH) + return -EINVAL; + + if (p_hdr10_mastering->max_display_mastering_luminance < + V4L2_HDR10_MASTERING_MAX_LUMA_LOW || + p_hdr10_mastering->max_display_mastering_luminance > + V4L2_HDR10_MASTERING_MAX_LUMA_HIGH || + p_hdr10_mastering->min_display_mastering_luminance < + V4L2_HDR10_MASTERING_MIN_LUMA_LOW || + p_hdr10_mastering->min_display_mastering_luminance > + V4L2_HDR10_MASTERING_MIN_LUMA_HIGH) + return -EINVAL; + + if (p_hdr10_mastering->max_display_mastering_luminance == + V4L2_HDR10_MASTERING_MAX_LUMA_LOW && + p_hdr10_mastering->min_display_mastering_luminance == + V4L2_HDR10_MASTERING_MIN_LUMA_HIGH) + return -EINVAL; + + break; + case V4L2_CTRL_TYPE_AREA: area = p; if (!area->width || !area->height) @@ -2826,6 +2887,12 @@ static struct v4l2_ctrl *v4l2_ctrl_new(struct v4l2_ctrl_handler *hdl, case V4L2_CTRL_TYPE_HEVC_SLICE_PARAMS: elem_size = sizeof(struct v4l2_ctrl_hevc_slice_params); break; + case V4L2_CTRL_TYPE_HDR10_CLL_INFO: + elem_size = sizeof(struct v4l2_ctrl_hdr10_cll_info); + break; + case V4L2_CTRL_TYPE_HDR10_MASTERING_DISPLAY: + elem_size = sizeof(struct v4l2_ctrl_hdr10_mastering_display); + break; case V4L2_CTRL_TYPE_AREA: elem_size = sizeof(struct v4l2_area); break; diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h index 167ca8c8424f..9c3ddbf3d099 100644 --- a/include/media/v4l2-ctrls.h +++ b/include/media/v4l2-ctrls.h @@ -54,6 +54,8 @@ struct video_device; * @p_hevc_sps: Pointer to an HEVC sequence parameter set structure. * @p_hevc_pps: Pointer to an HEVC picture parameter set structure. * @p_hevc_slice_params: Pointer to an HEVC slice parameters structure. + * @p_hdr10_cll: Pointer to an HDR10 Content Light Level structure. + * @p_hdr10_mastering: Pointer to an HDR10 Mastering Display structure. * @p_area: Pointer to an area. * @p: Pointer to a compound value. * @p_const: Pointer to a constant compound value. @@ -78,6 +80,8 @@ union v4l2_ctrl_ptr { struct v4l2_ctrl_hevc_sps *p_hevc_sps; struct v4l2_ctrl_hevc_pps *p_hevc_pps; struct v4l2_ctrl_hevc_slice_params *p_hevc_slice_params; + struct v4l2_ctrl_hdr10_cll_info *p_hdr10_cll; + struct v4l2_ctrl_hdr10_mastering_display *p_hdr10_mastering; struct v4l2_area *p_area; void *p; const void *p_const; diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h index a41039559193..349e86b18af7 100644 --- a/include/uapi/linux/v4l2-controls.h +++ b/include/uapi/linux/v4l2-controls.h @@ -1661,6 +1661,37 @@ struct v4l2_ctrl_fwht_params { #define V4L2_CID_COLORIMETRY_CLASS_BASE (V4L2_CTRL_CLASS_COLORIMETRY | 0x900) #define V4L2_CID_COLORIMETRY_CLASS (V4L2_CTRL_CLASS_COLORIMETRY | 1) +#define V4L2_CID_COLORIMETRY_HDR10_CLL_INFO (V4L2_CID_COLORIMETRY_CLASS_BASE + 0) + +struct v4l2_ctrl_hdr10_cll_info { + __u16 max_content_light_level; + __u16 max_pic_average_light_level; +}; + +#define V4L2_CID_COLORIMETRY_HDR10_MASTERING_DISPLAY (V4L2_CID_COLORIMETRY_CLASS_BASE + 1) + +#define V4L2_HDR10_MASTERING_PRIMARIES_X_LOW 5 +#define V4L2_HDR10_MASTERING_PRIMARIES_X_HIGH 37000 +#define V4L2_HDR10_MASTERING_PRIMARIES_Y_LOW 5 +#define V4L2_HDR10_MASTERING_PRIMARIES_Y_HIGH 42000 +#define V4L2_HDR10_MASTERING_WHITE_POINT_X_LOW 5 +#define V4L2_HDR10_MASTERING_WHITE_POINT_X_HIGH 37000 +#define V4L2_HDR10_MASTERING_WHITE_POINT_Y_LOW 5 +#define V4L2_HDR10_MASTERING_WHITE_POINT_Y_HIGH 42000 +#define V4L2_HDR10_MASTERING_MAX_LUMA_LOW 50000 +#define V4L2_HDR10_MASTERING_MAX_LUMA_HIGH 100000000 +#define V4L2_HDR10_MASTERING_MIN_LUMA_LOW 1 +#define V4L2_HDR10_MASTERING_MIN_LUMA_HIGH 50000 + +struct v4l2_ctrl_hdr10_mastering_display { + __u16 display_primaries_x[3]; + __u16 display_primaries_y[3]; + __u16 white_point_x; + __u16 white_point_y; + __u32 max_display_mastering_luminance; + __u32 min_display_mastering_luminance; +}; + /* MPEG-compression definitions kept for backwards compatibility */ #ifndef __KERNEL__ #define V4L2_CTRL_CLASS_MPEG V4L2_CTRL_CLASS_CODEC diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index 79dbde3bcf8d..f5f971407b66 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -1784,6 +1784,9 @@ enum v4l2_ctrl_type { V4L2_CTRL_TYPE_U32 = 0x0102, V4L2_CTRL_TYPE_AREA = 0x0106, + V4L2_CTRL_TYPE_HDR10_CLL_INFO = 0x0110, + V4L2_CTRL_TYPE_HDR10_MASTERING_DISPLAY = 0x0111, + V4L2_CTRL_TYPE_H264_SPS = 0x0200, V4L2_CTRL_TYPE_H264_PPS = 0x0201, V4L2_CTRL_TYPE_H264_SCALING_MATRIX = 0x0202, From patchwork Tue Feb 9 16:24:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 379363 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp375166jah; Tue, 9 Feb 2021 08:27:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJxP2Y8jWkuhPg9RZTrPGpJfmjw3vmH2ai1OpJAE2zE1y1Zoq2l5IA9XL7lBQ16FhmPeVJu6 X-Received: by 2002:a17:906:8292:: with SMTP id h18mr22862863ejx.342.1612888056353; Tue, 09 Feb 2021 08:27:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612888056; cv=none; d=google.com; s=arc-20160816; b=xyL99tihCD7QaJHMpWHnJmU1FkB5yFh1SRCdPT2XLV/DVCPnWNds+CMm7D6snP/ieI /spbKSK7SW7qboJ9LsiPKd5PlB5/TqCRNvKNu6N5fpcpCsiKK4uMltJv7xQ/HkUyc7K5 zt8R8Wltk70zYokJ0WOpnaJqyNp8Bp6BIaAhkV2EOAQvYNDc/G35j+YdwvumY31ELbBZ ogouoNRhqwNsWr3SzTBF3dHk0nziF0omnxzJoqdMUxFAfhQHHMEJy7eLzqU9aRdrxDxx 8tqvxEv5Er1wUg+WVI6DnqnYI5+S6osn7gpCjnNpOrOODXKJSURx9/J/tD7Sthh16/pd hFeg== 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=gm63VE0Ms6j+TktlY/wms9x6BlhYOZP/RTvoJB/vhKw=; b=s7e0I3pHjEsUWrDqde5lezB6mP+31pijZNHZLPE03cV/p3QmJ3I3A4T+3nSznbXqR+ sqAH6Vgh4aLVbG+ctTNih7cHpeDgNO/E8VizObIObNdNGN1/5/1Jp7posMVbwGnDZZvM 2Lwy4PX/7GGEY8WRXHhTC40ZKVqT/MC4PrBY/kVDwEMO/JiACnXmvxWtVFndJe5hgHNq dk3wxSfSqX5QIPEgVyUbROM23VjrMeZxG00rMaDCmsIFLdBco+Ql8UBvr1VlbgYMugTD fM0NfjEpWixfrXGFruqSuYzIcItw/gfq5Zd1TGSDNnhIARPnimZR6/qIxVy+3/rkbEsm PBoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FofgPF7Z; 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.36; Tue, 09 Feb 2021 08:27:36 -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=FofgPF7Z; 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 S232877AbhBIQ0p (ORCPT + 16 others); Tue, 9 Feb 2021 11:26:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232856AbhBIQ0V (ORCPT ); Tue, 9 Feb 2021 11:26:21 -0500 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9B3FC0617A9 for ; Tue, 9 Feb 2021 08:24:52 -0800 (PST) Received: by mail-wr1-x433.google.com with SMTP id h12so6414315wrw.6 for ; Tue, 09 Feb 2021 08:24:52 -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=gm63VE0Ms6j+TktlY/wms9x6BlhYOZP/RTvoJB/vhKw=; b=FofgPF7ZSTIvSiVaryp/NeVpmTAZO3agRjo/IJX4qA5hp0KcuMcnzJ2rGYZQ93sHZq 0RZVY/UZBd/bgfZS8HMzz/xNt8JvGsIFdnG8t4k/RFJkEKme1OUc3xUU19OemUHt9s91 5+nqc8YZW8tr6EiULtf3jKwmO+WCSiIZ4ttArZ0bqSSVDxYuTnsW1w0tj9TX6SC3plfP 7+LJ1TeFXrb+YdraquGE1jUScUTxblfsKrZIxfw9pinABzn4LdCqP2TIQboW22GQ57nZ NoP24Sl7LKAJs6xUNWHlQMVFL14IUtL8+1zAPfOagOpXMIdX+hQPjoSWD9aQywbTIo8X 3HSQ== 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=gm63VE0Ms6j+TktlY/wms9x6BlhYOZP/RTvoJB/vhKw=; b=F3FLW58kZ1NLTvMrKVvhYY/5uRpM/R4MZVNjPZ26S1xviy/Zx09WQn7/yVbHJ1dDY7 R7H5Ohra4dH8nTlnAowVtBywrOFVexNVT1W3jtFKZrDeL5UFnf6wfbjUd3cJ3dHsQv8P c9F1OzAD+kiL+CuE+3Vql4RhLiKdTyumcCeEwPEKvtVLGNFG6B85afC8sjJGdNz2AAQi TTfwBOlkduZaTfVwDX8Rt0RpbY8oAVXwxgmIo7jVMbZvUe+a406HQdQOsf1CbfvZkyYE Ky1uGYiTaZVS+J7ad0QDe4YtukFQTu4gow6YCc+fGkG7aVh0ZllLL4LNfxBfIBeeUZOb XQFw== X-Gm-Message-State: AOAM533S7/e0coQOKQ6EuzqrkZSm8q15JBFjwLu92V3bkkvrau3DaE99 fDVFnUUcxU4Wnx5MHtSoVthhOw== X-Received: by 2002:a5d:4a0b:: with SMTP id m11mr9481678wrq.51.1612887891609; Tue, 09 Feb 2021 08:24:51 -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.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Feb 2021 08:24:51 -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 4/5] docs: Document CLL and Mastering display colorimetry controls Date: Tue, 9 Feb 2021 18:24:24 +0200 Message-Id: <20210209162425.3970393-5-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 Document Content Light Level and Mastering Display v4l2 colorimetry controls. Signed-off-by: Stanimir Varbanov --- .../media/v4l/ext-ctrls-colorimetry.rst | 71 +++++++++++++++++++ .../media/v4l/vidioc-g-ext-ctrls.rst | 8 +++ .../media/videodev2.h.rst.exceptions | 2 + 3 files changed, 81 insertions(+) -- 2.25.1 Reviewed-by: Hans Verkuil diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-colorimetry.rst b/Documentation/userspace-api/media/v4l/ext-ctrls-colorimetry.rst index 862f78b41b32..a9f206a46175 100644 --- a/Documentation/userspace-api/media/v4l/ext-ctrls-colorimetry.rst +++ b/Documentation/userspace-api/media/v4l/ext-ctrls-colorimetry.rst @@ -20,3 +20,74 @@ Colorimetry Control IDs The Colorimetry class descriptor. Calling :ref:`VIDIOC_QUERYCTRL` for this control will return a description of this control class. + +``V4L2_CID_COLORIMETRY_HDR10_CLL_INFO (struct)`` + The Content Light Level defines upper bounds for the nominal target + brightness light level of the pictures. + +.. c:type:: v4l2_ctrl_hdr10_cll_info + +.. cssclass:: longtable + +.. flat-table:: struct v4l2_ctrl_hdr10_cll_info + :header-rows: 0 + :stub-columns: 0 + :widths: 1 1 2 + + * - __u16 + - ``max_content_light_level`` + - The upper bound for the maximum light level among all individual + samples for the pictures of a coded video sequence, cd/m\ :sup:`2`. + When equal to 0 no such upper bound is present. + * - __u16 + - ``max_pic_average_light_level`` + - The upper bound for the maximum average light level among the + samples for any individual picture of a coded video sequence, + cd/m\ :sup:`2`. When equal to 0 no such upper bound is present. + +``V4L2_CID_COLORIMETRY_HDR10_MASTERING_DISPLAY (struct)`` + The mastering display defines the color volume (the color primaries, + white point and luminance range) of a display considered to be the + mastering display for the current video content. + +.. c:type:: v4l2_ctrl_hdr10_mastering_display + +.. cssclass:: longtable + +.. flat-table:: struct v4l2_ctrl_hdr10_mastering_display + :header-rows: 0 + :stub-columns: 0 + :widths: 1 1 2 + + * - __u16 + - ``display_primaries_x[3]`` + - Specifies the normalized x chromaticity coordinate of the color + primary component c of the mastering display in increments of 0.00002. + For describing the mastering display that uses Red, Green and Blue + color primaries, index value c equal to 0 corresponds to the Green + primary, c equal to 1 corresponds to Blue primary and c equal to 2 + corresponds to the Red color primary. + * - __u16 + - ``display_primaries_y[3]`` + - Specifies the normalized y chromaticity coordinate of the color + primary component c of the mastering display in increments of 0.00002. + For describing the mastering display that uses Red, Green and Blue + color primaries, index value c equal to 0 corresponds to the Green + primary, c equal to 1 corresponds to Blue primary and c equal to 2 + corresponds to Red color primary. + * - __u16 + - ``white_point_x`` + - Specifies the normalized x chromaticity coordinate of the white + point of the mastering display in increments of 0.00002. + * - __u16 + - ``white_point_y`` + - Specifies the normalized y chromaticity coordinate of the white + point of the mastering display in increments of 0.00002. + * - __u32 + - ``max_luminance`` + - Specifies the nominal maximum display luminance of the mastering + display in units of 0.0001 cd/m\ :sup:`2`. + * - __u32 + - ``min_luminance`` + - specifies the nominal minimum display luminance of the mastering + display in units of 0.0001 cd/m\ :sup:`2`. diff --git a/Documentation/userspace-api/media/v4l/vidioc-g-ext-ctrls.rst b/Documentation/userspace-api/media/v4l/vidioc-g-ext-ctrls.rst index 8a95ebdd499a..2f6d0539fb93 100644 --- a/Documentation/userspace-api/media/v4l/vidioc-g-ext-ctrls.rst +++ b/Documentation/userspace-api/media/v4l/vidioc-g-ext-ctrls.rst @@ -212,6 +212,14 @@ still cause this situation. - ``p_fwht_params`` - A pointer to a struct :c:type:`v4l2_ctrl_fwht_params`. Valid if this control is of type ``V4L2_CTRL_TYPE_FWHT_PARAMS``. + * - struct :c:type:`v4l2_ctrl_hdr10_cll_info` * + - ``p_hdr10_cll`` + - A pointer to a struct :c:type:`v4l2_ctrl_hdr10_cll_info`. Valid if this control is + of type ``V4L2_CTRL_TYPE_HDR10_CLL_INFO``. + * - struct :c:type:`v4l2_ctrl_hdr10_mastering_display` * + - ``p_hdr10_mastering`` + - A pointer to a struct :c:type:`v4l2_ctrl_hdr10_mastering_display`. Valid if this control is + of type ``V4L2_CTRL_TYPE_HDR10_MASTERING_DISPLAY``. * - void * - ``ptr`` - A pointer to a compound type which can be an N-dimensional array diff --git a/Documentation/userspace-api/media/videodev2.h.rst.exceptions b/Documentation/userspace-api/media/videodev2.h.rst.exceptions index 0ed170c6e720..38b31a9b9580 100644 --- a/Documentation/userspace-api/media/videodev2.h.rst.exceptions +++ b/Documentation/userspace-api/media/videodev2.h.rst.exceptions @@ -147,6 +147,8 @@ replace symbol V4L2_CTRL_TYPE_HEVC_PPS :c:type:`v4l2_ctrl_type` replace symbol V4L2_CTRL_TYPE_HEVC_SLICE_PARAMS :c:type:`v4l2_ctrl_type` replace symbol V4L2_CTRL_TYPE_AREA :c:type:`v4l2_ctrl_type` replace symbol V4L2_CTRL_TYPE_FWHT_PARAMS :c:type:`v4l2_ctrl_type` +replace symbol V4L2_CTRL_TYPE_HDR10_CLL_INFO :c:type:`v4l2_ctrl_type` +replace symbol V4L2_CTRL_TYPE_HDR10_MASTERING_DISPLAY :c:type:`v4l2_ctrl_type` # V4L2 capability defines replace define V4L2_CAP_VIDEO_CAPTURE device-capabilities From patchwork Tue Feb 9 16:24:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 379364 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp375195jah; Tue, 9 Feb 2021 08:27:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJzVen50EeUTGjz77lb1iOuUdtaYYJkvjvnniqWNpPNI0Eiau0IY1pplPhrPgtIqLRC9F2eB X-Received: by 2002:a17:906:8159:: with SMTP id z25mr23134374ejw.270.1612888058196; Tue, 09 Feb 2021 08:27:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612888058; cv=none; d=google.com; s=arc-20160816; b=noUCQV2jovupYv3YP7x4lOXlPM+gTyd0xxu58sEn2qhQDcrZX5n/3F7t2iIqE7w0pz PKVO8ozKSCoiz//EPi1oX7TRXBbx5l9dWv6FUeVd8i8nkGg1+TaINdaO4Vj+q/+xgtZc Z79WJgcfbVI4KDwFRLP2BAGGrXqoRZGrYxZL13quDiFgFB9D009KsZFckz2Iar7ljMX+ Nz5w5fb7/mavCbOwf90vZxAv3w62E5h6p2onvBfhuZb8SBO2wnUjH5kFISkFSWRvGW5e U6gUSVPxy9SJBmyGQl06txYQqvhWsOJTEz2uteLJmQCxePqcCrzte7W72Rs5yG3JZYEu YT+A== 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=wu1Zf/mFp11ctNj1vtuDSQPYbJ+HL7jrEiQ0KZuFezo=; b=mSP9Yt5ZXM3UErKx79OdSJm2Mvgo3XyCSxWmMfMJAEZiwBi+nmdWvIRUPsxBShri17 u8mF/6Of5G4l2VYKDjZWLprcPszBbCHrGjTCHOCImco5+rJu3CmS45I2FxQ0lXFtkbh2 WUE8aiaohvxdh2Yrgs/mopGf64H3E1V0TXzNwqlUSaLzZPY2UvQ78J4rUqUggoA3aLM4 TyULarbYG6DBb9AnO4YwAhS+xC3IgNCMxAPINIgI/lCVrzJ8AxZtREcAS8Z6qcX6e6aG mtxVEoNBw7Oonh4YnSnvVbrvN9hDC8U7/41OhF3IGUmX6+N9NdG2/TzcRc1j6Bk4zTvX 0oAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=I6D4bF5u; 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.37; Tue, 09 Feb 2021 08:27:38 -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=I6D4bF5u; 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 S232898AbhBIQ1L (ORCPT + 16 others); Tue, 9 Feb 2021 11:27:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232875AbhBIQ0g (ORCPT ); Tue, 9 Feb 2021 11:26:36 -0500 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA9B6C06121C for ; Tue, 9 Feb 2021 08:24:53 -0800 (PST) Received: by mail-wr1-x429.google.com with SMTP id v15so22677718wrx.4 for ; Tue, 09 Feb 2021 08:24:53 -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=wu1Zf/mFp11ctNj1vtuDSQPYbJ+HL7jrEiQ0KZuFezo=; b=I6D4bF5uMxtRWwS0Mn+TavIJ4XVUv7hvagTHG3ISwzJ6D/6d3zSF2mNypBEES4av7Y hJxhwYsGmnnRSERkuFsGkCiLx5/fycwp13gXAiPeBIk1hei6pdyckZMlA6uJFrDbDf91 W8LkGgTZ4DiQekZ6ace+CgTv2aRjSWN0ZpEdtrSHimr51N2xkkBJPRuFSVzPYj4uXYWx l0ubWK1bc+cKKQGXGI329I1xBooi6THHIgW7m4564Le9Jymvvo/OQ10LDX8C/qp25DJM WqQxR+X81bpjX2yOKQonm4dz4rO6rCfsgkNVW427O1s8gWplkQtlmMZLbZvKgDRs7Y8S JUgg== 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=wu1Zf/mFp11ctNj1vtuDSQPYbJ+HL7jrEiQ0KZuFezo=; b=S2oz37+/vJ5N90O6VOikMCWqx2sh3dMvNYe2zQQuEWDde1hQoZLo3ZBV99fw67LjT4 nnJx7guQYlMIsp0i8qA76oF1s+deLNWp2dUeNxPOyZOEa+s+e/YoruSJr/2rmkEi3ACM LT0QvQa7UbmAhpcG8WRHBFYcKs958VK3kyIAZvN+dN6kLkCXhUpAqwgtbgwUb5azSR8A St1jIitDEJv6hkCSoBVuvM6Q0c3KOQVkjeGXIED0BUk3LGsHz4ijEuZo7CX6pGzc6s9t kNIi1UNTlxENRsqH/8z/50xEpzO7VV2KKD0fncyeRrBr4APR3M0aVopKhZpU2vmgavOW Zwtg== X-Gm-Message-State: AOAM533J7G/RHJJQhY6KUW7VRF7WIW4jj9d8RuPL4vKXxN8lhhIbDHOy SOBzpJHenoL5/7p6qP8JMZz6Rg== X-Received: by 2002:a5d:540d:: with SMTP id g13mr12949443wrv.143.1612887892665; Tue, 09 Feb 2021 08:24:52 -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.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Feb 2021 08:24:52 -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 5/5] venus: venc: Add support for CLL and Mastering display controls Date: Tue, 9 Feb 2021 18:24:25 +0200 Message-Id: <20210209162425.3970393-6-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 Create CLL and Mastering display colour volume v4l2 controls for encoder, add handling of HDR10 PQ SEI packet payloads for v4. Signed-off-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/core.h | 2 ++ drivers/media/platform/qcom/venus/hfi_cmds.c | 8 +++++ .../media/platform/qcom/venus/hfi_helper.h | 20 +++++++++++++ drivers/media/platform/qcom/venus/venc.c | 29 +++++++++++++++++++ .../media/platform/qcom/venus/venc_ctrls.c | 16 +++++++++- 5 files changed, 74 insertions(+), 1 deletion(-) -- 2.25.1 diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h index a252ed32cc14..adbcda6e9386 100644 --- a/drivers/media/platform/qcom/venus/core.h +++ b/drivers/media/platform/qcom/venus/core.h @@ -238,6 +238,8 @@ struct venc_controls { } level; u32 base_priority_id; + struct v4l2_ctrl_hdr10_cll_info cll; + struct v4l2_ctrl_hdr10_mastering_display mastering; }; struct venus_buffer { diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.c b/drivers/media/platform/qcom/venus/hfi_cmds.c index 4f7565834469..d2edf3896cf1 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.c +++ b/drivers/media/platform/qcom/venus/hfi_cmds.c @@ -1217,6 +1217,14 @@ pkt_session_set_property_4xx(struct hfi_session_set_property_pkt *pkt, pkt->shdr.hdr.size += sizeof(u32) + sizeof(*info); break; } + case HFI_PROPERTY_PARAM_VENC_HDR10_PQ_SEI: { + struct hfi_hdr10_pq_sei *in = pdata, *hdr10 = prop_data; + + memcpy(hdr10, in, sizeof(*hdr10)); + pkt->shdr.hdr.size += sizeof(u32) + sizeof(*hdr10); + break; + } + case HFI_PROPERTY_CONFIG_VENC_MAX_BITRATE: case HFI_PROPERTY_CONFIG_VDEC_POST_LOOP_DEBLOCKER: case HFI_PROPERTY_PARAM_BUFFER_ALLOC_MODE: diff --git a/drivers/media/platform/qcom/venus/hfi_helper.h b/drivers/media/platform/qcom/venus/hfi_helper.h index 6b524c7cde5f..d32d926c7b2c 100644 --- a/drivers/media/platform/qcom/venus/hfi_helper.h +++ b/drivers/media/platform/qcom/venus/hfi_helper.h @@ -513,6 +513,7 @@ #define HFI_PROPERTY_PARAM_VENC_VPX_ERROR_RESILIENCE_MODE 0x2005029 #define HFI_PROPERTY_PARAM_VENC_HIER_B_MAX_NUM_ENH_LAYER 0x200502c #define HFI_PROPERTY_PARAM_VENC_HIER_P_HYBRID_MODE 0x200502f +#define HFI_PROPERTY_PARAM_VENC_HDR10_PQ_SEI 0x2005036 /* * HFI_PROPERTY_CONFIG_VENC_COMMON_START @@ -809,6 +810,25 @@ struct hfi_ltr_mark { u32 mark_frame; }; +struct hfi_mastering_display_colour_sei_payload { + u32 display_primaries_x[3]; + u32 display_primaries_y[3]; + u32 white_point_x; + u32 white_point_y; + u32 max_display_mastering_luminance; + u32 min_display_mastering_luminance; +}; + +struct hfi_content_light_level_sei_payload { + u32 max_content_light; + u32 max_pic_average_light; +}; + +struct hfi_hdr10_pq_sei { + struct hfi_mastering_display_colour_sei_payload mastering; + struct hfi_content_light_level_sei_payload cll; +}; + struct hfi_framesize { u32 buffer_type; u32 width; diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c index 6976ed553647..192b8c4ef778 100644 --- a/drivers/media/platform/qcom/venus/venc.c +++ b/drivers/media/platform/qcom/venus/venc.c @@ -612,6 +612,35 @@ static int venc_set_properties(struct venus_inst *inst) return ret; } + if (inst->fmt_cap->pixfmt == V4L2_PIX_FMT_HEVC) { + struct hfi_hdr10_pq_sei hdr10; + unsigned int c; + + ptype = HFI_PROPERTY_PARAM_VENC_HDR10_PQ_SEI; + + for (c = 0; c < 3; c++) { + hdr10.mastering.display_primaries_x[c] = + ctr->mastering.display_primaries_x[c]; + hdr10.mastering.display_primaries_y[c] = + ctr->mastering.display_primaries_y[c]; + } + + hdr10.mastering.white_point_x = ctr->mastering.white_point_x; + hdr10.mastering.white_point_y = ctr->mastering.white_point_y; + hdr10.mastering.max_display_mastering_luminance = + ctr->mastering.max_display_mastering_luminance; + hdr10.mastering.min_display_mastering_luminance = + ctr->mastering.min_display_mastering_luminance; + + hdr10.cll.max_content_light = ctr->cll.max_content_light_level; + hdr10.cll.max_pic_average_light = + ctr->cll.max_pic_average_light_level; + + ret = hfi_session_set_property(inst, ptype, &hdr10); + if (ret) + return ret; + } + if (ctr->num_b_frames) { u32 max_num_b_frames = NUM_B_FRAMES_MAX; diff --git a/drivers/media/platform/qcom/venus/venc_ctrls.c b/drivers/media/platform/qcom/venus/venc_ctrls.c index a52b80055173..52ae665f361e 100644 --- a/drivers/media/platform/qcom/venus/venc_ctrls.c +++ b/drivers/media/platform/qcom/venus/venc_ctrls.c @@ -276,6 +276,12 @@ static int venc_op_s_ctrl(struct v4l2_ctrl *ctrl) case V4L2_CID_MPEG_VIDEO_BASELAYER_PRIORITY_ID: ctr->base_priority_id = ctrl->val; break; + case V4L2_CID_COLORIMETRY_HDR10_CLL_INFO: + ctr->cll = *ctrl->p_new.p_hdr10_cll; + break; + case V4L2_CID_COLORIMETRY_HDR10_MASTERING_DISPLAY: + ctr->mastering = *ctrl->p_new.p_hdr10_mastering; + break; default: return -EINVAL; } @@ -291,7 +297,7 @@ int venc_ctrl_init(struct venus_inst *inst) { int ret; - ret = v4l2_ctrl_handler_init(&inst->ctrl_handler, 51); + ret = v4l2_ctrl_handler_init(&inst->ctrl_handler, 53); if (ret) return ret; @@ -498,6 +504,14 @@ int venc_ctrl_init(struct venus_inst *inst) V4L2_CID_MPEG_VIDEO_BASELAYER_PRIORITY_ID, 0, 6, 1, 0); + v4l2_ctrl_new_std_compound(&inst->ctrl_handler, &venc_ctrl_ops, + V4L2_CID_COLORIMETRY_HDR10_CLL_INFO, + v4l2_ctrl_ptr_create(NULL)); + + v4l2_ctrl_new_std_compound(&inst->ctrl_handler, &venc_ctrl_ops, + V4L2_CID_COLORIMETRY_HDR10_MASTERING_DISPLAY, + v4l2_ctrl_ptr_create(NULL)); + ret = inst->ctrl_handler.error; if (ret) goto err;