[libcamera-devel] [PATCH 4/4] tests: camera-sensor: Drop check on media bus format

Laurent Pinchart laurent.pinchart at ideasonboard.com
Mon Aug 5 19:44:15 CEST 2019


Hi Niklas,

Thank you for the patch.

On Mon, Aug 05, 2019 at 05:51:33PM +0200, Niklas Söderlund wrote:
> Linux commit b6c61a6c37317efd ("media: vimc: propagate pixel format in
> the stream") changes the sensor in the vimc media graph to accept any
> media bus format set on it. This prevents the camera-sensor test case to
> verify that a supported media bus format is selected.

It's not any format, there's still an explicit list of supported formats
(which grew quite long, I agree, and I don't think this is right, but
that's a separate issue - although if you have time to ping Helen about
this, it could be useful). In order to keep the test meaningful, how
about changing the first item in the list of formats passed to
getFormat() to a known to be invalid value (0xffff, 0xdeadbeef or
anything similarly wrong) ?

> In lack of a better fix remove the check for media bus format.
> 
> Signed-off-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>
> ---
>  test/camera-sensor.cpp | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/test/camera-sensor.cpp b/test/camera-sensor.cpp
> index 092cbdd8111ce70d..a04b7333daecd9dd 100644
> --- a/test/camera-sensor.cpp
> +++ b/test/camera-sensor.cpp
> @@ -87,10 +87,8 @@ protected:
>  								  MEDIA_BUS_FMT_SBGGR10_1X10,
>  								  MEDIA_BUS_FMT_BGR888_1X24 },
>  								Size(1024, 768));
> -		if (format.mbus_code != MEDIA_BUS_FMT_SBGGR10_1X10 ||
> -		    format.size != Size(4096, 2160)) {
> -			cerr << "Failed to get a suitable format, expected 4096x2160-0x"
> -			     << std::hex << MEDIA_BUS_FMT_SBGGR10_1X10
> +		if (format.size != Size(4096, 2160)) {
> +			cerr << "Failed to get a suitable format, expected 4096x2160"
>  			     << ", got " << format.toString() << endl;
>  			return TestFail;
>  		}

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list