From: Marek Szyprowski <m.szyprowski@samsung.com>
To: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
Pawel Osciak <pawel@osciak.com>,
Kyungmin Park <kyungmin.park@samsung.com>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] media: vb2: unify calling of set_page_dirty_lock
Date: Tue, 10 Oct 2017 10:01:36 +0200 [thread overview]
Message-ID: <8c775a5d-e42a-761b-e5ef-6dee93d7f476@samsung.com> (raw)
In-Reply-To: <dd1e2f3e-18f1-ed77-2520-aac1bea0c1a9@linaro.org>
Hi Stanimir,
On 2017-10-10 09:42, Stanimir Varbanov wrote:
> Marek,
>
> Any comments?
Oh, I thought that this one has been already merged. If not (yet),
here is my ack.
> On 08/29/2017 02:26 PM, Stanimir Varbanov wrote:
>> Currently videobuf2-dma-sg checks for dma direction for
>> every single page and videobuf2-dc lacks any dma direction
>> checks and calls set_page_dirty_lock unconditionally.
>>
>> Thus unify and align the invocations of set_page_dirty_lock
>> for videobuf2-dc, videobuf2-sg memory allocators with
>> videobuf2-vmalloc, i.e. the pattern used in vmalloc has been
>> copied to dc and dma-sg.
>>
>> Suggested-by: Marek Szyprowski <m.szyprowski@samsung.com>
>> Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
>> ---
>> drivers/media/v4l2-core/videobuf2-dma-contig.c | 6 ++++--
>> drivers/media/v4l2-core/videobuf2-dma-sg.c | 7 +++----
>> 2 files changed, 7 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/media/v4l2-core/videobuf2-dma-contig.c b/drivers/media/v4l2-core/videobuf2-dma-contig.c
>> index 9f389f36566d..696e24f9128d 100644
>> --- a/drivers/media/v4l2-core/videobuf2-dma-contig.c
>> +++ b/drivers/media/v4l2-core/videobuf2-dma-contig.c
>> @@ -434,8 +434,10 @@ static void vb2_dc_put_userptr(void *buf_priv)
>> pages = frame_vector_pages(buf->vec);
>> /* sgt should exist only if vector contains pages... */
>> BUG_ON(IS_ERR(pages));
>> - for (i = 0; i < frame_vector_count(buf->vec); i++)
>> - set_page_dirty_lock(pages[i]);
>> + if (buf->dma_dir == DMA_FROM_DEVICE ||
>> + buf->dma_dir == DMA_BIDIRECTIONAL)
>> + for (i = 0; i < frame_vector_count(buf->vec); i++)
>> + set_page_dirty_lock(pages[i]);
>> sg_free_table(sgt);
>> kfree(sgt);
>> }
>> diff --git a/drivers/media/v4l2-core/videobuf2-dma-sg.c b/drivers/media/v4l2-core/videobuf2-dma-sg.c
>> index 6808231a6bdc..753ed3138dcc 100644
>> --- a/drivers/media/v4l2-core/videobuf2-dma-sg.c
>> +++ b/drivers/media/v4l2-core/videobuf2-dma-sg.c
>> @@ -292,11 +292,10 @@ static void vb2_dma_sg_put_userptr(void *buf_priv)
>> if (buf->vaddr)
>> vm_unmap_ram(buf->vaddr, buf->num_pages);
>> sg_free_table(buf->dma_sgt);
>> - while (--i >= 0) {
>> - if (buf->dma_dir == DMA_FROM_DEVICE ||
>> - buf->dma_dir == DMA_BIDIRECTIONAL)
>> + if (buf->dma_dir == DMA_FROM_DEVICE ||
>> + buf->dma_dir == DMA_BIDIRECTIONAL)
>> + while (--i >= 0)
>> set_page_dirty_lock(buf->pages[i]);
>> - }
>> vb2_destroy_framevec(buf->vec);
>> kfree(buf);
>> }
>>
Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland
next prev parent reply other threads:[~2017-10-10 8:01 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-29 11:26 Stanimir Varbanov
2017-10-10 7:42 ` Stanimir Varbanov
2017-10-10 8:01 ` Marek Szyprowski [this message]
2017-10-10 8:54 ` Sakari Ailus
2017-10-10 15:40 ` Nicolas Dufresne
2017-10-15 20:40 ` Sakari Ailus
2017-10-15 23:09 ` Nicolas Dufresne
2017-10-16 11:24 ` Sakari Ailus
2017-10-17 10:14 ` Sakari Ailus
2017-10-17 14:19 ` Nicolas Dufresne
2017-10-18 8:34 ` Stanimir Varbanov
2018-03-14 0:44 ` Nicolas Dufresne
2018-03-14 1:09 ` Nicolas Dufresne
2018-03-14 2:02 ` Nicolas Dufresne
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=8c775a5d-e42a-761b-e5ef-6dee93d7f476@samsung.com \
--to=m.szyprowski@samsung.com \
--cc=kyungmin.park@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=pawel@osciak.com \
--cc=stanimir.varbanov@linaro.org \
/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
all inboxes | Powered by JetHome®