Rename backend to PCIES2MM and handle events

This commit is contained in:
Mark.lin
2026-07-13 16:56:03 +08:00
parent 3e02a374e0
commit 9639a797aa
174 changed files with 754 additions and 3999 deletions
+7 -7
View File
@@ -27,19 +27,19 @@
<mxRectangle height="34" width="240" x="50" y="515" as="alternateBounds" />
</mxGeometry>
</mxCell>
<mxCell id="backendTypes" parent="backendLayer" style="rounded=1;whiteSpace=wrap;html=1;arcSize=8;fillColor=#ffffff;strokeColor=#d6b656;fontSize=14;" value="xdma_backend_types.h&lt;br&gt;internal frame/event/status types" vertex="1">
<mxCell id="backendTypes" parent="backendLayer" style="rounded=1;whiteSpace=wrap;html=1;arcSize=8;fillColor=#ffffff;strokeColor=#d6b656;fontSize=14;" value="pcies2mm_backend_types.h&lt;br&gt;internal frame/event/status types" vertex="1">
<mxGeometry height="58" width="285" x="30" y="95" as="geometry" />
</mxCell>
<mxCell id="workers" parent="backendLayer" style="rounded=1;whiteSpace=wrap;html=1;arcSize=8;fillColor=#ffffff;strokeColor=#d6b656;fontSize=14;" value="event worker + data worker&lt;br&gt;publish frames and events" vertex="1">
<mxGeometry height="52" width="280" x="510" y="173" as="geometry" />
</mxCell>
<mxCell id="xdmaSession" parent="backendLayer" style="rounded=1;whiteSpace=wrap;html=1;arcSize=8;fillColor=#ffffff;strokeColor=#d6b656;fontSize=14;" value="sdk/gvfg/src/backend/xdma/xdma_capture_session.cpp&lt;br&gt;internal session / workers / frame ring" vertex="1">
<mxCell id="pcies2mmSession" parent="backendLayer" style="rounded=1;whiteSpace=wrap;html=1;arcSize=8;fillColor=#ffffff;strokeColor=#d6b656;fontSize=14;" value="sdk/gvfg/src/backend/pcies2mm/pcies2mm_capture_session.cpp&lt;br&gt;internal session / workers / frame ring" vertex="1">
<mxGeometry height="58" width="340" x="420" y="65" as="geometry" />
</mxCell>
<mxCell id="e6" edge="1" parent="backendLayer" source="xdmaSession" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=block;strokeWidth=2;" target="backendTypes" value="uses">
<mxCell id="e6" edge="1" parent="backendLayer" source="pcies2mmSession" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=block;strokeWidth=2;" target="backendTypes" value="uses">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="e7" edge="1" parent="backendLayer" source="xdmaSession" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=block;strokeWidth=2;" target="workers" value="owns">
<mxCell id="e7" edge="1" parent="backendLayer" source="pcies2mmSession" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=block;strokeWidth=2;" target="workers" value="owns">
<mxGeometry relative="1" x="-0.004" as="geometry">
<mxPoint as="offset" />
</mxGeometry>
@@ -68,13 +68,13 @@
<mxCell id="e4" edge="1" parent="1" source="qtSample" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=block;strokeWidth=2;" target="render" value="private preview">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="e5" edge="1" parent="1" source="facade" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=block;strokeWidth=2;" target="xdmaSession" value="backend API calls">
<mxCell id="e5" edge="1" parent="1" source="facade" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=block;strokeWidth=2;" target="pcies2mmSession" value="backend API calls">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="e8" edge="1" parent="1" source="workers" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=block;strokeWidth=2;" target="ring" value="">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="e9" edge="1" parent="1" source="xdmaSession" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=block;strokeWidth=2;dashed=1;" target="facade" value="frames / events / status">
<mxCell id="e9" edge="1" parent="1" source="pcies2mmSession" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=block;strokeWidth=2;dashed=1;" target="facade" value="frames / events / status">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="420" y="589" />
@@ -82,7 +82,7 @@
</Array>
</mxGeometry>
</mxCell>
<mxCell id="e10" edge="1" parent="1" source="externalBoundary" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=block;strokeWidth=2;dashed=1;" target="xdmaSession" value="input boundary">
<mxCell id="e10" edge="1" parent="1" source="externalBoundary" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=block;strokeWidth=2;dashed=1;" target="pcies2mmSession" value="input boundary">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="550" y="780" />
+1 -1
View File
@@ -8,7 +8,7 @@
<mxGeometry x="360" y="30" width="880" height="40" as="geometry"/>
</mxCell>
<mxCell id="hw" value="FPGA / XDMA hardware&#xa;VIDEO IRQ" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;fontSize=14;fontStyle=1" vertex="1" parent="1">
<mxCell id="hw" value="FPGA / PCIES2MM hardware&#xa;VIDEO IRQ" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;fontSize=14;fontStyle=1" vertex="1" parent="1">
<mxGeometry x="80" y="130" width="210" height="80" as="geometry"/>
</mxCell>
<mxCell id="event" value="event_thread_proc()&#xa;ReadFile(event_N) returns" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=14;fontStyle=1" vertex="1" parent="1">
+9 -9
View File
@@ -25,7 +25,7 @@ samples/gvfg_qt_preview/
uses gvfg.dll + gvfg_preview.dll + gvfg_debug.h
```
從 customer 角度看,core SDK 必須維持 driver-neutral。XDMA、IRQ、DMA counters、
從 customer 角度看,core SDK 必須維持 driver-neutral。PCIES2MM、IRQ、DMA counters、
raw FPGA values、backend details 都是 internal。
## 架構
@@ -54,7 +54,7 @@ flowchart TD
end
subgraph Backend["Internal Backend"]
Xdma["sdk/gvfg/src/backend/xdma"]
PcieS2mm["sdk/gvfg/src/backend/pcies2mm"]
Ring["frame_ring_"]
Workers["event worker + data worker"]
end
@@ -70,8 +70,8 @@ flowchart TD
ConvertApi --> CaptureApi
CaptureApi --> Facade
DebugApi --> Facade
Facade --> Xdma
Xdma --> Workers
Facade --> PcieS2mm
PcieS2mm --> Workers
Workers --> Ring
```
@@ -118,7 +118,7 @@ gvfg_stop_callback_mode
- `frame.data` 在 `gvfg_release_frame()` 前有效。
- `gvfg_frame_t` 要保持 ABI-stable;不要為了 layout 直接 append fields。
- `gvfg_get_frame_layout()` 回傳 SDK-filled layout metadata:`plane_data`、
`plane_stride`、`plane_size`、`plane_offset`。目前 XDMA backend 先用
`plane_stride`、`plane_size`、`plane_offset`。目前 PCIES2MM backend 先用
width/height/format 推導 tightly packed layout;未來 driver 如果能回報真實
pitch 或 plane offsets,應該更新 layout query path,而不是改既有 frame struct。
- `gvfg_preview.dll` 應優先吃 `gvfg_get_frame_layout()`;layout query 不可用時才
@@ -155,7 +155,7 @@ GVFG_EVENT_CAPTURE_PAUSED
GVFG_EVENT_CAPTURE_RESUMED
```
Video IRQ handling 是 `sdk/gvfg/src/backend/xdma` 內部細節。IRQ bit numbers、
Video IRQ handling 是 `sdk/gvfg/src/backend/pcies2mm` 內部細節。IRQ bit numbers、
IRQ masks、DMA counters、raw FPGA register-like values 不應出現在
`gvfg_capture.h`。
@@ -208,7 +208,7 @@ Do not include:
include/gvfg_debug.h
SDK source
helper source
XDMA backend headers
PCIES2MM backend headers
PDB symbols
register / DMA / IRQ debug docs
internal diagnostic tools
@@ -246,7 +246,7 @@ Top-level CMake 會 build core SDK、helpers 和 optional sample:
```text
BUILD_GVFG_SAMPLES=ON
GVFG_XDMA_DEBUG_LOG=OFF
GVFG_PCIES2MM_DEBUG_LOG=OFF
```
輸出產物:
@@ -261,7 +261,7 @@ lib/gvfg_convert.lib
bin/gvfg_qt_preview.exe
```
`GVFG_XDMA_DEBUG_LOG=ON` 會打開 internal backend 的 verbose XDMA flow logging。
`GVFG_PCIES2MM_DEBUG_LOG=ON` 會打開 internal backend 的 verbose PCIES2MM flow logging。
## Draw.io Files