You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ISP IRQ resolved by `osal_platform_get_irq_byname(pdev, "ISP")` and consumed by `isp_isr()` in `kernel/isp/arch/hi3516cv500/mkp/src/isp.c` fires at the VI_PROC0 rate (~1.5 Hz with 21 fps streaming), not VI_CAP0's per-frame rate.
A FEND-event hook attached inside that ISR therefore emits at ~1/8 the sensor rate, not 1:1 with FS. Time-pair measurement on av300 confirmed:
Wrong IRQ resolved by name. `osal_platform_get_irq_byname(pdev, "ISP")` may be picking VI_PROC0 instead of VI_CAP0 because of how the device-tree node enumerates its IRQs and the order in which the OSAL wrapper walks them. Verifiable by logging the resolved `isp_fe_irq` value at module init and cross-referencing `/proc/interrupts` indexes. If true: switch the lookup to VI_CAP0 by name (or by index, after auditing the DT binding).
ISP back-end stall. The hardware may legitimately emit FEND only for frames the back-end pipeline can actually accept (DMA-bound, write-channel-bound). In that case FEND really is "frame fully delivered to ISP back end" — a semantically valid event, just not what we want for capture→encode timing. We'd need a different IRQ source for the per-frame back-end-ready signal.
Definition of done
Identify which of (1) or (2) is the actual mechanism on cv500. Diagnostics: dump `isp_fe_irq` value at module load, dump full `/proc/interrupts` while streaming, correlate IRQ count growth with frame count from `MIPI_RX`.
If (1): patch the cv500 ISP driver to resolve VI_CAP0 (or equivalent per-frame IRQ) for the FEND hook.
If (2): document this and audit V4 (ev200/ev300) ISP to confirm the equivalent IRQ source there is per-frame; otherwise propose an alternative (e.g., piggyback on the VI driver's frame-done callback, or hook a different IP block).
V4 (ev200/ev300) ISP IRQ topology may be cleaner — initial FEND-branch testing was only done on cv500. Worth checking V4 in parallel before deciding the design.
The vendor SDK's own ISP IRQ handler dispatches both `VI_PT0_INT_FSTART` and back-end-related interrupts inside a single `ISP_ISR` entry; the per-IP-block IRQ assignment is what differs across SoCs.
Sub-task of #176. Surfaced by @widgetii during validation of the stacked FEND-extension branch.
Observation
On hi3516av300 (cv500 family) with majestic actively streaming a ~21 fps sensor, `/proc/interrupts` shows:
```
MIPI_RX IRQ 43: 64371 ← per-frame (matches sensor rate)
VI_CAP0 IRQ 45: 49609 ← high-rate ISP capture IRQ
VI_PROC0 IRQ 46: 1464 ← ~33× slower than VI_CAP0
VPSS IRQ 47: 1464
```
The ISP IRQ resolved by `osal_platform_get_irq_byname(pdev, "ISP")` and consumed by `isp_isr()` in `kernel/isp/arch/hi3516cv500/mkp/src/isp.c` fires at the VI_PROC0 rate (~1.5 Hz with 21 fps streaming), not VI_CAP0's per-frame rate.
A FEND-event hook attached inside that ISR therefore emits at ~1/8 the sensor rate, not 1:1 with FS. Time-pair measurement on av300 confirmed:
```
=== 114 events in 5.00 s ===
MIPI_FS : 101 (20.2 fps)
ISP_FEND : 13 ( 2.6 fps) ← ~7.8× slower
```
Hypotheses
Either:
Wrong IRQ resolved by name. `osal_platform_get_irq_byname(pdev, "ISP")` may be picking VI_PROC0 instead of VI_CAP0 because of how the device-tree node enumerates its IRQs and the order in which the OSAL wrapper walks them. Verifiable by logging the resolved `isp_fe_irq` value at module init and cross-referencing `/proc/interrupts` indexes. If true: switch the lookup to VI_CAP0 by name (or by index, after auditing the DT binding).
ISP back-end stall. The hardware may legitimately emit FEND only for frames the back-end pipeline can actually accept (DMA-bound, write-channel-bound). In that case FEND really is "frame fully delivered to ISP back end" — a semantically valid event, just not what we want for capture→encode timing. We'd need a different IRQ source for the per-frame back-end-ready signal.
Definition of done
Notes