]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
media: rcar-vin: Fix stride setting for RAW8 formats
authorNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Wed, 2 Apr 2025 18:33:02 +0000 (20:33 +0200)
committerHans Verkuil <hverkuil@xs4all.nl>
Wed, 23 Apr 2025 08:55:52 +0000 (10:55 +0200)
Earlier versions of the datasheet where unclear about the stride setting
for RAW8 capture formats. Later datasheets clarifies that the stride
only process in this mode for non-image data. For image data the full
stride shall be used. Compare section "RAW: 8 Bits and Embedded 8-Bit
Non-Image Data, User Defined 8-bit Data" vs "RAW: 8 Bits".

Remove the special case from pixel formats that carry image data and
treat it as any other image format.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Link: https://lore.kernel.org/r/20250402183302.140055-1-niklas.soderlund+renesas@ragnatech.se
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
drivers/media/platform/renesas/rcar-vin/rcar-dma.c

index 8de8712404409c1e75a121f0fba095704948b475..edb06730bc7c065ca7361b99cb12bd9c115cb524 100644 (file)
@@ -679,22 +679,6 @@ void rvin_crop_scale_comp(struct rvin_dev *vin)
 
        fmt = rvin_format_from_pixel(vin, vin->format.pixelformat);
        stride = vin->format.bytesperline / fmt->bpp;
-
-       /* For RAW8 format bpp is 1, but the hardware process RAW8
-        * format in 2 pixel unit hence configure VNIS_REG as stride / 2.
-        */
-       switch (vin->format.pixelformat) {
-       case V4L2_PIX_FMT_SBGGR8:
-       case V4L2_PIX_FMT_SGBRG8:
-       case V4L2_PIX_FMT_SGRBG8:
-       case V4L2_PIX_FMT_SRGGB8:
-       case V4L2_PIX_FMT_GREY:
-               stride /= 2;
-               break;
-       default:
-               break;
-       }
-
        rvin_write(vin, stride, VNIS_REG);
 }