Rename backend to PCIES2MM and handle events
This commit is contained in:
@@ -0,0 +1,141 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#define PCIES2MM_MAX_PLANES 3
|
||||
|
||||
typedef enum pcies2mm_status_t
|
||||
{
|
||||
PCIES2MM_OK = 0,
|
||||
PCIES2MM_EINVAL,
|
||||
PCIES2MM_ENODEV,
|
||||
PCIES2MM_ESTATE,
|
||||
PCIES2MM_ENOTSUP,
|
||||
PCIES2MM_ETIMEOUT,
|
||||
PCIES2MM_EIO
|
||||
} pcies2mm_status_t;
|
||||
|
||||
typedef enum pcies2mm_input_t
|
||||
{
|
||||
PCIES2MM_INPUT_UNKNOWN = 0,
|
||||
PCIES2MM_INPUT_SDI = 1,
|
||||
PCIES2MM_INPUT_HDMI = 2
|
||||
} pcies2mm_input_t;
|
||||
|
||||
typedef enum pcies2mm_pixel_format_t
|
||||
{
|
||||
PCIES2MM_PIXFMT_UNKNOWN = 0,
|
||||
PCIES2MM_PIXFMT_YUY2 = 1,
|
||||
PCIES2MM_PIXFMT_UYVY = 2,
|
||||
PCIES2MM_PIXFMT_RGB24 = 3,
|
||||
PCIES2MM_PIXFMT_BGRX32 = 4,
|
||||
PCIES2MM_PIXFMT_NV12 = 5,
|
||||
PCIES2MM_PIXFMT_P010 = 6,
|
||||
PCIES2MM_PIXFMT_Y210 = 7,
|
||||
PCIES2MM_PIXFMT_YUV444 = 8
|
||||
} pcies2mm_pixel_format_t;
|
||||
|
||||
typedef enum pcies2mm_stream_state_t
|
||||
{
|
||||
PCIES2MM_STREAM_STOPPED = 0,
|
||||
PCIES2MM_STREAM_CONFIGURED = 1,
|
||||
PCIES2MM_STREAM_RUNNING = 2
|
||||
} pcies2mm_stream_state_t;
|
||||
|
||||
typedef struct pcies2mm_stream_desc_t
|
||||
{
|
||||
pcies2mm_input_t input;
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
pcies2mm_pixel_format_t pixel_format;
|
||||
uint32_t buffer_count;
|
||||
uint32_t flags;
|
||||
} pcies2mm_stream_desc_t;
|
||||
|
||||
typedef struct pcies2mm_signal_status_t
|
||||
{
|
||||
int signal_locked;
|
||||
pcies2mm_input_t input;
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
pcies2mm_pixel_format_t pixel_format;
|
||||
uint32_t bit_depth;
|
||||
uint32_t fpga_valid_mask; /* bit0:0x0c, bit1:0x18, bit2:0x1c, bit3:0x180 */
|
||||
uint32_t fpga_width_valid; /* Non-zero when FPGA 0x10 read succeeded. */
|
||||
uint32_t fpga_height_valid; /* Non-zero when FPGA 0x14 read succeeded. */
|
||||
uint32_t fpga_width_raw; /* Raw FPGA 0x10 width register. */
|
||||
uint32_t fpga_height_raw; /* Raw FPGA 0x14 height register. */
|
||||
uint32_t fpga_video_format_raw; /* 0x0c: 0=yuv422, 1=rgb, 2=yuv444, 3=yuv420 */
|
||||
uint32_t fpga_frame_rate_raw; /* 0x18 low nibble: frame-rate code */
|
||||
uint32_t fpga_bit_depth_raw; /* 0x1c: 8 or 10 */
|
||||
uint32_t fpga_status_raw; /* 0x180: bit0 SDI lock, bit1 SDI DDR, bit2 HDMI lock, bit3 HDMI DDR */
|
||||
} pcies2mm_signal_status_t;
|
||||
|
||||
typedef struct pcies2mm_frame_t
|
||||
{
|
||||
const void *data; /* Valid until the next PcieS2mmCaptureSession::wait_frame() or close(). */
|
||||
size_t data_size_bytes;
|
||||
uint64_t frame_id;
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
pcies2mm_pixel_format_t pixel_format;
|
||||
uint32_t bit_depth;
|
||||
} pcies2mm_frame_t;
|
||||
|
||||
typedef struct pcies2mm_stream_stats_t
|
||||
{
|
||||
pcies2mm_stream_state_t state;
|
||||
uint64_t frames_captured;
|
||||
uint64_t frames_delivered;
|
||||
uint64_t frames_dropped;
|
||||
uint64_t dma_errors;
|
||||
uint64_t interrupt_count;
|
||||
} pcies2mm_stream_stats_t;
|
||||
|
||||
typedef struct pcies2mm_debug_state_t
|
||||
{
|
||||
int running;
|
||||
int capture_active;
|
||||
int data_worker_stop;
|
||||
uint32_t pending_events;
|
||||
uint64_t latest_sequence;
|
||||
uint64_t delivered_sequence;
|
||||
uint64_t active_delivery_slot;
|
||||
uint64_t next_write_slot;
|
||||
uint64_t ring_size;
|
||||
} pcies2mm_debug_state_t;
|
||||
|
||||
typedef enum pcies2mm_event_type_t
|
||||
{
|
||||
PCIES2MM_EVENT_VIDEO_IRQ = 1,
|
||||
PCIES2MM_EVENT_PLUG_IN = 2,
|
||||
PCIES2MM_EVENT_PLUG_OUT = 3,
|
||||
PCIES2MM_EVENT_CAPTURE_PAUSED = 4,
|
||||
PCIES2MM_EVENT_CAPTURE_RESUMED = 5
|
||||
} pcies2mm_event_type_t;
|
||||
|
||||
enum
|
||||
{
|
||||
PCIES2MM_EVENT_MASK_VIDEO_IRQ = 1u << 0,
|
||||
PCIES2MM_EVENT_MASK_PLUG_IN = 1u << 1,
|
||||
PCIES2MM_EVENT_MASK_PLUG_OUT = 1u << 2,
|
||||
PCIES2MM_EVENT_MASK_CAPTURE_PAUSED = 1u << 3,
|
||||
PCIES2MM_EVENT_MASK_CAPTURE_RESUMED = 1u << 4,
|
||||
PCIES2MM_EVENT_MASK_HOTPLUG = PCIES2MM_EVENT_MASK_PLUG_IN |
|
||||
PCIES2MM_EVENT_MASK_PLUG_OUT |
|
||||
PCIES2MM_EVENT_MASK_CAPTURE_PAUSED |
|
||||
PCIES2MM_EVENT_MASK_CAPTURE_RESUMED,
|
||||
PCIES2MM_EVENT_MASK_DEFAULT = PCIES2MM_EVENT_MASK_HOTPLUG,
|
||||
PCIES2MM_EVENT_MASK_ALL = PCIES2MM_EVENT_MASK_VIDEO_IRQ | PCIES2MM_EVENT_MASK_HOTPLUG
|
||||
};
|
||||
|
||||
typedef struct pcies2mm_event_t
|
||||
{
|
||||
pcies2mm_event_type_t type;
|
||||
uint32_t irq_bit;
|
||||
uint32_t irq_mask;
|
||||
uint64_t timestamp_ns;
|
||||
} pcies2mm_event_t;
|
||||
|
||||
typedef void (*pcies2mm_event_callback_t)(const pcies2mm_event_t *event, void *user);
|
||||
+422
-246
File diff suppressed because it is too large
Load Diff
+42
-31
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "xdma_backend_types.h"
|
||||
#include "pcies2mm_backend_types.h"
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
@@ -15,58 +15,66 @@
|
||||
|
||||
namespace gvfg::internal
|
||||
{
|
||||
struct XdmaDevice
|
||||
struct PcieS2mmDevice
|
||||
{
|
||||
std::wstring interface_path;
|
||||
std::wstring friendly_name;
|
||||
};
|
||||
|
||||
std::vector<XdmaDevice> enumerate_xdma_devices();
|
||||
std::vector<PcieS2mmDevice> enumerate_pcies2mm_devices();
|
||||
|
||||
class XdmaCaptureSession
|
||||
class PcieS2mmCaptureSession
|
||||
{
|
||||
public:
|
||||
XdmaCaptureSession();
|
||||
XdmaCaptureSession(const XdmaCaptureSession &) = delete;
|
||||
XdmaCaptureSession &operator=(const XdmaCaptureSession &) = delete;
|
||||
~XdmaCaptureSession();
|
||||
PcieS2mmCaptureSession();
|
||||
PcieS2mmCaptureSession(const PcieS2mmCaptureSession &) = delete;
|
||||
PcieS2mmCaptureSession &operator=(const PcieS2mmCaptureSession &) = delete;
|
||||
~PcieS2mmCaptureSession();
|
||||
|
||||
xdma_status_t open_device_index(size_t deviceIndex);
|
||||
xdma_status_t close();
|
||||
pcies2mm_status_t open_device_index(size_t deviceIndex);
|
||||
pcies2mm_status_t close();
|
||||
|
||||
xdma_status_t set_input(xdma_input_t input);
|
||||
xdma_status_t get_signal_status(xdma_signal_status_t &out) const;
|
||||
pcies2mm_status_t set_input(pcies2mm_input_t input);
|
||||
pcies2mm_status_t get_signal_status(pcies2mm_signal_status_t &out) const;
|
||||
|
||||
xdma_status_t set_event_callback(xdma_event_callback_t callback, void *user, uint32_t eventMask);
|
||||
xdma_status_t configure_stream(const xdma_stream_desc_t &desc);
|
||||
xdma_status_t start_stream();
|
||||
xdma_status_t stop_stream();
|
||||
xdma_status_t wait_frame(uint32_t timeoutMs, xdma_frame_t &out);
|
||||
xdma_status_t release_frame(const xdma_frame_t &frame);
|
||||
pcies2mm_status_t set_event_callback(pcies2mm_event_callback_t callback, void *user, uint32_t eventMask);
|
||||
pcies2mm_status_t configure_stream(const pcies2mm_stream_desc_t &desc);
|
||||
pcies2mm_status_t start_stream();
|
||||
pcies2mm_status_t stop_stream();
|
||||
pcies2mm_status_t wait_frame(uint32_t timeoutMs, pcies2mm_frame_t &out);
|
||||
pcies2mm_status_t release_frame(const pcies2mm_frame_t &frame);
|
||||
|
||||
const char *last_error() const;
|
||||
void get_debug_stats(xdma_stream_stats_t &outStats,
|
||||
void get_debug_stats(pcies2mm_stream_stats_t &outStats,
|
||||
uint64_t &outWaitTimeouts,
|
||||
xdma_debug_state_t &outDebugState) const;
|
||||
pcies2mm_debug_state_t &outDebugState) const;
|
||||
|
||||
private:
|
||||
xdma_status_t open_device(const XdmaDevice &device);
|
||||
pcies2mm_status_t open_device(const PcieS2mmDevice &device);
|
||||
void close_handles();
|
||||
|
||||
bool read_reg(uint32_t offset, uint32_t &out) const;
|
||||
bool write_reg(uint32_t offset, uint32_t value) const;
|
||||
bool read_reg_bar1(uint32_t offset, uint32_t &out) const;
|
||||
bool write_reg_bar1(uint32_t offset, uint32_t value) const;
|
||||
bool register_event(uint32_t channelIndex);
|
||||
void unregister_event(uint32_t channelIndex);
|
||||
bool register_event(uint32_t channelIndex, uint32_t eventType, HANDLE eventHandle);
|
||||
void unregister_event(uint32_t channelIndex, uint32_t eventType);
|
||||
bool create_and_register_events(uint32_t channelIndex);
|
||||
void unregister_events(uint32_t channelIndex);
|
||||
void close_event_handles();
|
||||
bool get_video_done_index(uint32_t channelIndex, uint32_t &doneIndex) const;
|
||||
int get_frame(uint32_t channelIndex, uint32_t frameIndex, uint8_t *buffer, DWORD bufferSize) const;
|
||||
|
||||
void capture_thread_proc();
|
||||
void handle_dma_event(uint32_t channel);
|
||||
void handle_format_change_event(uint32_t channel);
|
||||
void handle_plugin_event(uint32_t channel);
|
||||
void handle_unplug_event(uint32_t channel);
|
||||
bool refresh_stream_from_signal(bool resizeRing);
|
||||
void publish_frame(size_t slotIndex, size_t bytes);
|
||||
void emit_event(xdma_event_type_t type, uint32_t irqBit, uint32_t irqMask) const;
|
||||
void emit_event(pcies2mm_event_type_t type, uint32_t irqBit, uint32_t irqMask) const;
|
||||
|
||||
xdma_status_t fail(xdma_status_t status, const char *where, DWORD winerr = GetLastError()) const;
|
||||
pcies2mm_status_t fail(pcies2mm_status_t status, const char *where, DWORD winerr = GetLastError()) const;
|
||||
void set_last_error(const std::string &message) const;
|
||||
void clear_last_error() const;
|
||||
|
||||
@@ -89,11 +97,14 @@ namespace gvfg::internal
|
||||
std::wstring friendly_name_;
|
||||
|
||||
HANDLE device_ = INVALID_HANDLE_VALUE;
|
||||
HANDLE interrupt_event_ = nullptr;
|
||||
HANDLE dma_event_ = nullptr;
|
||||
HANDLE format_change_event_ = nullptr;
|
||||
HANDLE plug_in_event_ = nullptr;
|
||||
HANDLE plug_out_event_ = nullptr;
|
||||
|
||||
xdma_stream_desc_t stream_desc_{};
|
||||
pcies2mm_stream_desc_t stream_desc_{};
|
||||
uint32_t stream_bit_depth_ = 8;
|
||||
xdma_input_t input_ = XDMA_INPUT_SDI;
|
||||
pcies2mm_input_t input_ = PCIES2MM_INPUT_SDI;
|
||||
bool opened_ = false;
|
||||
bool configured_ = false;
|
||||
|
||||
@@ -105,9 +116,9 @@ namespace gvfg::internal
|
||||
mutable std::mutex event_callback_mutex_;
|
||||
std::condition_variable frame_cv_;
|
||||
std::condition_variable data_cv_;
|
||||
xdma_event_callback_t event_callback_ = nullptr;
|
||||
pcies2mm_event_callback_t event_callback_ = nullptr;
|
||||
void *event_callback_user_ = nullptr;
|
||||
uint32_t event_mask_filter_ = XDMA_EVENT_MASK_DEFAULT;
|
||||
uint32_t event_mask_filter_ = PCIES2MM_EVENT_MASK_DEFAULT;
|
||||
uint32_t pending_events_ = 0;
|
||||
std::vector<FrameSlot> frame_ring_;
|
||||
size_t next_write_slot_ = 0;
|
||||
@@ -116,7 +127,7 @@ namespace gvfg::internal
|
||||
uint64_t delivered_sequence_ = 0;
|
||||
uint64_t wait_timeout_count_ = 0;
|
||||
bool stream_error_ = false;
|
||||
xdma_stream_stats_t stats_{};
|
||||
pcies2mm_stream_stats_t stats_{};
|
||||
mutable std::string last_error_;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* PCIES2MM driver public contract used by the GVFG backend.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <windows.h>
|
||||
|
||||
#define PCIES2MM_IOCTL(index, method, access) CTL_CODE(FILE_DEVICE_UNKNOWN, index, method, access)
|
||||
|
||||
#define IOCTL_PCIES2MM_WRITE_REG PCIES2MM_IOCTL(0x800, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||
#define IOCTL_PCIES2MM_READ_REG PCIES2MM_IOCTL(0x801, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||
#define IOCTL_PCIES2MM_REGISTER_EVENT PCIES2MM_IOCTL(0x802, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||
#define IOCTL_PCIES2MM_GET_FRAME PCIES2MM_IOCTL(0x803, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
|
||||
#define IOCTL_PCIES2MM_UNREGISTER_EVENT PCIES2MM_IOCTL(0x804, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||
#define IOCTL_PCIES2MM_WRITE_REG_BAR1 PCIES2MM_IOCTL(0x805, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||
#define IOCTL_PCIES2MM_READ_REG_BAR1 PCIES2MM_IOCTL(0x806, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||
#define IOCTL_PCIES2MM_GET_VIDEO_DONE_INDEX PCIES2MM_IOCTL(0x807, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||
|
||||
enum
|
||||
{
|
||||
PCIES2MM_EVENT_TYPE_VIDEO_DMA = 0,
|
||||
PCIES2MM_EVENT_TYPE_VIDEO_FORMAT_CHANGE = 1,
|
||||
PCIES2MM_EVENT_TYPE_VIDEO_PLUGIN = 2,
|
||||
PCIES2MM_EVENT_TYPE_VIDEO_UNPLUG = 3,
|
||||
PCIES2MM_EVENT_TYPE_AUDIO_DMA = 4
|
||||
};
|
||||
|
||||
typedef struct PCIES2MM_REG_ACCESS
|
||||
{
|
||||
ULONG Offset;
|
||||
ULONG Value;
|
||||
} PCIES2MM_REG_ACCESS;
|
||||
|
||||
typedef struct PCIES2MM_EVENT_REG
|
||||
{
|
||||
ULONG Type;
|
||||
ULONG ChannelIndex;
|
||||
HANDLE EventHandle;
|
||||
} PCIES2MM_EVENT_REG;
|
||||
@@ -1,141 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#define XDMA_MAX_PLANES 3
|
||||
|
||||
typedef enum xdma_status_t
|
||||
{
|
||||
XDMA_OK = 0,
|
||||
XDMA_EINVAL,
|
||||
XDMA_ENODEV,
|
||||
XDMA_ESTATE,
|
||||
XDMA_ENOTSUP,
|
||||
XDMA_ETIMEOUT,
|
||||
XDMA_EIO
|
||||
} xdma_status_t;
|
||||
|
||||
typedef enum xdma_input_t
|
||||
{
|
||||
XDMA_INPUT_UNKNOWN = 0,
|
||||
XDMA_INPUT_SDI = 1,
|
||||
XDMA_INPUT_HDMI = 2
|
||||
} xdma_input_t;
|
||||
|
||||
typedef enum xdma_pixel_format_t
|
||||
{
|
||||
XDMA_PIXFMT_UNKNOWN = 0,
|
||||
XDMA_PIXFMT_YUY2 = 1,
|
||||
XDMA_PIXFMT_UYVY = 2,
|
||||
XDMA_PIXFMT_RGB24 = 3,
|
||||
XDMA_PIXFMT_BGRX32 = 4,
|
||||
XDMA_PIXFMT_NV12 = 5,
|
||||
XDMA_PIXFMT_P010 = 6,
|
||||
XDMA_PIXFMT_Y210 = 7,
|
||||
XDMA_PIXFMT_YUV444 = 8
|
||||
} xdma_pixel_format_t;
|
||||
|
||||
typedef enum xdma_stream_state_t
|
||||
{
|
||||
XDMA_STREAM_STOPPED = 0,
|
||||
XDMA_STREAM_CONFIGURED = 1,
|
||||
XDMA_STREAM_RUNNING = 2
|
||||
} xdma_stream_state_t;
|
||||
|
||||
typedef struct xdma_stream_desc_t
|
||||
{
|
||||
xdma_input_t input;
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
xdma_pixel_format_t pixel_format;
|
||||
uint32_t buffer_count;
|
||||
uint32_t flags;
|
||||
} xdma_stream_desc_t;
|
||||
|
||||
typedef struct xdma_signal_status_t
|
||||
{
|
||||
int signal_locked;
|
||||
xdma_input_t input;
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
xdma_pixel_format_t pixel_format;
|
||||
uint32_t bit_depth;
|
||||
uint32_t fpga_valid_mask; /* bit0:0x0c, bit1:0x18, bit2:0x1c, bit3:0x180 */
|
||||
uint32_t fpga_width_valid; /* Non-zero when FPGA 0x10 read succeeded. */
|
||||
uint32_t fpga_height_valid; /* Non-zero when FPGA 0x14 read succeeded. */
|
||||
uint32_t fpga_width_raw; /* Raw FPGA 0x10 width register. */
|
||||
uint32_t fpga_height_raw; /* Raw FPGA 0x14 height register. */
|
||||
uint32_t fpga_video_format_raw; /* 0x0c: 0=yuv422, 1=rgb, 2=yuv444, 3=yuv420 */
|
||||
uint32_t fpga_frame_rate_raw; /* 0x18 low nibble: frame-rate code */
|
||||
uint32_t fpga_bit_depth_raw; /* 0x1c: 8 or 10 */
|
||||
uint32_t fpga_status_raw; /* 0x180: bit0 SDI lock, bit1 SDI DDR, bit2 HDMI lock, bit3 HDMI DDR */
|
||||
} xdma_signal_status_t;
|
||||
|
||||
typedef struct xdma_frame_t
|
||||
{
|
||||
const void *data; /* Valid until the next XdmaCaptureSession::wait_frame() or close(). */
|
||||
size_t data_size_bytes;
|
||||
uint64_t frame_id;
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
xdma_pixel_format_t pixel_format;
|
||||
uint32_t bit_depth;
|
||||
} xdma_frame_t;
|
||||
|
||||
typedef struct xdma_stream_stats_t
|
||||
{
|
||||
xdma_stream_state_t state;
|
||||
uint64_t frames_captured;
|
||||
uint64_t frames_delivered;
|
||||
uint64_t frames_dropped;
|
||||
uint64_t dma_errors;
|
||||
uint64_t interrupt_count;
|
||||
} xdma_stream_stats_t;
|
||||
|
||||
typedef struct xdma_debug_state_t
|
||||
{
|
||||
int running;
|
||||
int capture_active;
|
||||
int data_worker_stop;
|
||||
uint32_t pending_events;
|
||||
uint64_t latest_sequence;
|
||||
uint64_t delivered_sequence;
|
||||
uint64_t active_delivery_slot;
|
||||
uint64_t next_write_slot;
|
||||
uint64_t ring_size;
|
||||
} xdma_debug_state_t;
|
||||
|
||||
typedef enum xdma_event_type_t
|
||||
{
|
||||
XDMA_EVENT_VIDEO_IRQ = 1,
|
||||
XDMA_EVENT_PLUG_IN = 2,
|
||||
XDMA_EVENT_PLUG_OUT = 3,
|
||||
XDMA_EVENT_CAPTURE_PAUSED = 4,
|
||||
XDMA_EVENT_CAPTURE_RESUMED = 5
|
||||
} xdma_event_type_t;
|
||||
|
||||
enum
|
||||
{
|
||||
XDMA_EVENT_MASK_VIDEO_IRQ = 1u << 0,
|
||||
XDMA_EVENT_MASK_PLUG_IN = 1u << 1,
|
||||
XDMA_EVENT_MASK_PLUG_OUT = 1u << 2,
|
||||
XDMA_EVENT_MASK_CAPTURE_PAUSED = 1u << 3,
|
||||
XDMA_EVENT_MASK_CAPTURE_RESUMED = 1u << 4,
|
||||
XDMA_EVENT_MASK_HOTPLUG = XDMA_EVENT_MASK_PLUG_IN |
|
||||
XDMA_EVENT_MASK_PLUG_OUT |
|
||||
XDMA_EVENT_MASK_CAPTURE_PAUSED |
|
||||
XDMA_EVENT_MASK_CAPTURE_RESUMED,
|
||||
XDMA_EVENT_MASK_DEFAULT = XDMA_EVENT_MASK_HOTPLUG,
|
||||
XDMA_EVENT_MASK_ALL = XDMA_EVENT_MASK_VIDEO_IRQ | XDMA_EVENT_MASK_HOTPLUG
|
||||
};
|
||||
|
||||
typedef struct xdma_event_t
|
||||
{
|
||||
xdma_event_type_t type;
|
||||
uint32_t irq_bit;
|
||||
uint32_t irq_mask;
|
||||
uint64_t timestamp_ns;
|
||||
} xdma_event_t;
|
||||
|
||||
typedef void (*xdma_event_callback_t)(const xdma_event_t *event, void *user);
|
||||
@@ -1,34 +0,0 @@
|
||||
/*
|
||||
* XDMA Driver public API
|
||||
*
|
||||
* This header mirrors the public IOCTL values exposed by the Xilinx XDMA
|
||||
* Windows driver. The values are consumed by the GVFG internal XDMA backend.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <windows.h>
|
||||
|
||||
#define XDMA_MAKE_VERSION(major, minor, patch) (((major) << 24) | ((minor) << 16) | (patch))
|
||||
#define XDMA_VERSION_MAJOR(version) (((uint32_t)(version) >> 24) & 0xff)
|
||||
#define XDMA_VERSION_MINOR(version) (((uint32_t)(version) >> 16) & 0xff)
|
||||
#define XDMA_VERSION_PATCH(version) ((uint32_t)(version) & 0xffff)
|
||||
|
||||
#define XDMA_DRIVER_VERSION XDMA_MAKE_VERSION(1, 0, 0)
|
||||
|
||||
#define XDMA_IOCTL(index) CTL_CODE(FILE_DEVICE_UNKNOWN, index, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||
|
||||
#define IOCTL_XDMA_GET_VERSION XDMA_IOCTL(0x0)
|
||||
#define IOCTL_XDMA_PERF_START XDMA_IOCTL(0x1)
|
||||
#define IOCTL_XDMA_PERF_STOP XDMA_IOCTL(0x2)
|
||||
#define IOCTL_XDMA_PERF_GET XDMA_IOCTL(0x3)
|
||||
#define IOCTL_XDMA_USER_INT_ENABLE XDMA_IOCTL(0x4)
|
||||
#define IOCTL_XDMA_USER_INT_DISABLE XDMA_IOCTL(0x5)
|
||||
|
||||
typedef struct XDMA_PERF_DATA
|
||||
{
|
||||
UINT64 clockCycleCount;
|
||||
UINT64 dataCycleCount;
|
||||
UINT64 pendingCount;
|
||||
} XDMA_PERF_DATA;
|
||||
Reference in New Issue
Block a user