aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/emgd/include/igd_2d.h
blob: 9d1fe7b8a8246e732687300af27afc8dc0e804a6 (plain)
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
/* -*- pse-c -*-
 *-----------------------------------------------------------------------------
 * Filename: igd_2d.h
 * $Revision: 1.3 $
 *-----------------------------------------------------------------------------
 * Copyright © 2002-2010, Intel Corporation.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms and conditions of the GNU General Public License,
 * version 2, as published by the Free Software Foundation.
 *
 * This program is distributed in the hope it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
 *
 *-----------------------------------------------------------------------------
 * Description:
 *  This is a header file for the Intel GFX commands.
 *  This includes commands specific to Intel hardware and structures specific
 *  to Intel hardware.  All other commands and structures are available
 *  through GFX.
 *-----------------------------------------------------------------------------
 */

#ifndef _IGD_2D_H
#define _IGD_2D_H

/* Needed for igd_display_h and pixel_format. */
#include <igd_mode.h>
#include <igd_render.h>
#include <igd_appcontext.h>

/* byte mask */
#define IGD_ALPHA_CHANNEL 0x200000
#define IGD_RGB_CHANNEL   0x100000

/* flags for XY_SETUP_CLIP_BLT */
#define IGD_CLIP_ENABLED		0x01
#define IGD_CLIP_DISABLED		0x00

/* flags for igd_mono_src_t->pat_select_transp_mode for functions
 *  igd_mono_src_copy_blt
 *  igd_full_mono_src_blt
 *  igd_full_mono_pat_blt
 *  igd_full_mono_pat_mono_src_blt
 */
#define IGD_SRC_TRANSP_MODE_BACKGROUND	(0x0 << 29)
#define IGD_SRC_TRANSP_MODE_ENABLED		(0x1 << 29)

/* flags for igd_mono_pat_t->pat_select_transp_mode for functions
 *  igd_full_mono_pat_blt
 *  igd_full_mono_pat_mono_src_blt
*/
#define IGD_PAT_SOLID                   (0x1 << 31)
#define IGD_PAT_NO_SOLID                (0x0 << 31)

/* flags for igd_mono_pat_t->pat_select_transp_mode for functions
 *  igd_mono_pat_blt
 *  igd_full_mono_pat_blt
 *  igd_full_mono_pat_mono_src_blt
 * FIXME: Does this work for igd_full_mono_pat_blt???
 */
#define IGD_PAT_TRANSP_MODE_BACKGROUND	(0x0 << 28)
#define IGD_PAT_TRANSP_MODE_ENABLED		(0x1 << 28)


/* chroma transparency range mode */
#define IGD_NO_TRANSP             0
#define IGD_SRC_RGB_TRANSP        1
#define IGD_SRC_RGB_ALPHA_TRANSP  2
#define IGD_DEST_RGB_TRANSP       3
#define IGD_DEST_RGB_ALPHA_TRANSP 4


typedef struct igd_chroma {
	unsigned int transp_range_mode;
	unsigned int color_low;
	unsigned int color_high;
} igd_chroma_t;

typedef struct igd_mono_src {
	unsigned int data_bit_pos;
	unsigned int mono_src_transp_mode;
	/*
	 * FIXME: Maybe. Immediate mode instructions need a virtual
	 *  address. The rest need an offset. Hence there are two
	 *  address values in this structure. The type of instructure
	 *  determines which one is used.  This is a bit confusing for
	 *  the IAL layer. Ideally, these would be combined into one value.
	 */
	unsigned long addr;
	unsigned char *virt_addr;  /* Used by Immediate mode instructions */
	unsigned int bgcolor;
	unsigned int fgcolor;
	int mono_src_size;
} igd_mono_src_t;

/* fixed pattern not supported yet */
typedef struct igd_mono_pat {
	unsigned int pat_select_transp_mode;
	unsigned int horiz_seed;
	unsigned int vert_seed;
	unsigned int bgcolor;
	unsigned int fgcolor;
	unsigned int data0;
	unsigned int data1;
} igd_mono_pat_t;

typedef struct igd_pat {
	unsigned int horiz_seed;
	unsigned int vert_seed;
	unsigned long base_addr;
    unsigned char *virt_addr;
} igd_pat_t;



/*----------------------------------------------------------------------
 * Function:
 *  int dispatch->setup_clip_blt(igd_display_h display_handle,
 *    int priority,
 *    igd_rect_t *dest_rect,
 *    igd_appcontext_h appcontext_handle,
 *    unsigned int flags);
 *
 * Description:
 *  XY_SETUP_CLIP_BLT: used to change the clip coordinate registers
 *
 * Parameters:
 *
 * Returns:
 *----------------------------------------------------------------------
 */



/*----------------------------------------------------------------------
 * Function:
 *  int dispatch->color_blt(igd_display_h display_handle,
 *    int priority,
 *    igd_surface_t *dest,
 *    igd_rect_t *dest_rect,
 *    unsigned int byte_mask,
 *    unsigned int color,
 *    unsigned int raster_ops,
 *    igd_appcontext_h appcontext,
 *    unsigned int flags);
 *
 * Description:
 *  color_blt: copy solid_color to dest at specific address
 *
 * Parameters:
 *
 * Returns:
 *----------------------------------------------------------------------
 */
	

/*----------------------------------------------------------------------
 * Function:
 *  int dispatch->rgb_color_blt(igd_display_h display_handle,
 *    int priority,
 *    igd_surface_t *dest,
 *    igd_rect_t *dest_rect,
 *    unsigned int byte_mask,
 *    unsigned int color,
 *    unsigned int raster_ops,
 *    igd_appcontext_h appcontext,
 *    unsigned int flags);
 *
 * Description:
 *
 * Parameters:
 *
 * Returns:
 *----------------------------------------------------------------------
 */



