Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp625027imm; Fri, 8 Jun 2018 02:31:12 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKPftvgAGiVZ5kGqHgH1UISfa5dSruDki16v05Ym3TeolfiZLyq7uNXh+DXT/ug4/RNpOP8 X-Received: by 2002:aa7:8589:: with SMTP id w9-v6mr5285920pfn.119.1528450272359; Fri, 08 Jun 2018 02:31:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528450272; cv=none; d=google.com; s=arc-20160816; b=k+0EIpE1shYK2SFcufmS75Ap7QClbKtEB2vBkjlwiEu0pHJCyo7i8zBWD3NXLgEXJL qbAYnU9/KOw/ykndrMIBQWjcX7bn7jSQlPdQQnxVtInG/v8jgr3q1Usj75qoJdLP2PRo Lk0+Cwdswf5LkcHVP+cTMxaeJyLu/tuiwFBXPaN89i03VmEQtMG2tySwYBlbt7k1Cy2y FwfsXdT/tJxMTuVrg4V1ocE0kuWVRHXnk6cp5yv6PiOHvUD+L3LnPs2U9c+5hI3VMddC 7NEMA1ZZhUBRw9MBe9bbwlCNqp3eB+lyjD6+iPnFZLETkD7Xaeo7rSYd7jRfjV4OMzdN OWvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=TdLo/ISjOr1AVxJA+loKylmUEZtQzulslx2vv1eug8E=; b=iHlCEGZGA9pgs/Cmm5JyQVuO1kpPFetdTc3NsG+fMEIRx17Ky3tGTk/FTfv/uMytc/ tIg2ODAHpZ420T7eppKT+Jaefxw4mTx0paLQCbA3ZNKJoBuKvKcX3Z84O6HsBS1WNWdN 31eTSc1hTffiE0F7HUPfrlNjVhI5gAAM1g0g+6XLnwcRYQ6RaxmAMM0oj/Z7yH10e/np /Y/Aevp5y3cnK8E2Au+72EXiXDbVbFNdz08ZstoPIFlbJlaheFKg76xMMLPrpqZekbkT COdd108LjhcIlhh0Ej/wc7CgZq8+NENxp20VXAoVK4u31jUiQTwb1K4EJLrjvQ2ouq+p S3UQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p4-v6si16518901pfg.329.2018.06.08.02.30.57; Fri, 08 Jun 2018 02:31:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752610AbeFHJ3q (ORCPT + 99 others); Fri, 8 Jun 2018 05:29:46 -0400 Received: from lb2-smtp-cloud9.xs4all.net ([194.109.24.26]:49336 "EHLO lb2-smtp-cloud9.xs4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751072AbeFHJ3b (ORCPT ); Fri, 8 Jun 2018 05:29:31 -0400 Received: from [192.168.2.10] ([212.251.195.8]) by smtp-cloud9.xs4all.net with ESMTPA id RDi2fnw0XtLaARDi5fy0XA; Fri, 08 Jun 2018 11:29:30 +0200 Subject: Re: [PATCH v2 1/2] media: v4l2-ctrl: Add control for VP9 profile To: Keiichi Watanabe , linux-arm-kernel@lists.infradead.org Cc: Mauro Carvalho Chehab , Tiffany Lin , Andrew-CT Chen , Matthias Brugger , Sakari Ailus , Sylwester Nawrocki , Smitha T Murthy , Tom Saeger , Andy Shevchenko , Tomasz Figa , Ricardo Ribalda Delgado , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, Stanimir Varbanov References: <20180530071613.125768-1-keiichiw@chromium.org> <20180530071613.125768-2-keiichiw@chromium.org> From: Hans Verkuil Message-ID: Date: Fri, 8 Jun 2018 11:29:25 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20180530071613.125768-2-keiichiw@chromium.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4wfGNkpPPY5AGW3xHYdYJguB+6QdcJ5f9jkXJQSchlJOckF5Lte9klcAXHm4SZipXJNqDx6RUAwi10a5DYffEXzu9OzNrVzL0tP415+HZe5SGNlKDuluMW eJFJhWcS9tJsQt0yKfy848QGXeIa+AKzl44jxL1o5wI9Md2fYp1v4siJbrbHKpzvHfV2u/T2Xyjuln2772hwKjphB3Of556h8FZnOou7rCIM1kzIm+pVvVrq 9Ms+a8Prg1IB3MhD2cj6hnQEghY8bJ2KTgn35x+nHM4pCzwzoK+aqQbeF9NL2hdT/eKsJQMYCmLLfeEfqLZck6Cz/SloRec7FZjKjg4s4q7UOqyc0QhXfbtv ri/0WOU82EFJ+qlnMxZEel9qttfsFbRjgkpA7afbEu0zC2Otx1ASG7osxGb+QUmOVOWeWG0OJZZk1Paf+ozJx0dxXdnfkB4oVw+xjmoC4K3wrH+SZJ/RPVbk M7juHQFqdpK8b1rjLZ1/BpghS4HVB1PknQ7eF6jqXg8kPRWa+pviEHM1DXdmtDUjPJBfKOPrAQR8FpKOlXrCLY9ZQ8prQmJa6SY+GDHMQOt+bXxKBDLEsAMd bl/oLUdduPt4TCWUstxjC8KemTfcAW18p/yEPHfP9dNv4PxZtkSdcI3BePOtetYxVwhYnBawABMQ0VJ96iSxvWsfTqk61WgNp5XTMhfIiQiYQA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/30/2018 09:16 AM, Keiichi Watanabe wrote: > Add a new control V4L2_CID_MPEG_VIDEO_VP9_PROFILE for selecting desired > profile for VP9 encoder and querying for supported profiles by VP9 encoder > or decoder. > > An existing control V4L2_CID_MPEG_VIDEO_VPX_PROFILE cannot be > used for querying since it is not a menu control but an integer > control, which cannot return an arbitrary set of supported profiles. > > The new control V4L2_CID_MPEG_VIDEO_VP9_PROFILE is a menu control as > with controls for other codec profiles. (e.g. H264) Please ignore my reply to patch 2/2. I looked at this a bit more and what you should do is to change the type of V4L2_CID_MPEG_VIDEO_VPX_PROFILE to enum. All other codec profile controls are all enums, so the fact that VPX_PROFILE isn't is a bug. Changing the type should not cause any problems since the same control value is used when you set the control. Sylwester: I see that s5p-mfc uses this control, but it is explicitly added as an integer type control, so the s5p-mfc driver should not be affected by changing the type of this control. Stanimir: this will slightly change the venus driver, but since it is a very recent driver I think we can get away with changing the core type of the VPX_PROFILE control. I think that's better than ending up with two controls that do the same thing. Regards, Hans > > Signed-off-by: Keiichi Watanabe > --- > .../media/uapi/v4l/extended-controls.rst | 26 +++++++++++++++++++ > drivers/media/v4l2-core/v4l2-ctrls.c | 12 +++++++++ > include/uapi/linux/v4l2-controls.h | 8 ++++++ > 3 files changed, 46 insertions(+) > > diff --git a/Documentation/media/uapi/v4l/extended-controls.rst b/Documentation/media/uapi/v4l/extended-controls.rst > index 03931f9b1285..4f7f128a4998 100644 > --- a/Documentation/media/uapi/v4l/extended-controls.rst > +++ b/Documentation/media/uapi/v4l/extended-controls.rst > @@ -1959,6 +1959,32 @@ enum v4l2_vp8_golden_frame_sel - > Select the desired profile for VPx encoder. Acceptable values are 0, > 1, 2 and 3 corresponding to encoder profiles 0, 1, 2 and 3. > > +.. _v4l2-mpeg-video-vp9-profile: > + > +``V4L2_CID_MPEG_VIDEO_VP9_PROFILE`` > + (enum) > + > +enum v4l2_mpeg_video_vp9_profile - > + This control allows to select the profile for VP9 encoder. > + This is also used to enumerate supported profiles by VP9 encoder or decoder. > + Possible values are: > + > + > + > +.. flat-table:: > + :header-rows: 0 > + :stub-columns: 0 > + > + * - ``V4L2_MPEG_VIDEO_VP9_PROFILE_0`` > + - Profile 0 > + * - ``V4L2_MPEG_VIDEO_VP9_PROFILE_1`` > + - Profile 1 > + * - ``V4L2_MPEG_VIDEO_VP9_PROFILE_2`` > + - Profile 2 > + * - ``V4L2_MPEG_VIDEO_VP9_PROFILE_3`` > + - Profile 3 > + > + > > High Efficiency Video Coding (HEVC/H.265) Control Reference > ----------------------------------------------------------- > diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c > index d29e45516eb7..401ce21c2e63 100644 > --- a/drivers/media/v4l2-core/v4l2-ctrls.c > +++ b/drivers/media/v4l2-core/v4l2-ctrls.c > @@ -431,6 +431,13 @@ const char * const *v4l2_ctrl_get_menu(u32 id) > "Use Previous Specific Frame", > NULL, > }; > + static const char * const vp9_profile[] = { > + "0", > + "1", > + "2", > + "3", > + NULL, > + }; > > static const char * const flash_led_mode[] = { > "Off", > @@ -614,6 +621,8 @@ const char * const *v4l2_ctrl_get_menu(u32 id) > return mpeg4_profile; > case V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_SEL: > return vpx_golden_frame_sel; > + case V4L2_CID_MPEG_VIDEO_VP9_PROFILE: > + return vp9_profile; > case V4L2_CID_JPEG_CHROMA_SUBSAMPLING: > return jpeg_chroma_subsampling; > case V4L2_CID_DV_TX_MODE: > @@ -841,6 +850,8 @@ const char *v4l2_ctrl_get_name(u32 id) > case V4L2_CID_MPEG_VIDEO_VPX_P_FRAME_QP: return "VPX P-Frame QP Value"; > case V4L2_CID_MPEG_VIDEO_VPX_PROFILE: return "VPX Profile"; > > + case V4L2_CID_MPEG_VIDEO_VP9_PROFILE: return "VP9 Profile"; > + > /* HEVC controls */ > case V4L2_CID_MPEG_VIDEO_HEVC_I_FRAME_QP: return "HEVC I-Frame QP Value"; > case V4L2_CID_MPEG_VIDEO_HEVC_P_FRAME_QP: return "HEVC P-Frame QP Value"; > @@ -1180,6 +1191,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type, > case V4L2_CID_DEINTERLACING_MODE: > case V4L2_CID_TUNE_DEEMPHASIS: > case V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_SEL: > + case V4L2_CID_MPEG_VIDEO_VP9_PROFILE: > case V4L2_CID_DETECT_MD_MODE: > case V4L2_CID_MPEG_VIDEO_HEVC_PROFILE: > case V4L2_CID_MPEG_VIDEO_HEVC_LEVEL: > diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h > index 8d473c979b61..56203b7b715c 100644 > --- a/include/uapi/linux/v4l2-controls.h > +++ b/include/uapi/linux/v4l2-controls.h > @@ -589,6 +589,14 @@ enum v4l2_vp8_golden_frame_sel { > #define V4L2_CID_MPEG_VIDEO_VPX_P_FRAME_QP (V4L2_CID_MPEG_BASE+510) > #define V4L2_CID_MPEG_VIDEO_VPX_PROFILE (V4L2_CID_MPEG_BASE+511) > > +#define V4L2_CID_MPEG_VIDEO_VP9_PROFILE (V4L2_CID_MPEG_BASE+512) > +enum v4l2_mpeg_video_vp9_profile { > + V4L2_MPEG_VIDEO_VP9_PROFILE_0 = 0, > + V4L2_MPEG_VIDEO_VP9_PROFILE_1 = 1, > + V4L2_MPEG_VIDEO_VP9_PROFILE_2 = 2, > + V4L2_MPEG_VIDEO_VP9_PROFILE_3 = 3, > +}; > + > /* CIDs for HEVC encoding. */ > > #define V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP (V4L2_CID_MPEG_BASE + 600) > -- > 2.17.0.921.gf22659ad46-goog >