[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4778394.31r3eYUQgx@kista>
Date: Mon, 31 Oct 2022 10:15:21 +0100
From: Jernej Škrabec <jernej.skrabec@...il.com>
To: linux-kernel@...r.kernel.org, linux-media@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-sunxi@...ts.linux.dev,
Paul Kocialkowski <paul.kocialkowski@...tlin.com>
Cc: Yong Deng <yong.deng@...ewell.com>,
Paul Kocialkowski <paul.kocialkowski@...tlin.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Chen-Yu Tsai <wens@...e.org>,
Samuel Holland <samuel@...lland.org>,
Laurent Pinchart <laurent.pinchart@...asonboard.com>,
Maxime Ripard <mripard@...nel.org>,
Thomas Petazzoni <thomas.petazzoni@...tlin.com>
Subject: Re: [PATCH v6 18/43] media: sun6i-csi: Add capture state using vsync for page flip
Dne petek, 26. avgust 2022 ob 20:32:15 CET je Paul Kocialkowski napisal(a):
> The current implementation requires up to 3 buffers to properly
> implement page flipping without losing frames: one is configured
> before the video stream is started, one just after that and page
> flipping is synchronized to the frame done interrupt. The comment in
> the code mentions that "CSI will lookup the next dma buffer for next
> frame before the current frame done IRQ triggered".
>
> Based on observations of the CSI unit behavior, it seems that the
> buffer DMA address is sampled when the frame scan begins (in addition
> to starting the stream), which corresponds to the vblank interrupt
> that hits just before the frame-done interrupt of the previous frame.
>
> As a result, the address configured at the frame done interrupt is not
> actually used for the next frame but for the one after that.
>
> This proposal changes the page flipping sync point to the vsync
> interrupt, which allows the DMA address to be sampled for the next
> frame instead and allows operating with only two buffers.
>
> In addition to the change in the sync point, the code is refactored
> to introduce a notion of state that clarifies tracking of the buffers
> with tidy functions.
>
> Signed-off-by: Paul Kocialkowski <paul.kocialkowski@...tlin.com>
Acked-by: Jernej Skrabec <jernej.skrabec@...il.com>
Best regards,
Jernej
Powered by blists - more mailing lists