pipeline: rkisp1: Limit sensor size to max resolution

In RkISPPath::validate() the sensor sizes are correctly filtered to the
ones supported by the ISP. But later in RkISPPipeline::configure() the
configured stream size is passed to sensor->getFormat() and the
CameraSensor class chooses the best sensor format for the requested
stream size. This can result in a sensor format that is too big for the
ISP. Fix that by supplying the maximum resolution supported by the ISP
to setFormat().

Fixes: 761545407c ("pipeline: rkisp1: Filter out sensor sizes not supported by the pipeline")
Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
This commit is contained in:
Stefan Klug 2024-12-16 16:41:00 +01:00
parent 60e94a0d99
commit 62959e1f89
2 changed files with 3 additions and 1 deletions

View file

@ -677,7 +677,8 @@ CameraConfiguration::Status RkISP1CameraConfiguration::validate()
[](const auto &value) { return value.second; }); [](const auto &value) { return value.second; });
} }
sensorFormat_ = sensor->getFormat(mbusCodes, maxSize); sensorFormat_ = sensor->getFormat(mbusCodes, maxSize,
mainPath->maxResolution());
if (sensorFormat_.size.isNull()) if (sensorFormat_.size.isNull())
sensorFormat_.size = sensor->resolution(); sensorFormat_.size = sensor->resolution();

View file

@ -62,6 +62,7 @@ public:
int queueBuffer(FrameBuffer *buffer) { return video_->queueBuffer(buffer); } int queueBuffer(FrameBuffer *buffer) { return video_->queueBuffer(buffer); }
Signal<FrameBuffer *> &bufferReady() { return video_->bufferReady; } Signal<FrameBuffer *> &bufferReady() { return video_->bufferReady; }
const Size &maxResolution() const { return maxResolution_; }
private: private:
void populateFormats(); void populateFormats();