Re: [PATCH] media: rcar-vin: Fix stride setting for RAW8 formats

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Tomi,

On 2025-05-30 14:58:17 +0300, Tomi Valkeinen wrote:
> Hi,
> 
> On 02/04/2025 21:33, Niklas Söderlund wrote:
> > 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@xxxxxxxxxxxx>
> > ---
> >  .../media/platform/renesas/rcar-vin/rcar-dma.c   | 16 ----------------
> >  1 file changed, 16 deletions(-)
> > 
> > diff --git a/drivers/media/platform/renesas/rcar-vin/rcar-dma.c b/drivers/media/platform/renesas/rcar-vin/rcar-dma.c
> > index f8394be8a922..fdf0f86c801f 100644
> > --- a/drivers/media/platform/renesas/rcar-vin/rcar-dma.c
> > +++ b/drivers/media/platform/renesas/rcar-vin/rcar-dma.c
> > @@ -680,22 +680,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);
> >  }
> >  
> 
> This one breaks RAW8 for me (V4H, streams, GMSL2 + imx219 sensors). How
> did you test this?

I tested this with V4H and IMX219 and IMX462.

As you point out in your other reply the documentation is a tad unclear.  
I don't have access to it atm, but from memory there where two 8-bit 
modes. One operated in 1-byte units, the other in 2-byte units. This fix 
addresses the 1-byt use-case.

I will get back to you when I'm back in the office with better 
references to the documentation. Just wanted to let you know how this 
was tested.

> 
>  Tomi
> 

-- 
Kind Regards,
Niklas Söderlund




[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux