summaryrefslogtreecommitdiff
path: root/recipes/mplayer/files/vo_w100_api.h
blob: 59cf58be26c21e72f2da1c2596f27619b5937316 (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
/* -*- mode: c++; tab-width: 4 -*- */

/* $Id$ */

/*
 * Copyright (C) 2003-2004 AGAWA Koji <i (AT) atty (DOT) jp>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */

/**
 * @file w100api.h
 * @brief 
 *
 * 
 *
 * @author AGAWA Koji
 * @date $Date$
 * @version $Revision$
 */

#ifndef W100API_H_INCLUDED
#define W100API_H_INCLUDED

#ifdef __cplusplus
# define EXTERN_C_BEGIN extern "C" {
# define EXTERN_C_END }
#else
# define EXTERN_C_BEGIN
# define EXTERN_C_END
#endif

EXTERN_C_BEGIN

#include <inttypes.h>

typedef int8_t s8;
typedef int16_t s16;
typedef int32_t s32;
typedef uint8_t u8;
typedef uint16_t u16;
typedef uint32_t u32;

#include "vo_w100_fb.h"

// DP_GUI_MASTER_CNTL.GMC_Dst_DataType
// DP_DATATYPE.Dp_Dst_DataType
/* #define DSTTYPE_8BPP            2       // 8 bpp grey scale */
/* #define DSTTYPE_16BPP_1555      3       //16 bpp aRGB 1555 */
/* #define DSTTYPE_16BPP_444       5       //16 bpp aRGB 4444 */
#define DSTTYPE_8BPP            1

// DP_GUI_MASTER_CNTL.GMC_Src_DataType
// DP_DATATYPE.Dp_Src_DataType
#define SRCTYPE_1BPP_OPA        0       //mono (expanded to frgd, bkgd)
#define SRCTYPE_1BPP_TRA        1       //mono (expanded to frgd, leave_alone)
#define SRCTYPE_EQU_DST         3       //color (same as DST)
#define SRCTYPE_SOLID_COLOR_BLT 4       //solid color for Blt (use frgd)
#define SRCTYPE_4BPP            5       //4 bpp
#define SRCTYPE_12BPP_PACKED    6       //12 bpp packed

#define ROP3_SRCCOPY            0xCC

#define OVLTYPE_YUV420          0x07

#define INTERNAL_VRAM 0
#define EXTERNAL_VRAM 1

#define VRAM_OFFSET_INTERNAL 0x00000000
#define VRAM_OFFSET_EXTERNAL 0x0F000000

typedef struct {
    /* 順序と型が未確定 */
    int16_t XCoord;
    int16_t YCoord;
} ATI_POINT;

typedef struct {
    /* 順序と型が未確定 */
    int16_t XCoord;
    int16_t YCoord;
    int16_t Width;
    int16_t Height;
} ATI_RECT;

typedef struct {
    /* 順序と型が未確定 */
    uint32_t Count;                        /* +0 */
    uint8_t ScaleXFactor;                 /* +4 確定 */
    uint8_t ScaleYFactor;                 /* +5 確定 */
    uint8_t BlendOn;                      /* +6 確定 */
    uint8_t dummy1;
} ATI_STRETCH;                          /* 8bytes? */

typedef struct {
    uint32_t *lpSrcBitmap;
    uint16_t XCoord;                      /* +4  確定 */
    uint16_t YCoord;                      /* +6  確定 */
    uint16_t SrcPitch;                    /* +8  確定 */
    uint16_t SrcHeight;                   /* +10 確定 */
    uint16_t OverlayWidth;
    uint16_t OverlayHeight;
    uint16_t *lpOverlayKey;                /* +16 確定 */
	// uint16_t key[2] へのポインタ
    uint8_t OverlayFormat;               /* +20 確定 */
    uint8_t dummy1;
    uint16_t dummy2;
} ATI_OVERLAYPROP;                      /* 24bytes? */

typedef struct {
    int HInvert;
    int VInvert;
} ATI_EXTVIDEOPROP;

typedef struct {
    ATI_EXTVIDEOPROP ExtVideoProp;
} ATI_UNKNOWN1;

typedef struct {
	ATI_UNKNOWN1 u1;			// こっち?
	uint8_t HExpansion;                   /* +8  確定 */
    uint8_t VExpansion;                   /* +9  確定 */
    uint8_t RConversion;                  /* +12 確定 */
/*     ATI_UNKNOWN1 x; */
} ATI_EXTENDEDOVERLAYPROP;              /* 16byte? */

/**
 * アクセラレーションの利用を開始する。
 *
 * @return              1:success, 0:fail
 */
int AtiCore_ProcessAttach(void);
int AtiCore_ProcessAttachSpecialMode(uint32_t);

/**
 * アクセラレーションの利用を終了する。
 *
 * @return              *不明*
 */
int AtiCore_ProcessDetach(void);

/**
 * サーフェスをビデオメモリ上に作成する。
 *
 * @arg     handle      (返値)サーフェスのハンドル
 * @arg     offset      (返値)サーフェスのオフセット
 * @arg     size        サーフェスのサイズ
 * @arg     direction   (0:低位から高位へ, 1:高位から低位へ)向かって確保
 * @return              1:success, 0:fail
 */
int AtiCore_AllocateSurface(uint16_t *handle, uint32_t *offset,
							uint32_t size, uint32_t direction);

/**
 * サーフェスを破棄する。
 *
 * @arg     handle      サーフェスのハンドル
 * @return              1:success, 0:fail
 */
int AtiCore_DestroySurface(uint16_t handle);

/*8
 * @param   rop         8ビットのフラグと思われる
 */
int AtiCore_SetRopOperation(uint32_t rop);

int AtiCore_SetDstType(uint32_t);
int AtiCore_SetSrcType(uint32_t);
int AtiCore_SetSrcClippingRect(ATI_CLIPRECT *cliprect);
int AtiCore_SetDstClippingRect(ATI_CLIPRECT *cliprect);
int AtiCore_SetSrcPitchOffset(int pitch, int offset);
int AtiCore_SetDstPitchOffset(int pitch, int offset);

int AtiCore_BitBltFilpRotate(int blt090Rotate,
                             ATI_RECT *dstRect, ATI_RECT *srcRect);
int AtiCore_StretchBlt(ATI_STRETCH *option,
                       ATI_POINT *point, ATI_RECT *srcRect);


/**
 * (BitBltなどの)処理が完了するのを待つ。
 *
 * @param   nsec        ウェイト時間(msec)
 * @return              1:処理が完了した, 0:処理はまだ終わっていない
 */
int AtiCore_WaitComplete(int msec);

/**
 * オーバレイを作成する。
 *
 * @param   handle      (返値)オーバレイのハンドル
 * @return              1:success, 0:fail
 */
int AtiCore_AllocOverlay(uint16_t *handle);

int AtiCore_ReleaseOverlay(uint16_t handle);

/**
 * @return              1:success, 0:fail
 */
int AtiCore_SetupOverlay(uint16_t handle, ATI_OVERLAYPROP *prop);

int AtiCore_SetupOverlayExtended(uint16_t handle, ATI_EXTENDEDOVERLAYPROP *prop);

/**
 * @return              1:success, 0:fail
 */
int AtiCore_SetOverlayOnOff(uint16_t handle, int isEnable);

int AtiCore_SetOverlayPos(uint16_t handle, uint16_t x, uint16_t y);

int AtiCore_SetupMemoryTransfer(uint32_t offset, void **regdata);
int AtiCore_TerminateMemoryTransfer(void);

int AtiCore_GetFrontBufferPitchOffset(uint32_t *pitch, uint32_t *offset);

/**
 * @return              1:success, 0:fail
 */
int AtiCore_SetDisplayBrightness(int brightness);

/**
 * @return              1:success, 0:fail
 */
int GetAvailableVideoMem(uint32_t *internal, uint32_t *external);

/*
 * 1 ; 0
 */
int AtiCore_SetGraphicWindowOnOff(int );

int AtiCore_ReadReg(uint32_t reg, void *val);
int AtiCore_WriteReg(uint32_t reg, void *val);

uint32_t GetRealMemAddr(uint32_t offset);

int AtiCore_SetBkgColour(uint32_t);

/* ================================================================ */
/* from libqte.so.2.3.2 */
/*
AtiCore_AlphaBlend
AtiCore_BitBlt
AtiCore_BrushType
AtiCore_CursorOnOff
AtiCore_DrawPixel
AtiCore_Flush
AtiCore_GammaCorrection
AtiCore_GetCRC
AtiCore_GetCursorPos
AtiCore_GetDeviceInfo
AtiCore_GetGPIO_Data
AtiCore_GetGraphicExtended
AtiCore_GetGraphicWindowPos
AtiCore_GetLargestVideoMemBlock
AtiCore_GetLastError
AtiCore_GetMultiCRC
AtiCore_GetOverlayPos
AtiCore_GetPitchOffsetProperty
AtiCore_Host
AtiCore_LoadCursorBitMap
AtiCore_PaintRect
AtiCore_PolyScanline
AtiCore_Polyline
AtiCore_ProcessAttachMinimal
AtiCore_ProcessAttachSpecialMode
AtiCore_ProcessDetachMinimal
AtiCore_ProcessDetachSpecialMode
AtiCore_ReadCfgReg
AtiCore_ScanlineShading
AtiCore_SetApertures
AtiCore_SetBkgColour
AtiCore_SetBytePixelOrder
AtiCore_SetCursorPos
AtiCore_SetDisplayParameters
AtiCore_SetDriverBehaviour
AtiCore_SetFrgColour
AtiCore_SetFrontBuffer
AtiCore_SetGPIO_Data
AtiCore_SetGraphicWindowPos
AtiCore_SetOverlayPosUsingGraphicWindowXY
AtiCore_SetPartialCursor
AtiCore_SetupGraphicExtended
AtiCore_SetupGraphicWindow
AtiCore_SetupPM4
AtiCore_SmallText
AtiCore_SubmitPM4Packet
AtiCore_TransBitBlt
AtiCore_WriteCfgReg
 */

EXTERN_C_END

#endif /* W100API_H_INCLUDED */