Skip to content

Commit 34f1f8a

Browse files
committed
[PATCH] Fix patch application process
1 parent 004b67f commit 34f1f8a

2 files changed

Lines changed: 52 additions & 2 deletions

File tree

apply_patches.sh

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,15 @@ apply_external_patches() {
6262
fi
6363
ls -Ld "${PWD}/$3/$2"
6464
ls -Lw1 "${PWD}/$3/$2"
65-
git -C "sources_$SOURCES_VERSION/$3" apply "${PWD}/$3/$2"/*
65+
# Apply patches individually to avoid corruption when concatenating multiple patches
66+
for patch in "${PWD}/$3/$2"/*; do
67+
echo "[PATCH] Applying $(basename "$patch")..."
68+
if git -C "sources_$SOURCES_VERSION/$3" apply "$patch"; then
69+
echo "[PATCH] Applied $(basename "$patch")"
70+
else
71+
echo "[PATCH] WARNING: Failed to apply $(basename "$patch") - will try Python fallback"
72+
fi
73+
done
6674
elif [ "$1" = "reset" ]; then
6775
if ! git -C "sources_$SOURCES_VERSION/$3" diff --quiet || ! git -C "sources_$SOURCES_VERSION/$3" diff --cached --quiet; then
6876
read -p "Repo sources_$SOURCES_VERSION/$3 has changes that will be hard reset. Continue (y/N)? " confirm
@@ -88,6 +96,21 @@ if [[ "$ACTION" = "apply" ]]; then
8896
if [[ "$JETPACK_VERSION" == "6.x" ]]; then
8997
# jp6 overlay
9098
cp hardware/realsense/tegra234-camera-d4xx-overlay*.dts "sources_$SOURCES_VERSION/hardware/nvidia/t23x/nv-public/overlay/"
99+
# Apply Y12I frame_err workaround
100+
python3 << 'PYTHON_SCRIPT'
101+
import re
102+
file_path = "sources_6.2/nvidia-oot/drivers/media/platform/tegra/camera/vi/vi5_fops.c"
103+
with open(file_path, 'r') as f:
104+
content = f.read()
105+
# Find and replace the if (frame_err) line with the conditional check
106+
content = content.replace(
107+
'\tif (frame_err)',
108+
'\t/* TODO: Remove Y12I frame_err workaround once Y12I is fixed\n\t * Currently there is a black-bar at the bottom of the frame.\n\t */\n\tif (frame_err && chan->fmtinfo->fourcc != V4L2_PIX_FMT_Y12I)'
109+
)
110+
with open(file_path, 'w') as f:
111+
f.write(content)
112+
print("Y12I workaround applied to vi5_fops.c")
113+
PYTHON_SCRIPT
91114
else
92115
cp "hardware/realsense/${JP5_D4XX_DTSI}" "sources_$SOURCES_VERSION/hardware/nvidia/platform/t19x/galen/kernel-dts/common/tegra194-camera-d4xx.dtsi"
93116
fi

nvidia-oot/6.2/0003-Fix-y12i-calibration-stream.patch

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
From: Administrator <admin@realsenseai.com>
2+
Date: Wed, 22 Jan 2026 12:00:00 +0000
3+
Subject: [PATCH] Fix Y12I calibration stream
4+
5+
Y12I calibration stream produces visual artifacts. Disable frame error
6+
checking for Y12I format only as a workaround.
7+
---
8+
drivers/media/platform/tegra/camera/vi/vi5_fops.c | 6 +++++-
9+
1 file changed, 5 insertions(+), 1 deletion(-)
10+
11+
diff --git a/drivers/media/platform/tegra/camera/vi/vi5_fops.c b/drivers/media/platform/tegra/camera/vi/vi5_fops.c
12+
index c6093a75..7264dcc39 100644
13+
--- a/drivers/media/platform/tegra/camera/vi/vi5_fops.c
14+
+++ b/drivers/media/platform/tegra/camera/vi/vi5_fops.c
15+
@@ -612,7 +612,12 @@ static void vi5_capture_dequeue(struct tegra_channel *chan,
16+
trace_tegra_channel_capture_frame("sof", &ts);
17+
vb->vb2_buf.timestamp = descr->status.sof_timestamp;
18+
19+
-if (frame_err)
20+
+/* TODO: Remove Y12I frame_err workaround once Y12I is fixed
21+
+ * Currently there is a black-bar at the bottom of the frame.
22+
+ */
23+
+if (frame_err && chan->fmtinfo->fourcc != V4L2_PIX_FMT_Y12I)
24+
buf->vb2_state = VB2_BUF_STATE_ERROR;
25+
else
26+
buf->vb2_state = VB2_BUF_STATE_DONE;
27+
--
28+
2.43.0

0 commit comments

Comments
 (0)