From patchwork Mon Jun 18 07:58:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keiichi Watanabe X-Patchwork-Id: 10469503 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8B534600CC for ; Mon, 18 Jun 2018 08:01:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7F852286BF for ; Mon, 18 Jun 2018 08:01:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 73C8B28923; Mon, 18 Jun 2018 08:01:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 07836286BF for ; Mon, 18 Jun 2018 08:01:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=D9/k1Na8oVeOtaS28jrUEYWeDl3AevjSRmwgfPKzmWg=; b=JuhVJ+//sffnp2v8xgWGVQyCkY HG1xV0zb2JgYvz++8MWfztx+Z1FewwtSArysZi26kiSTg3Fslcc1Sjd2sNn54AA/UUlxmGNWcyybS 7bm5j3GiqmeSECZ4437esYsduAThA4Gt9SxUBJKgoKxbFd20TIq+2QMB0G9KZ46Y/PgcNgVyiws6/ Z94ZMjEo14utG3kkbY8zecyW63hKXI4hOWMQn5EJoeOe8AxBfGEAnJuSbXpuwjpSW21cMet3ypudu uKtzOo/ZQQNtc7u6TGGMHw/7AeDcUz7Hfx2grrfJ2WKfrsr8r4HIwTBPdvjI+n3yiEw0naDDm4i99 a5YA0lPA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fUp6I-0001Vb-Ro for patchwork-linux-mediatek@patchwork.kernel.org; Mon, 18 Jun 2018 08:01:22 +0000 Received: from mail-pf0-x242.google.com ([2607:f8b0:400e:c00::242]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fUp5r-0001CO-Cq for linux-mediatek@lists.infradead.org; Mon, 18 Jun 2018 08:01:02 +0000 Received: by mail-pf0-x242.google.com with SMTP id b74-v6so7753806pfl.5 for ; Mon, 18 Jun 2018 01:00:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=iR0+fncgsvec2AyQI/2lSDZMuD4M3894EfDJS7wDM5o=; b=Br9a5Hic65qyQ8Pxx7CRrlcbDSEH3lis9ksIIo+ztvdUYaG/z+f4+xkQNUr3xJFkb9 slqP64cyU2LwhxFfBLoOns3GDfJTey1nSXitBIGsc4v8bL9DsCfm7n8ptNzjaUhOBcNW +TsAVtltQCIarp5VW8Hy8lt7FmDFdaTC7Obvw= 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; bh=iR0+fncgsvec2AyQI/2lSDZMuD4M3894EfDJS7wDM5o=; b=VrV3JlyPzKx8Xv4Zgt/hYLsW/hhERHNsYDaFdJC0YPLu6UxCdUlcJdsn+BxgclTnZK AkwBRlfaLAHeazi37b7q455rIOZmK86im4SUjHl49V4tXr+1YZvFg40urIwby4KRb/PY Lqq/6GrugbqzI1GPe4QpkoNYNgLoz0hTSKn/K4PGMT/MPj8Zd1KupVKyk+vl17FRsiJ0 3qWapgjfF5/aOXWByGNC1RMms0M14m8Af27hBNMKz3QezGVcMKNOBne68L0N2XGFDf2y sg1Q1l9ZyxVhzXy//IqOz9DLUAEgUuUtdphbCY4H5Yi52Ypb5mCF11Lv1KH+vLwykLto KxtQ== X-Gm-Message-State: APt69E0X48LSYlrfsSH3P4eAEWKXh5PkQ/1R4RuDe0usZeBzjK1giwxE kfAbnRnHCU++VMt0ysEQo9axsA== X-Google-Smtp-Source: ADUXVKJgYDxuyu13GJWCSDGJkrM8D7VpwNcTNnNrL3H/ebZm4cXa9y8X0ALL3e9z4GO8NRH1sjQ2Gw== X-Received: by 2002:a65:4985:: with SMTP id r5-v6mr10078680pgs.110.1529308851636; Mon, 18 Jun 2018 01:00:51 -0700 (PDT) Received: from keiichiw1.tok.corp.google.com ([2401:fa00:4:4:968c:de0d:27a3:4bef]) by smtp.gmail.com with ESMTPSA id d9-v6sm23543236pfg.183.2018.06.18.01.00.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Jun 2018 01:00:50 -0700 (PDT) From: Keiichi Watanabe To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v4 2/3] media: v4l2-ctrl: Add control for VP9 profile Date: Mon, 18 Jun 2018 16:58:53 +0900 Message-Id: <20180618075854.12881-3-keiichiw@chromium.org> X-Mailer: git-send-email 2.18.0.rc1.244.gcf134e6275-goog In-Reply-To: <20180618075854.12881-1-keiichiw@chromium.org> References: <20180618075854.12881-1-keiichiw@chromium.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180618_010055_466083_9C451D4A X-CRM114-Status: GOOD ( 12.23 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew-CT Chen , Tom Saeger , Stanimir Varbanov , Hans Verkuil , Andrzej Hajda , Sylwester Nawrocki , Ricardo Ribalda Delgado , Andy Shevchenko , Keiichi Watanabe , linux-arm-msm@vger.kernel.org, linux-media@vger.kernel.org, Smitha T Murthy , Mauro Carvalho Chehab , Kamil Debski , Jeongtae Park , linux-mediatek@lists.infradead.org, Matthias Brugger , Tiffany Lin , linux-kernel@vger.kernel.org, Tomasz Figa , Kyungmin Park , Sakari Ailus MIME-Version: 1.0 Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add a new control V4L2_CID_MPEG_VIDEO_VP9_PROFILE for VP9 profiles. This control allows selecting the desired profile for VP9 encoder and querying for supported profiles by VP9 encoder/decoder. Though this control is similar to V4L2_CID_MPEG_VIDEO_VP8_PROFILE, we need to separate this control from it because supported profiles usually differ between VP8 and VP9. Signed-off-by: Keiichi Watanabe --- .../media/uapi/v4l/extended-controls.rst | 23 +++++++++++++++++++ drivers/media/v4l2-core/v4l2-ctrls.c | 11 +++++++++ include/uapi/linux/v4l2-controls.h | 7 ++++++ 3 files changed, 41 insertions(+) -- 2.18.0.rc1.244.gcf134e6275-goog diff --git a/Documentation/media/uapi/v4l/extended-controls.rst b/Documentation/media/uapi/v4l/extended-controls.rst index 01ef31a934b4..9f7312bf3365 100644 --- a/Documentation/media/uapi/v4l/extended-controls.rst +++ b/Documentation/media/uapi/v4l/extended-controls.rst @@ -1978,6 +1978,29 @@ enum v4l2_mpeg_video_vp8_profile - * - ``V4L2_MPEG_VIDEO_VP8_PROFILE_3`` - Profile 3 +.. _v4l2-mpeg-video-vp9-profile: + +``V4L2_CID_MPEG_VIDEO_VP9_PROFILE`` + (enum) + +enum v4l2_mpeg_video_vp9_profile - + This control allows selecting 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 e7e6340b395e..eacfab7574dc 100644 --- a/drivers/media/v4l2-core/v4l2-ctrls.c +++ b/drivers/media/v4l2-core/v4l2-ctrls.c @@ -438,6 +438,13 @@ const char * const *v4l2_ctrl_get_menu(u32 id) "3", NULL, }; + static const char * const vp9_profile[] = { + "0", + "1", + "2", + "3", + NULL, + }; static const char * const flash_led_mode[] = { "Off", @@ -623,6 +630,8 @@ const char * const *v4l2_ctrl_get_menu(u32 id) return vpx_golden_frame_sel; case V4L2_CID_MPEG_VIDEO_VP8_PROFILE: return vp8_profile; + 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: @@ -849,6 +858,7 @@ const char *v4l2_ctrl_get_name(u32 id) case V4L2_CID_MPEG_VIDEO_VPX_I_FRAME_QP: return "VPX I-Frame QP Value"; case V4L2_CID_MPEG_VIDEO_VPX_P_FRAME_QP: return "VPX P-Frame QP Value"; case V4L2_CID_MPEG_VIDEO_VP8_PROFILE: return "VP8 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"; @@ -1190,6 +1200,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type, case V4L2_CID_TUNE_DEEMPHASIS: case V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_SEL: case V4L2_CID_MPEG_VIDEO_VP8_PROFILE: + 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 2001823c3072..f03d3214eec2 100644 --- a/include/uapi/linux/v4l2-controls.h +++ b/include/uapi/linux/v4l2-controls.h @@ -597,6 +597,13 @@ enum v4l2_mpeg_video_vp8_profile { }; /* Deprecated alias for compatibility reasons. */ #define V4L2_CID_MPEG_VIDEO_VPX_PROFILE V4L2_CID_MPEG_VIDEO_VP8_PROFILE +#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. */