From patchwork Mon Jun 3 11:09:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boris Brezillon X-Patchwork-Id: 10972769 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 435001398 for ; Mon, 3 Jun 2019 11:09:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3293C1FFCA for ; Mon, 3 Jun 2019 11:09:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 26AC5287AE; Mon, 3 Jun 2019 11:09:57 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CC4881FFCA for ; Mon, 3 Jun 2019 11:09:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727872AbfFCLJz (ORCPT ); Mon, 3 Jun 2019 07:09:55 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:60904 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727862AbfFCLJz (ORCPT ); Mon, 3 Jun 2019 07:09:55 -0400 Received: from localhost.localdomain (unknown [IPv6:2a01:e0a:2c:6930:5cf4:84a1:2763:fe0d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: bbrezillon) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id DC28D285168; Mon, 3 Jun 2019 12:09:52 +0100 (BST) From: Boris Brezillon To: Mauro Carvalho Chehab , Hans Verkuil , Laurent Pinchart , Sakari Ailus , linux-media@vger.kernel.org Cc: Tomasz Figa , Nicolas Dufresne , kernel@collabora.com, Paul Kocialkowski , Ezequiel Garcia , Jonas Karlman , Jernej Skrabec , Alexandre Courbot , Thierry Reding , Boris Brezillon Subject: [PATCH RFC 5/6] media: cedrus: Make the slice_params array size limitation more explicit Date: Mon, 3 Jun 2019 13:09:45 +0200 Message-Id: <20190603110946.4952-6-boris.brezillon@collabora.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190603110946.4952-1-boris.brezillon@collabora.com> References: <20190603110946.4952-1-boris.brezillon@collabora.com> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The driver only supports per-slice decoding, and in that mode decode_params->num_slices must be set to 1 and the slice_params array should contain only one element. The current code already had this limitation but it made it look like the slice_params control was a single struct while, according to the spec, it's actually an array. Make it more explicit by setting dims[0] and adding a comment explaining why we have this limitation. Signed-off-by: Boris Brezillon --- drivers/staging/media/sunxi/cedrus/cedrus.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.c b/drivers/staging/media/sunxi/cedrus/cedrus.c index 378032fe71f9..3661c6a04864 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus.c +++ b/drivers/staging/media/sunxi/cedrus/cedrus.c @@ -49,6 +49,12 @@ static const struct cedrus_control cedrus_controls[] = { { .cfg.id = V4L2_CID_MPEG_VIDEO_H264_SLICE_PARAMS, .cfg.elem_size = sizeof(struct v4l2_ctrl_h264_slice_params), + /* + * This driver does not support per-frame decoding (yet?). + * Allow only on per-slice decoding operation, which implies + * that only 1 slice param is passed per decoding operation. + */ + .cfg.dims[0] = 1, .codec = CEDRUS_CODEC_H264, .required = true, },