[libcamera-devel] [PATCH v2 0/4] Move frame contexts queue to separate class

Umang Jain umang.jain at ideasonboard.com
Sat Jun 18 19:18:07 CEST 2022


Changes in v2:
- In 1/4, inherit from std::vector instead of std::array
- In 2/4, head and tail pointers are dropped and frame counters
  representing corresponding markers are used
  (so we can resize later)
- In 3/4, it is overhauled completely - but the goal is same,
  preventing FCQueue being overflowed with requests
- 4/4 is unchanged.
- Documentation is extensively included to understand the internals
- Fix the possibility of wrong slot of IPAFrameContext being delivered
  as call to .get() (was a bug in v1)
- 2 \todos to resolve - needs some discussion - one related to
  frame-drops (in 2/4), other is where to define size of the Queue
  (in 3/4).
- Branch: uajain/FCQueue

Changes in v1 (from RFCv2):
- Implement a proper mechanism to prevent FCQueue oveflow
- Docs fixes
- Minor &reference => *pointer conversions.

Summary:
This patch series moves the frame contexts ring buffer to a separate
class. Minimialistic implementation in 1/4 to keep things run same.

Patch 2/4 extends the .get() function to handle cases as :
- Return same IPAFrameContext if previously created
- Assign a new IPAFrameContext if the frame contexts for frame didn't
  exists
- isFull() detection

Patch 3/4 implements a mechanism to prevent overflowing the FCQueue
but changes are made to Base pipeline handler as suggested in v1

Patch 4/4 removes IPAFrameContext pointer requirement from
Algorithm::process() and use a frame number instead.

Umang Jain (4):
  ipa: ipu3: Separate out frame context queue as a distinct class
  ipa: ipu3: ipa_context: Extend FCQueue::get()
  libcamera: pipeline-handler: Consider max in-flight requests
    constraint
  ipa: algorithm: process() should take in frame number instead of
    context

 include/libcamera/internal/pipeline_handler.h |   6 +
 include/libcamera/ipa/ipu3.mojom              |   1 +
 src/ipa/ipu3/algorithms/af.cpp                |   4 +-
 src/ipa/ipu3/algorithms/af.h                  |   2 +-
 src/ipa/ipu3/algorithms/agc.cpp               |  13 +-
 src/ipa/ipu3/algorithms/agc.h                 |   4 +-
 src/ipa/ipu3/algorithms/algorithm.h           |   4 +-
 src/ipa/ipu3/algorithms/awb.cpp               |   2 +-
 src/ipa/ipu3/algorithms/awb.h                 |   2 +-
 src/ipa/ipu3/algorithms/tone_mapping.cpp      |   4 +-
 src/ipa/ipu3/algorithms/tone_mapping.h        |   2 +-
 src/ipa/ipu3/ipa_context.cpp                  | 146 +++++++++++++++++-
 src/ipa/ipu3/ipa_context.h                    |  21 ++-
 src/ipa/ipu3/ipu3.cpp                         |  23 +--
 src/ipa/libipa/algorithm.cpp                  |   2 +-
 src/ipa/libipa/algorithm.h                    |   6 +-
 src/ipa/rkisp1/algorithms/agc.cpp             |   3 +-
 src/ipa/rkisp1/algorithms/agc.h               |   2 +-
 src/ipa/rkisp1/algorithms/algorithm.h         |   5 +-
 src/ipa/rkisp1/algorithms/awb.cpp             |   2 +-
 src/ipa/rkisp1/algorithms/awb.h               |   2 +-
 src/ipa/rkisp1/rkisp1.cpp                     |   2 +-
 src/libcamera/pipeline/ipu3/ipu3.cpp          |   9 ++
 src/libcamera/pipeline_handler.cpp            |  50 +++++-
 24 files changed, 272 insertions(+), 45 deletions(-)

-- 
2.31.1



More information about the libcamera-devel mailing list