Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp943049pxp; Wed, 16 Mar 2022 22:07:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMxbEs9JMXzCKgohO61ftCPOWptzL8EgBuj6FUm7SjLBH2JKGup6IQKUuy1eu1MtwVhT3a X-Received: by 2002:a63:1c58:0:b0:380:bfd8:9e10 with SMTP id c24-20020a631c58000000b00380bfd89e10mr2338949pgm.422.1647493656918; Wed, 16 Mar 2022 22:07:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647493656; cv=none; d=google.com; s=arc-20160816; b=DJ3+t059jdFD04bY/sgR7gx0nTyKn1L9y//ZQ225L6SEjC7NAyoIcOf+f6IGFSk0PQ 50uZXlXUe1SvWSR2E708o2ubCEw4rWVJOjwvAl1ravs1mHmA45IIYAmG631y880Rga0n 3J/GGxtc5eXxC10cvtqugChQTgRV+1EpXYvqCqiBGkLMqW1j1mZhvucD0e8eGNrCcDX4 qf2P7anWjTJQy1S0SHF3dWrff3huzZn4XilrV+g0YMfqWB/ERkx0O3UtnZkxia9bCvMX 6UrMKY123Sz9uvjpiqVo/JRHP1tLxki5jYu5CxFN13VZH54X3S7UAg1Bj2kIhqkzXA6K tkKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=Pmz8F5ODVxduy9IG9GdTPQb2WNGo5VKviw3f5KMySu0=; b=Ny1/9vcQb/7XqMOX+aXsmpx59PlfGhDB6QmNhtTDBWTWfwjmNeH3q6AO+0etr6Qkeu PFDcvoRrllbtUszzNJveZU7E8lsGHzv6p8Fut9bple1OTCX5v76GgmIiZXGxdZ4+hVJr S4Ju27oEnc0kAaI9XMExNAMdN9LzgfmYzcQdSN2wirsSoVyCGgUq4uh8VaTNymPmDsSa s+Y1F2nw3czFcuAoUJy1hc2bAcWGYOQh7CQB4r2aKjJm0rXz+DigYWqFujEqj6rjpzHx fEdi91mmDmNBtU2rybBZ2W5kc1WvcduvRBbPh9WLpmN+BqleN56mfBvsaFA6u0IFiMBO S8wg== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xs4all.nl Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id t16-20020a170902b21000b0014b6c885ebfsi3317821plr.234.2022.03.16.22.07.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 22:07:36 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xs4all.nl Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 18C031B98A6; Wed, 16 Mar 2022 21:19:02 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238543AbiCNK3P (ORCPT + 99 others); Mon, 14 Mar 2022 06:29:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238533AbiCNK3M (ORCPT ); Mon, 14 Mar 2022 06:29:12 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 19C4C3C4AB; Mon, 14 Mar 2022 03:28:02 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id AAF4560F40; Mon, 14 Mar 2022 10:27:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 71863C340E9; Mon, 14 Mar 2022 10:27:43 +0000 (UTC) Message-ID: <9f9d3bcf-6adc-c6c4-663d-0bdabc8adb67@xs4all.nl> Date: Mon, 14 Mar 2022 11:27:41 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCH v4 1/2] media: v4l2-ctrls: Add intra-refresh type control Content-Language: en-US To: quic_dikshita@quicinc.com, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: linux-arm-msm@vger.kernel.org, ezequiel@collabora.com, stanimir.varbanov@linaro.org, quic_vgarodia@quicinc.com, quic_majja@quicinc.com, quic_jdas@quicinc.com References: <1647252574-30451-1-git-send-email-quic_dikshita@quicinc.com> <1647252574-30451-2-git-send-email-quic_dikshita@quicinc.com> From: Hans Verkuil In-Reply-To: <1647252574-30451-2-git-send-email-quic_dikshita@quicinc.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/14/22 11:09, quic_dikshita@quicinc.com wrote: > From: Dikshita Agarwal > > Add a control to set intra-refresh type. > > Signed-off-by: Dikshita Agarwal > Reviewed-by: Nicolas Dufresne > --- > .../userspace-api/media/v4l/ext-ctrls-codec.rst | 22 ++++++++++++++++++++++ > drivers/media/v4l2-core/v4l2-ctrls-defs.c | 9 +++++++++ > include/uapi/linux/v4l2-controls.h | 5 +++++ > 3 files changed, 36 insertions(+) > > diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst > index 4cd7c54..1539cd5 100644 > --- a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst > +++ b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst > @@ -1180,6 +1180,28 @@ enum v4l2_mpeg_video_h264_entropy_mode - > is set to non zero value. > Applicable to H264, H263 and MPEG4 encoder. > > +``V4L2_CID_MPEG_VIDEO_INTRA_REFRESH_PERIOD_TYPE (enum)`` > + > +enum v4l2_mpeg_video_intra_refresh_period_type - > + Sets the type of intra refresh. The period to refresh > + the whole frame is specified by V4L2_CID_MPEG_VIDEO_INTRA_REFRESH_PERIOD. > + Note that if this control is not present, then it is undefined what > + refresh type is used and it is up to the drive to decide. drive -> driver > + Applicable to H264 and HEVC encoders. Possible values are: > + > +.. tabularcolumns:: |p{9.6cm}|p{7.9cm}| > + > +.. flat-table:: > + :header-rows: 0 > + :stub-columns: 0 > + > + * - ``V4L2_MPEG_VIDEO_INTRA_REFRESH_PERIOD_TYPE_RANDOM`` > + - The whole frame is completely refreshed randomly > + after the specified period. > + * - ``V4L2_MPEG_VIDEO_INTRA_REFRESH_PERIOD_TYPE_CYCLIC`` > + - The whole frame MBs are completely refreshed in cyclic order > + after the specified period. > + > ``V4L2_CID_MPEG_VIDEO_INTRA_REFRESH_PERIOD (integer)`` > Intra macroblock refresh period. This sets the period to refresh > the whole frame. In other words, this defines the number of frames > diff --git a/drivers/media/v4l2-core/v4l2-ctrls-defs.c b/drivers/media/v4l2-core/v4l2-ctrls-defs.c > index 54ca4e6..3089e50 100644 > --- a/drivers/media/v4l2-core/v4l2-ctrls-defs.c > +++ b/drivers/media/v4l2-core/v4l2-ctrls-defs.c > @@ -572,6 +572,11 @@ const char * const *v4l2_ctrl_get_menu(u32 id) > "VBV/CPB Limit", > NULL, > }; > + static const char * const intra_refresh_period_type[] = { > + "Random", > + "Cyclic", > + NULL, > + }; > > switch (id) { > case V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ: > @@ -705,6 +710,8 @@ const char * const *v4l2_ctrl_get_menu(u32 id) > return hevc_start_code; > case V4L2_CID_CAMERA_ORIENTATION: > return camera_orientation; > + case V4L2_CID_MPEG_VIDEO_INTRA_REFRESH_PERIOD_TYPE: > + return intra_refresh_period_type; > default: > return NULL; > } > @@ -834,6 +841,7 @@ const char *v4l2_ctrl_get_name(u32 id) > case V4L2_CID_MPEG_VIDEO_DECODER_SLICE_INTERFACE: return "Decoder Slice Interface"; > case V4L2_CID_MPEG_VIDEO_DECODER_MPEG4_DEBLOCK_FILTER: return "MPEG4 Loop Filter Enable"; > case V4L2_CID_MPEG_VIDEO_CYCLIC_INTRA_REFRESH_MB: return "Number of Intra Refresh MBs"; > + case V4L2_CID_MPEG_VIDEO_INTRA_REFRESH_PERIOD_TYPE: return "Intra Refresh Priod Type"; Priod -> Period > case V4L2_CID_MPEG_VIDEO_INTRA_REFRESH_PERIOD: return "Intra Refresh Period"; > case V4L2_CID_MPEG_VIDEO_FRAME_RC_ENABLE: return "Frame Level Rate Control Enable"; > case V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE: return "H264 MB Level Rate Control"; > @@ -1360,6 +1368,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type, > case V4L2_CID_STATELESS_H264_DECODE_MODE: > case V4L2_CID_STATELESS_H264_START_CODE: > case V4L2_CID_CAMERA_ORIENTATION: > + case V4L2_CID_MPEG_VIDEO_INTRA_REFRESH_PERIOD_TYPE: > *type = V4L2_CTRL_TYPE_MENU; > break; > case V4L2_CID_LINK_FREQ: > diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h > index c8e0f84..e7df4c5 100644 > --- a/include/uapi/linux/v4l2-controls.h > +++ b/include/uapi/linux/v4l2-controls.h > @@ -443,6 +443,11 @@ enum v4l2_mpeg_video_multi_slice_mode { > #define V4L2_CID_MPEG_VIDEO_USE_LTR_FRAMES (V4L2_CID_CODEC_BASE+234) > #define V4L2_CID_MPEG_VIDEO_DEC_CONCEAL_COLOR (V4L2_CID_CODEC_BASE+235) > #define V4L2_CID_MPEG_VIDEO_INTRA_REFRESH_PERIOD (V4L2_CID_CODEC_BASE+236) > +#define V4L2_CID_MPEG_VIDEO_INTRA_REFRESH_PERIOD_TYPE (V4L2_CID_CODEC_BASE+237) > +enum v4l2_mpeg_video_intra_refresh_period_type { > + V4L2_CID_MPEG_VIDEO_INTRA_REFRESH_PERIOD_TYPE_RANDOM = 0, > + V4L2_CID_MPEG_VIDEO_INTRA_REFRESH_PERIOD_TYPE_CYCLIC = 1, > +}; > > /* CIDs for the MPEG-2 Part 2 (H.262) codec */ > #define V4L2_CID_MPEG_VIDEO_MPEG2_LEVEL (V4L2_CID_CODEC_BASE+270) After fixing these two typos you can add my: Acked-by: Hans Verkuil I assume that Stanimir will merge this together with patch 2/2. Regards, Hans