From patchwork Sun Sep 9 19:10:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Kocialkowski X-Patchwork-Id: 10593403 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 6F3DB6CB for ; Sun, 9 Sep 2018 19:11:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5FBA829070 for ; Sun, 9 Sep 2018 19:11:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 53193291DD; Sun, 9 Sep 2018 19:11:29 +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 EE20429070 for ; Sun, 9 Sep 2018 19:11:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726795AbeIJACB (ORCPT ); Sun, 9 Sep 2018 20:02:01 -0400 Received: from leonov.paulk.fr ([185.233.101.22]:44736 "EHLO leonov.paulk.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726599AbeIJACB (ORCPT ); Sun, 9 Sep 2018 20:02:01 -0400 Received: from gagarine.paulk.fr (gagarine [192.168.1.127]) by leonov.paulk.fr (Postfix) with ESMTPS id 6516DC0262; Sun, 9 Sep 2018 21:11:21 +0200 (CEST) Received: by gagarine.paulk.fr (Postfix, from userid 114) id DEC38C0FF9; Sun, 9 Sep 2018 21:11:19 +0200 (CEST) Received: from localhost.localdomain (collins [192.168.1.129]) by gagarine.paulk.fr (Postfix) with ESMTP id D2B81C0FE9; Sun, 9 Sep 2018 21:10:20 +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 , Thomas Petazzoni , linux-sunxi@googlegroups.com, Randy Li , Hans Verkuil , Ezequiel Garcia , Tomasz Figa , Alexandre Courbot , Philipp Zabel , Laurent Pinchart , Sakari Ailus , Paul Kocialkowski Subject: [PATCH v2 1/4] media: cedrus: Fix error reporting in request validation Date: Sun, 9 Sep 2018 21:10:12 +0200 Message-Id: <20180909191015.20902-2-contact@paulk.fr> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180909191015.20902-1-contact@paulk.fr> References: <20180909191015.20902-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 Sun Sep 9 19:10:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Kocialkowski X-Patchwork-Id: 10593407 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 A6ABE6CB for ; Sun, 9 Sep 2018 19:11:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 943C529070 for ; Sun, 9 Sep 2018 19:11:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 85EFA291DD; Sun, 9 Sep 2018 19:11:50 +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 3426F29070 for ; Sun, 9 Sep 2018 19:11:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726725AbeIJAC1 (ORCPT ); Sun, 9 Sep 2018 20:02:27 -0400 Received: from leonov.paulk.fr ([185.233.101.22]:44770 "EHLO leonov.paulk.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726599AbeIJAC1 (ORCPT ); Sun, 9 Sep 2018 20:02:27 -0400 Received: from gagarine.paulk.fr (gagarine [192.168.1.127]) by leonov.paulk.fr (Postfix) with ESMTPS id C2E7FC0262; Sun, 9 Sep 2018 21:11:47 +0200 (CEST) Received: by gagarine.paulk.fr (Postfix, from userid 114) id 66119C0FFA; Sun, 9 Sep 2018 21:11:46 +0200 (CEST) Received: from localhost.localdomain (collins [192.168.1.129]) by gagarine.paulk.fr (Postfix) with ESMTP id 3B48DC0FEA; Sun, 9 Sep 2018 21:10:21 +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 , Thomas Petazzoni , linux-sunxi@googlegroups.com, Randy Li , Hans Verkuil , Ezequiel Garcia , Tomasz Figa , Alexandre Courbot , Philipp Zabel , Laurent Pinchart , Sakari Ailus , Paul Kocialkowski Subject: [PATCH v2 2/4] media: cedrus: Add TODO file with tasks to complete before unstaging Date: Sun, 9 Sep 2018 21:10:13 +0200 Message-Id: <20180909191015.20902-3-contact@paulk.fr> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180909191015.20902-1-contact@paulk.fr> References: <20180909191015.20902-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. From patchwork Sun Sep 9 19:10:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Kocialkowski X-Patchwork-Id: 10593409 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 EABFA921 for ; Sun, 9 Sep 2018 19:12:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DADF029070 for ; Sun, 9 Sep 2018 19:12:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CE57129208; Sun, 9 Sep 2018 19:12:19 +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 763C029070 for ; Sun, 9 Sep 2018 19:12:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726684AbeIJAC4 (ORCPT ); Sun, 9 Sep 2018 20:02:56 -0400 Received: from leonov.paulk.fr ([185.233.101.22]:44800 "EHLO leonov.paulk.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726599AbeIJAC4 (ORCPT ); Sun, 9 Sep 2018 20:02:56 -0400 Received: from gagarine.paulk.fr (gagarine [192.168.1.127]) by leonov.paulk.fr (Postfix) with ESMTPS id 330EBC0206; Sun, 9 Sep 2018 21:12:17 +0200 (CEST) Received: by gagarine.paulk.fr (Postfix, from userid 114) id E7FDCC0FFE; Sun, 9 Sep 2018 21:12:15 +0200 (CEST) Received: from localhost.localdomain (collins [192.168.1.129]) by gagarine.paulk.fr (Postfix) with ESMTP id 985D5C0FEC; Sun, 9 Sep 2018 21:10:21 +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 , Thomas Petazzoni , linux-sunxi@googlegroups.com, Randy Li , Hans Verkuil , Ezequiel Garcia , Tomasz Figa , Alexandre Courbot , Philipp Zabel , Laurent Pinchart , Sakari Ailus , Paul Kocialkowski Subject: [PATCH v2 3/4] media: cedrus: Wrap PHYS_PFN_OFFSET with ifdef and add dedicated comment Date: Sun, 9 Sep 2018 21:10:14 +0200 Message-Id: <20180909191015.20902-4-contact@paulk.fr> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180909191015.20902-1-contact@paulk.fr> References: <20180909191015.20902-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 Since PHYS_PFN_OFFSET is not defined for all architectures, it is requried to wrap it with ifdef so that it can be built on all architectures. Signed-off-by: Paul Kocialkowski --- drivers/staging/media/sunxi/cedrus/cedrus_hw.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_hw.c b/drivers/staging/media/sunxi/cedrus/cedrus_hw.c index f4307e8f7908..32adbcbe6175 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus_hw.c +++ b/drivers/staging/media/sunxi/cedrus/cedrus_hw.c @@ -199,8 +199,13 @@ int cedrus_hw_probe(struct cedrus_dev *dev) /* * The VPU is only able to handle bus addresses so we have to subtract * the RAM offset to the physcal addresses. + * + * This information will eventually be obtained from device-tree. */ + +#ifdef PHYS_PFN_OFFSET dev->dev->dma_pfn_offset = PHYS_PFN_OFFSET; +#endif ret = of_reserved_mem_device_init(dev->dev); if (ret && ret != -ENODEV) { From patchwork Sun Sep 9 19:10:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Kocialkowski X-Patchwork-Id: 10593413 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 0839A6CB for ; Sun, 9 Sep 2018 19:12:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EC57629070 for ; Sun, 9 Sep 2018 19:12:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DE911291DD; Sun, 9 Sep 2018 19:12:50 +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 8001B29070 for ; Sun, 9 Sep 2018 19:12:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726657AbeIJADW (ORCPT ); Sun, 9 Sep 2018 20:03:22 -0400 Received: from leonov.paulk.fr ([185.233.101.22]:44832 "EHLO leonov.paulk.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726599AbeIJADW (ORCPT ); Sun, 9 Sep 2018 20:03:22 -0400 Received: from gagarine.paulk.fr (gagarine [192.168.1.127]) by leonov.paulk.fr (Postfix) with ESMTPS id 2438CC0279; Sun, 9 Sep 2018 21:12:43 +0200 (CEST) Received: by gagarine.paulk.fr (Postfix, from userid 114) id B39BBC0FFF; Sun, 9 Sep 2018 21:12:41 +0200 (CEST) Received: from localhost.localdomain (collins [192.168.1.129]) by gagarine.paulk.fr (Postfix) with ESMTP id 0056FC0FED; Sun, 9 Sep 2018 21:10:21 +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 , Thomas Petazzoni , linux-sunxi@googlegroups.com, Randy Li , Hans Verkuil , Ezequiel Garcia , Tomasz Figa , Alexandre Courbot , Philipp Zabel , Laurent Pinchart , Sakari Ailus , Paul Kocialkowski Subject: [PATCH v2 4/4] media: cedrus: Select the sunxi SRAM driver in Kconfig Date: Sun, 9 Sep 2018 21:10:15 +0200 Message-Id: <20180909191015.20902-5-contact@paulk.fr> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180909191015.20902-1-contact@paulk.fr> References: <20180909191015.20902-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 Since the sunxi SRAM driver is required to build the Cedrus driver, select it in Kconfig. Signed-off-by: Paul Kocialkowski --- drivers/staging/media/sunxi/cedrus/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/media/sunxi/cedrus/Kconfig b/drivers/staging/media/sunxi/cedrus/Kconfig index afd7d7ee0388..3b06283e4bf3 100644 --- a/drivers/staging/media/sunxi/cedrus/Kconfig +++ b/drivers/staging/media/sunxi/cedrus/Kconfig @@ -3,6 +3,7 @@ config VIDEO_SUNXI_CEDRUS depends on VIDEO_DEV && VIDEO_V4L2 && MEDIA_CONTROLLER depends on HAS_DMA depends on OF + select SUNXI_SRAM select VIDEOBUF2_DMA_CONTIG select MEDIA_REQUEST_API select V4L2_MEM2MEM_DEV