lkml.org 
[lkml]   [2020]   [Jan]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC][PATCH 14/15] videobuf2: don't test db_attach in dma-contig prepare and finish
From
Date
On 12/17/19 4:20 AM, Sergey Senozhatsky wrote:
> We moved cache management decision making to the upper layer and
> rely on buffer's need_cache_sync flags and videobuf2 core. If the
> upper layer (core) has decided to invoke ->prepare() or ->finish()
> then we must sync.
>
> For DMABUF ->need_cache_sync_on_prepare and ->need_cache_sync_on_flush
> are always false so videobuf core does not call ->prepare() and
> ->finish() on such buffers.
>
> Additionally, scratch the DMABUF comment.

Just combine this and the next patch into a single patch. No need to
split this up.

Regards,

Hans

>
> Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org>
> ---
> drivers/media/common/videobuf2/videobuf2-dma-contig.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/media/common/videobuf2/videobuf2-dma-contig.c b/drivers/media/common/videobuf2/videobuf2-dma-contig.c
> index a387260fb321..6ea0961149d7 100644
> --- a/drivers/media/common/videobuf2/videobuf2-dma-contig.c
> +++ b/drivers/media/common/videobuf2/videobuf2-dma-contig.c
> @@ -100,8 +100,7 @@ static void vb2_dc_prepare(void *buf_priv)
> struct vb2_dc_buf *buf = buf_priv;
> struct sg_table *sgt = buf->dma_sgt;
>
> - /* DMABUF exporter will flush the cache for us */
> - if (!sgt || buf->db_attach)
> + if (!sgt)
> return;
>
> dma_sync_sg_for_device(buf->dev, sgt->sgl, sgt->orig_nents,
> @@ -113,8 +112,7 @@ static void vb2_dc_finish(void *buf_priv)
> struct vb2_dc_buf *buf = buf_priv;
> struct sg_table *sgt = buf->dma_sgt;
>
> - /* DMABUF exporter will flush the cache for us */
> - if (!sgt || buf->db_attach)
> + if (!sgt)
> return;
>
> dma_sync_sg_for_cpu(buf->dev, sgt->sgl, sgt->orig_nents, buf->dma_dir);
>

\
 
 \ /
  Last update: 2020-01-10 11:33    [W:0.218 / U:17.900 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site