From patchwork Mon Jul 6 21:54:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Karlman X-Patchwork-Id: 11646947 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CAA6D739 for ; Mon, 6 Jul 2020 21:54:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A8E022073E for ; Mon, 6 Jul 2020 21:54:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kwiboo.se header.i=@kwiboo.se header.b="S1nVBMGm" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727853AbgGFVyp (ORCPT ); Mon, 6 Jul 2020 17:54:45 -0400 Received: from o1.b.az.sendgrid.net ([208.117.55.133]:38039 "EHLO o1.b.az.sendgrid.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727789AbgGFVyj (ORCPT ); Mon, 6 Jul 2020 17:54:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=from:subject:in-reply-to:references:to:cc:content-type: content-transfer-encoding; s=001; bh=xRvXleIsFrOUoVEFb2+EqS1sO8vNP09eztv2NUch3P4=; b=S1nVBMGmkIVtJMfuJDtwUDlmFM36++kjO/Sbbw3SBF8V8MLUQ0Wa2NB0F8t1ZP48hTSJ JisXget+1VHsk17FOWWgMnzDtNWN/XDp5tbZ99jItemPZevfJGfHzlI2LtJbd5FtUnKbPi Gy8qguUJHcFQ6DKTvydNbrTVCU1K60Pos= Received: by filterdrecv-p3iad2-5b55dcd864-5dqzw with SMTP id filterdrecv-p3iad2-5b55dcd864-5dqzw-19-5F039D9E-D 2020-07-06 21:54:38.266225202 +0000 UTC m=+881111.140990039 Received: from bionic.localdomain (unknown) by ismtpd0008p1lon1.sendgrid.net (SG) with ESMTP id RkkRZ2UwQbil5L0N__xREg Mon, 06 Jul 2020 21:54:38.020 +0000 (UTC) From: Jonas Karlman Subject: [PATCH v2 12/12] media: rkvdec: h264: Support profile and level controls Date: Mon, 06 Jul 2020 21:54:38 +0000 (UTC) Message-Id: <20200706215430.22859-13-jonas@kwiboo.se> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200706215430.22859-1-jonas@kwiboo.se> References: <20200701215616.30874-1-jonas@kwiboo.se> <20200706215430.22859-1-jonas@kwiboo.se> X-SG-EID: TdbjyGynYnRZWhH+7lKUQJL+ZxmxpowvO2O9SQF5CwCVrYgcwUXgU5DKUU3QxAfZekEeQsTe+RrMu3cja6a0h1vz2//hk378RB7OvuU+Unwr2NFFYBDDmKvAj6aOu7u4GSrColBrbVrhTX5qJmcTnPslZyASlbiJvcXj2p9JfMzqQjp2c5Dwej9bazdn0FDJ3De97GWZ5P2JxHPOyDbQEAv+dtSFg9upo7V2PjhaujJhfQ+LfJPCspTtgQ+wyWhRQGbSEJS+zCDI3TbCnYaHwg== To: linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Jonas Karlman , Ezequiel Garcia , Hans Verkuil , Nicolas Dufresne , Tomasz Figa , Alexandre Courbot Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The Rockchip Video Decoder used in RK3399 supports H.264 profiles from Baseline to High 4:2:2 up to Level 5.1, except for the Extended profile. Expose the V4L2_CID_MPEG_VIDEO_H264_PROFILE and the V4L2_CID_MPEG_VIDEO_H264_LEVEL control, so that userspace can query the driver for the list of supported profiles and level. Signed-off-by: Jonas Karlman Reviewed-by: Ezequiel Garcia --- Changes in v2: - Moved to end - Collect r-b tag --- drivers/staging/media/rkvdec/rkvdec.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c index 4faee9262392..b21031535330 100644 --- a/drivers/staging/media/rkvdec/rkvdec.c +++ b/drivers/staging/media/rkvdec/rkvdec.c @@ -144,6 +144,19 @@ static const struct rkvdec_ctrl_desc rkvdec_h264_ctrl_descs[] = { .cfg.def = V4L2_MPEG_VIDEO_H264_START_CODE_ANNEX_B, .cfg.max = V4L2_MPEG_VIDEO_H264_START_CODE_ANNEX_B, }, + { + .cfg.id = V4L2_CID_MPEG_VIDEO_H264_PROFILE, + .cfg.min = V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE, + .cfg.max = V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_422, + .cfg.menu_skip_mask = + BIT(V4L2_MPEG_VIDEO_H264_PROFILE_EXTENDED), + .cfg.def = V4L2_MPEG_VIDEO_H264_PROFILE_MAIN, + }, + { + .cfg.id = V4L2_CID_MPEG_VIDEO_H264_LEVEL, + .cfg.min = V4L2_MPEG_VIDEO_H264_LEVEL_1_0, + .cfg.max = V4L2_MPEG_VIDEO_H264_LEVEL_5_1, + }, }; static const struct rkvdec_ctrls rkvdec_h264_ctrls = {