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

Message ID 20190805155133.11335-5-niklas.soderlund@ragnatech.se
State Superseded
Headers show
Series
  • libcamera: Fix issues with vimc and Linux v5.2
Related show

Commit Message

Niklas Söderlund Aug. 5, 2019, 3:51 p.m. UTC
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.

In lack of a better fix remove the check for media bus format.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
---
 test/camera-sensor.cpp | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

Laurent Pinchart Aug. 5, 2019, 5:44 p.m. UTC | #1
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@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;
>  		}

Patch

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;
 		}