media: rcar-vin: Gen3 can not scale NV12
authorNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Sat, 11 Feb 2023 20:54:31 +0000 (21:54 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Mon, 8 May 2023 11:11:24 +0000 (12:11 +0100)
The VIN modules on Gen3 can not scale NV12, fail format validation if
the user tries. Currently no frames are produced if this is attempted.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
drivers/media/platform/renesas/rcar-vin/rcar-dma.c

index 98bfd445a649bcc4d32a217988dfcac0b6e51912..cc6b59e5621aef042db200aa4af5946c2e75d92b 100644 (file)
@@ -1312,6 +1312,11 @@ static int rvin_mc_validate_format(struct rvin_dev *vin, struct v4l2_subdev *sd,
        }
 
        if (rvin_scaler_needed(vin)) {
+               /* Gen3 can't scale NV12 */
+               if (vin->info->model == RCAR_GEN3 &&
+                   vin->format.pixelformat == V4L2_PIX_FMT_NV12)
+                       return -EPIPE;
+
                if (!vin->scaler)
                        return -EPIPE;
        } else {