blob: 89c4601042c18009287725d61c8c4600d93f6f52 [file] [log] [blame]
Mauro Carvalho Chehab447d6fb2006-05-22 10:31:37 -03001OSD firmware API description
2============================
3
4Note: this API is part of the decoder firmware, so it's cx23415 only.
5
6-------------------------------------------------------------------------------
7
8Name CX2341X_OSD_GET_FRAMEBUFFER
9Enum 65/0x41
10Description
11 Return base and length of contiguous OSD memory.
12Result[0]
13 OSD base address
14Result[1]
15 OSD length
16
17-------------------------------------------------------------------------------
18
19Name CX2341X_OSD_GET_PIXEL_FORMAT
20Enum 66/0x42
21Description
22 Query OSD format
23Result[0]
Ian Armstrong59fc7f52007-03-16 07:40:48 -030024 0=8bit index
25 1=16bit RGB 5:6:5
26 2=16bit ARGB 1:5:5:5
27 3=16bit ARGB 1:4:4:4
28 4=32bit ARGB 8:8:8:8
Mauro Carvalho Chehab447d6fb2006-05-22 10:31:37 -030029
30-------------------------------------------------------------------------------
31
32Name CX2341X_OSD_SET_PIXEL_FORMAT
33Enum 67/0x43
34Description
35 Assign pixel format
36Param[0]
Ian Armstrong59fc7f52007-03-16 07:40:48 -030037 0=8bit index
38 1=16bit RGB 5:6:5
39 2=16bit ARGB 1:5:5:5
40 3=16bit ARGB 1:4:4:4
41 4=32bit ARGB 8:8:8:8
Mauro Carvalho Chehab447d6fb2006-05-22 10:31:37 -030042
43-------------------------------------------------------------------------------
44
45Name CX2341X_OSD_GET_STATE
46Enum 68/0x44
47Description
48 Query OSD state
49Result[0]
50 Bit 0 0=off, 1=on
51 Bits 1:2 alpha control
52 Bits 3:5 pixel format
53
54-------------------------------------------------------------------------------
55
56Name CX2341X_OSD_SET_STATE
57Enum 69/0x45
58Description
59 OSD switch
60Param[0]
61 0=off, 1=on
62
63-------------------------------------------------------------------------------
64
65Name CX2341X_OSD_GET_OSD_COORDS
66Enum 70/0x46
67Description
68 Retrieve coordinates of OSD area blended with video
69Result[0]
70 OSD buffer address
71Result[1]
72 Stride in pixels
73Result[2]
74 Lines in OSD buffer
75Result[3]
76 Horizontal offset in buffer
77Result[4]
78 Vertical offset in buffer
79
80-------------------------------------------------------------------------------
81
82Name CX2341X_OSD_SET_OSD_COORDS
83Enum 71/0x47
84Description
85 Assign the coordinates of the OSD area to blend with video
86Param[0]
87 buffer address
88Param[1]
89 buffer stride in pixels
90Param[2]
91 lines in buffer
92Param[3]
93 horizontal offset
94Param[4]
95 vertical offset
96
97-------------------------------------------------------------------------------
98
99Name CX2341X_OSD_GET_SCREEN_COORDS
100Enum 72/0x48
101Description
102 Retrieve OSD screen area coordinates
103Result[0]
104 top left horizontal offset
105Result[1]
106 top left vertical offset
107Result[2]
Matt LaPlante2fe0ae72006-10-03 22:50:39 +0200108 bottom right horizontal offset
Mauro Carvalho Chehab447d6fb2006-05-22 10:31:37 -0300109Result[3]
110 bottom right vertical offset
111
112-------------------------------------------------------------------------------
113
114Name CX2341X_OSD_SET_SCREEN_COORDS
115Enum 73/0x49
116Description
117 Assign the coordinates of the screen area to blend with video
118Param[0]
119 top left horizontal offset
120Param[1]
121 top left vertical offset
122Param[2]
123 bottom left horizontal offset
124Param[3]
125 bottom left vertical offset
126
127-------------------------------------------------------------------------------
128
129Name CX2341X_OSD_GET_GLOBAL_ALPHA
130Enum 74/0x4A
131Description
132 Retrieve OSD global alpha
133Result[0]
134 global alpha: 0=off, 1=on
135Result[1]
136 bits 0:7 global alpha
137
138-------------------------------------------------------------------------------
139
140Name CX2341X_OSD_SET_GLOBAL_ALPHA
141Enum 75/0x4B
142Description
143 Update global alpha
144Param[0]
145 global alpha: 0=off, 1=on
146Param[1]
147 global alpha (8 bits)
148Param[2]
149 local alpha: 0=on, 1=off
150
151-------------------------------------------------------------------------------
152
153Name CX2341X_OSD_SET_BLEND_COORDS
154Enum 78/0x4C
155Description
156 Move start of blending area within display buffer
157Param[0]
158 horizontal offset in buffer
159Param[1]
160 vertical offset in buffer
161
162-------------------------------------------------------------------------------
163
164Name CX2341X_OSD_GET_FLICKER_STATE
165Enum 79/0x4F
166Description
167 Retrieve flicker reduction module state
168Result[0]
169 flicker state: 0=off, 1=on
170
171-------------------------------------------------------------------------------
172
173Name CX2341X_OSD_SET_FLICKER_STATE
174Enum 80/0x50
175Description
176 Set flicker reduction module state
177Param[0]
178 State: 0=off, 1=on
179
180-------------------------------------------------------------------------------
181
182Name CX2341X_OSD_BLT_COPY
183Enum 82/0x52
184Description
185 BLT copy
186Param[0]
187'0000' zero
188'0001' ~destination AND ~source
189'0010' ~destination AND source
190'0011' ~destination
191'0100' destination AND ~source
192'0101' ~source
193'0110' destination XOR source
194'0111' ~destination OR ~source
195'1000' ~destination AND ~source
196'1001' destination XNOR source
197'1010' source
198'1011' ~destination OR source
199'1100' destination
200'1101' destination OR ~source
201'1110' destination OR source
202'1111' one
203
204Param[1]
205 Resulting alpha blending
206 '01' source_alpha
207 '10' destination_alpha
208 '11' source_alpha*destination_alpha+1
209 (zero if both source and destination alpha are zero)
210Param[2]
211 '00' output_pixel = source_pixel
212
213 '01' if source_alpha=0:
214 output_pixel = destination_pixel
215 if 256 > source_alpha > 1:
216 output_pixel = ((source_alpha + 1)*source_pixel +
217 (255 - source_alpha)*destination_pixel)/256
218
219 '10' if destination_alpha=0:
220 output_pixel = source_pixel
221 if 255 > destination_alpha > 0:
222 output_pixel = ((255 - destination_alpha)*source_pixel +
223 (destination_alpha + 1)*destination_pixel)/256
224
225 '11' if source_alpha=0:
226 source_temp = 0
227 if source_alpha=255:
228 source_temp = source_pixel*256
229 if 255 > source_alpha > 0:
230 source_temp = source_pixel*(source_alpha + 1)
231 if destination_alpha=0:
232 destination_temp = 0
233 if destination_alpha=255:
234 destination_temp = destination_pixel*256
235 if 255 > destination_alpha > 0:
236 destination_temp = destination_pixel*(destination_alpha + 1)
237 output_pixel = (source_temp + destination_temp)/256
238Param[3]
239 width
240Param[4]
241 height
242Param[5]
243 destination pixel mask
244Param[6]
245 destination rectangle start address
246Param[7]
247 destination stride in dwords
248Param[8]
249 source stride in dwords
250Param[9]
251 source rectangle start address
252
253-------------------------------------------------------------------------------
254
255Name CX2341X_OSD_BLT_FILL
256Enum 83/0x53
257Description
258 BLT fill color
259Param[0]
260 Same as Param[0] on API 0x52
261Param[1]
262 Same as Param[1] on API 0x52
263Param[2]
264 Same as Param[2] on API 0x52
265Param[3]
266 width
267Param[4]
268 height
269Param[5]
270 destination pixel mask
271Param[6]
272 destination rectangle start address
273Param[7]
274 destination stride in dwords
275Param[8]
276 color fill value
277
278-------------------------------------------------------------------------------
279
280Name CX2341X_OSD_BLT_TEXT
281Enum 84/0x54
282Description
283 BLT for 8 bit alpha text source
284Param[0]
285 Same as Param[0] on API 0x52
286Param[1]
287 Same as Param[1] on API 0x52
288Param[2]
289 Same as Param[2] on API 0x52
290Param[3]
291 width
292Param[4]
293 height
294Param[5]
295 destination pixel mask
296Param[6]
297 destination rectangle start address
298Param[7]
299 destination stride in dwords
300Param[8]
301 source stride in dwords
302Param[9]
303 source rectangle start address
304Param[10]
305 color fill value
306
307-------------------------------------------------------------------------------
308
309Name CX2341X_OSD_SET_FRAMEBUFFER_WINDOW
310Enum 86/0x56
311Description
312 Positions the main output window on the screen. The coordinates must be
313 such that the entire window fits on the screen.
314Param[0]
315 window width
316Param[1]
317 window height
318Param[2]
319 top left window corner horizontal offset
320Param[3]
321 top left window corner vertical offset
322
323-------------------------------------------------------------------------------
324
325Name CX2341X_OSD_SET_CHROMA_KEY
326Enum 96/0x60
327Description
328 Chroma key switch and color
329Param[0]
330 state: 0=off, 1=on
331Param[1]
332 color
333
334-------------------------------------------------------------------------------
335
336Name CX2341X_OSD_GET_ALPHA_CONTENT_INDEX
337Enum 97/0x61
338Description
339 Retrieve alpha content index
340Result[0]
341 alpha content index, Range 0:15
342
343-------------------------------------------------------------------------------
344
345Name CX2341X_OSD_SET_ALPHA_CONTENT_INDEX
346Enum 98/0x62
347Description
348 Assign alpha content index
349Param[0]
350 alpha content index, range 0:15