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 From patchwork Tue Mar 23 13:40:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 406881 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp4464430jai; Tue, 23 Mar 2021 06:41:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3b8QBLL3uWB7lc69O7G79gtPwAJbVG7PuT1LGMsb0XxJAP6oBKTUkRH3Wb99EfNH6xQ8t X-Received: by 2002:aa7:c6da:: with SMTP id b26mr4761864eds.254.1616506901039; 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=Inh2FeXCvtitC5TIctpGV4hC+BQ4xTpwkGEDGHAH4GqhwELEZHawyyyU3WZ/Ou3+F8 VwNeoKJrbEgo0Zp3sB1EtI8GZQx+J2jaNsMAMsSstTiDhr4BmdJrDO2XmzQ4OP4fevuO QiTdsSBi9lX5YuHrT5qL+d/7n7REIIgQQGP0KGE5z+32G5K/w8aeak24KnuDJtGfMkbS 4akPFG1BcxhKXSgWqMi7g1ZYoK8hAAlIatrUybiyYJcEycdBUr55xCWUeJhm0e3XiMel iA5q6IkDYgrgfSOrUkXa4pPzPthNatRB+HvceL7WDJB75yYC79YvwLuuzYPeRNh4Qvdr 8BVg== 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=1Dh8Wzu8kVq+/wNWGF7WLux54WatKazjsRYvC0lfLjg=; b=SORU35fUWnhlCdz2yJ3FhYogIDD/E++tyMdV7horHJzLauFLe8kYLtK2IN/vGlvnqV plXJibL9izbV0jzBaGLZHHtX5YgWAsickXTVkbeFmNWSh4L4hIA425g8VYCINzCSg2vK rjRXBWGSFroHSBXT7EwogSjODfSCFnf45NVF7nMWFVuOP6ylNncWqZeH8tw7E28Zg3ox jHpOs7/43FkA0b0qtmOGQ3N2StZEF5x8jD6Jgw39R8bfjDh5Py8Uwzi4udxyQrSoAL73 zXH48DKs4N1b/3GRr7vkGGu0Oj9z0kMrgO2nJmWcoMGOoiVqLjnVA5Eevv75DflVrSQ0 LZeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UcOizWiB; 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.40; 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=UcOizWiB; 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 S231152AbhCWNlJ (ORCPT + 17 others); Tue, 23 Mar 2021 09:41:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231627AbhCWNk6 (ORCPT ); Tue, 23 Mar 2021 09:40:58 -0400 Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FB14C061763 for ; Tue, 23 Mar 2021 06:40:57 -0700 (PDT) Received: by mail-ej1-x630.google.com with SMTP id u5so27167946ejn.8 for ; Tue, 23 Mar 2021 06:40:57 -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=1Dh8Wzu8kVq+/wNWGF7WLux54WatKazjsRYvC0lfLjg=; b=UcOizWiBt0Aa8UBzGS9dnt74F83HWzTX3vxSrX/wIRebamGz4BrbMxPq8k3UyleY41 JEtukybV3OF1bUgVFnmF2akQQ1jSTsmdsmhPWPzk6QqOvKp8IEM0UhvI37dSTts2MqNr qSb2waumwU9GdELkguv9sY9t+RTiLqj22T6ENj4mtGuv8rVXcGW2kqDGTWk5PlykpLwH iW+JL8SL50XkGRffY7DuIyWXICb0hjUxhBYMplOocuzOdUuGhgqmQLrXbs4sJXA4oROX wPt7QSjZ8FbhJyYkyfb07dfHDYgsMXRR8rl8n7PByEK94yUjCEAdr0aeDo8tpdzL8NP/ areg== 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=1Dh8Wzu8kVq+/wNWGF7WLux54WatKazjsRYvC0lfLjg=; b=pO8zzkj3TJvv8vdL3lB7laOwvJ0yfSHWy6pl+gAtcCnhQsY5FujVLlRPPkwIsQoCy+ fTDDvWW09wQZAtnU+kYbGUDN0x/BeccTwjspKFZCoqoGwAk7fbRAdjJjTfrmhNPlsoR/ hTl6MC/yg7F4pOTwVEfO/2z+zpT9Ep0oSGvW7h5IIusVbSPa2JaNfSSkSvhSDxB5onpz 1aHmwTyMr82fp7CDiFg2FAfwnG4t7+n4vwfcFjCcU2lpEnTupPkKbOg7rPzvOerHAk8U MoqNeyulwxiZGHX9QOQptNHE16Lu4mV8c1EBkdVDuib/Y3aQxZHO0QZR/zYx9LYylfln qvlw== X-Gm-Message-State: AOAM533sikmRkdeu+eX2Qrrqw0ypu69ogw+YvYhG6EMzdFx/ZwKQeE3a iUSgCWMxNwTGUkW8j8sAJ2dJoNmcJLrYcud/ X-Received: by 2002:a17:906:eda3:: with SMTP id sa3mr4965869ejb.147.1616506856297; Tue, 23 Mar 2021 06:40:56 -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.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Mar 2021 06:40:56 -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 2/5] docs: Document colorimetry class Date: Tue, 23 Mar 2021 15:40:37 +0200 Message-Id: <20210323134040.943757-3-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 a document for ext control colorimetry class. Signed-off-by: Stanimir Varbanov Reviewed-by: Hans Verkuil --- .../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 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 01773f01c4a7..15291be55299 100644 --- a/Documentation/userspace-api/media/v4l/vidioc-g-ext-ctrls.rst +++ b/Documentation/userspace-api/media/v4l/vidioc-g-ext-ctrls.rst @@ -404,6 +404,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 Mar 23 13:40:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 406884 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp4464466jai; Tue, 23 Mar 2021 06:41:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOKYh5H2YiIRhVnoc7vG/8g7N/g41jWaH3Tf2zibD+yR3g0AQRolY3K56lJJc3I8k9Ui/N X-Received: by 2002:a17:906:8308:: with SMTP id j8mr4825649ejx.339.1616506903429; Tue, 23 Mar 2021 06:41:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616506903; cv=none; d=google.com; s=arc-20160816; b=aFx4/sWf6cchYhlfBcpBo4nH+XZDgdkQvVXydwXt7hg8XMRzfUZ/MhAjzok8o1AMPS /p1gUpH5Y5Pmq2Vz1nQXd4p8hNSWlLW5Ge4u19ryFfNSlwqMxDzhpVqGTC1IFEGayoU2 nMx8fG25XIJuoqC/J6iJf0pz6EWxVxH7U/a+2cTq2P7JXpvEcMoPyvEJ8DVjqhkPJJtV 829EjmQdpduQrfh3/UaofkiNFA0RxIiwhRKMiN9qAwm7skhv2zYlvbMraSyejj5cVfse XZMk0YfWXL9oq33GAYlO+BUDWAEktAu/nDk3faMtHBWoudKNOQQwKkWv0eqqKY1QgVsq BNDQ== 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=6G+TQj9/qOTQhvcW+oHW6J6wM8+8za0JtehJLRJFECA=; b=KNIwF+NUZRf62nnqaTqY+qq3vxyEHbyrLxz1AcBm+M1oQnTIQI+7nwqkcYhAEcA6II 13bHa5tz4nJc7QTQRCf8gry7LOIC8XC2iQ3CPn2MKADpzaQd2vS1LJvaLnu9k0CGzBm1 2+N1a3gCpVlT5YWWhS/VWoqxMk+n1cu7xkopHafhG0Tv8TJizYu5zC49mEmCrNY/mN8R OvpzCZOHz4lVLAFgrq6ZIFISlZHCDD3MDeSTDBoLwEK0qWrhhZotvQ3c7NvcDqd7WPla SCbGGotij6CjPiw92dgJbLxcHcBihvFF6AEaWUCD7vAiYmWYXmAgB4fnRjXWIFN/8Wrg KixQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Dky9rPoY; 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.43; Tue, 23 Mar 2021 06:41:43 -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=Dky9rPoY; 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 S231646AbhCWNlJ (ORCPT + 17 others); Tue, 23 Mar 2021 09:41:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231631AbhCWNk6 (ORCPT ); Tue, 23 Mar 2021 09:40:58 -0400 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58CA1C061765 for ; Tue, 23 Mar 2021 06:40:58 -0700 (PDT) Received: by mail-ed1-x536.google.com with SMTP id bf3so23521852edb.6 for ; Tue, 23 Mar 2021 06:40:58 -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=6G+TQj9/qOTQhvcW+oHW6J6wM8+8za0JtehJLRJFECA=; b=Dky9rPoYb77CnmyG0aXh1EVDWiLWidRdbfqAjEfm8APOBYCmOw9DgChSPFp59spZJH UYv3cvAqwx2EfO6CuktftNiJIanIAKWeLsyYcFuIDX06qRIKgg0MgXPShuBHDyUSoece M/m0sqwTUN6b12Ty6+QtdHJPTZOKbqDoyyEAly9WF2Y6blCK0uLQnoMvqxKy08dl9xYI Jx7PfK6IU6GlSKVd3kOkehAZwjljIK5dm6HaHI66XNNKum3jyFFYPpFk/NQO8eOtXbh2 wz8kHloV4Q5QuiuBu5yf6AoN3ntCPUooJCunATMzN4IE5LHWoWqu5ML6+d2kzaOkCCga aa8g== 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=6G+TQj9/qOTQhvcW+oHW6J6wM8+8za0JtehJLRJFECA=; b=UOpGysZUL6G32CSrcp6PLrXvJFiItZvQDy40oZCdAta5CUXX6E0ReMO0fkOIXQ8dEI 0ILcH4vun3O1OBrOuG8NRvZ2YPhJNxM4kbmCU3AihZhGH0iu0mTnAIJDaWbGJB14WlFw OeyNegZ21OYp7mBSk5RCMPJ5STA5JedXQL0AaG9vmj52XjG4gNYAEVogHYJu7uOBuz1X we2q9tsGW9IsETxk+ypyCQZoGAT/YJU8GRPM6SqpOVcylgOjKsMGT0XI/S9+AT+y1x/g gFy6hSeE9YjrLVZC3RmftCFeS80awuzOkZSmoxX3I7OyGE02yX0H02FG3r8SOyTZDkcm itig== X-Gm-Message-State: AOAM531yCZLAQF5QNJLff1HZOZWoVQhxUi6zKqshJYXDW77nNEmpprqn ZCmsc+jBqXQvDUTDJS3bur30UA== X-Received: by 2002:a05:6402:5113:: with SMTP id m19mr4815636edd.78.1616506857079; Tue, 23 Mar 2021 06:40:57 -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.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Mar 2021 06:40:56 -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 3/5] v4l: Add HDR10 static metadata controls Date: Tue, 23 Mar 2021 15:40:38 +0200 Message-Id: <20210323134040.943757-4-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 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 | 68 ++++++++++++++++++++++++++++ include/media/v4l2-ctrls.h | 4 ++ include/uapi/linux/v4l2-controls.h | 31 +++++++++++++ include/uapi/linux/videodev2.h | 3 ++ 4 files changed, 106 insertions(+) -- 2.25.1 diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c index 41ded74c6764..4e825569a167 100644 --- a/drivers/media/v4l2-core/v4l2-ctrls.c +++ b/drivers/media/v4l2-core/v4l2-ctrls.c @@ -1208,6 +1208,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; } @@ -1497,6 +1499,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; @@ -1792,6 +1800,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; @@ -1844,6 +1858,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; @@ -2139,6 +2154,53 @@ 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; + + /* The following restriction comes from ITU-T Rec. H.265 spec */ + 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) @@ -2832,6 +2894,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 038c722ca4d2..8cc8cd27936f 100644 --- a/include/uapi/linux/v4l2-controls.h +++ b/include/uapi/linux/v4l2-controls.h @@ -1665,6 +1665,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 Mar 23 13:40:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 406886 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp4464495jai; Tue, 23 Mar 2021 06:41:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxIZS6zSsRP4pGGXPjsciHzuTjJdbnsWUfFPM+KYF4ku0FpvolkNdxL8idCiQV386FSuA+2 X-Received: by 2002:a17:906:c08f:: with SMTP id f15mr5077929ejz.318.1616506905358; Tue, 23 Mar 2021 06:41:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616506905; cv=none; d=google.com; s=arc-20160816; b=plD00LGTDXcfyECbdua1b0iFD/SbBP1KZjbXwWg6wnG++fcmKOKuI3SEuTpti+keiT OpexP4VSGNR6iDyf1PcS1ZpiDVWYtGdRnhQ85Y6qsi2wbktd82BilBaZhzHnr6Q+RhD+ se5akJohHojIknmkMo23xav14n6OBNo1lNAeGeKamDNwKaquHQn/1bUyilK/LoUVvhL2 KOmYG/En7a0KzbxWhz9m18ilJkHFZLAP3iPa/JGOs/n1jE+z0hF9noxEbmvEJH11Vyv0 e23MRbreFxaO9WymsSqz9g9lCdfMpBNhDX4hawxb54jpQhfFzy2CvLueYJSF+QwBeo1R RIOg== 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=VmfOlnNHDrGmLQHATXfl48zw4SyfIPyue1iLUvZyyls=; b=IYUvAGmz0AiwEdDHoOupjDa0CqpjoW3opO/+xzZK+w9S5MESsQwRezL8KlhrWZR6u9 k4FNPFC/HaSbjyU0528/L9XBVXuL2jcXGA0V7Y2EG4+5aNQCMZRZKc5LXFwtgTg0bxV9 WkXme2exYx1LP7tWwgnC5nByAj88y4xmPm0Wk7x7IahQCkjivVlzWhK4vAwnzx9sVzHV NToZjmb47OdMBv8XRtMxryLXdL8PJNS7wl+lce2VRRyZt5fbIGM1fCh2m4BtQAztSw3K XCnMuUtDmkjoNoVYiyEDU+xLZvlthyJcQhUcUTdXSsLgK+TyMYfc4BVkEprQHh2ha4Or Gg5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Zb9/PTYV"; 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.45; Tue, 23 Mar 2021 06:41:45 -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="Zb9/PTYV"; 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 S231653AbhCWNlK (ORCPT + 17 others); Tue, 23 Mar 2021 09:41:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231634AbhCWNk7 (ORCPT ); Tue, 23 Mar 2021 09:40:59 -0400 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52E19C061764 for ; Tue, 23 Mar 2021 06:40:59 -0700 (PDT) Received: by mail-ej1-x62d.google.com with SMTP id u21so9193528ejo.13 for ; Tue, 23 Mar 2021 06:40:59 -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=VmfOlnNHDrGmLQHATXfl48zw4SyfIPyue1iLUvZyyls=; b=Zb9/PTYVhs5fxyf2gd6VaeTMSPY0eS6j2Gzri/xH+FwcEyvVTS1w3AEVklOwZoUHXR mNU0AQddCuTDzUKVRTp3pH0NxrFzGweO/alaO2gWa+XrzlG+H/YGWxEUUJjT60MJXcWZ HmvxBQQsf9X7sZtTc8xhG1JnOAzrUlzf3bRwQ3NvQG5zwhpR94VOPaAM4+gAHPRqXJP9 AhJ1VrgovS0E7yqQPdrdHON6MsCOuBa7Iq431lTkrZqCnzRYlrQliaX3nQVnrUCMVLHn lXzm2wDMkyKEoUCd8MgmrgKv3RsQ64niL4cFq1f7RLPtUEnxr2L263Lr3BScn7zIwhL3 dbzw== 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=VmfOlnNHDrGmLQHATXfl48zw4SyfIPyue1iLUvZyyls=; b=TAmDvs8kz0Nj2tUruwvu1cv7CAfyWlTHOODH9AS/M2RkCzx9A0/3ms/vaCfjLFAZsz qpNVRy7N/X+4zqfy4T3sd78s0RK7VYZQsO6wiztG4ZjIiABLOtf6f3ZbpzWsQryqkRdz AvgWDurS9grLwfn4hOBm3BEDiudEcH6laidkGnb5bpciWWztsWYQvecKQwLVZyGCU89k Gc4voEtQp/ZzrZd9O9kWONYiXkVyB2htFVD09PDoalmslNOxj+2/nKCh0nBVENZ+neQb +a6vJQNFqp7xiU7uMpzAKloHzvVN6IV9nU4Z20BfnPqDg7DrBHFeIieFnq71MwpcTSu/ b5wQ== X-Gm-Message-State: AOAM533ArFgN02AasG0b5zpIZHrVvcmg3wZ+8MXVCnRF9lC3WHDWEp3a R15XzpdgSC65kL6HGDc0KKGYvA== X-Received: by 2002:a17:906:4bce:: with SMTP id x14mr4854113ejv.383.1616506858010; Tue, 23 Mar 2021 06:40:58 -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.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Mar 2021 06:40:57 -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 4/5] docs: Document CLL and Mastering display colorimetry controls Date: Tue, 23 Mar 2021 15:40:39 +0200 Message-Id: <20210323134040.943757-5-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 Document Content Light Level and Mastering Display v4l2 colorimetry controls. Signed-off-by: Stanimir Varbanov Reviewed-by: Hans Verkuil --- .../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 diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-colorimetry.rst b/Documentation/userspace-api/media/v4l/ext-ctrls-colorimetry.rst index 862f78b41b32..1e7265155715 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 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 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 15291be55299..f8847abd2766 100644 --- a/Documentation/userspace-api/media/v4l/vidioc-g-ext-ctrls.rst +++ b/Documentation/userspace-api/media/v4l/vidioc-g-ext-ctrls.rst @@ -216,6 +216,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 Mar 23 13:40:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 406885 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp4464486jai; Tue, 23 Mar 2021 06:41:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy1YbCgVE39MF2vs29VLI5szg4d4ejrNpyTQ7fwSs/BVJX5QYqDhA2qlEUo2lv54B/DIH+V X-Received: by 2002:a17:906:4d96:: with SMTP id s22mr4967646eju.189.1616506904874; Tue, 23 Mar 2021 06:41:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616506904; cv=none; d=google.com; s=arc-20160816; b=TOYUGlF+Aw4QUf93CSJaPYXlhjeBEuC3lQWvzbbKQakcNMpq/22dJtH0XxUYhT8hXR cQ8vzlLaNBjqYjFwOYLHKVjucwaFwSEf67CC48zs8mJS4ykeSPlvfw28fqb+Q76hcJ31 jyGhbPgOA5S+nKtN70HpEl5tM1GlpoeDcmX3N7Ot9b/bG+d4fPO/OgLElLg6O/ap6VW/ 9E3EDOh1uF6yvPesV143HGQLMNeqLBB+wDCFS9bvByh0OYAHlefJh59vtgPHDAGkBXlv HOC9QmqI5oajWDKcUwz4dlm9vQsYtfcHlhTus9uo7DdaeeCKVIoeuecSGdbEtqzNlLCV 9/lQ== 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=54fMzulxyHOS7Wa5z7A+h/N7/JoxoBYIy5OqkE1tzqE=; b=sZR5HfJhLNciKaJ9DRZH1gZjWwv9DoaOFsURVnOXVis7nnUe6OIr2Y2j4GXA/6TKtb AjOvtamNeWjpUm/UU5bStZratk8X0apcraBPNLR/X88/Hrw8mLoaVDQ6cmX+N4A4r0YX rUgzITd5YNPqwjNfkHterTYZIefrskljs8ULzBMGHVUAl0AgfRqAEKx5MPbt8LElDeSh Q7/tn9KB8qELq2LmAVUMxYA9x7d2f5QEIu97RRFS0EnhB/P+zjBHPcpdDvtV2f/K2hLt tqTSxAcUH/C0t7v96tqrB5Y/K9VSgaTHdOnUIpAx+gGvoMxGpfi777jnCJ2NwqEQahzq xkHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NYMIcABA; 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.44; Tue, 23 Mar 2021 06:41:44 -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=NYMIcABA; 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 S231288AbhCWNlK (ORCPT + 17 others); Tue, 23 Mar 2021 09:41:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231638AbhCWNlA (ORCPT ); Tue, 23 Mar 2021 09:41:00 -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 EEFC7C0613D8 for ; Tue, 23 Mar 2021 06:40:59 -0700 (PDT) Received: by mail-ed1-x52e.google.com with SMTP id y6so23520876eds.1 for ; Tue, 23 Mar 2021 06:40:59 -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=54fMzulxyHOS7Wa5z7A+h/N7/JoxoBYIy5OqkE1tzqE=; b=NYMIcABAAx9hRWPA5aVHH0/o4nUfU0gfso2WoxLyWfu/VeQfkotYP349F+UvXrfqlz pSfmcd4tpv/93FHMEHPhUp/hpyE4iUE8jSAuGr4D+B566YpMp9U7Yc9oygTTo7fQBq39 hQ0Gj/ZALlp310s+9+G0tMApmHSlBEHwibpMZjlLI9oycHMbs+NnlPBzsMNctF4A9lcN PzxYCMEN6OnmHqkdMxE7BZrpfdw5VNnhBJ/mnvb/MeTEJCGHo2y0XLXwn7V6IS7A+pvZ 2gAEBBr8dS/b+0qo0isYgM2ccDhYe9CnrxKhTXCAsTNQNOkd5gxNJjayOH2sMIMFXl8f CUTw== 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=54fMzulxyHOS7Wa5z7A+h/N7/JoxoBYIy5OqkE1tzqE=; b=mf5CHKy6tlwqjz6Vg9kHPdppP/M2hA83bR/BVT8ThrR5k/glnfsQYffwAVi/ANqqOA 2xXwvmSOMBPAvDg/MJIOtzvBvplENPDFkw+P9v0mLE2IBGTFhWQ3XElNkC3y4oDOxvw9 QJN7g4xND2TiWstLkxe+w74sdFjzBxfMFQVqMnwQw7BD7kN4ksSK9fXj2M1Cxj1Qgdtm 3HWvHHPxagPJTy3LPs9T7+45ZQQ5cI606uEzVohV14+BvCOdiOpd6GO5TdyZhYuXVJmQ 19hgaa8vZAF+txX6/QuWkv8CTuE4AycrkRySgy+tyomKB9bIjNrLaCMG8g3aO/JzueJO L0VA== X-Gm-Message-State: AOAM531cvovJN0m4pEWU2sXI95wSrvVIfBNwbFc/Tbnw1GiOrzScAPil zApTurA+iE7Nk1RgfCvfHXpe2MzR4wNrlM0k X-Received: by 2002:a05:6402:549:: with SMTP id i9mr4746720edx.379.1616506858726; Tue, 23 Mar 2021 06:40:58 -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.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Mar 2021 06:40:58 -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 5/5] venus: venc: Add support for CLL and Mastering display controls Date: Tue, 23 Mar 2021 15:40:40 +0200 Message-Id: <20210323134040.943757-6-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 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 13c18c49714d..029f620a28ff 100644 --- a/drivers/media/platform/qcom/venus/core.h +++ b/drivers/media/platform/qcom/venus/core.h @@ -241,6 +241,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 505d092dc433..855761c01276 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 16d6c64d5f64..8a7cf6960811 100644 --- a/drivers/media/platform/qcom/venus/venc_ctrls.c +++ b/drivers/media/platform/qcom/venus/venc_ctrls.c @@ -279,6 +279,12 @@ static int venc_op_s_ctrl(struct v4l2_ctrl *ctrl) case V4L2_CID_MPEG_VIDEO_AU_DELIMITER: ctr->aud_enable = 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; } @@ -294,7 +300,7 @@ int venc_ctrl_init(struct venus_inst *inst) { int ret; - ret = v4l2_ctrl_handler_init(&inst->ctrl_handler, 52); + ret = v4l2_ctrl_handler_init(&inst->ctrl_handler, 54); if (ret) return ret; @@ -504,6 +510,14 @@ int venc_ctrl_init(struct venus_inst *inst) v4l2_ctrl_new_std(&inst->ctrl_handler, &venc_ctrl_ops, V4L2_CID_MPEG_VIDEO_AU_DELIMITER, 0, 1, 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;