All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tomasz Stanislawski <t.stanislaws@samsung.com>
To: linux-media@vger.kernel.org
Cc: Sumit Semwal <sumit.semwal@linaro.org>,
	Pawel Osciak <pawel@osciak.com>,
	Sumit Semwal <sumit.semwal@ti.com>,
	linaro-mm-sig@lists.linaro.org, linux-media@vger.kernel.org,
	arnd@arndb.de, jesse.barker@linaro.org, m.szyprowski@samsung.com,
	rob@ti.com, daniel@ffwll.ch, patches@linaro.org
Subject: Re: [RFCv1 2/4] v4l:vb2: add support for shared buffer (dma_buf)
Date: Fri, 20 Jan 2012 16:53:20 +0100	[thread overview]
Message-ID: <4F198DF0.7000801@samsung.com> (raw)
In-Reply-To: <201201201612.31821.laurent.pinchart@ideasonboard.com>

Hi Laurent,

On 01/20/2012 04:12 PM, Laurent Pinchart wrote:
> Hi Tomasz,
>
> On Friday 20 January 2012 11:58:39 Tomasz Stanislawski wrote:
>> On 01/20/2012 11:41 AM, Sumit Semwal wrote:
>>> On 20 January 2012 00:37, Pawel Osciak<pawel@osciak.com>   wrote:
>>>> Hi Sumit,
>>>> Thank you for your work. Please find my comments below.
>>>
>>> Hi Pawel,
>>>
<snip>
>>>>>    struct vb2_mem_ops {
>>>>>
>>>>>          void            *(*alloc)(void *alloc_ctx, unsigned long size);
>>>>>
>>>>> @@ -65,6 +82,16 @@ struct vb2_mem_ops {
>>>>>
>>>>>                                          unsigned long size, int write);
>>>>>
>>>>>          void            (*put_userptr)(void *buf_priv);
>>>>>
>>>>> +       /* Comment from Rob Clark: XXX: I think the attach / detach
>>>>> could be handled +        * in the vb2 core, and vb2_mem_ops really
>>>>> just need to get/put the +        * sglist (and make sure that the
>>>>> sglist fits it's needs..) +        */
>>>>
>>>> I *strongly* agree with Rob here. Could you explain the reason behind
>>>> not doing this?
>>>> Allocator should ideally not have to be aware of attaching/detaching,
>>>> this is not specific to an allocator.
>>>
>>> Ok, I thought we'll start with this version first, and then refine.
>>> But you guys are right.
>>
>> I think that it is not possible to move attach/detach to vb2-core. The
>> problem is that dma_buf_attach needs 'struct device' argument. This
>> pointer is not available in vb2-core. This pointer is delivered by
>> device's driver in "void *alloc_context".
>>
>> Moving information about device would introduce new problems like:
>> - breaking layering in vb2
>> - some allocators like vb2-vmalloc do not posses any device related
>> attributes
>
> What about passing the device to vb2-core then ?
>

IMO, One way to do this is adding field 'struct device *dev' to struct 
vb2_queue. This field should be filled by a driver prior to calling 
vb2_queue_init.

Regards,
Tomasz Stanislawski


  reply	other threads:[~2012-01-20 15:53 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-05 10:41 [RFCv1 0/4] v4l: DMA buffer sharing support as a user Sumit Semwal
2012-01-05 10:41 ` [RFCv1 1/4] v4l: Add DMABUF as a memory type Sumit Semwal
2012-01-05 10:41 ` [RFCv1 2/4] v4l:vb2: add support for shared buffer (dma_buf) Sumit Semwal
2012-01-14 20:38   ` [Linaro-mm-sig] " Sakari Ailus
     [not found]     ` <CAB2ybb83ub=A45-m6o+RXqFOTUmXCgeFqs03WZDHeWeLe2+29w@mail.gmail.com>
2012-01-16  5:35       ` Semwal, Sumit
2012-01-20 15:04       ` Laurent Pinchart
2012-01-19 19:07   ` Pawel Osciak
2012-01-20 10:41     ` Sumit Semwal
2012-01-20 10:58       ` Tomasz Stanislawski
2012-01-20 15:12         ` Laurent Pinchart
2012-01-20 15:53           ` Tomasz Stanislawski [this message]
2012-01-20 16:11             ` Laurent Pinchart
2012-01-20 16:20               ` Tomasz Stanislawski
2012-01-20 16:28                 ` Laurent Pinchart
2012-01-23  9:06                   ` Marek Szyprowski
2012-01-23  9:40                     ` Daniel Vetter
2012-01-23  9:45                       ` Daniel Vetter
2012-01-23  9:48                     ` Laurent Pinchart
2012-01-23 10:35                       ` Daniel Vetter
2012-01-23 10:54                         ` Laurent Pinchart
2012-01-24  0:26                           ` Clark, Rob
2012-01-24  9:34                             ` Laurent Pinchart
2012-01-24 10:52                               ` Daniel Vetter
2012-01-24 13:03                           ` Daniel Vetter
2012-01-25  8:09                             ` Daniel Vetter
2012-01-30 14:44                             ` Laurent Pinchart
2012-01-30 16:29                               ` Daniel Vetter
2012-01-25 23:28                         ` Sakari Ailus
2012-01-26 11:27                           ` Daniel Vetter
2012-01-29 11:03                             ` Sakari Ailus
2012-01-29 13:03                               ` Daniel Vetter
2012-01-30 14:33                                 ` Laurent Pinchart
2012-01-30 22:01                                 ` Sakari Ailus
2012-01-31 15:38                                   ` Clark, Rob
2012-02-02 10:19                                     ` Laurent Pinchart
2012-02-02 14:01                                       ` Clark, Rob
2012-02-02 14:40                                         ` Sumit Semwal
2012-02-02 20:23                                       ` Daniel Vetter
2012-02-02 20:49                                         ` Clark, Rob
2012-02-04 11:43                                     ` Sakari Ailus
2012-02-05 15:08                                       ` Clark, Rob
2012-01-20 14:55   ` [Linaro-mm-sig] " Laurent Pinchart
2012-01-05 10:41 ` [RFCv1 3/4] v4l:vb: remove warnings about MEMORY_DMABUF Sumit Semwal
2012-01-05 10:41 ` [RFCv1 4/4] v4l:vb2: Add dma-contig allocator as dma_buf user Sumit Semwal
2012-01-16  7:57 ` [RFCv1 0/4] v4l: DMA buffer sharing support as a user Kyungmin Park

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=4F198DF0.7000801@samsung.com \
    --to=t.stanislaws@samsung.com \
    --cc=arnd@arndb.de \
    --cc=daniel@ffwll.ch \
    --cc=jesse.barker@linaro.org \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-media@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=patches@linaro.org \
    --cc=pawel@osciak.com \
    --cc=rob@ti.com \
    --cc=sumit.semwal@linaro.org \
    --cc=sumit.semwal@ti.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.