[libcamera-devel] [PATCH] libcamera: camera_sensor: Do not initialise unsupported test patterns

Naushir Patuck naush at raspberrypi.com
Mon Feb 21 15:49:20 CET 2022


Hi Kieran,

Thank you for your patch.

On Sat, 12 Feb 2022 at 23:34, Kieran Bingham <
kieran.bingham at ideasonboard.com> wrote:

> After the CameraSensor class has initialised properties, a default
> setting is applied to ensure that test pattern modes are disabled unless
> explicitly requested.
>
> This does not currently check to see if test patterns are supported on
> the CameraSensor and the applyTestPatternMode call will report a failure
> if it attempts to set a mode when not supported.
>
> Move the initialisation of the test pattern mode to the implementation
> of the control mappings to ensure that it is correctly reset at start
> up, while the code path will have already completed early if not
> supported.
>
> Bug: https://github.com/raspberrypi/libcamera-apps/issues/249
> Signed-off-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
>

This does reduce panic caused by the error message on startup for our
imx477 users :-)

Reviewed-by: Naushir Patuck <naush at raspberrypi.com>


> ---
>  src/libcamera/camera_sensor.cpp | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/src/libcamera/camera_sensor.cpp
> b/src/libcamera/camera_sensor.cpp
> index 345b4a170d47..3a6a1a6bca77 100644
> --- a/src/libcamera/camera_sensor.cpp
> +++ b/src/libcamera/camera_sensor.cpp
> @@ -172,7 +172,7 @@ int CameraSensor::init()
>         if (ret)
>                 return ret;
>
> -       return
> applyTestPatternMode(controls::draft::TestPatternModeEnum::TestPatternModeOff);
> +       return 0;
>  }
>
>  int CameraSensor::validateSensorDriver()
> @@ -372,6 +372,9 @@ void CameraSensor::initTestPatternModes()
>
>                 testPatternModes_.push_back(it->second);
>         }
> +
> +       /* Initialise the sensor with test patterns disabled. */
> +
>  applyTestPatternMode(controls::draft::TestPatternModeEnum::TestPatternModeOff);
>  }
>
>  int CameraSensor::initProperties()
> --
> 2.32.0
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.libcamera.org/pipermail/libcamera-devel/attachments/20220221/91dd0ad9/attachment.htm>


More information about the libcamera-devel mailing list