Repository navigation
xiongmai-opensdk-xm510: open_vi in place of the vendor xm510_vi.ko - #2717
Conversation
xiongmai-opensdk-xm510 also builds drivers/xm510_vi (open_vi.ko) from
OpenIPC/openxiongmai (9498822), and load_xiongmai loads it by modprobe,
falling back to the vendor xm510_vi.ko. It keeps the vendor /dev/vi ABI
and releases the frames of a consumer that exits.
The fallback is insmod: the vendor xm510_vi.ko depends on mmz, so
modprobe would load the vendor mmz.ko under a running open_mmz, which
refuses it ("exports duplicate symbol mmz_alloc"), and the load fails.
open_vi looks the MMZ symbols up and has no module dependency.
PR Summary by QodoUse open_vi for XM510 video input with vendor fallback
AI Description
Diagram
High-Level Assessment
Files changed (3)
|
Code Review by Qodo
1. Vendor fallback skips dependency checks
|
With the vendor mmz.ko loaded, modprobe resolves xm510_vi.ko's dependency, so the fallback uses it there; insmod is left only for open_mmz, where modprobe would load the vendor mmz.ko beside it and fail. Tested on the XM510: the fallback loads xm510_vi on open_mmz (insmod) and on the vendor mmz (modprobe), with video both times.
The XM510 gets the open VI driver.
xiongmai-opensdk-xm510now also buildsdrivers/xm510_vi(open_vi.ko) from OpenIPC/openxiongmai, pinned at 9498822 (OpenIPC/openxiongmai#41).load_xiongmailoads it bymodprobe, falling back to the vendorxm510_vi.ko.open_vikeeps the vendor/dev/viABI and the vendor buffer protocol. It also:polland a non-blocking get;It looks up the MMZ symbols at run time, so it has no module dependency and loads on
open_mmzor on the vendormmz.ko.The vendor fallback uses
insmod, notmodprobe.xm510_vi.kodeclaresdepends=mmz, so withopen_mmzloaded,modprobe xm510_vitries to load the vendormmz.kobeside it. That fails, and the whole fallback with it. Seen on the camera:insmod xm510_vi.kotakes the symbols from whichever MMZ module is loaded.Tested
XM510 + JX-H62, xm510_lite image from this branch flashed with sysupgrade:
load_xiongmailoadsopen_mmz,open_viandopen_h264, the vendor ISP and RGN run on them, and majestic streams H.264.load_xiongmai -r, then-i, unloads everything and loads it back, and video returns.open_vihidden, the fallback loads the vendorxm510_vion top ofopen_mmz, and video streams.The driver's own tests are in OpenIPC/openxiongmai#41:
/proc/umap/viand picture as the vendor driver;poll, non-blocking get, release and release-on-close;kill -9.