Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1477489pxb; Fri, 13 Nov 2020 13:53:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJynaPj2vqi1qb1hns5/S6BOmIaEJ33jbo59Ew7uPdlMY7nV8VziQ79XWdIzrr4xSnINM0WD X-Received: by 2002:a17:906:d20a:: with SMTP id w10mr4116624ejz.3.1605304412788; Fri, 13 Nov 2020 13:53:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605304412; cv=none; d=google.com; s=arc-20160816; b=BV+GyMGz5YwPrAmsdVaAAIxffRE6MuU9LT7O95P0agbwP2P+6RcuwHenkNxwCDMUXL 3cIT0nTeijf6iPMEb6h3CBix94+OHtu6m9NLiulzctRlYWYFVKGex1kvLfzWiaDxPAfG Qm4QQZUo/U49YhGgepoZ61UIsVLHVqA84B2xxwnwAmrUV1ZB8XZPjwUbVPIqPDYP44fh I3Nzg95pAXo9SGtYwSjH/icAQDu6H8ra/CZWTXOU8YQP9qnXFAgLY5nRrfbieZVRLlC3 zYAajWuiZRzJa3/On0TP/uhmSVQD/arhcnK6iU7JtM0Iq8P2/jCGx4g+C84vdNWN/a5y S1SQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=ZUF0sO+dfmr6AWBIglTW89FwpszUFzOPRXIVjrnZ5Fk=; b=xntmBQNO5zkS9ZHqzCLp4gjdIUW6IQ+He+maL91xgnrMYsYXbT6ReYKp2KXwuDQcLk ECgL5vHnTkzsWXlbO7Ed1qiSDmPkvRn/LEkHDWGfOC3nDomQuIDH1QhKhqIRe7SXg0Rr PNx83DJ/I9AFo2kzed5T6rs2K7XLP/XJDxdVEIZeriIkKd+YFu2jWTiLCrLcTFI4Hx8q +BVSd/IJbQqZdxUQs8qwzkeu0P8v4QcZfJ8o3kCjxIs6FAglOJuZWfvPE4n3q7WtCr27 Pcb6v33fPPBjjEf+twSURjfSjdtr4Rs/IprPbABAO4LEWiFlKme/8T9Vn0fCqfv2rESh 5tbw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a19si7535077edb.410.2020.11.13.13.53.10; Fri, 13 Nov 2020 13:53:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726204AbgKMVvo (ORCPT + 99 others); Fri, 13 Nov 2020 16:51:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725885AbgKMVvn (ORCPT ); Fri, 13 Nov 2020 16:51:43 -0500 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F40AFC0613D1; Fri, 13 Nov 2020 13:51:42 -0800 (PST) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: ezequiel) with ESMTPSA id F216D1F46BC4 From: Ezequiel Garcia To: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: kernel@collabora.com, Jonas Karlman , Hans Verkuil , Nicolas Dufresne , Philipp Zabel , Maxime Ripard , Paul Kocialkowski , Jernej Skrabec , Ezequiel Garcia Subject: [PATCH v2 1/9] media: rkvdec: h264: Support profile and level controls Date: Fri, 13 Nov 2020 18:51:13 -0300 Message-Id: <20201113215121.505173-2-ezequiel@collabora.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201113215121.505173-1-ezequiel@collabora.com> References: <20201113215121.505173-1-ezequiel@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jonas Karlman 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. For now, we don't expose 4:2:2 since the driver doesn't implement the required support. Signed-off-by: Jonas Karlman [Ezequiel: Don't expose 4:2:2 profile for now] Signed-off-by: Ezequiel Garcia --- 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 552e0bd12ecf..fe65f55d3b49 100644 --- a/drivers/staging/media/rkvdec/rkvdec.c +++ b/drivers/staging/media/rkvdec/rkvdec.c @@ -82,6 +82,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, + .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 = { -- 2.27.0