From patchwork Fri Sep 7 16:33:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Kocialkowski X-Patchwork-Id: 10592363 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 09A4413AC for ; Fri, 7 Sep 2018 16:34:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E901E2B94B for ; Fri, 7 Sep 2018 16:34:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D96B02B8D7; Fri, 7 Sep 2018 16:34:53 +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 7F3F52B8D7 for ; Fri, 7 Sep 2018 16:34:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726565AbeIGVQe (ORCPT ); Fri, 7 Sep 2018 17:16:34 -0400 Received: from leonov.paulk.fr ([185.233.101.22]:60444 "EHLO leonov.paulk.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725999AbeIGVQe (ORCPT ); Fri, 7 Sep 2018 17:16:34 -0400 Received: from gagarine.paulk.fr (gagarine [192.168.1.127]) by leonov.paulk.fr (Postfix) with ESMTPS id 3803EC025F; Fri, 7 Sep 2018 18:34:51 +0200 (CEST) Received: by gagarine.paulk.fr (Postfix, from userid 114) id A5080C0F69; Fri, 7 Sep 2018 18:34:49 +0200 (CEST) Received: from localhost.localdomain (collins [192.168.1.129]) by gagarine.paulk.fr (Postfix) with ESMTP id BA84EC0F5E; Fri, 7 Sep 2018 18:33:55 +0200 (CEST) From: Paul Kocialkowski To: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, devel@driverdev.osuosl.org, linux-arm-kernel@lists.infradead.org Cc: Maxime Ripard , Paul Kocialkowski , Mauro Carvalho Chehab , Greg Kroah-Hartman , Chen-Yu Tsai , linux-sunxi@googlegroups.com, Randy Li , Hans Verkuil , Ezequiel Garcia , Tomasz Figa , Alexandre Courbot , Philipp Zabel , Laurent Pinchart , Sakari Ailus , Thomas Petazzoni , Paul Kocialkowski Subject: [PATCH 1/2] media: cedrus: Fix error reporting in request validation Date: Fri, 7 Sep 2018 18:33:46 +0200 Message-Id: <20180907163347.32312-2-contact@paulk.fr> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180907163347.32312-1-contact@paulk.fr> References: <20180907163347.32312-1-contact@paulk.fr> 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 This fixes error reporting by using the appropriate logging helpers and return codes, while introducing new messages when there are not enough or too many buffers associated with the request. Signed-off-by: Paul Kocialkowski --- drivers/staging/media/sunxi/cedrus/cedrus.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.c b/drivers/staging/media/sunxi/cedrus/cedrus.c index 09ab1b732c31..0a9363c7db06 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus.c +++ b/drivers/staging/media/sunxi/cedrus/cedrus.c @@ -105,10 +105,19 @@ static int cedrus_request_validate(struct media_request *req) struct v4l2_ctrl_handler *parent_hdl, *hdl; struct cedrus_ctx *ctx = NULL; struct v4l2_ctrl *ctrl_test; + unsigned int count; unsigned int i; - if (vb2_request_buffer_cnt(req) != 1) + count = vb2_request_buffer_cnt(req); + if (!count) { + v4l2_info(&ctx->dev->v4l2_dev, + "No buffer was provided with the request\n"); return -ENOENT; + } else if (count > 1) { + v4l2_info(&ctx->dev->v4l2_dev, + "More than one buffer was provided with the request\n"); + return -EINVAL; + } list_for_each_entry(obj, &req->objects, list) { struct vb2_buffer *vb; @@ -128,7 +137,7 @@ static int cedrus_request_validate(struct media_request *req) hdl = v4l2_ctrl_request_hdl_find(req, parent_hdl); if (!hdl) { - v4l2_err(&ctx->dev->v4l2_dev, "Missing codec control(s)\n"); + v4l2_info(&ctx->dev->v4l2_dev, "Missing codec control(s)\n"); return -ENOENT; } @@ -140,7 +149,7 @@ static int cedrus_request_validate(struct media_request *req) ctrl_test = v4l2_ctrl_request_hdl_ctrl_find(hdl, cedrus_controls[i].id); if (!ctrl_test) { - v4l2_err(&ctx->dev->v4l2_dev, + v4l2_info(&ctx->dev->v4l2_dev, "Missing required codec control\n"); return -ENOENT; } From patchwork Fri Sep 7 16:33:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Kocialkowski X-Patchwork-Id: 10592367 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 ABA4414E0 for ; Fri, 7 Sep 2018 16:35:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 986242B94B for ; Fri, 7 Sep 2018 16:35:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8C5A92B97F; Fri, 7 Sep 2018 16:35:23 +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 3E0F12B94B for ; Fri, 7 Sep 2018 16:35:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726738AbeIGVRE (ORCPT ); Fri, 7 Sep 2018 17:17:04 -0400 Received: from leonov.paulk.fr ([185.233.101.22]:60476 "EHLO leonov.paulk.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726717AbeIGVRE (ORCPT ); Fri, 7 Sep 2018 17:17:04 -0400 Received: from gagarine.paulk.fr (gagarine [192.168.1.127]) by leonov.paulk.fr (Postfix) with ESMTPS id BF84BC01F6; Fri, 7 Sep 2018 18:35:20 +0200 (CEST) Received: by gagarine.paulk.fr (Postfix, from userid 114) id 7B898C0F69; Fri, 7 Sep 2018 18:35:19 +0200 (CEST) Received: from localhost.localdomain (collins [192.168.1.129]) by gagarine.paulk.fr (Postfix) with ESMTP id 2EE8DC0F60; Fri, 7 Sep 2018 18:33:56 +0200 (CEST) From: Paul Kocialkowski To: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, devel@driverdev.osuosl.org, linux-arm-kernel@lists.infradead.org Cc: Maxime Ripard , Paul Kocialkowski , Mauro Carvalho Chehab , Greg Kroah-Hartman , Chen-Yu Tsai , linux-sunxi@googlegroups.com, Randy Li , Hans Verkuil , Ezequiel Garcia , Tomasz Figa , Alexandre Courbot , Philipp Zabel , Laurent Pinchart , Sakari Ailus , Thomas Petazzoni , Paul Kocialkowski Subject: [PATCH 2/2] media: cedrus: Add TODO file with tasks to complete before unstaging Date: Fri, 7 Sep 2018 18:33:47 +0200 Message-Id: <20180907163347.32312-3-contact@paulk.fr> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180907163347.32312-1-contact@paulk.fr> References: <20180907163347.32312-1-contact@paulk.fr> 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 When the elements listed are complete, the Cedrus driver will be ready to move out of the staging area of the kernel. Signed-off-by: Paul Kocialkowski --- drivers/staging/media/sunxi/cedrus/TODO | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 drivers/staging/media/sunxi/cedrus/TODO diff --git a/drivers/staging/media/sunxi/cedrus/TODO b/drivers/staging/media/sunxi/cedrus/TODO new file mode 100644 index 000000000000..ec277ece47af --- /dev/null +++ b/drivers/staging/media/sunxi/cedrus/TODO @@ -0,0 +1,7 @@ +Before this stateless decoder driver can leave the staging area: +* The Request API needs to be stabilized; +* The codec-specific controls need to be thoroughly reviewed to ensure they + cover all intended uses cases; +* Userspace support for the Request API needs to be reviewed; +* Another stateless decoder driver should be submitted; +* At least one stateless encoder driver should be submitted.