devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil@xs4all.nl>
To: Ramiro Oliveira <Ramiro.Oliveira@synopsys.com>,
	robh+dt@kernel.org, mark.rutland@arm.com, mchehab@kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-media@vger.kernel.org
Cc: davem@davemloft.net, gregkh@linuxfoundation.org,
	geert+renesas@glider.be, akpm@linux-foundation.org,
	linux@roeck-us.net, laurent.pinchart+renesas@ideasonboard.com,
	arnd@arndb.de, sudipm.mukherjee@gmail.com,
	tiffany.lin@mediatek.com, minghsiu.tsai@mediatek.com,
	jean-christophe.trotin@st.com, andrew-ct.chen@mediatek.com,
	simon.horman@netronome.com, songjun.wu@microchip.com,
	bparrot@ti.com, CARLOS.PALMINHA@synopsys.com,
	Sakari Ailus <sakari.ailus@iki.fi>
Subject: Re: [PATCH v2 2/2] Support for DW CSI-2 Host IPK
Date: Thu, 12 Jan 2017 19:06:41 +0100	[thread overview]
Message-ID: <f1ea65b3-dbad-fd6c-d2c4-33abc3a66890@xs4all.nl> (raw)
In-Reply-To: <8823670a-8456-87d0-3265-cb427e3445eb@synopsys.com>

On 01/12/2017 06:43 PM, Ramiro Oliveira wrote:
> Hi Hans,
> 
> Thank you for your feedback.
> 
> On 1/11/2017 11:54 AM, Hans Verkuil wrote:
>> Hi Ramiro,
>>
>> See my review comments below:
>>
>> On 12/12/16 16:00, Ramiro Oliveira wrote:
>>> Add support for the DesignWare CSI-2 Host IP Prototyping Kit
>>>
>>> Signed-off-by: Ramiro Oliveira <roliveir@synopsys.com>
> 
> [snip]

>>> +
>>> +static int vid_dev_subdev_s_power(struct v4l2_subdev *sd, int on)
>>> +{
>>> +    return 0;
>>> +}
>>
>> Just drop this empty function, shouldn't be needed.
>>
> 
> When I start my system I'm hoping all the subdevs have s_power registered. If it
> doesn't exist should I change the way I handle it, or will the core handle it
> for me?

If it isn't provided, then it is just skipped. The general rule is that
you only provide these ops if they do something useful.

> 
>>> +
>>> +static int vid_dev_subdev_registered(struct v4l2_subdev *sd)
>>> +{
>>> +    struct video_device_dev *vid_dev = v4l2_get_subdevdata(sd);
>>> +    struct vb2_queue *q = &vid_dev->vb_queue;
>>> +    struct video_device *vfd = &vid_dev->ve.vdev;
>>> +    int ret;
>>> +
>>> +    memset(vfd, 0, sizeof(*vfd));
>>> +
>>> +    strlcpy(vfd->name, VIDEO_DEVICE_NAME, sizeof(vfd->name));
>>> +
>>> +    vfd->fops = &vid_dev_fops;
>>> +    vfd->ioctl_ops = &vid_dev_ioctl_ops;
>>> +    vfd->v4l2_dev = sd->v4l2_dev;
>>> +    vfd->minor = -1;
>>> +    vfd->release = video_device_release_empty;
>>> +    vfd->queue = q;
>>> +
>>> +    INIT_LIST_HEAD(&vid_dev->vidq.active);
>>> +    init_waitqueue_head(&vid_dev->vidq.wq);
>>> +    memset(q, 0, sizeof(*q));
>>> +    q->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
>>> +    q->io_modes = VB2_MMAP | VB2_USERPTR;
>>
>> Add VB2_DMABUF and VB2_READ.
>>
> 
> I'll add them, but I'm not using them, is it standard procedure to add them all
> even if they aren't used?

You may not use them, but others might. And it doesn't cost anything to add them.

> 
>>> +    q->ops = &vb2_video_qops;
>>> +    q->mem_ops = &vb2_vmalloc_memops;
>>
>> Why is vmalloc used? Can't you use dma_contig or dma_sg and avoid having to copy
>> the image data? That's a really bad design given the amount of video data that
>> you have to copy.
>>
> 
> When I started development, the arch I was using (ARC) didn't support
> dma_contig, so I was forced to use vmalloc.
> 
> Since then things have changed and I'm already using dma_contig, however it
> wasn't included in this patch. I'll add it to the next patch.

Ah, good. If you are switching to dma_contig, then remove VB2_USERPTR.
VB2_DMABUF should be used instead.

Regards,

	Hans

      reply	other threads:[~2017-01-12 18:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-12 15:00 [PATCH v2 0/2] Add support for the DW IP Prototyping Kits for MIPI CSI-2 Host Ramiro Oliveira
2016-12-12 15:00 ` [PATCH v2 1/2] Add Documentation for Media Device, Video Device, and Synopsys DW " Ramiro Oliveira
2016-12-19 17:38   ` Rob Herring
2017-02-15 15:29     ` Ramiro Oliveira
     [not found] ` <48a46d2d60fff723e322fdbfb29d533c2d0f5637.1481554324.git.roliveir-HKixBCOQz3hWk0Htik3J/w@public.gmane.org>
     [not found]   ` <cover.1481548484.git.roliveir-HKixBCOQz3hWk0Htik3J/w@public.gmane.org>
2016-12-12 15:00     ` [PATCH v2 2/2] Support for DW CSI-2 Host IPK Ramiro Oliveira
     [not found]       ` <bf2f0a6730e4a74d64e04575859d6b195f65b368.1481554324.git.roliveir-HKixBCOQz3hWk0Htik3J/w@public.gmane.org>
2017-01-11 11:54         ` Hans Verkuil
2017-01-12 17:43           ` Ramiro Oliveira
2017-01-12 18:06             ` Hans Verkuil [this message]

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=f1ea65b3-dbad-fd6c-d2c4-33abc3a66890@xs4all.nl \
    --to=hverkuil@xs4all.nl \
    --cc=CARLOS.PALMINHA@synopsys.com \
    --cc=Ramiro.Oliveira@synopsys.com \
    --cc=akpm@linux-foundation.org \
    --cc=andrew-ct.chen@mediatek.com \
    --cc=arnd@arndb.de \
    --cc=bparrot@ti.com \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=geert+renesas@glider.be \
    --cc=gregkh@linuxfoundation.org \
    --cc=jean-christophe.trotin@st.com \
    --cc=laurent.pinchart+renesas@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=mark.rutland@arm.com \
    --cc=mchehab@kernel.org \
    --cc=minghsiu.tsai@mediatek.com \
    --cc=robh+dt@kernel.org \
    --cc=sakari.ailus@iki.fi \
    --cc=simon.horman@netronome.com \
    --cc=songjun.wu@microchip.com \
    --cc=sudipm.mukherjee@gmail.com \
    --cc=tiffany.lin@mediatek.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).