• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  *    Filename: cedarv_ve.h
3  *     Version: 0.01alpha
4  * Description: Video engine driver API, Don't modify it in user space.
5  *     License: GPLv2
6  *
7  *		Author  : xyliu <xyliu@allwinnertech.com>
8  *		Date    : 2016/04/13
9  *
10  *  This program is free software; you can redistribute it and/or modify
11  *  it under the terms of the GNU General Public License version 2 as
12  *  published by the Free Software Foundation.
13  *
14  *  This program is distributed in the hope that it will be useful,
15  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  *  GNU General Public License for more details.
18  */
19  /* Notice: It's video engine driver API, Don't modify it in user space. */
20 #ifndef _CEDAR_VE_H_
21 #define _CEDAR_VE_H_
22 #include <linux/types.h>
23 
24 enum IOCTL_CMD {
25 	IOCTL_UNKOWN = 0x100,
26 	IOCTL_GET_ENV_INFO,
27 	IOCTL_WAIT_VE_DE,
28 	IOCTL_WAIT_VE_EN,
29 	IOCTL_RESET_VE,
30 	IOCTL_ENABLE_VE,
31 	IOCTL_DISABLE_VE,
32 	IOCTL_SET_VE_FREQ,
33 
34 	IOCTL_CONFIG_AVS2 = 0x200,
35 	IOCTL_GETVALUE_AVS2,
36 	IOCTL_PAUSE_AVS2,
37 	IOCTL_START_AVS2,
38 	IOCTL_RESET_AVS2,
39 	IOCTL_ADJUST_AVS2,
40 	IOCTL_ENGINE_REQ,
41 	IOCTL_ENGINE_REL,
42 	IOCTL_ENGINE_CHECK_DELAY,
43 	IOCTL_GET_IC_VER,
44 	IOCTL_ADJUST_AVS2_ABS,
45 	IOCTL_FLUSH_CACHE,
46 	IOCTL_SET_REFCOUNT,
47 	IOCTL_FLUSH_CACHE_ALL,
48 	IOCTL_TEST_VERSION,
49 
50 	IOCTL_GET_LOCK = 0x310,
51 	IOCTL_RELEASE_LOCK,
52 
53 	IOCTL_SET_VOL = 0x400,
54 
55 	IOCTL_WAIT_JPEG_DEC = 0x500,
56 	/*for get the ve ref_count for ipc to delete the semphore*/
57 	IOCTL_GET_REFCOUNT,
58 
59 	/*for iommu*/
60 	IOCTL_GET_IOMMU_ADDR,
61 	IOCTL_FREE_IOMMU_ADDR,
62 
63 	/* map/unmap dma buffer to get/free phyaddr by dma fd */
64 	/* get/free iommu addr will not use since kernel 5.4  */
65 	IOCTL_MAP_DMA_BUF,
66 	IOCTL_UNMAP_DMA_BUF,
67 
68 	/*for fush cache range since kernel 5.4*/
69 	IOCTL_FLUSH_CACHE_RANGE,
70 
71 	/*for debug*/
72 	IOCTL_SET_PROC_INFO,
73 	IOCTL_STOP_PROC_INFO,
74 	IOCTL_COPY_PROC_INFO,
75 
76 	IOCTL_SET_DRAM_HIGH_CHANNAL = 0x600,
77 
78 	/* debug for decoder and encoder*/
79 	IOCTL_PROC_INFO_COPY = 0x610,
80 	IOCTL_PROC_INFO_STOP,
81 	IOCTL_POWER_SETUP = 0x700,
82 	IOCTL_POWER_SHUTDOWN,
83 };
84 
85 #define VE_LOCK_VDEC        0x01
86 #define VE_LOCK_VENC        0x02
87 #define VE_LOCK_JDEC        0x04
88 #define VE_LOCK_00_REG      0x08
89 #define VE_LOCK_04_REG      0x10
90 #define VE_LOCK_ERR         0x80
91 
92 #define VE_LOCK_PROC_INFO   0x1000
93 
94 struct cedarv_env_infomation {
95 	unsigned int phymem_start;
96 	int  phymem_total_size;
97 	uint64_t  address_macc;
98 };
99 
100 struct dma_buf_param {
101 	int				fd;       //[in]
102 	unsigned int	phy_addr; //[out]
103 };
104 
105 struct cache_range {
106 	uint64_t	start;
107 	uint64_t	end;
108 };
109 
110 #endif
111