Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1743204lqa; Mon, 29 Apr 2024 19:14:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW9zkczSFJeOh1d/PnRuPzKdAGZtdIj7/OSirVr4OJOREXTosKp0ERyOMJQVkqnly+tfEh/4l4W/iBrEuzxiNExasNmPYbEwJgBTLwppA== X-Google-Smtp-Source: AGHT+IEVSaObogB/x4eGTaj+z8tHWQKnV7X7AVXjVoMGpPCtrsGrDWqAF0D1QUEt1d+F4GwbLHM+ X-Received: by 2002:a17:906:b7cf:b0:a52:4bde:4999 with SMTP id fy15-20020a170906b7cf00b00a524bde4999mr1207389ejb.31.1714443248598; Mon, 29 Apr 2024 19:14:08 -0700 (PDT) Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id bq7-20020a170906d0c700b00a59066bba98si1487520ejb.377.2024.04.29.19.14.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 19:14:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-163259-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=lX8XA+9x; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-163259-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163259-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 2D3B21F22D34 for ; Tue, 30 Apr 2024 02:14:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 255B4D2E5; Tue, 30 Apr 2024 02:13:56 +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="lX8XA+9x" Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2052.outbound.protection.outlook.com [40.107.7.52]) (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 A70B88BF6; Tue, 30 Apr 2024 02:13:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.7.52 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714443234; cv=fail; b=gvpbwIE/zd0HTVt3wmMwV2UVF7mL3rteWwoPihG/4d1NgXpcHjmpPgKaKYmlH8OAdyhsQZSC9DOolq15BeCClQMnLkFtW4Jn9OEjVQMUsLdWdPKbWU0buPPiavcGBWs098OM7hvbXHj7fra9SRCuXeEIvj7NyE+Fl+QlqwiyQLw= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714443234; c=relaxed/simple; bh=UXrbkQ/u4XM7BCqHDdk9hMz31Id+EKfV5CrIb7KNhPI=; h=Message-ID:Date:Subject:To:Cc:References:From:In-Reply-To: Content-Type:MIME-Version; b=Xa50180ZmQIax/SXCNQ3/+dFewJdkkcBfVuolK56+nJdbQANpp9sVmgI+BIHan1qz6pYq4WK3tcREKB5lfWvmcpPh6JkwMot/zV4dgtpgWa1XKYEiRJfv3MamDtu+8y6sLqiFIP+JVHFog9cuTT2zZ3/5+Zt4/OG1O8cPM6rt6w= 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=lX8XA+9x; arc=fail smtp.client-ip=40.107.7.52 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=JmvuW579JHM6UazSVxAHNXSVkoQ56c65c/MDUq3XCtk8vuPa5j80VPUBbTwgkgi53irFTxnqkfMRBZQCh40U5VCHaW3RD5jECAMtRi8oMNbOxPxSIcU5pn5EiSCDA0rnf0lF8Ln5U5k9rYbRx1XV098atOozPMZUE6KmnkwMSRNx2gyhvOs4B0fMIejIvimmLkQIY9cfNHBTfsp/185CYVix97b/0A6UpbhIAoEx+zlzukU5a4I6WDimEcdBATcKrohtWn3y8tIqYL25YnbKu7ba8TXjJi7PtEhB444zanFmvYNpAHq/JNdIyAXtTFfSl5nQM2k/gROhX5DYlxDucQ== 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=r7Gx3+ATZ/wJJB3BPRygNld5XHLVp1p1ajZk3USx8To=; b=htW9EHansiVyS3LdrTp1w0U9M8DJCFQXoa/1QUDO2xZajvv4rK9pV2SzDaDyMguseBMFku7o5NBcAOwV4utIMouKSe7dHQtlggN6EZYj9ZYuo4yEXtX5erdo7g4homhOmhJzlk4vxZY3fe2Il5Dvdwy6ETGRdglKvnzmnSadV/MNBaImIKdhcXwd7SDMT+205JrouT3u5J6WH4eaMlGS53d4V07NIUc0SaOP+nmdHfAbQ/WJZ8DUAYo3ZI5ELfQP3zie6BYwl0qnJPK77larKneHV2gBLsxJxv8wJlfXlKzsJ5Qqa69v5vwc0nQsOR+f1oLDv0Fdm8XvbVM9iEZuHQ== 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=r7Gx3+ATZ/wJJB3BPRygNld5XHLVp1p1ajZk3USx8To=; b=lX8XA+9xhhWl75iLxQL6tYvL+/JEf92C88o2fDmSCGi6gJ0pCLyocpxuQgNOLDZVo5Dy4uKkMth4Jwz3k2bMRxNd5Yvjj+jt8qHtY9Ekr+4KRsjfBPA0Iuw+yfN9+yTLJWFLWejhwgIr143d1RTnhitJqJZV4KWq9PM4dEojABQ= 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 VE1PR04MB7296.eurprd04.prod.outlook.com (2603:10a6:800:1aa::13) 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 02:13:48 +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 02:13:48 +0000 Message-ID: <383b6e30-1266-4db1-9c5d-10db7ab17957@oss.nxp.com> Date: Tue, 30 Apr 2024 10:20:03 +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> 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: AM0PR04CA0032.eurprd04.prod.outlook.com (2603:10a6:208:122::45) 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_|VE1PR04MB7296:EE_ X-MS-Office365-Filtering-Correlation-Id: 1e13990b-6417-44f8-4c74-08dc68bb2bad 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|366007|376005|7416005|1800799015; X-Microsoft-Antispam-Message-Info: =?utf-8?B?VER3UTNwWXNnSTdPRWxCMnQyMFR5OHNJRG9BSENvdjlLTHo5b2d1MC9nZ3dw?= =?utf-8?B?QksreGZ1QmF4ZUlVeUJyK3NtaXdNVGVFakk3ekZodEVtdnJNQUxyUExDamg4?= =?utf-8?B?VlloZXcyQmxkY0gxNDlFZkJmMWNUZkRjQTVjeVFyaUVoOGRoK1dEenpqc1RJ?= =?utf-8?B?c09hV0JGa3hZWjNZYWZYQWtCMU9BdEsyeHdBZkVuZWhUM3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UNqRnZmZGE1cCt3TllvbzNIWkZMY2p1VFNjZVRN?= =?utf-8?B?RWwwSVQ3OVVmOTUrYkFsOFREd1JsdTUyOGhsUXBaMENVekJ6WWYwci9LUG5M?= =?utf-8?B?RTh1UkFXNUtxTHo5VVU2bHY5UWRvZE5hNDJ1bHVXb0VCTGNTakVJck85bHRF?= =?utf-8?B?YnRpU1V4SDhqKytNbllDWThQSS8wdXQ2ZTFkQXNINzIwY09QaUpOWFBjVytt?= =?utf-8?B?OWVjNHBjcDBvdGRLTVYrdHpOc0hQOGp1WGxwakpsblZCenVZNm9ZZDlqRkMz?= =?utf-8?B?elRZSGM4QzhDbXlXdTlvKzQ1bE1ZYS9oMTJDMytIUjY3aVJkWVcxMDE0WDV1?= =?utf-8?B?RVhPUEJzQURoWEYwTjFIVnh4NVo4ZU5mOHZZMFF4ZTlFRE8zY0NjTWNqV2Yr?= =?utf-8?B?ajg4OEY1b3pDSFpQYWlRQlpQT3pHM2JOT2pFbG13SVVyUm5zSDlEVkdyZ3Av?= =?utf-8?B?dWxTV2ZZckRCS1FWOVd1OU5nMHRacFQvbEdZZ0lHR1ZodWsrajdqZkVkbHpO?= =?utf-8?B?bTVHZjZSLzNNQ1dsRkZ4b1FPaFY5NzNXR09VWisvS0dXYVBpc1hRMTNsRVM2?= =?utf-8?B?RUJBUlRRWjlUU2NKL2V5Y2xhWjJtaFI2TjEwRTdlMWdaNEdGWlJETnpRPT0=?= 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)(366007)(376005)(7416005)(1800799015);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?YXdrMDdFMWlOWmYxOGZ2K0F0YUhOY3VtNUNURUdkVFA4TkJmclNIUElsSklm?= =?utf-8?B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tFenZhZTFZTC9XdmVCT3dFdEZY?= =?utf-8?B?enZJczhmYXE0SVMwOUIyeHpERERCMWduVzJ5cmo2SWdFL0pTSjNEVHhUb25n?= =?utf-8?B?MThUN3plR0VmTWljVDZBSDdyQVU4ME1FN3p2VnYwVllMTUxzdlBuUjJzNG94?= =?utf-8?B?aUFsTkNZbHoyTEVUaG5qejJlZUptRjhkZkM4VERCTkVVM0lwSXFraEU0SThs?= =?utf-8?B?bWJEeURNL2twNTArcWJWSFgzanVYODk2MWs3Tkg5Uk1aSjdVYVpPVjBZY2Np?= =?utf-8?Q?DMdCo//qcJ9o1UBT51OEdYHyA?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1e13990b-6417-44f8-4c74-08dc68bb2bad X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8254.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Apr 2024 02:13:48.3749 (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: EWS9UpKknbuydlratJ3kSiydvZLCvQJD3QjgH66qnV8leu8X+W53IUItwkQMea///JbQpoUCG+3lwIaa4lWP9g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7296 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. 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) >