mbox series

[v2,0/3] media: videobuf2-core: attach once if multiple planes share the same dbuf

Message ID 20240403091306.1308878-1-yunkec@chromium.org (mailing list archive)
Headers show
Series media: videobuf2-core: attach once if multiple planes share the same dbuf | expand

Message

Yunke Cao April 3, 2024, 9:13 a.m. UTC
Hi,

This patch set avoids attaching and mapping a dma_buf multiple times when
several planes in one vb2 buffer share the same dma_buf.

1/3 and 2/3 refactors __prepare_dmabuf()
3/3 adds a flag to avoid duplicated attaching

Changelog since v1:
- Add patch 1/3 to refactor __prepare_dmabuf()
- Add patch 2/3 to resolve Tomasz's comment on __vb2_buf_dmabuf_put()'s
iteration order
- Fix mem_priv in patch 3/3
- Rename duplicated_dbuf to dbuf_duplicated

Yunke Cao (3):
  media: videobuf2-core: release all planes first in __prepare_dmabuf()
  media: videobuf2-core: reverse the iteration order in
    __vb2_buf_dmabuf_put
  media: videobuf2-core: attach once if multiple planes share the same
    dbuf

 .../media/common/videobuf2/videobuf2-core.c   | 97 +++++++++++--------
 include/media/videobuf2-core.h                |  3 +
 2 files changed, 62 insertions(+), 38 deletions(-)

Comments

Hans Verkuil April 24, 2024, 10:25 a.m. UTC | #1
Tomasz,

I would appreciate it if you can review this series.

Regards,

	Hans

On 03/04/2024 11:13, Yunke Cao wrote:
> Hi,
> 
> This patch set avoids attaching and mapping a dma_buf multiple times when
> several planes in one vb2 buffer share the same dma_buf.
> 
> 1/3 and 2/3 refactors __prepare_dmabuf()
> 3/3 adds a flag to avoid duplicated attaching
> 
> Changelog since v1:
> - Add patch 1/3 to refactor __prepare_dmabuf()
> - Add patch 2/3 to resolve Tomasz's comment on __vb2_buf_dmabuf_put()'s
> iteration order
> - Fix mem_priv in patch 3/3
> - Rename duplicated_dbuf to dbuf_duplicated
> 
> Yunke Cao (3):
>   media: videobuf2-core: release all planes first in __prepare_dmabuf()
>   media: videobuf2-core: reverse the iteration order in
>     __vb2_buf_dmabuf_put
>   media: videobuf2-core: attach once if multiple planes share the same
>     dbuf
> 
>  .../media/common/videobuf2/videobuf2-core.c   | 97 +++++++++++--------
>  include/media/videobuf2-core.h                |  3 +
>  2 files changed, 62 insertions(+), 38 deletions(-)
>
Tomasz Figa May 8, 2024, 4:02 p.m. UTC | #2
On Wed, Apr 24, 2024 at 7:25 PM Hans Verkuil <hverkuil@xs4all.nl> wrote:
>
> Tomasz,
>
> I would appreciate it if you can review this series.

Sorry, I've been out for the last 2 weeks. Catching up now and should
get to this shortly.

Best,
Tomasz

>
> Regards,
>
>         Hans
>
> On 03/04/2024 11:13, Yunke Cao wrote:
> > Hi,
> >
> > This patch set avoids attaching and mapping a dma_buf multiple times when
> > several planes in one vb2 buffer share the same dma_buf.
> >
> > 1/3 and 2/3 refactors __prepare_dmabuf()
> > 3/3 adds a flag to avoid duplicated attaching
> >
> > Changelog since v1:
> > - Add patch 1/3 to refactor __prepare_dmabuf()
> > - Add patch 2/3 to resolve Tomasz's comment on __vb2_buf_dmabuf_put()'s
> > iteration order
> > - Fix mem_priv in patch 3/3
> > - Rename duplicated_dbuf to dbuf_duplicated
> >
> > Yunke Cao (3):
> >   media: videobuf2-core: release all planes first in __prepare_dmabuf()
> >   media: videobuf2-core: reverse the iteration order in
> >     __vb2_buf_dmabuf_put
> >   media: videobuf2-core: attach once if multiple planes share the same
> >     dbuf
> >
> >  .../media/common/videobuf2/videobuf2-core.c   | 97 +++++++++++--------
> >  include/media/videobuf2-core.h                |  3 +
> >  2 files changed, 62 insertions(+), 38 deletions(-)
> >
>