]> git.kernelconcepts.de Git - karo-tx-linux.git/blob - drivers/staging/sm750fb/sm750_accel.h
staging: sm750fb: change definition of DE_DIMENSION fields
[karo-tx-linux.git] / drivers / staging / sm750fb / sm750_accel.h
1 #ifndef ACCEL_H__
2 #define ACCEL_H__
3
4 #define HW_ROP2_COPY 0xc
5 #define HW_ROP2_XOR 0x6
6
7 /* notes: below address are the offset value from de_base_address (0x100000)*/
8
9 /* for sm718/750/502 de_base is at mmreg_1mb*/
10 #define DE_BASE_ADDR_TYPE1 0x100000
11 /* for sm712,de_base is at mmreg_32kb */
12 #define DE_BASE_ADDR_TYPE2  0x8000
13 /* for sm722,de_base is at mmreg_0 */
14 #define DE_BASE_ADDR_TYPE3 0
15
16 /* type1 data port address is at mmreg_0x110000*/
17 #define DE_PORT_ADDR_TYPE1 0x110000
18 /* for sm712,data port address is at mmreg_0 */
19 #define DE_PORT_ADDR_TYPE2 0x100000
20 /* for sm722,data port address is at mmreg_1mb */
21 #define DE_PORT_ADDR_TYPE3 0x100000
22
23 #define DE_SOURCE                                       0x0
24 #define DE_SOURCE_WRAP                                  BIT(31)
25 #define DE_SOURCE_X_K1_SHIFT                            16
26 #define DE_SOURCE_X_K1_MASK                             (0x3fff << 16)
27 #define DE_SOURCE_X_K1_MONO_MASK                        (0x1f << 16)
28 #define DE_SOURCE_Y_K2_MASK                             0xffff
29
30 #define DE_DESTINATION                                  0x4
31 #define DE_DESTINATION_WRAP                             BIT(31)
32 #define DE_DESTINATION_X_SHIFT                          16
33 #define DE_DESTINATION_X_MASK                           (0x1fff << 16)
34 #define DE_DESTINATION_Y_MASK                           0xffff
35
36 #define DE_DIMENSION                                    0x8
37 #define DE_DIMENSION_X_SHIFT                            16
38 #define DE_DIMENSION_X_MASK                             (0x1fff << 16)
39 #define DE_DIMENSION_Y_ET_MASK                          0x1fff
40
41 #define DE_CONTROL                                      0xC
42 #define DE_CONTROL_STATUS                               31:31
43 #define DE_CONTROL_STATUS_STOP                          0
44 #define DE_CONTROL_STATUS_START                         1
45 #define DE_CONTROL_PATTERN                              30:30
46 #define DE_CONTROL_PATTERN_MONO                         0
47 #define DE_CONTROL_PATTERN_COLOR                        1
48 #define DE_CONTROL_UPDATE_DESTINATION_X                 29:29
49 #define DE_CONTROL_UPDATE_DESTINATION_X_DISABLE         0
50 #define DE_CONTROL_UPDATE_DESTINATION_X_ENABLE          1
51 #define DE_CONTROL_QUICK_START                          28:28
52 #define DE_CONTROL_QUICK_START_DISABLE                  0
53 #define DE_CONTROL_QUICK_START_ENABLE                   1
54 #define DE_CONTROL_DIRECTION                            27:27
55 #define DE_CONTROL_DIRECTION_LEFT_TO_RIGHT              0
56 #define DE_CONTROL_DIRECTION_RIGHT_TO_LEFT              1
57 #define DE_CONTROL_MAJOR                                26:26
58 #define DE_CONTROL_MAJOR_X                              0
59 #define DE_CONTROL_MAJOR_Y                              1
60 #define DE_CONTROL_STEP_X                               25:25
61 #define DE_CONTROL_STEP_X_POSITIVE                      1
62 #define DE_CONTROL_STEP_X_NEGATIVE                      0
63 #define DE_CONTROL_STEP_Y                               24:24
64 #define DE_CONTROL_STEP_Y_POSITIVE                      1
65 #define DE_CONTROL_STEP_Y_NEGATIVE                      0
66 #define DE_CONTROL_STRETCH                              23:23
67 #define DE_CONTROL_STRETCH_DISABLE                      0
68 #define DE_CONTROL_STRETCH_ENABLE                       1
69 #define DE_CONTROL_HOST                                 22:22
70 #define DE_CONTROL_HOST_COLOR                           0
71 #define DE_CONTROL_HOST_MONO                            1
72 #define DE_CONTROL_LAST_PIXEL                           21:21
73 #define DE_CONTROL_LAST_PIXEL_OFF                       0
74 #define DE_CONTROL_LAST_PIXEL_ON                        1
75 #define DE_CONTROL_COMMAND                              20:16
76 #define DE_CONTROL_COMMAND_BITBLT                       0
77 #define DE_CONTROL_COMMAND_RECTANGLE_FILL               1
78 #define DE_CONTROL_COMMAND_DE_TILE                      2
79 #define DE_CONTROL_COMMAND_TRAPEZOID_FILL               3
80 #define DE_CONTROL_COMMAND_ALPHA_BLEND                  4
81 #define DE_CONTROL_COMMAND_RLE_STRIP                    5
82 #define DE_CONTROL_COMMAND_SHORT_STROKE                 6
83 #define DE_CONTROL_COMMAND_LINE_DRAW                    7
84 #define DE_CONTROL_COMMAND_HOST_WRITE                   8
85 #define DE_CONTROL_COMMAND_HOST_READ                    9
86 #define DE_CONTROL_COMMAND_HOST_WRITE_BOTTOM_UP         10
87 #define DE_CONTROL_COMMAND_ROTATE                       11
88 #define DE_CONTROL_COMMAND_FONT                         12
89 #define DE_CONTROL_COMMAND_TEXTURE_LOAD                 15
90 #define DE_CONTROL_ROP_SELECT                           15:15
91 #define DE_CONTROL_ROP_SELECT_ROP3                      0
92 #define DE_CONTROL_ROP_SELECT_ROP2                      1
93 #define DE_CONTROL_ROP2_SOURCE                          14:14
94 #define DE_CONTROL_ROP2_SOURCE_BITMAP                   0
95 #define DE_CONTROL_ROP2_SOURCE_PATTERN                  1
96 #define DE_CONTROL_MONO_DATA                            13:12
97 #define DE_CONTROL_MONO_DATA_NOT_PACKED                 0
98 #define DE_CONTROL_MONO_DATA_8_PACKED                   1
99 #define DE_CONTROL_MONO_DATA_16_PACKED                  2
100 #define DE_CONTROL_MONO_DATA_32_PACKED                  3
101 #define DE_CONTROL_REPEAT_ROTATE                        11:11
102 #define DE_CONTROL_REPEAT_ROTATE_DISABLE                0
103 #define DE_CONTROL_REPEAT_ROTATE_ENABLE                 1
104 #define DE_CONTROL_TRANSPARENCY_MATCH                   10:10
105 #define DE_CONTROL_TRANSPARENCY_MATCH_OPAQUE            0
106 #define DE_CONTROL_TRANSPARENCY_MATCH_TRANSPARENT       1
107 #define DE_CONTROL_TRANSPARENCY_SELECT                  9:9
108 #define DE_CONTROL_TRANSPARENCY_SELECT_SOURCE           0
109 #define DE_CONTROL_TRANSPARENCY_SELECT_DESTINATION      1
110 #define DE_CONTROL_TRANSPARENCY                         8:8
111 #define DE_CONTROL_TRANSPARENCY_DISABLE                 0
112 #define DE_CONTROL_TRANSPARENCY_ENABLE                  1
113 #define DE_CONTROL_ROP                                  7:0
114
115 /* Pseudo fields. */
116
117 #define DE_CONTROL_SHORT_STROKE_DIR                     27:24
118 #define DE_CONTROL_SHORT_STROKE_DIR_225                 0
119 #define DE_CONTROL_SHORT_STROKE_DIR_135                 1
120 #define DE_CONTROL_SHORT_STROKE_DIR_315                 2
121 #define DE_CONTROL_SHORT_STROKE_DIR_45                  3
122 #define DE_CONTROL_SHORT_STROKE_DIR_270                 4
123 #define DE_CONTROL_SHORT_STROKE_DIR_90                  5
124 #define DE_CONTROL_SHORT_STROKE_DIR_180                 8
125 #define DE_CONTROL_SHORT_STROKE_DIR_0                   10
126 #define DE_CONTROL_ROTATION                             25:24
127 #define DE_CONTROL_ROTATION_0                           0
128 #define DE_CONTROL_ROTATION_270                         1
129 #define DE_CONTROL_ROTATION_90                          2
130 #define DE_CONTROL_ROTATION_180                         3
131
132 #define DE_PITCH                                        0x000010
133 #define DE_PITCH_DESTINATION                            28:16
134 #define DE_PITCH_SOURCE                                 12:0
135
136 #define DE_FOREGROUND                                   0x000014
137 #define DE_FOREGROUND_COLOR                             31:0
138
139 #define DE_BACKGROUND                                   0x000018
140 #define DE_BACKGROUND_COLOR                             31:0
141
142 #define DE_STRETCH_FORMAT                               0x00001C
143 #define DE_STRETCH_FORMAT_PATTERN_XY                    30:30
144 #define DE_STRETCH_FORMAT_PATTERN_XY_NORMAL             0
145 #define DE_STRETCH_FORMAT_PATTERN_XY_OVERWRITE          1
146 #define DE_STRETCH_FORMAT_PATTERN_Y                     29:27
147 #define DE_STRETCH_FORMAT_PATTERN_X                     25:23
148 #define DE_STRETCH_FORMAT_PIXEL_FORMAT                  21:20
149 #define DE_STRETCH_FORMAT_PIXEL_FORMAT_8                0
150 #define DE_STRETCH_FORMAT_PIXEL_FORMAT_16               1
151 #define DE_STRETCH_FORMAT_PIXEL_FORMAT_32               2
152 #define DE_STRETCH_FORMAT_PIXEL_FORMAT_24               3
153
154 #define DE_STRETCH_FORMAT_ADDRESSING                    19:16
155 #define DE_STRETCH_FORMAT_ADDRESSING_XY                 0
156 #define DE_STRETCH_FORMAT_ADDRESSING_LINEAR             15
157 #define DE_STRETCH_FORMAT_SOURCE_HEIGHT                 11:0
158
159 #define DE_COLOR_COMPARE                                0x000020
160 #define DE_COLOR_COMPARE_COLOR                          23:0
161
162 #define DE_COLOR_COMPARE_MASK                           0x000024
163 #define DE_COLOR_COMPARE_MASK_MASKS                     23:0
164
165 #define DE_MASKS                                        0x000028
166 #define DE_MASKS_BYTE_MASK                              31:16
167 #define DE_MASKS_BIT_MASK                               15:0
168
169 #define DE_CLIP_TL                                      0x00002C
170 #define DE_CLIP_TL_TOP                                  31:16
171 #define DE_CLIP_TL_STATUS                               13:13
172 #define DE_CLIP_TL_STATUS_DISABLE                       0
173 #define DE_CLIP_TL_STATUS_ENABLE                        1
174 #define DE_CLIP_TL_INHIBIT                              12:12
175 #define DE_CLIP_TL_INHIBIT_OUTSIDE                      0
176 #define DE_CLIP_TL_INHIBIT_INSIDE                       1
177 #define DE_CLIP_TL_LEFT                                 11:0
178
179 #define DE_CLIP_BR                                      0x000030
180 #define DE_CLIP_BR_BOTTOM                               31:16
181 #define DE_CLIP_BR_RIGHT                                12:0
182
183 #define DE_MONO_PATTERN_LOW                             0x000034
184 #define DE_MONO_PATTERN_LOW_PATTERN                     31:0
185
186 #define DE_MONO_PATTERN_HIGH                            0x000038
187 #define DE_MONO_PATTERN_HIGH_PATTERN                    31:0
188
189 #define DE_WINDOW_WIDTH                                 0x00003C
190 #define DE_WINDOW_WIDTH_DESTINATION                     28:16
191 #define DE_WINDOW_WIDTH_SOURCE                          12:0
192
193 #define DE_WINDOW_SOURCE_BASE                           0x000040
194 #define DE_WINDOW_SOURCE_BASE_EXT                       27:27
195 #define DE_WINDOW_SOURCE_BASE_EXT_LOCAL                 0
196 #define DE_WINDOW_SOURCE_BASE_EXT_EXTERNAL              1
197 #define DE_WINDOW_SOURCE_BASE_CS                        26:26
198 #define DE_WINDOW_SOURCE_BASE_CS_0                      0
199 #define DE_WINDOW_SOURCE_BASE_CS_1                      1
200 #define DE_WINDOW_SOURCE_BASE_ADDRESS                   25:0
201
202 #define DE_WINDOW_DESTINATION_BASE                      0x000044
203 #define DE_WINDOW_DESTINATION_BASE_EXT                  27:27
204 #define DE_WINDOW_DESTINATION_BASE_EXT_LOCAL            0
205 #define DE_WINDOW_DESTINATION_BASE_EXT_EXTERNAL         1
206 #define DE_WINDOW_DESTINATION_BASE_CS                   26:26
207 #define DE_WINDOW_DESTINATION_BASE_CS_0                 0
208 #define DE_WINDOW_DESTINATION_BASE_CS_1                 1
209 #define DE_WINDOW_DESTINATION_BASE_ADDRESS              25:0
210
211 #define DE_ALPHA                                        0x000048
212 #define DE_ALPHA_VALUE                                  7:0
213
214 #define DE_WRAP                                         0x00004C
215 #define DE_WRAP_X                                       31:16
216 #define DE_WRAP_Y                                       15:0
217
218 #define DE_STATUS                                       0x000050
219 #define DE_STATUS_CSC                                   1:1
220 #define DE_STATUS_CSC_CLEAR                             0
221 #define DE_STATUS_CSC_NOT_ACTIVE                        0
222 #define DE_STATUS_CSC_ACTIVE                            1
223 #define DE_STATUS_2D                                    0:0
224 #define DE_STATUS_2D_CLEAR                              0
225 #define DE_STATUS_2D_NOT_ACTIVE                         0
226 #define DE_STATUS_2D_ACTIVE                             1
227
228
229
230 /* blt direction */
231 #define TOP_TO_BOTTOM 0
232 #define LEFT_TO_RIGHT 0
233 #define BOTTOM_TO_TOP 1
234 #define RIGHT_TO_LEFT 1
235
236 void hw_set2dformat(struct lynx_accel *accel, int fmt);
237
238 void hw_de_init(struct lynx_accel *accel);
239
240 int hw_fillrect(struct lynx_accel *accel,
241                                 u32 base, u32 pitch, u32 Bpp,
242                                 u32 x, u32 y, u32 width, u32 height,
243                                 u32 color, u32 rop);
244
245 int hw_copyarea(
246 struct lynx_accel *accel,
247 unsigned int sBase,  /* Address of source: offset in frame buffer */
248 unsigned int sPitch, /* Pitch value of source surface in BYTE */
249 unsigned int sx,
250 unsigned int sy,     /* Starting coordinate of source surface */
251 unsigned int dBase,  /* Address of destination: offset in frame buffer */
252 unsigned int dPitch, /* Pitch value of destination surface in BYTE */
253 unsigned int bpp,    /* Color depth of destination surface */
254 unsigned int dx,
255 unsigned int dy,     /* Starting coordinate of destination surface */
256 unsigned int width,
257 unsigned int height, /* width and height of rectangle in pixel value */
258 unsigned int rop2);
259
260 int hw_imageblit(struct lynx_accel *accel,
261                  const char *pSrcbuf, /* pointer to start of source buffer in system memory */
262                  u32 srcDelta,          /* Pitch value (in bytes) of the source buffer, +ive means top down and -ive mean button up */
263                  u32 startBit, /* Mono data can start at any bit in a byte, this value should be 0 to 7 */
264                  u32 dBase,    /* Address of destination: offset in frame buffer */
265                  u32 dPitch,   /* Pitch value of destination surface in BYTE */
266                  u32 bytePerPixel,      /* Color depth of destination surface */
267                  u32 dx,
268                  u32 dy,       /* Starting coordinate of destination surface */
269                  u32 width,
270                  u32 height,   /* width and height of rectangle in pixel value */
271                  u32 fColor,   /* Foreground color (corresponding to a 1 in the monochrome data */
272                  u32 bColor,   /* Background color (corresponding to a 0 in the monochrome data */
273                  u32 rop2);
274 #endif