Hi,
Our product has been using TX2 JetPack 4.6 as the release version, and we currently need to fix the issue of V4L2 buffering 2 frames. After applying the modifications mentioned in the link below for verification, we found them to be effective. My question is whether there is an official patch for JetPack 4.6 to avoid potential issues introduced by incomplete modifications in the linked solution.
thanks
hello wwwaaa,
unfortunately, we don’t have official patch for this issue. as you can see.. JetPack 4 Reaches End of Life.
Thank you for the information.
Could you please confirm if the method to reduce the V4L2 buffer to 2 frames consists of the following three modifications, or if there are any additional changes needed?
1.kernel/nvidia/include/media/mc_common.h
QUEUED_BUFFERS = 2
2.diff --git a/drivers/media/platform/tegra/camera/vi/channel.c b/drivers/media/platform/tegra/camera/vi/channel.c
index 0a07f9d..057678f 100644
--- a/drivers/media/platform/tegra/camera/vi/channel.c
+++ b/drivers/media/platform/tegra/camera/vi/channel.c
@@ -525,7 +525,7 @@ static void add_buffer_to_ring(struct tegra_channel *chan,
static void update_state_to_buffer(struct tegra_channel *chan, int state)
{
- int save_index = (chan->save_index - PREVIOUS_BUFFER_DEC_INDEX);
+ int save_index = (chan->save_index - 1);
/* save index decrements by 2 as 3 bufs are added in ring buffer */
if (save_index < 0)
@@ -565,7 +565,7 @@ void tegra_channel_ring_buffer(struct tegra_channel *chan,
}
/* release buffer N at N+2 frame start event */
- if (chan->num_buffers >= (chan->capture_queue_depth - 1))
+ //if (chan->num_buffers >= (chan->capture_queue_depth - 1))
free_ring_buffers(chan, 1);
}
3.diff --git a/drivers/media/platform/tegra/camera/vi/vi4_fops.c b/drivers/media/platform/tegra/camera/vi/vi4_fops.c
index 9bcae78..e481552 100644
--- a/drivers/media/platform/tegra/camera/vi/vi4_fops.c
+++ b/drivers/media/platform/tegra/camera/vi/vi4_fops.c
@@ -206,7 +206,7 @@ static bool vi_notify_wait(struct tegra_channel *chan,
*/
for (i = 0; i < chan->valid_ports; i++) {
err = nvhost_syncpt_wait_timeout_ext(chan->vi->ndev,
- chan->syncpt[i][SOF_SYNCPT_IDX], thresh[i],
+ chan->syncpt[i][FE_SYNCPT_IDX], thresh[i],
chan->timeout, NULL, NULL);
if (unlikely(err)) {
dev_err(chan->vi->dev,
hello wwwaaa,
on the other hand, there’s two thread approach in VI-4 driver to have better performance.
this is CID control of.. TEGRA_CAMERA_CID_LOW_LATENCY
.
it’s used by VI-4 driver for select multi-thread approach (i.e. chan->low_latency
) to obtain frame buffer quickly.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.