[0/5] Add InfoFrame
mbox series

Message ID 20241009074642.2965791-1-chenghaoyang@chromium.org
Headers show
Series
  • Add InfoFrame
Related show

Message

Harvey Yang Oct. 9, 2024, 7:41 a.m. UTC
Hi folks,

This series of patches adds MailBox, Pool and InfoFrame as helper
classes, which are useful to save duplicated code in the upcoming
mtkisp7 implementation. We also think that they're helpful for other
pipeline handlers.

It's based on the `Add VirtualPipelineHandler` series, as one
of the patch updates struct FrameBuffer.

We can also check if we should append DmaBufAllocator to support
strideAlign and scanAlign, so that InfoFramePool can save some
duplicated code.

It passed the gitlab pipeline:
https://gitlab.freedesktop.org/chenghaoyang/libcamera/-/pipelines/1286167

Please take a look. Thanks!

BR,
Harvey

Han-Lin Chen (2):
  libcamera: Add mailbox template helper
  libcamera: format: Extend plane size calculation to accept scanline
    alignment

Harvey Yang (3):
  libcamera: Add template for pool implementation
  libcamera: Add stride in FrameBuffer::Plane
  libcamera: Add InfoFrame implememtation

 include/libcamera/framebuffer.h         |   1 +
 include/libcamera/internal/formats.h    |   5 +-
 include/libcamera/internal/info_frame.h | 105 ++++++++
 include/libcamera/internal/mailbox.h    |  75 ++++++
 include/libcamera/internal/meson.build  |   3 +
 include/libcamera/internal/pool.h       | 119 ++++++++++
 src/libcamera/dma_buf_allocator.cpp     |   3 +-
 src/libcamera/formats.cpp               |  17 +-
 src/libcamera/framebuffer.cpp           |   5 +
 src/libcamera/info_frame.cpp            | 302 ++++++++++++++++++++++++
 src/libcamera/ipa_data_serializer.cpp   |   3 +
 src/libcamera/mailbox.cpp               |  60 +++++
 src/libcamera/meson.build               |   3 +
 src/libcamera/pool.cpp                  |  70 ++++++
 14 files changed, 764 insertions(+), 7 deletions(-)
 create mode 100644 include/libcamera/internal/info_frame.h
 create mode 100644 include/libcamera/internal/mailbox.h
 create mode 100644 include/libcamera/internal/pool.h
 create mode 100644 src/libcamera/info_frame.cpp
 create mode 100644 src/libcamera/mailbox.cpp
 create mode 100644 src/libcamera/pool.cpp

Comments

Kieran Bingham Oct. 9, 2024, 10:46 p.m. UTC | #1
Hi Harvey,

Quoting Harvey Yang (2024-10-09 08:41:18)
> Hi folks,
> 
> This series of patches adds MailBox, Pool and InfoFrame as helper
> classes, which are useful to save duplicated code in the upcoming
> mtkisp7 implementation. We also think that they're helpful for other
> pipeline handlers.
> 
> It's based on the `Add VirtualPipelineHandler` series, as one
> of the patch updates struct FrameBuffer.
> 
> We can also check if we should append DmaBufAllocator to support
> strideAlign and scanAlign, so that InfoFramePool can save some
> duplicated code.
> 
> It passed the gitlab pipeline:
> https://gitlab.freedesktop.org/chenghaoyang/libcamera/-/pipelines/1286167
> 
> Please take a look. Thanks!

these certainly look interesting, but without users it's hard to fully
grasp what they're doing.

I think at least the MailBox and Pool would likely benefit from unit
tests to be added. Adding unit tests would also show how they can be
used (or not used) and would help a lot with reviewing.

Or possibly as well, converting other pipeline handlers to use the
helpers if it they are to be common helpers would really be useful to
see the power they are delivering.

--
Kieran


> 
> BR,
> Harvey
> 
> Han-Lin Chen (2):
>   libcamera: Add mailbox template helper
>   libcamera: format: Extend plane size calculation to accept scanline
>     alignment
> 
> Harvey Yang (3):
>   libcamera: Add template for pool implementation
>   libcamera: Add stride in FrameBuffer::Plane
>   libcamera: Add InfoFrame implememtation
> 
>  include/libcamera/framebuffer.h         |   1 +
>  include/libcamera/internal/formats.h    |   5 +-
>  include/libcamera/internal/info_frame.h | 105 ++++++++
>  include/libcamera/internal/mailbox.h    |  75 ++++++
>  include/libcamera/internal/meson.build  |   3 +
>  include/libcamera/internal/pool.h       | 119 ++++++++++
>  src/libcamera/dma_buf_allocator.cpp     |   3 +-
>  src/libcamera/formats.cpp               |  17 +-
>  src/libcamera/framebuffer.cpp           |   5 +
>  src/libcamera/info_frame.cpp            | 302 ++++++++++++++++++++++++
>  src/libcamera/ipa_data_serializer.cpp   |   3 +
>  src/libcamera/mailbox.cpp               |  60 +++++
>  src/libcamera/meson.build               |   3 +
>  src/libcamera/pool.cpp                  |  70 ++++++
>  14 files changed, 764 insertions(+), 7 deletions(-)
>  create mode 100644 include/libcamera/internal/info_frame.h
>  create mode 100644 include/libcamera/internal/mailbox.h
>  create mode 100644 include/libcamera/internal/pool.h
>  create mode 100644 src/libcamera/info_frame.cpp
>  create mode 100644 src/libcamera/mailbox.cpp
>  create mode 100644 src/libcamera/pool.cpp
> 
> -- 
> 2.47.0.rc0.187.ge670bccf7e-goog
>