mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-24 00:55:07 +03:00
libcamera: pipeline: rkisp1: Destroy frame information before completing request
It's common for applications to create and queue a new request in a previous request completion handler. When the new request gets queued to the RkISP1 pipeline handler it tries to find a parameters and statistic buffer to be used with the request. The problem is if the pipeline depth is already filled there are no internal buffers free to be used by the new request. This was solved by allocation one more parameters and statistic buffer then the pipeline depth, this is waste full. Instead free the resources of the request that has completed before it is signaled to the application, this way if the pipeline depth is full it can reuse the internal resources and the wasteful allocation can be removed. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
parent
6e1e847753
commit
96312d6dbb
1 changed files with 6 additions and 6 deletions
|
@ -671,14 +671,14 @@ int PipelineHandlerRkISP1::allocateBuffers(Camera *camera,
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
paramPool_.createBuffers(stream->configuration().bufferCount + 1);
|
||||
paramPool_.createBuffers(stream->configuration().bufferCount);
|
||||
ret = param_->exportBuffers(¶mPool_);
|
||||
if (ret) {
|
||||
video_->releaseBuffers();
|
||||
return ret;
|
||||
}
|
||||
|
||||
statPool_.createBuffers(stream->configuration().bufferCount + 1);
|
||||
statPool_.createBuffers(stream->configuration().bufferCount);
|
||||
ret = stat_->exportBuffers(&statPool_);
|
||||
if (ret) {
|
||||
param_->releaseBuffers();
|
||||
|
@ -686,13 +686,13 @@ int PipelineHandlerRkISP1::allocateBuffers(Camera *camera,
|
|||
return ret;
|
||||
}
|
||||
|
||||
for (unsigned int i = 0; i < stream->configuration().bufferCount + 1; i++) {
|
||||
for (unsigned int i = 0; i < stream->configuration().bufferCount; i++) {
|
||||
data->ipaBuffers_.push_back({ .id = RKISP1_PARAM_BASE | i,
|
||||
.planes = paramPool_.buffers()[i].planes() });
|
||||
paramBuffers_.push(new Buffer(i));
|
||||
}
|
||||
|
||||
for (unsigned int i = 0; i < stream->configuration().bufferCount + 1; i++) {
|
||||
for (unsigned int i = 0; i < stream->configuration().bufferCount; i++) {
|
||||
data->ipaBuffers_.push_back({ .id = RKISP1_STAT_BASE | i,
|
||||
.planes = statPool_.buffers()[i].planes() });
|
||||
statBuffers_.push(new Buffer(i));
|
||||
|
@ -981,9 +981,9 @@ void PipelineHandlerRkISP1::tryCompleteRequest(Request *request)
|
|||
if (!info->paramDequeued)
|
||||
return;
|
||||
|
||||
completeRequest(activeCamera_, request);
|
||||
|
||||
data->frameInfo_.destroy(info->frame);
|
||||
|
||||
completeRequest(activeCamera_, request);
|
||||
}
|
||||
|
||||
void PipelineHandlerRkISP1::bufferReady(Buffer *buffer)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue