aboutsummaryrefslogtreecommitdiff
path: root/drivers/misc/mediatek/dispsys/mt6735/ddp_info.h
blob: 8f8674c34f9286b674ee7a7209ad29a4ccbe2acd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
#ifndef _H_DDP_INFO
#define _H_DDP_INFO
#include <linux/types.h>
#include "ddp_hal.h"
#include "DpDataType.h"
#include "lcm_drv.h"
#include "disp_event.h"
#include "ddp_ovl.h"
#include <disp_session.h>

typedef struct _OVL_CONFIG_STRUCT
{
    unsigned int ovl_index;
    unsigned int layer;
	unsigned int layer_en;
    enum OVL_LAYER_SOURCE source;
    unsigned int fmt;
    unsigned long addr;  
    unsigned long vaddr;
    unsigned int src_x;
    unsigned int src_y;
    unsigned int src_w;
    unsigned int src_h;
    unsigned int src_pitch;
    unsigned int dst_x;
    unsigned int dst_y;
    unsigned int dst_w;
    unsigned int dst_h;                  // clip region
    unsigned int keyEn;
    unsigned int key; 
    unsigned int aen; 
    unsigned char alpha;
    
    unsigned int sur_aen;
    unsigned int src_alpha;
    unsigned int dst_alpha;

    unsigned int isTdshp;
    unsigned int isDirty;

    unsigned int buff_idx;
    unsigned int identity;
    unsigned int connected_type;
    DISP_BUFFER_TYPE security;

    unsigned int yuv_range;
}OVL_CONFIG_STRUCT;

typedef struct _OVL_BASIC_STRUCT
{
	unsigned int layer;
	unsigned int layer_en;
	unsigned int fmt;
    unsigned long addr;
	unsigned int src_w;
    unsigned int src_h;
    unsigned int src_pitch;
    unsigned int bpp;
}OVL_BASIC_STRUCT;

typedef struct _RDMA_BASIC_STRUCT
{
    unsigned long addr;
	unsigned int src_w;
    unsigned int src_h;
    unsigned int bpp;
}RDMA_BASIC_STRUCT;

typedef struct _RDMA_CONFIG_STRUCT
{
    unsigned idx;            // instance index
    DpColorFormat inputFormat;
    unsigned long address;
    unsigned pitch;
    unsigned width; 
    unsigned height;
    bool isidle;	
	DISP_BUFFER_TYPE security;
}RDMA_CONFIG_STRUCT;

typedef struct _WDMA_CONFIG_STRUCT
{
    unsigned srcWidth; 
    unsigned srcHeight;     // input
    unsigned clipX; 
    unsigned clipY; 
    unsigned clipWidth; 
    unsigned clipHeight;    // clip
    DpColorFormat outputFormat; 
    unsigned long dstAddress; 
    unsigned dstPitch;     // output
    unsigned int useSpecifiedAlpha; 
    unsigned char alpha;
	DISP_BUFFER_TYPE security;
}WDMA_CONFIG_STRUCT;

typedef struct
{
    // for ovl
    bool ovl_dirty;
    bool rdma_dirty;
    bool wdma_dirty;
    bool dst_dirty;
    bool roi_dirty;
    OVL_CONFIG_STRUCT ovl_config[OVL_LAYER_NUM];
    RDMA_CONFIG_STRUCT rdma_config;
    WDMA_CONFIG_STRUCT wdma_config;
    LCM_PARAMS dispif_config;	
    unsigned int lcm_bpp;
    unsigned int dst_w;
    unsigned int dst_h;
    unsigned int fps;
}disp_ddp_path_config;

typedef struct
{
    unsigned int old_session;
    unsigned int old_mode;
    unsigned int cur_mode;
    unsigned int ext_req;
    unsigned int switching;
    unsigned int ext_sid;
}SWITCH_MODE_INFO_STRUCT;

typedef int (*ddp_module_notify)(DISP_MODULE_ENUM, DISP_PATH_EVENT);

typedef struct
{
	DISP_MODULE_ENUM	module;
	int (*init)(DISP_MODULE_ENUM module, void *handle);
	int (*deinit)(DISP_MODULE_ENUM module, void *handle);
	int (*config)(DISP_MODULE_ENUM module, disp_ddp_path_config *config, void *handle);
	int (*start)(DISP_MODULE_ENUM module, void *handle);
	int (*trigger)(DISP_MODULE_ENUM module, void *handle);
	int (*stop)(DISP_MODULE_ENUM module, void *handle);
	int (*reset)(DISP_MODULE_ENUM module, void *handle);
	int (*power_on)(DISP_MODULE_ENUM module, void *handle);
	int (*power_off)(DISP_MODULE_ENUM module, void *handle);
    int (*suspend)(DISP_MODULE_ENUM module, void *handle);
	int (*resume)(DISP_MODULE_ENUM module, void *handle);
	int (*is_idle)(DISP_MODULE_ENUM module);
	int (*is_busy)(DISP_MODULE_ENUM module);
	int (*dump_info)(DISP_MODULE_ENUM module, int level);
	int (*bypass)(DISP_MODULE_ENUM module, int bypass);	
	int (*build_cmdq)(DISP_MODULE_ENUM module, void *cmdq_handle, CMDQ_STATE state);	
	int (*set_lcm_utils)(DISP_MODULE_ENUM module, LCM_DRIVER *lcm_drv);
	int (*set_listener)(DISP_MODULE_ENUM module,ddp_module_notify notify);
	int (*cmd)(DISP_MODULE_ENUM module,int msg, unsigned long arg, void * handle);
	int (*ioctl)(DISP_MODULE_ENUM module, void *handle, unsigned int ioctl_cmd, unsigned long *params);
} DDP_MODULE_DRIVER;

char* ddp_get_module_name(DISP_MODULE_ENUM module);
char* ddp_get_reg_module_name(DISP_REG_ENUM module);
int   ddp_get_module_max_irq_bit(DISP_MODULE_ENUM module);

#endif