[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aefee886-3aed-b72f-b1c4-722b3f213399@collabora.com>
Date: Thu, 20 Oct 2016 10:20:05 +0200
From: Thierry Escande <thierry.escande@...labora.com>
To: Sakari Ailus <sakari.ailus@....fi>
Cc: Mauro Carvalho Chehab <mchehab@...nel.org>,
linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
Pawel Osciak <pawel@...iak.com>,
Marek Szyprowski <m.szyprowski@...sung.com>,
Kyungmin Park <kyungmin.park@...sung.com>
Subject: Re: [PATCH 1/2] [media] vb2: Store dma_dir in vb2_queue
Hi Sakari,
On 19/10/2016 23:29, Sakari Ailus wrote:
> Hi Thierry,
>
> On Wed, Oct 19, 2016 at 10:24:16AM +0200, Thierry Escande wrote:
>> From: Pawel Osciak <posciak@...omium.org>
>>
>> Store dma_dir in struct vb2_queue and reuse it, instead of recalculating
>> it each time.
>>
>> Signed-off-by: Pawel Osciak <posciak@...omium.org>
>> Tested-by: Pawel Osciak <posciak@...omium.org>
>> Reviewed-by: Tomasz Figa <tfiga@...omium.org>
>> Reviewed-by: Owen Lin <owenlin@...omium.org>
>> Signed-off-by: Thierry Escande <thierry.escande@...labora.com>
>> ---
>> drivers/media/v4l2-core/videobuf2-core.c | 12 +++---------
>> drivers/media/v4l2-core/videobuf2-v4l2.c | 2 ++
>> include/media/videobuf2-core.h | 2 ++
>> 3 files changed, 7 insertions(+), 9 deletions(-)
>>
>> diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c
>> index 21900202..f12103c 100644
>> --- a/drivers/media/v4l2-core/videobuf2-core.c
>> +++ b/drivers/media/v4l2-core/videobuf2-core.c
>> @@ -194,8 +194,6 @@ static void __enqueue_in_driver(struct vb2_buffer *vb);
>> static int __vb2_buf_mem_alloc(struct vb2_buffer *vb)
>> {
>> struct vb2_queue *q = vb->vb2_queue;
>> - enum dma_data_direction dma_dir =
>> - q->is_output ? DMA_TO_DEVICE : DMA_FROM_DEVICE;
>> void *mem_priv;
>> int plane;
>> int ret = -ENOMEM;
>> @@ -209,7 +207,7 @@ static int __vb2_buf_mem_alloc(struct vb2_buffer *vb)
>>
>> mem_priv = call_ptr_memop(vb, alloc,
>> q->alloc_devs[plane] ? : q->dev,
>> - q->dma_attrs, size, dma_dir, q->gfp_flags);
>> + q->dma_attrs, size, q->dma_dir, q->gfp_flags);
>
> My bad, I guess I expressed myself unclearly.
>
> Could you introduce the macro in this patch? You can then remove q->dma_dir
> altogether.
My bad. Sorry for the confusion...
The v3 is on its way.
Regards,
Thierry
Powered by blists - more mailing lists