ipa: vimc: Map and unmap buffers
VIMC pipeline handler has dmabuf-backed mock FrameBuffers which are specifically targetted mimicking IPA buffers (parameter and statistics). Map these mock buffers to the VIMC IPA that would enable exercising IPA IPC code paths. This will provide leverage to our test suite to test IPA IPC code paths, which are common to various platforms. Signed-off-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
@@ -334,6 +334,14 @@ int PipelineHandlerVimc::start(Camera *camera, [[maybe_unused]] const ControlLis
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
/* Map the mock IPA buffers to VIMC IPA to exercise IPC code paths. */
|
||||
std::vector<IPABuffer> ipaBuffers;
|
||||
for (auto [i, buffer] : utils::enumerate(data->mockIPABufs_)) {
|
||||
buffer->setCookie(i + 1);
|
||||
ipaBuffers.emplace_back(buffer->cookie(), buffer->planes());
|
||||
}
|
||||
data->ipa_->mapBuffers(ipaBuffers);
|
||||
|
||||
ret = data->ipa_->start();
|
||||
if (ret) {
|
||||
data->video_->releaseBuffers();
|
||||
@@ -354,7 +362,13 @@ void PipelineHandlerVimc::stop(Camera *camera)
|
||||
{
|
||||
VimcCameraData *data = cameraData(camera);
|
||||
data->video_->streamOff();
|
||||
|
||||
std::vector<unsigned int> ids;
|
||||
for (const std::unique_ptr<FrameBuffer> &buffer : data->mockIPABufs_)
|
||||
ids.push_back(buffer->cookie());
|
||||
data->ipa_->unmapBuffers(ids);
|
||||
data->ipa_->stop();
|
||||
|
||||
data->video_->releaseBuffers();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user