<div dir="ltr">Hi,<div><br></div><div>Ping for a review please.</div><div><br></div><div>Naush</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 5 Jul 2022 at 14:59, Naushir Patuck <<a href="mailto:naush@raspberrypi.com">naush@raspberrypi.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">The controls::ScalerCrop in the ControlInfoMap was advertised based on the ISP<br>
output Rectangle. This is incorrect, it needs to be set based on the sensor<br>
output Rectangle. Fix this.<br>
<br>
Additionally, do not use emplace to be consistent with the other controls set<br>
in the ControlInfoMap.<br>
<br>
Fixes: 9dacde0d651d (pipeline: raspberrypi: Advertise ScalerCrop from the pipeline handler)<br>
Reported-by: David Plowman <<a href="mailto:david.plowman@raspberrypi.com" target="_blank">david.plowman@raspberrypi.com</a>><br>
Signed-off-by: Naushir Patuck <<a href="mailto:naush@raspberrypi.com" target="_blank">naush@raspberrypi.com</a>><br>
---<br>
 src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 5 +++--<br>
 1 file changed, 3 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp<br>
index 66a84b1dfb97..fdc24cd530c2 100644<br>
--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp<br>
+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp<br>
@@ -946,8 +946,9 @@ int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config)<br>
                ctrlMap.emplace(c.first, c.second);<br>
<br>
        /* Add the ScalerCrop control limits based on the current mode. */<br>
-       ctrlMap.emplace(&controls::ScalerCrop,<br>
-                       ControlInfo(Rectangle(data->ispMinCropSize_), Rectangle(data->sensorInfo_.outputSize)));<br>
+       Rectangle ispMinCrop(data->ispMinCropSize_);<br>
+       ispMinCrop.scaleBy(data->sensorInfo_.analogCrop.size(), data->sensorInfo_.outputSize);<br>
+       ctrlMap[&controls::ScalerCrop] = ControlInfo(ispMinCrop, Rectangle(data->sensorInfo_.analogCrop.size()));<br>
<br>
        data->controlInfo_ = ControlInfoMap(std::move(ctrlMap), result.controlInfo.idmap());<br>
<br>
-- <br>
2.25.1<br>
<br>
</blockquote></div>