ipa: rpi: Add hardware line rate constraints

Advertise hardware constraints on the pixel processing rate through the
Controller::HardwareConfig structure. When calculating the minimum line
length during a configure() operation, ensure that we don't exceed this
constraint.

If we do exceed the hardware constraints, increase the modes's minimum
line length so the pixel processing rate falls below the hardware limit.
If this is not possible, throw a loud error message in the logs.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Naushir Patuck
2024-01-04 11:38:55 +00:00
committed by Laurent Pinchart
parent 577e0c6b76
commit 271598618d
3 changed files with 49 additions and 0 deletions
+20
View File
@@ -17,6 +17,7 @@
using namespace RPiController;
using namespace libcamera;
using namespace std::literals::chrono_literals;
LOG_DEFINE_CATEGORY(RPiController)
@@ -37,6 +38,7 @@ static const std::map<std::string, Controller::HardwareConfig> HardwareConfigMap
.numGammaPoints = 33,
.pipelineWidth = 13,
.statsInline = false,
.minPixelProcessingTime = 0s,
}
},
{
@@ -51,6 +53,24 @@ static const std::map<std::string, Controller::HardwareConfig> HardwareConfigMap
.numGammaPoints = 64,
.pipelineWidth = 16,
.statsInline = true,
/*
* The constraint below is on the rate of pixels going
* from CSI2 peripheral to ISP-FE (400Mpix/s, plus tiny
* overheads per scanline, for which 380Mpix/s is a
* conservative bound).
*
* There is a 64kbit data FIFO before the bottleneck,
* which means that in all reasonable cases the
* constraint applies at a timescale >= 1 scanline, so
* adding horizontal blanking can prevent loss.
*
* If the backlog were to grow beyond 64kbit during a
* single scanline, there could still be loss. This
* could happen using 4 lanes at 1.5Gbps at 10bpp with
* frames wider than ~16,000 pixels.
*/
.minPixelProcessingTime = 1.0us / 380,
}
},
};