/*----------------------------------------------------------------------
 * Function:
 *  int dispatch->pat_blt(igd_display_h display_handle,
 *    int priority,
 *    igd_surface_t *dest,
 *    igd_rect_t *dest_rect,
 *    unsigned int byte_mask,
 *    igd_pat_t *pat, 
 *    igd_chroma_t *chroma,
 *    unsigned int raster_ops,
 *    igd_appcontext_h appcontext,
 *    unsigned int flags);
 *
 * Description:
 *  pat_blt() copy a color pattern to the dest surface
 *
 * Parameters:
 *
 * Returns:
 *----------------------------------------------------------------------
 */


/*----------------------------------------------------------------------
 * Function:
 *  int dispatch->mono_pat_blt(igd_display_h display_handle,
 *    int priority,
 *    igd_surface_t *dest,
 *    igd_rect_t *dest_rect,
 *    unsigned int byte_mask,
 *    igd_mono_pat_t *pat, 
 *    unsigned int raster_ops,
 *    igd_appcontext_h appcontext,
 *    unsigned int flags);
 *
 * Description:
 *  mono_pat_blt(): copy a monochrome pattern to the dest surface
 *
 * Parameters:
 *
 * Returns:
 *----------------------------------------------------------------------
 */

/*----------------------------------------------------------------------
 * Function:
 *  int dispatch->src_copy_blt(igd_display_h display_handle,
 *    int priority,
 *    igd_surface_t *dest,
 *    igd_rect_t *dest_rect,
 *    igd_surface_t *src,
 *    igd_coord_t *src_coord,
 *    unsigned int byte_mask,
 *    igd_chroma_t *chroma,
 *    unsigned int raster_ops,
 *    igd_appcontext_h appcontext,
 *    unsigned int flags);
 *
 * Description:
 *  src_copy_blt: copy a source surface to the dest surface
 *
 * Parameters:
 *
 * Returns:
 *----------------------------------------------------------------------
 */


/*----------------------------------------------------------------------
 * Function:
 *  int dispatch->mono_src_copy_blt(igd_display_h display_handle,
 *    int priority,
 *    igd_surface_t *dest,
 *    igd_rect_t *dest_rect,
 *    igd_mono_src_t *src,
 *    unsigned int byte_mask,
 *    unsigned int raster_ops,
 *    igd_appcontext_h appcontext,
 *    unsigned int flags);
 *
 * Description:
 *  mono_src_copy_blt: color source copy with chroma-keying
 *
 * Parameters:
 *
 * Returns:
 *----------------------------------------------------------------------
 */

/*----------------------------------------------------------------------
 * Function:
 *  int dispatch->full_blt(igd_display_h display_handle,
 *    int priority,
 *    igd_surface_t *dest,
 *    igd_rect_t *dest_rect,
 *    igd_surface_t *src,
 *    igd_coord_t *src_coord,
 *    unsigned int byte_mask,
 *    igd_pat_t *pat,
 *    unsigned int raster_ops,
 *    igd_appcontext_h appcontext,
 *    unsigned int flags);
 *
 * Description:
 *  full_blt: copy with specification of destination, source
 *  and pattern
 *
 * Parameters:
 *
 * Returns:
 *----------------------------------------------------------------------
 */



/*----------------------------------------------------------------------
 * Function:
 *  int dispatch->full_mono_src_blt(igd_display_h display_handle,
 *    int priority,
 *    igd_surface_t *dest,
 *    igd_rect_t *dest_rect,
 *    igd_mono_src_t *src, 
 *    unsigned int byte_mask,
 *    igd_pat_t *pat, 
 *    unsigned int raster_ops,
 *    igd_appcontext_h appcontext,
 *    unsigned int flags);
 *
 * Description:
 *  full_mono_src_blt: copy with specification of destination, source
 *  and pattern where source is monochrome
 *
 * Parameters:
 *
 * Returns:
 *----------------------------------------------------------------------
 */



/*----------------------------------------------------------------------
 * Function:
 *   int dispatch->full_mono_pat_blt(igd_display_h display_handle,
 *     int priority,
 *     igd_surface_t *dest,
 *     igd_rect_t *dest_rect,
 *     igd_coord_t *src_coord,
 *     igd_surface_t *src,	
 *     unsigned int byte_mask,
 *     igd_mono_pat_t *pat, 
 *     unsigned int raster_ops,
 *     igd_appcontext_h appcontext,
 *     unsigned int flags);
 *
 * Description:
 *  full_mono_pat_blt copy with specification of destination, source
 *  and pattern where pattern is monochrome
 *
 * Parameters:
 *
 * Returns:
 *----------------------------------------------------------------------
 */



/*----------------------------------------------------------------------
 * Function:
 *  int dispatch->full_mono_pat_mono_src_blt(igd_display_h display_handle, 
 *    int priority,
 *    igd_surface_t *dest, 
 *    igd_rect_t *dest_rect,
 *    igd_mono_src_t *src,
 *    unsigned int byte_mask,
 *    igd_mono_pat_t *pat, 
 *    unsigned int raster_ops,
 *    igd_appcontext_h appcontext,
 *    unsigned int flags);
 *
 * Description:
 *  full_mono_pat_mono_src_blt copy with specification of destination, source
 *  and pattern where patter and source are monochrome
 *
 * Parameters:
 *
 * Returns:
 *----------------------------------------------------------------------
 */

#endif /* _IGD_2D_H */