Re: [PATCH] media: imx: Round line size to 4 bytes

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

 



On Sun, 2021-10-17 at 13:07 +0200, Dorota Czaplejewicz wrote:
> Hello,
> 
> On Thu, 14 Oct 2021 13:26:26 +0200
> Philipp Zabel <p.zabel@xxxxxxxxxxxxxx> wrote:
> 
> > Hi Dorota,
> > 
> > On Wed, 2021-10-13 at 11:26 +0200, Dorota Czaplejewicz wrote:
> > > On Fri, 08 Oct 2021 14:19:41 +0200 Philipp Zabel <p.zabel@xxxxxxxxxxxxxx> wrote:  
> > [...]
> > > > I wonder: if you use 4-byte aligned width and odd height, does the CSI
> > > > write over the end of the buffer?  
> > > 
> > > I tested this case, and found a glitch which suggests the last 4 bytes are ignored:
> > > 
> > > https://source.puri.sm/Librem5/linux-next/uploads/cfb59e3832431aaa3a69549455502568/image.png  
> > 
> > Thank you for testing, so it appears that at least without FBUF_STRIDE
> > the only requirement is that the whole image size must be a multiple of
> > 8 bytes.
> > 
> > > That would be taken care of rounding up towards a number decided at runtime, like:
> > > 
> > > divisor = 8 >> (mbus->height % 2);  
> > 
> > Which would then cause the CSI to write past the end of the buffer?
> > 
> I'm not sure if you point out the mistake here (should be "4 <<"), or
> the fact that rounding is happening. If it's the latter, then it's of
> no concern: the values derived here are used to calculate buffer size.
> 
> I'm submitting a new series where this is fixed.

Thanks, I just didn't understand your intention. The name "divisor"
threw me off, see the comment in the new series.

regards
Philipp





[Index of Archives]     [Linux Driver Development]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux