fix(imx296): 修复快速触发帧交付与 PWM 周期恢复 - #14
Open
OKayJH wants to merge 5 commits into
Open
Conversation
Track fast-trigger mode across CIF so RKISP can identify IMX296. Finish V39 buffers at the last observable line. Delay vb2_done until tail DMA has drained. Restore full-frame ROI registers. Drain the invalid ROI frame during the free-run restart. Drop diagnostic and timing experiments from the production fix. Signed-off-by: OKayJH <okayjhh@gmail.com>
Cache the firmware PWM period instead of mutable runtime state. Recompute the period from the base period. Include the current pulse width and safety margin. Apply the disabled PWM state when trigger_pulse_us changes. This restores trigger rate after long-to-short exposure without reboot. Signed-off-by: OKayJH <okayjhh@gmail.com>
OKayJH
force-pushed
the
fix/imx296-fast-trigger-n1-pwm-period
branch
from
July 22, 2026 04:12
8f5e7c6 to
2c9b30b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
提出者:@ymxc152
概要
vb2缓冲区完成时机,确保尾部 DMA 已排空。YYYYMMDDNN编号的 DLCVCAM 内核构建版本;当前版本为2026072202,构建主机和板端uname -v均可查看。问题描述
快速触发模式下修改 ROI 后,第一次采集结果可能仍对应 N-1 帧。此外,长曝光会扩大 PWM 周期,随后恢复短曝光时,驱动会把已扩大的运行时周期继续当作基准,导致最大触发帧率维持在约 20 fps,无法恢复到约 50 fps,直至设备重启。
模式或 ROI 切换过程中,外部触发输入还可能产生不应执行的排队任务,因此增加了可控的触发门控机制。
此前发布版本号通过
KBUILD_BUILD_VERSION手工传入,仓库记录可能与交付到设备上的内核不一致。新增的DLCVCAM_BUILD_VERSION文件采用YYYYMMDDNN格式,同时不改变uname -r或内核模块目录。修复方案
enablesysfs 开关及抑制计数,关闭时屏蔽 IRQ、取消工作并清空 pending 触发。与 #9 的关系
#9 的修改当前未包含在本 PR 中。#9 新增
IMX296_VBLANK_MIN = 37,并把V4L2_CID_VBLANK的最小值从IMX296_VBLANK_DEFAULT(1162)改为IMX296_VBLANK_MIN;本 PR 当前仍使用 1162 作为该控制器的最小值。因此,如需恢复自由运行模式下通过降低vertical_blanking达到 60 fps 的能力,仍需单独合入 #9 或将其两处修改补入本分支。验证
scripts/checkpatch.pl --strict:帧处理与 PWM 相关提交为 0 error、0 warning;构建版本提交仅有新文件未加入 MAINTAINERS 的通用警告。imx296.o、capture.o、capture_v39.o、rkisp.o。Image dtbs modules通过。6.1.99-rk3576 ... #2026072202 SMP。make -s dlcvcam-build-version同时支持源码内构建和O=构建,且仍支持命令行覆盖。.version。git diff --check origin/rk3576..HEAD通过。