Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1876113lqa; Tue, 30 Apr 2024 01:37:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX4B8XFDOLnn0nSqsQCrpTIi4rUZ6Rd68eu+3m1UpDagW21ykGf6uTkDHTmzvaKhIxsGx4Cj508SdI9DNyTXXnukUm4CCRxyubsH6NOug== X-Google-Smtp-Source: AGHT+IHcKPlBFplLd3cgVGasvFTklW0VThaekzfb/zZiw7Kh/pkgECwTh9ZBBPrBJp8HVHhwlAtU X-Received: by 2002:a17:902:8202:b0:1e5:562d:425b with SMTP id x2-20020a170902820200b001e5562d425bmr11743088pln.22.1714466268973; Tue, 30 Apr 2024 01:37:48 -0700 (PDT) Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id z9-20020a170902d54900b001ec2c2393dcsi1364765plf.647.2024.04.30.01.37.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 01:37:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-163548-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=db+rGjmJ; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-163548-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163548-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id C5064284E4A for ; Tue, 30 Apr 2024 08:37:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 44616127E30; Tue, 30 Apr 2024 08:37:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="db+rGjmJ" Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on2085.outbound.protection.outlook.com [40.107.8.85]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B2F7A127B77; Tue, 30 Apr 2024 08:37:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.8.85 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714466251; cv=fail; b=hERsyyQtEh0NUUB16XTl4QnGYV7r2SIpvJjqTJ5/MZkTCxl0qcSmlWgZk6IXLKVOJy+OUIN1/T7TV17FzL+0gxNzwQtWgzCpXjGN38fCPkY90glRgR9FDQD0JCtfqRH+6CGJTfAg4xdNcW0EUkW81Px0Ev2xy4RJvSZtKhX5QJg= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714466251; c=relaxed/simple; bh=UjlzGIoREkBEkzNdoJLhKxVWeiZbQH3xpd/ax7ACe/Y=; h=Message-ID:Date:Subject:To:Cc:References:From:In-Reply-To: Content-Type:MIME-Version; b=Gw+uNmTfa3zoxraUwTiVyAZWXlxJYsS4vzUstDhmUpecx0NkUgv5p9taywv88pGk3XIv1frXSTgmvDOe9Jt2iUcm3o605CfxThHWfpc9m6WXAQCq8TjlpKF0OqIZ1HNy1vZlxBtewNqf1sXhRq3YHlCS7yMEhFpgLGFszFACl9I= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com; spf=pass smtp.mailfrom=oss.nxp.com; dkim=pass (1024-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b=db+rGjmJ; arc=fail smtp.client-ip=40.107.8.85 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UrCe7kUIxjN8OiMIfv/ugsWeSgFaK3MBUw/e+ytP5z+cUDfjzI0H7LmaAnuaxMoxkTbv44Ro2C3M9WOrgynnzQMDhr+lrznGpHDrTF9zG2E/erualUJXSl40diTZrmxIiXPKbV44bG80koct/3ir3PWpxYOYbHEojqCu51Ajzfeor1a2oewgm7AMtnr7FuDQUU98DHqCJFSuwZcD3r7ZyxNWpkqRsjlkdYN2MU+XK/11zOHwExPlyZ/yi7cnltIkgGqNDHs1n3wgsT6pjLYPyp56lJRj5G4ctTZ0ZI6FQJ9xOsJVCeEQ1LyIgkZU1PDZz0l/mKVwLijx6vFgI/yzvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=xc65M1gJYltW12CM0JT3ob4bHCkLeG+ISdOD3LP8hj0=; b=ecogX6y0s6nkiXEL3mMWl6tFOAoSFCtgM0WeRceeJmHoAJU6iHWBbNOk9Ijq1Pk27rVY/j+M+p/tOKlEbdwyilW6ZWwvnljDKjMUCFdIpqcJqbZaNDbHZRzfCRjz6xNRtCc4I34O49aV8enC+jMeh/kqnF+z1jv6fFpfU6EhDLRz3FZRB6eTAxhuXzyZcsTLo+SCKIOPkxaD+GjWUUvwVoqVsY3TGfun7GOcGi5guoOg0Jen66gLi3vkqC9o9bj2wBTeEU1TfIUXqj8DDYluDgsM68EEFkk50rM3sRkT8LHWzNeux37U48XX4zWye7kYe/Y5AQmaBdKUWnJOxbqTwA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xc65M1gJYltW12CM0JT3ob4bHCkLeG+ISdOD3LP8hj0=; b=db+rGjmJSRUREOZRtbVYo6UVdsMe0f/NFwTTusRsuV+LhRMuuwzVv+KO7WeiZQ0Q0kDbmyHK1a6cljd7/CdMVR8YF6A4NfV5pFFVr6OTkoMBYCb8PVwDWwdAXE05EaJ2HqGTa1q1bUYgQLsw15slZo881JEUpL1LQihzo1ChyPg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from PAXPR04MB8254.eurprd04.prod.outlook.com (2603:10a6:102:1cd::24) by GV1PR04MB10241.eurprd04.prod.outlook.com (2603:10a6:150:1a4::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.36; Tue, 30 Apr 2024 08:37:23 +0000 Received: from PAXPR04MB8254.eurprd04.prod.outlook.com ([fe80::8589:eb00:ecf3:b4ca]) by PAXPR04MB8254.eurprd04.prod.outlook.com ([fe80::8589:eb00:ecf3:b4ca%6]) with mapi id 15.20.7519.035; Tue, 30 Apr 2024 08:37:23 +0000 Message-ID: Date: Tue, 30 Apr 2024 16:43:39 +0800 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 1/3] media: v4l2-ctrls: Add average qp control To: Andrzej Pietrasiewicz , Ming Qian , mchehab@kernel.org, hverkuil-cisco@xs4all.nl Cc: shawnguo@kernel.org, robh+dt@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, xiahong.bao@nxp.com, eagle.zhou@nxp.com, tao.jiang_2@nxp.com, imx@lists.linux.dev, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <20240425065011.105915-1-ming.qian@nxp.com> <383b6e30-1266-4db1-9c5d-10db7ab17957@oss.nxp.com> Content-Language: en-US From: ming qian In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: AM0PR03CA0008.eurprd03.prod.outlook.com (2603:10a6:208:14::21) To PAXPR04MB8254.eurprd04.prod.outlook.com (2603:10a6:102:1cd::24) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8254:EE_|GV1PR04MB10241:EE_ X-MS-Office365-Filtering-Correlation-Id: 06087668-b0f7-44c6-989b-08dc68f0c1a0 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|7416005|1800799015|366007|376005; X-Microsoft-Antispam-Message-Info: =?utf-8?B?VE5OdzZib20rUDRoczY1VEhoYVBML0N3ZFNsWUIrM0FvdGpXYytNakNjRkdY?= =?utf-8?B?U2VnWVpZYUIvYnd3cGY2UjFJdW5aaVV0WGsvdWFndmdSem1QY05aZ25BZ0dZ?= =?utf-8?B?YzNRMU0rejNReW9KbEhuaUJXUCtXcDByRlRQWTZvTFpWSUdhUStjSWRCWGlP?= =?utf-8?B?eUFiVmRKL1E3Vkxxdjk0ajhPakk4T3F6TnRSQTF5TGx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zUGR2WVZ6U1ZZVnZnbjZWaFZsOVlzc2pT?= =?utf-8?B?RUFpWjZ4NkpEZjdkSTJuZXQ4am9iT3JXclVteFpKZk40RHRqcTk4U3RsOU1p?= =?utf-8?B?cW1hbjltUW1mbEhLTzlhRHNNcWRtNCt6bjE2amZpcGtxYnNOS21ndHgzbWpD?= =?utf-8?B?MTdZSnZwaldSU0dsNzlHZTBMSnFyMkVQTmxEeTZsQk1KMXJSZzd2VzV4YzRk?= =?utf-8?B?eTlIbVFLdkVvQUU0aHUvRVlIcFZlL24zbm9xZkRneDZoU0xWbVpLR3N3WjVa?= =?utf-8?B?VFBVbXA0M3NVTnJZN1R6WklQMGJHWU8vZlJmWTRGblRHRmNUYjlyaUx1blNz?= =?utf-8?B?ek9oV0k1VDF4cjZvL1ZXdUdwNzFlajdIMlRYM3d0ZytTS2d1S0Mva3VPQmda?= =?utf-8?B?Q2I4Zjl5cDdmSEV3TmQ4Q0k5VEdCYUg2MnVIbURLMEFYYkNVRzk2by9JMDl2?= =?utf-8?B?blRRWjY0RHNqb2pHODd6dXRTS2swclFlMG10Rk8zakFURWhmRDBGWUoxMm1a?= =?utf-8?B?cWc1UE5sT0ZrOGhKaXJtZG1EWmp6SFBiUkQ1NWNqNDdsVUVKcUpFUDQxbm1S?= =?utf-8?B?SUFWaG1IMXhRK0g0Z1hMOTJ3SUFLQWdOOGRkZ1NCOXZzOHhBaFd2WGpRPT0=?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB8254.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(7416005)(1800799015)(366007)(376005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?NzhweTJ1WjZxN3lkakhzdGhNaTcrcXFOZEV5OGRNbUFLa1hBSWNUSzJyZCtS?= =?utf-8?B?T3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UVhxQmJhZksx?= =?utf-8?B?VWZCdWdJSVA3SUpmYmJURTN3ZFI2ZExHbHlITnlFeDh0MFBZd2dnQ203VE1F?= =?utf-8?B?bi9jV1UrU1FLNFNzZnNpR2RoeDRmdzl1L3ZYNXJxdkloeWpEVmNoTHkrdWtN?= =?utf-8?B?MUpjYktsWDRmNEQwS0ZTUlo4bk9RdFBqcnRDelZqS1NhMUN3S2FUMDkvc2hn?= =?utf-8?B?NVB4ZnJXY2hFQkllZmszTWcwbnl0OThIdktNcGEwYndidzdoa1hodFlSN3RI?= =?utf-8?Q?uMD4f2uLyANfqP//9vfwhTmHu?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 06087668-b0f7-44c6-989b-08dc68f0c1a0 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8254.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Apr 2024 08:37:23.2743 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: fp/ErYY9KaHZR5cY0mZ/xTghvyQGSQwo05FFXQHJiWv+sky5MYIR/b4d3wihCWa2qC3BaWWzm++Dv4oPeggJvQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR04MB10241 Hi Andrzej, > Hi Ming, > > W dniu 30.04.2024 o 04:20, ming qian pisze: >> >> Hi Andrzej, >> >>> Hi Ming Qian, >>> >>> W dniu 25.04.2024 o 08:50, Ming Qian pisze: >>>> Add a control V4L2_CID_MPEG_VIDEO_AVERAGE_QP to report the average qp >>>> value of current encoded frame. the value applies to the last dequeued >>>> capture buffer. >>>> >>>> Signed-off-by: Ming Qian >>>> --- >>>> v2 >>>> - improve document description according Hans's comments >>>> - drop volatile flag >>>> >>>> Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst | 5 +++++ >>>> drivers/media/v4l2-core/v4l2-ctrls-defs.c | 5 +++++ >>>> include/uapi/linux/v4l2-controls.h | 2 ++ >>>> 3 files changed, 12 insertions(+) >>>> >>>> diff --git >>>> a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst >>>> b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst >>>> index 2a165ae063fb..7d82ab14b8ba 100644 >>>> --- a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst >>>> +++ b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst >>>> @@ -1653,6 +1653,11 @@ enum >>>> v4l2_mpeg_video_h264_hierarchical_coding_type - >>>> Quantization parameter for a P frame for FWHT. Valid range: >>>> from 1 >>>> to 31. >>>> +``V4L2_CID_MPEG_VIDEO_AVERAGE_QP (integer)`` >>>> + This read-only control returns the average QP value of the >>>> currently >>>> + encoded frame. The value applies to the last dequeued capture >>>> buffer >>>> + (VIDIOC_DQBUF). Applicable to encoders. >>>> + >>> >>> What is the intended range of the values? And why? Is your intention >>> to make it >>> a hardware-agnostic control or a hardware-specific control? >>> >>> Regrds, >>> >>> Andrzej >>> >> >> The value range depends on the format, >> For H264, it's [V4L2_CID_MPEG_VIDEO_H264_MIN_QP, >> V4L2_CID_MPEG_VIDEO_H264_MIN_QP], >> usually this is [0, 51]. >> For HEVC, it's [V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP, >> V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP], >> usually it's from 0 to 51 for 8 bit and from 0 to 63 for 10 bit. >> For H263 and MPEG4, it may be from 1 to 31. >> For VPX, it may be from 1 to 128. >> >> I think the driver that supports this ctrl can set an appropriate value >> range based on the format it supports. >> >> Users also need to read the value of this ctrl according to the format >> they set. > > What happens if the user does not set the format or until they set it? > > This looks like a contextual control, where the context is a cross > product between setting or not setting the format and which particular > format is actually set. > > I don't want to voice strong opinions about whether this should or > should not be accepted, but this kind of behavior should definitely > be documented so that driver writers know how to implement this control. > Right now reading the documentation in the *.rst file as a driver writer > I would be puzzled. So, from a driver writer's perspective I'd expect > these additions to the doc: > > - the range of returned values > - the expected behavior when format has not been set > - the expected behavior when no frames have been processed yet (so > there's no QP > to be read back from the hardware) > > Regards, > > Andrzej > The ctrl value only applies to the last dequeued capture buffer. It requires that the format has been set and the streaming has been started. Before that, the value is meaningless, and the driver can set a default value by itself. I agree that it's better to add the value range description in the document, but as discussed above, it's not a fixed value, maybe I can add some description according to format. Best regards, Ming >> >> Best regards, >> Ming >> >>>> .. raw:: latex >>>> \normalsize >>>> diff --git a/drivers/media/v4l2-core/v4l2-ctrls-defs.c >>>> b/drivers/media/v4l2-core/v4l2-ctrls-defs.c >>>> index 8696eb1cdd61..1ea52011247a 100644 >>>> --- a/drivers/media/v4l2-core/v4l2-ctrls-defs.c >>>> +++ b/drivers/media/v4l2-core/v4l2-ctrls-defs.c >>>> @@ -970,6 +970,7 @@ const char *v4l2_ctrl_get_name(u32 id) >>>> case V4L2_CID_MPEG_VIDEO_LTR_COUNT: return "LTR >>>> Count"; >>>> case V4L2_CID_MPEG_VIDEO_FRAME_LTR_INDEX: return "Frame >>>> LTR Index"; >>>> case V4L2_CID_MPEG_VIDEO_USE_LTR_FRAMES: return "Use >>>> LTR Frames"; >>>> + case V4L2_CID_MPEG_VIDEO_AVERAGE_QP: return "Average >>>> QP Value"; >>>> case V4L2_CID_FWHT_I_FRAME_QP: return "FWHT >>>> I-Frame QP Value"; >>>> case V4L2_CID_FWHT_P_FRAME_QP: return "FWHT >>>> P-Frame QP Value"; >>>> @@ -1507,6 +1508,10 @@ void v4l2_ctrl_fill(u32 id, const char >>>> **name, enum v4l2_ctrl_type *type, >>>> *max = 0xffffffffffffLL; >>>> *step = 1; >>>> break; >>>> + case V4L2_CID_MPEG_VIDEO_AVERAGE_QP: >>>> + *type = V4L2_CTRL_TYPE_INTEGER; >>>> + *flags |= V4L2_CTRL_FLAG_READ_ONLY; >>>> + break; >>>> case V4L2_CID_PIXEL_RATE: >>>> *type = V4L2_CTRL_TYPE_INTEGER64; >>>> *flags |= V4L2_CTRL_FLAG_READ_ONLY; >>>> diff --git a/include/uapi/linux/v4l2-controls.h >>>> b/include/uapi/linux/v4l2-controls.h >>>> index 99c3f5e99da7..974fd254e573 100644 >>>> --- a/include/uapi/linux/v4l2-controls.h >>>> +++ b/include/uapi/linux/v4l2-controls.h >>>> @@ -898,6 +898,8 @@ enum v4l2_mpeg_video_av1_level { >>>> V4L2_MPEG_VIDEO_AV1_LEVEL_7_3 = 23 >>>> }; >>>> +#define V4L2_CID_MPEG_VIDEO_AVERAGE_QP (V4L2_CID_CODEC_BASE + 657) >>>> + >>>> /* MPEG-class control IDs specific to the CX2341x driver as >>>> defined by V4L2 */ >>>> #define V4L2_CID_CODEC_CX2341X_BASE (V4L2_CTRL_CLASS_CODEC | 0x1000) >>>> #define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE >>>> (V4L2_CID_CODEC_CX2341X_BASE+0) >>> >