LibMWCapture  3.3.1
LibMWCapture Documentation
MWDMAMem.h
Go to the documentation of this file.
1 // CONFIDENTIAL and PROPRIETARY software of Magewell Electronics Co., Ltd.
3 // Copyright (c) 2011-2014 Magewell Electronics Co., Ltd. (Nanjing)
4 // All rights reserved.
5 // This copyright notice MUST be reproduced on all authorized copies.
7 #ifndef __MW_DMA_MEM_H__
8 #define __MW_DMA_MEM_H__
9 
10 #pragma pack(push)
11 #pragma pack(1)
12 
13 #include "MWSg.h"
14 
20 };
21 
22 static inline int mw_valid_dma_direction(int direction)
23 {
24  return ((direction == MW_DMA_BIDIRECTIONAL) ||
25  (direction == MW_DMA_TO_DEVICE) ||
26  (direction == MW_DMA_FROM_DEVICE));
27 }
28 
29 #define MW_DMA_MEMORY_MAX_CLIENT (16)
30 
31 #define MWCAP_VIDEO_MEMORY_TYPE_USER (3)
32 #define MWCAP_VIDEO_MEMORY_TYPE_PHYSICAL (4)
33 #define MWCAP_VIDEO_MEMORY_TYPE_NVRDMA (5) /* need NvRdmaForProCapture module */
34 #define MWCAP_VIDEO_MEMORY_TYPE_PRIV_BASE (6)
35 
36 
38 
39 struct mw_dma_desc {
41  int sglen;
42 
43  /* for internal use */
45 };
46 
48  int mem_type;
49 
50  int (*create_dma_desc)(struct mw_dma_desc **dma_desc,
51  unsigned long addr, size_t size,
52  int direction,
53  void *private_data);
54  int (*sync_for_cpu)(struct mw_dma_desc *dma_desc);
55  int (*sync_for_device)(struct mw_dma_desc *dma_desc);
56  void (*destroy_dma_desc)(struct mw_dma_desc *dma_desc);
57 };
58 
60 
62 
63 #pragma pack(pop)
64 
65 #endif /* __MW_DMA_MEM_H__ */
mw_dma_data_direction
Definition: MWDMAMem.h:15
int(* create_dma_desc)(struct mw_dma_desc **dma_desc, unsigned long addr, size_t size, int direction, void *private_data)
Definition: MWDMAMem.h:50
int mw_register_dma_memory_client(struct mw_dma_memory_client *client)
int(* sync_for_cpu)(struct mw_dma_desc *dma_desc)
Definition: MWDMAMem.h:54
int(* sync_for_device)(struct mw_dma_desc *dma_desc)
Definition: MWDMAMem.h:55
int mw_unregister_dma_memory_client(struct mw_dma_memory_client *client)
void(* destroy_dma_desc)(struct mw_dma_desc *dma_desc)
Definition: MWDMAMem.h:56
mw_scatterlist_t * mwsg_list
Definition: MWDMAMem.h:40
int sglen
Definition: MWDMAMem.h:41
struct mw_dma_memory_client * client
Definition: MWDMAMem.h:44