From patchwork Fri Dec 16 11:48:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pankaj Dubey X-Patchwork-Id: 9477809 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8BE46607EE for ; Fri, 16 Dec 2016 11:48:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 81039285EB for ; Fri, 16 Dec 2016 11:48:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 75B622875D; Fri, 16 Dec 2016 11:48:58 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable 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 EFCC5285EB for ; Fri, 16 Dec 2016 11:48:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761247AbcLPLsm (ORCPT ); Fri, 16 Dec 2016 06:48:42 -0500 Received: from mailout1.samsung.com ([203.254.224.24]:51944 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760420AbcLPLr5 (ORCPT ); Fri, 16 Dec 2016 06:47:57 -0500 Received: from epcpsbgm2new.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OIA02TML0OTD2E0@mailout1.samsung.com>; Fri, 16 Dec 2016 20:46:07 +0900 (KST) X-AuditID: cbfee61b-f796f6d000004092-4e-5853d3ff862c Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id EF.72.16530.FF3D3585; Fri, 16 Dec 2016 20:46:07 +0900 (KST) Received: from pankaj.sisodomain.com ([107.108.83.125]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OIA005QB0OMSDA0@mmp2.samsung.com>; Fri, 16 Dec 2016 20:46:07 +0900 (KST) From: Pankaj Dubey To: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: kyungmin.park@samsung.com, jtp.park@samsung.com, mchehab@kernel.org, mchehab@osg.samsung.com, hans.verkuil@cisco.com, krzk@kernel.org, kgene@kernel.org, javier@osg.samsung.com, Smitha T Murthy , Pankaj Dubey Subject: [PATCH 1/2] media: s5p-mfc: convert drivers to use the new vb2_queue dev field Date: Fri, 16 Dec 2016 17:18:34 +0530 Message-id: <1481888915-19624-2-git-send-email-pankaj.dubey@samsung.com> X-Mailer: git-send-email 2.7.4 In-reply-to: <1481888915-19624-1-git-send-email-pankaj.dubey@samsung.com> References: <1481888915-19624-1-git-send-email-pankaj.dubey@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprMIsWRmVeSWpSXmKPExsVy+t9jQd3/l4MjDPoPSlos+bmLyeLN2zVM FkfWXmWy6H/8mtni/PkN7BZnm96wW2x6fI3V4vKuOWwWPRu2slrMOL+PyWLZpj9MFqufVVgs 2vqF3eLunm2MDnweU35vZPXYtKqTzWPzknqPLf132T36tqxi9Pi8SS6ALcrNJiM1MSW1SCE1 Lzk/JTMv3VYpNMRN10JJIS8xN9VWKULXNyRISaEsMacUyDMyQAMOzgHuwUr6dgluGad2HmUs OCBY8b+zn6WB8RtfFyMnh4SAicTGneuZIWwxiQv31rN1MXJxCAnMYpR49KydGcL5ySjx89oV NpAqNgFdiSfv54IlRAQ6GCUudzSxgySYBbqYJPov54LYwgKREvO2LgaLswioSryas4EFxOYV 8JD4/+YpO8Q6OYmb5zrBVnMKeEosXXEPyOYA2uYhcbtTcwIj7wJGhlWMEqkFyQXFSem5Rnmp 5XrFibnFpXnpesn5uZsYwRHyTHoH4+Fd7ocYBTgYlXh4f2wLihBiTSwrrsw9xCjBwawkwrv0 UnCEEG9KYmVValF+fFFpTmrxIUZToLsmMkuJJucDozevJN7QxNzE3NjAwtzS0sRISZy3cfaz cCGB9MSS1OzU1ILUIpg+Jg5OqQbGyfGrlMKUnF5J57hUfHy7w2z6ckPNL7qP9A4ViNSeORj+ +qS+puDbtIVPWOafzD7E+EaVSYJ78/U6prPTPjcr3nGU3dJev0fl7ZZns7q/siXP3BUh83dy Y2X2zjvdr645Sp5+I7beSyDTfsLdDbcZ7HefMq9WT+mu/yr+/MK8O48Ftp+TaQiuUmIpzkg0 1GIuKk4EAMkZRL+mAgAA X-MTR: 20000000000000000@CPGS 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 From: Smitha T Murthy commit 2548fee63d9e ("[media] media/platform: convert drivers to use the new vb2_queue dev field") has missed to set dev pointer of vb2_queue which will be used in reqbufs of mfc driver. Without this change following error is observed: --------------------------------------------------------------- V4L2 Codec decoding example application Kamil Debski Copyright 2012 Samsung Electronics Co., Ltd. Opening MFC. (mfc.c:mfc_open:58): MFC Info (/dev/video0): driver="s5p-mfc" \ bus_info="platform:12c30000.mfc0" card="s5p-mfc-dec" fd=0x4[ 42.339165] Remapping memory failed, error: -6 MFC Open Success. (main.c:main:711): Successfully opened all necessary files and devices (mfc.c:mfc_dec_setup_output:103): Setup MFC decoding OUTPUT buffer \ size=4194304 (requested=4194304) (mfc.c:mfc_dec_setup_output:120): Number of MFC OUTPUT buffers is 2 \ (requested 2) [App] Out buf phy : 0x00000000, virt : 0xffffffff Output Length is = 0x300000 Error (mfc.c:mfc_dec_setup_output:145): Failed to MMAP MFC OUTPUT buffer ------------------------------------------------------- Signed-off-by: Smitha T Murthy [pankaj.dubey: debugging issue and formatting commit message] Signed-off-by: Pankaj Dubey --- drivers/media/platform/s5p-mfc/s5p_mfc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c index 0a5b8f5..6ea8246 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c @@ -838,6 +838,7 @@ static int s5p_mfc_open(struct file *file) q->type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; q->drv_priv = &ctx->fh; q->lock = &dev->mfc_mutex; + q->dev = &dev->plat_dev->dev; if (vdev == dev->vfd_dec) { q->io_modes = VB2_MMAP; q->ops = get_dec_queue_ops(); @@ -861,6 +862,7 @@ static int s5p_mfc_open(struct file *file) q->io_modes = VB2_MMAP; q->drv_priv = &ctx->fh; q->lock = &dev->mfc_mutex; + q->dev = &dev->plat_dev->dev; if (vdev == dev->vfd_dec) { q->io_modes = VB2_MMAP; q->ops = get_dec_queue_ops();