linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Javier Martinez Canillas <javier@osg.samsung.com>
To: Pankaj Dubey <pankaj.dubey@samsung.com>,
	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,
	Smitha T Murthy <smitha.t@samsung.com>
Subject: Re: [PATCH 1/2] media: s5p-mfc: convert drivers to use the new vb2_queue dev field
Date: Fri, 24 Feb 2017 16:22:56 -0300	[thread overview]
Message-ID: <a4db0512-8a5b-aaea-713b-5e3c09c3e8c2@osg.samsung.com> (raw)
In-Reply-To: <1481888915-19624-2-git-send-email-pankaj.dubey@samsung.com>

Hello Pankaj,

On 12/16/2016 08:48 AM, Pankaj Dubey wrote:
> From: Smitha T Murthy <smitha.t@samsung.com>
> 
> 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 <k.debski@samsung.com>
> 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
> -------------------------------------------------------
> 

On which kernel version did you face this issue?

> Signed-off-by: Smitha T Murthy <smitha.t@samsung.com>
> [pankaj.dubey: debugging issue and formatting commit message]
> Signed-off-by: Pankaj Dubey <pankaj.dubey@samsung.com>
> ---
>  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();
>

Please correct me if I'm wrong, but AFAIU this shouldn't be needed in
the s5p-mfc driver since the videobuf2 core either uses the vb2_queue
.dev field or the vb2_queue .alloc_devs. And the latter is set in the
s5p_mfc_queue_setup() function, so the .dev field shouldn't be used.

Best regards,
-- 
Javier Martinez Canillas
Open Source Group
Samsung Research America

  reply	other threads:[~2017-02-24 19:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20161216115004epcas1p276eddca803dcafe3470e223386b86da0@epcas1p2.samsung.com>
2016-12-16 11:48 ` [PATCH 0/2] s5p-mfc fix for using reserved memory Pankaj Dubey
2016-12-16 11:48   ` [PATCH 1/2] media: s5p-mfc: convert drivers to use the new vb2_queue dev field Pankaj Dubey
2017-02-24 19:22     ` Javier Martinez Canillas [this message]
2017-02-27  3:09       ` pankaj.dubey
2016-12-16 11:48   ` [PATCH 2/2] media: s5p-mfc: fix MMAP of mfc buffer during reqbufs Pankaj Dubey
2017-02-24 19:42     ` Javier Martinez Canillas
2017-02-27  3:17       ` pankaj.dubey
2016-12-20 11:58   ` [PATCH 0/2] s5p-mfc fix for using reserved memory Marek Szyprowski
2016-12-21  5:44     ` pankaj.dubey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a4db0512-8a5b-aaea-713b-5e3c09c3e8c2@osg.samsung.com \
    --to=javier@osg.samsung.com \
    --cc=hans.verkuil@cisco.com \
    --cc=jtp.park@samsung.com \
    --cc=kgene@kernel.org \
    --cc=krzk@kernel.org \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=mchehab@osg.samsung.com \
    --cc=pankaj.dubey@samsung.com \
    --cc=smitha.t@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).