* RFC: vb2: replace alloc_ctx by struct device * in vb2_queue
@ 2014-09-21 13:05 Hans Verkuil
2014-09-22 3:47 ` Pawel Osciak
2014-09-22 6:18 ` Marek Szyprowski
0 siblings, 2 replies; 3+ messages in thread
From: Hans Verkuil @ 2014-09-21 13:05 UTC (permalink / raw)
To: Pawel Osciak, Marek Szyprowski; +Cc: Linux Media Mailing List, Laurent Pinchart
Hi Marek, Pawel,
Currently for dma_config (and the dma_sg code that I posted before) drivers have
to allocate a alloc_ctx context, but in practice that just contains a device pointer.
Is there any reason why we can't just change in struct vb2_queue:
void *alloc_ctx[VIDEO_MAX_PLANES];
to:
struct device *alloc_ctx[VIDEO_MAX_PLANES];
or possibly even just:
struct device *alloc_ctx;
That simplifies the code quite a bit and I don't see and need for anything
else. The last option would make it impossible to have different allocation
contexts for different planes, but that might be something that Samsumg needs.
Regards,
Hans
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: RFC: vb2: replace alloc_ctx by struct device * in vb2_queue
2014-09-21 13:05 RFC: vb2: replace alloc_ctx by struct device * in vb2_queue Hans Verkuil
@ 2014-09-22 3:47 ` Pawel Osciak
2014-09-22 6:18 ` Marek Szyprowski
1 sibling, 0 replies; 3+ messages in thread
From: Pawel Osciak @ 2014-09-22 3:47 UTC (permalink / raw)
To: Hans Verkuil; +Cc: Marek Szyprowski, Linux Media Mailing List, Laurent Pinchart
Hi Hans,
I'm not very much against it, but I'm not sure how option 2 is
significantly simpler than option 1. It's just one cast away from
being the same, unless you have some more rework in mind, e.g. making
vb2 aware of devices somehow and skip driver's involvement for
example?
Thanks,
Pawel
On Sun, Sep 21, 2014 at 10:05 PM, Hans Verkuil <hverkuil@xs4all.nl> wrote:
> Hi Marek, Pawel,
>
> Currently for dma_config (and the dma_sg code that I posted before) drivers have
> to allocate a alloc_ctx context, but in practice that just contains a device pointer.
>
> Is there any reason why we can't just change in struct vb2_queue:
>
> void *alloc_ctx[VIDEO_MAX_PLANES];
>
> to:
>
> struct device *alloc_ctx[VIDEO_MAX_PLANES];
>
> or possibly even just:
>
> struct device *alloc_ctx;
>
> That simplifies the code quite a bit and I don't see and need for anything
> else. The last option would make it impossible to have different allocation
> contexts for different planes, but that might be something that Samsumg needs.
>
> Regards,
>
> Hans
--
Best regards,
Pawel Osciak
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: RFC: vb2: replace alloc_ctx by struct device * in vb2_queue
2014-09-21 13:05 RFC: vb2: replace alloc_ctx by struct device * in vb2_queue Hans Verkuil
2014-09-22 3:47 ` Pawel Osciak
@ 2014-09-22 6:18 ` Marek Szyprowski
1 sibling, 0 replies; 3+ messages in thread
From: Marek Szyprowski @ 2014-09-22 6:18 UTC (permalink / raw)
To: Hans Verkuil, Pawel Osciak; +Cc: Linux Media Mailing List, Laurent Pinchart
Hello,
On 2014-09-21 15:05, Hans Verkuil wrote:
> Hi Marek, Pawel,
>
> Currently for dma_config (and the dma_sg code that I posted before) drivers have
> to allocate a alloc_ctx context, but in practice that just contains a device pointer.
>
> Is there any reason why we can't just change in struct vb2_queue:
>
> void *alloc_ctx[VIDEO_MAX_PLANES];
>
> to:
>
> struct device *alloc_ctx[VIDEO_MAX_PLANES];
>
> or possibly even just:
>
> struct device *alloc_ctx;
>
> That simplifies the code quite a bit and I don't see and need for anything
> else. The last option would make it impossible to have different allocation
> contexts for different planes, but that might be something that Samsumg needs.
The last option won't work for for s5p-mfc driver, so better please keep
separate context per each plane.
If we are going to change the structures and their names, then maybe we
should
get rid of 'context' name are simply replace it by the following entry in
vb2_queue:
struct device *alloc_dev[VIDEO_MAX_PLANES];
and change respective parameter names in memory allocators.
The true context was useful when we were using custom, non-mainline memory
allocators.
Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-09-22 6:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-21 13:05 RFC: vb2: replace alloc_ctx by struct device * in vb2_queue Hans Verkuil
2014-09-22 3:47 ` Pawel Osciak
2014-09-22 6:18 ` Marek Szyprowski
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).