|
1 /* |
|
2 display_chipset_api.h |
|
3 |
|
4 Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
5 All rights reserved. |
|
6 |
|
7 This program and the accompanying materials are made available |
|
8 under the terms of the Eclipse Public License v1.0 which accompanies |
|
9 this distribution, and is available at |
|
10 http://www.eclipse.org/legal/epl-v10.html |
|
11 |
|
12 Initial Contributors: |
|
13 Nokia Corporation - initial contribution. |
|
14 |
|
15 Contributors: |
|
16 */ |
|
17 |
|
18 /** |
|
19 |
|
20 @mainpage |
|
21 @section intro_sec Introduction |
|
22 |
|
23 <p>This is the display chipset driver API document.</p> |
|
24 <p>This API hides HW differences from display (and other users) driver. |
|
25 API is not kept as binary compatible.</p> |
|
26 <p></p> |
|
27 <p>Multiclient: |
|
28 API is purposed for multiclient use. Same chipset driver should take care |
|
29 more than one client in same time. Common HW (bus) will be shared |
|
30 for two clients, that way that they cannot detect sharing.</p> |
|
31 <p></p> |
|
32 <p>Resource managing: |
|
33 Chipset driver is responsible to allocate needed power resources. Chipset driver |
|
34 should deallocate resources immediately when those are not needed. Display |
|
35 driver (top of chipset driver) does not need allocate any of power resources for |
|
36 chipset driver.</p> |
|
37 <p></p> |
|
38 <p>DVFS (Dynamic Voltage and Frequency Scaling): |
|
39 Chipset driver is responsible to allocate needed clock state and |
|
40 listening if clock will change. It is better if display driver does not |
|
41 listening (top of chipset driver) DVFS at all, for avoiding death locks.</p> |
|
42 <p></p> |
|
43 <p>Structs: |
|
44 Always when some of any struct is created, creator is responsible to fill it |
|
45 with zeroes, and should use sizeof() operator. </p> |
|
46 <p></p> |
|
47 <p>Identifier: |
|
48 Functions where is not IDENTIFIER given, and chipset driver still need to detect |
|
49 the client, it has to implement couple of methods for same function, to getting |
|
50 difference using different function pointer. |
|
51 <p></p> |
|
52 <p>Image processing stages: |
|
53 Image processing should happen in order (or output should look like this): |
|
54 [Source image] -> [Color space conversion] -> [InputScissor] -> [Mirror] -> |
|
55 [Rotate] -> [TargetArea(Scaling)] -> [Offset] -> [Blend] -> [Output]</p> |
|
56 <p></p> |
|
57 */ |
|
58 /** @file |
|
59 |
|
60 Declaration of display chipset driver API |
|
61 |
|
62 @publishedDeviceAbstraction |
|
63 */ |
|
64 |
|
65 #ifndef DISPLAY_CHIPSET_API_H |
|
66 #define DISPLAY_CHIPSET_API_H |
|
67 |
|
68 /*- Include Files ----------------------------------------------------------*/ |
|
69 |
|
70 #include "display_chipset_os.h" /* OS specific header file, typedef etc. */ |
|
71 |
|
72 /*- Data Types --------------------------------------------------------------*/ |
|
73 |
|
74 /*- Enumerations ------------------------------------------------------------*/ |
|
75 |
|
76 /** Error codes */ |
|
77 typedef enum |
|
78 { |
|
79 DISP_ERROR_NONE, /**< OK */ |
|
80 DISP_ERROR_FATAL, /**< Restart needed. Fatal error. */ |
|
81 DISP_ERROR_INVALID_PARAMETER, /**< Given parameter is not ok */ |
|
82 DISP_ERROR_BUS_TIMEOUT, /**< Possible Hw jam */ |
|
83 DISP_ERROR_INVALID_BUFFER_FORMAT, /**< Unknown buffer format */ |
|
84 DISP_ERROR_BUFFER_FORMAT_MISMATCH, /**< when target device has different format than the input hal_buffer and Hw is not capable to perform conversion */ |
|
85 DISP_ERROR_OUT_OF_MEMORY, /**< Chipset driver operation is not made, because out of memory */ |
|
86 DISP_ERROR_NO_DEVICE, /**< Device not found */ |
|
87 DISP_ERROR_INVALID_SIZE, /**< Given size parameters are too small or too big */ |
|
88 DISP_ERROR_HW_IS_BUSY, /**< Operation is not allowed, because Hw is reserved for another use */ |
|
89 DISP_ERROR_USER_IS_NOT_RECOGNISED, /**< User is not detected (parameter: identifier), or initialisiation is not done */ |
|
90 DISP_ERROR_CANNOT_CLONE, /**< If clone combination is impossible. @see dispCloneOutput() */ |
|
91 DISP_ERROR_NOT_SUPPORTED, /**< Given operation is not supported by Hw */ |
|
92 DISP_ERROR_NOT_IMPLEMENTED, /**< Given operation is not supported by Sw */ |
|
93 DISP_ERROR_INVALID_NAME, /**< Invalid name */ |
|
94 DISP_ERROR_ALREADY_EXISTS, /**< E.g.: Set twice */ |
|
95 DISP_ERROR_NOT_FOUND, /**< Something missing */ |
|
96 DISP_ERROR_ALIGNMENT, /**< Data alignment error */ |
|
97 DISP_ERROR_NOT_READY, /**< Device is not ready for operation */ |
|
98 DISP_ERROR_CANCELLED, /**< Operation cancelled */ |
|
99 DISP_ERROR_NO_CLOCK, /**< Bad clock signal */ |
|
100 DISP_ERROR_BLUE, /**< Blue color error */ |
|
101 DISP_ERROR_GREEN, /**< Green color error */ |
|
102 DISP_ERROR_RED, /**< Red color error */ |
|
103 DISP_ERROR_NOT_IDENTIFIED, /**< Cannot identify HW */ |
|
104 DISP_ERROR_TE_MISSED, /**< Tearing Effect line is not detected */ |
|
105 DISP_ERROR_RESET, /**< Reset line error */ |
|
106 DISP_ERROR_DATA_LINES, /**< Data lines error */ |
|
107 DISP_ERROR_AUDIO, /**< HDMI audio error */ |
|
108 DISP_ERROR_CEC, /**< CEC error */ |
|
109 DISP_ERROR_DDC, /**< DDC error */ |
|
110 DISP_ERROR_HPD, /**< Hot Plug Detection */ |
|
111 DISP_ERROR_NO_POWER, /**< Not powered */ |
|
112 DISP_ERROR_NACK, /**< Not acknowledged */ |
|
113 DISP_ERROR_CRC, /**< CRC error */ |
|
114 } DISPE_ERROR; |
|
115 |
|
116 /** Rotation and flipping */ |
|
117 typedef enum |
|
118 { |
|
119 DISP_ROTATION_INVALID = 0x0000, /**< Initialisation value, don't use */ |
|
120 DISP_ROTATION_0 = ( 1 << 0 ),/**< No rotation */ |
|
121 DISP_ROTATION_90 = ( 1 << 1 ),/**< 90 degree */ |
|
122 DISP_ROTATION_180 = ( 1 << 2 ),/**< 180 degree */ |
|
123 DISP_ROTATION_270 = ( 1 << 3 ),/**< 270 degree */ |
|
124 DISP_ROTATION_MIRROR_VERTICAL = ( 1 << 4 ),/**< Upside down/flip */ |
|
125 DISP_ROTATION_MIRROR_HORIZONTAL = ( 1 << 5 ),/**< Mirrored */ |
|
126 } DISPE_ROTATION; |
|
127 |
|
128 /** Color format */ |
|
129 const uint32 KLittleEndian = 0x0; |
|
130 const uint32 KBigEndian = 0x1; |
|
131 typedef enum |
|
132 { |
|
133 DISP_COLOR_FORMAT_INVALID = 0, /**< Initialisation value, don't use */ |
|
134 DISP_COLOR_FORMAT_XRGB8888_LE = ( 1 << 1 ) | KLittleEndian, |
|
135 DISP_COLOR_FORMAT_XRGB8888_BE = ( 1 << 1 ) | KBigEndian, |
|
136 DISP_COLOR_FORMAT_ARGB8888_LE = ( 1 << 2 ) | KLittleEndian, |
|
137 DISP_COLOR_FORMAT_ARGB8888_BE = ( 1 << 2 ) | KBigEndian, |
|
138 DISP_COLOR_FORMAT_ARGB8888P_LE = ( 1 << 3 ) | KLittleEndian, /** Pre-multiplied */ |
|
139 DISP_COLOR_FORMAT_ARGB8888P_BE = ( 1 << 3 ) | KBigEndian, |
|
140 DISP_COLOR_FORMAT_RGB888_LE = ( 1 << 4 ) | KLittleEndian, |
|
141 DISP_COLOR_FORMAT_RGB888_BE = ( 1 << 4 ) | KBigEndian, |
|
142 DISP_COLOR_FORMAT_RGB565_LE = ( 1 << 5 ) | KLittleEndian, |
|
143 DISP_COLOR_FORMAT_RGB565_BE = ( 1 << 5 ) | KBigEndian, |
|
144 DISP_COLOR_FORMAT_ARGB1555_LE = ( 1 << 6 ) | KLittleEndian, |
|
145 DISP_COLOR_FORMAT_ARGB1555_BE = ( 1 << 6 ) | KBigEndian, |
|
146 DISP_COLOR_FORMAT_ARGB1555P_LE = ( 1 << 7 ) | KLittleEndian, /** Pre-multiplied */ |
|
147 DISP_COLOR_FORMAT_ARGB1555P_BE = ( 1 << 7 ) | KBigEndian, |
|
148 DISP_COLOR_FORMAT_ARGB4444_LE = ( 1 << 8 ) | KLittleEndian, |
|
149 DISP_COLOR_FORMAT_ARGB4444_BE = ( 1 << 8 ) | KBigEndian, |
|
150 DISP_COLOR_FORMAT_ARGB4444P_LE = ( 1 << 9 ) | KLittleEndian, /** Pre-multiplied */ |
|
151 DISP_COLOR_FORMAT_ARGB4444P_BE = ( 1 << 9 ) | KBigEndian, |
|
152 DISP_COLOR_FORMAT_YCBCR422_LE = ( 1 << 10 ) | KLittleEndian, |
|
153 DISP_COLOR_FORMAT_YCBCR422_BE = ( 1 << 10 ) | KBigEndian, |
|
154 DISP_COLOR_FORMAT_YCBCR420_LE = ( 1 << 11 ) | KLittleEndian, |
|
155 DISP_COLOR_FORMAT_YCBCR420_BE = ( 1 << 11 ) | KBigEndian, |
|
156 DISP_COLOR_FORMAT_PLATFORM = ( 1 << 12 ), /**< Non standard, platform specific format */ |
|
157 } DISPE_COLOR_FORMAT; |
|
158 |
|
159 /** YCbCr standard bit mask */ |
|
160 typedef enum |
|
161 { |
|
162 DISP_COLOR_FORMAT_YCBCR_INVALID = 0x0000, /**< Can be set when RGB */ |
|
163 DISP_COLOR_FORMAT_FULL_RANGE = ( 1 << 0 ),/**< Full range 0-255 */ |
|
164 DISP_COLOR_FORMAT_LIMITED_RANGE = ( 1 << 1 ),/**< Limited range 16-235 */ |
|
165 } DISPE_COLOR_YCBCR_BIT_MASK; |
|
166 |
|
167 /** Colorspace - API supports one case-by-case fixed conversion matrix (FIXED) for one most used conversion */ |
|
168 typedef enum |
|
169 { |
|
170 DISP_COLOR_SPACE_NONE = 0x0000, /**< Initialisation value, don't use */ |
|
171 DISP_COLOR_SPACE_LINEAR_RGB = ( 1 << 0 ), /**< Linear color space */ |
|
172 DISP_COLOR_SPACE_STANDARD_RGB = ( 1 << 1 ), /**< sRGB, Red[0.6400, 0.3300] Green[0.3000, 0.6000] Blue[0.1500, 0.0600] White[0.3127,0.3290] */ |
|
173 DISP_COLOR_FIXED_DISPLAY_CS_LINEAR = ( 1 << 2 ), /**< Fixed display color space - Buffer pixels are linearised RGB for FIXED */ |
|
174 DISP_COLOR_FIXED_DISPLAY_CS = ( 1 << 3 ), /**< Fixed display color space */ |
|
175 DISP_COLOR_COORDINATES = ( 1 << 4 ), /**< With this, Chipset driver does the conversion, according to input and output coordinates */ |
|
176 DISP_COLOR_MATRIX_CONV = ( 1 << 5 ), /**< Free 3x3 matrix conversion. @see DISPS_COLOR_SPACE_CONV_MATRIX */ |
|
177 } DISPE_COLOR_SPACE; |
|
178 |
|
179 /** Scaling */ |
|
180 typedef enum |
|
181 { |
|
182 DISP_SCALING_NO = 0x0000, /**< No HW support for scaling */ |
|
183 DISP_SCALING_NEAREST_NEIGHBOUR = ( 1 << 0 ),/**< Style: Plain pixel copy */ |
|
184 DISP_SCALING_BILINEAR_OR_BEST = ( 1 << 1 ),/**< Style: Bilinear or better*/ |
|
185 } DISPE_SCALING; |
|
186 |
|
187 /** Display Interface Types */ |
|
188 const uint32 KMeSSIBus = 0x1; /**< MIPI DBI-2 type B */ |
|
189 const uint32 KLoSSIBus = 0x2; /**< MIPI DBI-2 type C option 1 */ |
|
190 const uint32 KViSSIBus = 0x3; /**< MIPI DPI-2 */ |
|
191 const uint32 KCDPBus = 0x4; /**< CDP (HiSSI-V)=No corresponding MIPI standard. LoSSI works as control bus. */ |
|
192 const uint32 KDSIVideoBus = 0x5; /**< DSI (HiSSI-M)=MIPI DSI1.1, Videobus */ |
|
193 const uint32 KDSICmdBus = 0x6; /**< DSI (HiSSI-M)=MIPI DSI1.1, Commandbus */ |
|
194 const uint32 KOffscreenDisplay = 0x7; /**< Offscreen display, for possible USB, WLAN, etc. purpose */ |
|
195 const uint32 KCvbsBus = 0x8; |
|
196 const uint32 KHdmiBus = 0x9; |
|
197 const uint32 KDdcBus = 0xA; |
|
198 const uint32 KCecBus = 0xB; |
|
199 |
|
200 const uint32 KInterfaceNumberShift = 5; |
|
201 typedef enum |
|
202 { |
|
203 DISP_BUS_NONE = 0, /**< Initialisation value */ |
|
204 |
|
205 DISP_BUS_MESSI0 = ( 0 << KInterfaceNumberShift ) | KMeSSIBus, /**< MeSSI bus ID:0 */ |
|
206 DISP_BUS_MESSI1 = ( 1 << KInterfaceNumberShift ) | KMeSSIBus, |
|
207 DISP_BUS_MESSI2 = ( 2 << KInterfaceNumberShift ) | KMeSSIBus, |
|
208 DISP_BUS_MESSI3 = ( 3 << KInterfaceNumberShift ) | KMeSSIBus, |
|
209 DISP_BUS_MESSI4 = ( 4 << KInterfaceNumberShift ) | KMeSSIBus, |
|
210 |
|
211 DISP_BUS_LOSSI0 = ( 0 << KInterfaceNumberShift ) | KLoSSIBus, /**< LoSSI bus ID:0 */ |
|
212 DISP_BUS_LOSSI1 = ( 1 << KInterfaceNumberShift ) | KLoSSIBus, |
|
213 DISP_BUS_LOSSI2 = ( 2 << KInterfaceNumberShift ) | KLoSSIBus, |
|
214 DISP_BUS_LOSSI3 = ( 3 << KInterfaceNumberShift ) | KLoSSIBus, |
|
215 DISP_BUS_LOSSI4 = ( 4 << KInterfaceNumberShift ) | KLoSSIBus, |
|
216 |
|
217 DISP_BUS_VISSI0 = ( 0 << KInterfaceNumberShift ) | KViSSIBus, /**< ViSSI ID:0 */ |
|
218 DISP_BUS_VISSI1 = ( 1 << KInterfaceNumberShift ) | KViSSIBus, |
|
219 DISP_BUS_VISSI2 = ( 2 << KInterfaceNumberShift ) | KViSSIBus, |
|
220 DISP_BUS_VISSI3 = ( 3 << KInterfaceNumberShift ) | KViSSIBus, |
|
221 DISP_BUS_VISSI4 = ( 4 << KInterfaceNumberShift ) | KViSSIBus, |
|
222 |
|
223 DISP_BUS_CDP0 = ( 0 << KInterfaceNumberShift ) | KCDPBus, /**< CDP ID:0 */ |
|
224 DISP_BUS_CDP1 = ( 1 << KInterfaceNumberShift ) | KCDPBus, |
|
225 DISP_BUS_CDP2 = ( 2 << KInterfaceNumberShift ) | KCDPBus, |
|
226 DISP_BUS_CDP3 = ( 3 << KInterfaceNumberShift ) | KCDPBus, |
|
227 DISP_BUS_CDP4 = ( 4 << KInterfaceNumberShift ) | KCDPBus, |
|
228 |
|
229 DISP_BUS_DSIV0 = ( 0 << KInterfaceNumberShift ) | KDSIVideoBus, /**< HiSSI-M ID:0. ID maps to Virtual Channel */ |
|
230 DISP_BUS_DSIV1 = ( 1 << KInterfaceNumberShift ) | KDSIVideoBus, |
|
231 DISP_BUS_DSIV2 = ( 2 << KInterfaceNumberShift ) | KDSIVideoBus, |
|
232 DISP_BUS_DSIV3 = ( 3 << KInterfaceNumberShift ) | KDSIVideoBus, |
|
233 DISP_BUS_DSIV4 = ( 4 << KInterfaceNumberShift ) | KDSIVideoBus, /**< ID:0 in second physical layer */ |
|
234 DISP_BUS_DSIV5 = ( 5 << KInterfaceNumberShift ) | KDSIVideoBus, |
|
235 DISP_BUS_DSIV6 = ( 6 << KInterfaceNumberShift ) | KDSIVideoBus, |
|
236 DISP_BUS_DSIV7 = ( 7 << KInterfaceNumberShift ) | KDSIVideoBus, |
|
237 DISP_BUS_DSIV8 = ( 8 << KInterfaceNumberShift ) | KDSIVideoBus, /**< ID:0 in third physical layer */ |
|
238 DISP_BUS_DSIV9 = ( 9 << KInterfaceNumberShift ) | KDSIVideoBus, |
|
239 DISP_BUS_DSIV10 = ( 10 << KInterfaceNumberShift ) | KDSIVideoBus, |
|
240 DISP_BUS_DSIV11 = ( 11 << KInterfaceNumberShift ) | KDSIVideoBus, |
|
241 |
|
242 DISP_BUS_DSIC0 = ( 0 << KInterfaceNumberShift ) | KDSICmdBus, /**< HiSSI-M ID:0. ID maps to Virtual Channel */ |
|
243 DISP_BUS_DSIC1 = ( 1 << KInterfaceNumberShift ) | KDSICmdBus, |
|
244 DISP_BUS_DSIC2 = ( 2 << KInterfaceNumberShift ) | KDSICmdBus, |
|
245 DISP_BUS_DSIC3 = ( 3 << KInterfaceNumberShift ) | KDSICmdBus, |
|
246 DISP_BUS_DSIC4 = ( 4 << KInterfaceNumberShift ) | KDSICmdBus, /**< ID:0 in second physical layer */ |
|
247 DISP_BUS_DSIC5 = ( 5 << KInterfaceNumberShift ) | KDSICmdBus, |
|
248 DISP_BUS_DSIC6 = ( 6 << KInterfaceNumberShift ) | KDSICmdBus, |
|
249 DISP_BUS_DSIC7 = ( 7 << KInterfaceNumberShift ) | KDSICmdBus, |
|
250 DISP_BUS_DSIC8 = ( 8 << KInterfaceNumberShift ) | KDSICmdBus, /**< ID:0 in third physical layer */ |
|
251 DISP_BUS_DSIC9 = ( 9 << KInterfaceNumberShift ) | KDSICmdBus, |
|
252 DISP_BUS_DSIC10 = ( 10 << KInterfaceNumberShift ) | KDSICmdBus, |
|
253 DISP_BUS_DSIC11 = ( 11 << KInterfaceNumberShift ) | KDSICmdBus, |
|
254 |
|
255 DISP_BUS_OFFSCR = KOffscreenDisplay, /**< Offscreen display */ |
|
256 |
|
257 DISP_BUS_CVBS = KCvbsBus, /**< Composite Tv-out */ |
|
258 DISP_BUS_HDMI = KHdmiBus, /**< Hdmi Tv-out */ |
|
259 DISP_BUS_DDC = KDdcBus, /**< DDC bus (HDMI and DVI) */ |
|
260 DISP_BUS_CEC = KCecBus, /**< CEC bus (HDMI) */ |
|
261 } DISPE_BUS; |
|
262 |
|
263 /** Transfer mode */ |
|
264 typedef enum |
|
265 { |
|
266 DISP_BUS_0BIT = 0x0000, /**< Initialisation value, don't use */ |
|
267 DISP_BUS_1BIT = ( 1 << 0 ),/**< 1bit width bus, bidirectional LoSSI */ |
|
268 DISP_BUS_2BIT = ( 1 << 1 ),/**< LoSSI with separate read and write signals */ |
|
269 DISP_BUS_3BIT = ( 1 << 2 ),/**< E.g. DSI 3 lanes */ |
|
270 DISP_BUS_4BIT = ( 1 << 3 ),/**< E.g. DSI 4 lanes */ |
|
271 DISP_BUS_8BIT = ( 1 << 4 ),/**< E.g. MeSSI-8 */ |
|
272 DISP_BUS_12BIT = ( 1 << 5 ), |
|
273 DISP_BUS_16BIT = ( 1 << 6 ), |
|
274 DISP_BUS_18BIT = ( 1 << 7 ), |
|
275 DISP_BUS_24BIT = ( 1 << 8 ), |
|
276 DISP_BUS_32BIT = ( 1 << 9 ), |
|
277 } DISPE_BUS_WIDTH; |
|
278 |
|
279 /** Power control */ |
|
280 typedef enum |
|
281 { |
|
282 DISP_PWR_MODE_INVALID = 0x0000, /**< Initialisation value, don't use */ |
|
283 DISP_PWR_MODE_ANALOG_POWER_ON = 0x0011, /**< External analogue voltages */ |
|
284 DISP_PWR_MODE_ANALOG_POWER_OFF = 0x0010, |
|
285 DISP_PWR_MODE_DIGITAL_POWER_ON = 0x0021, /**< External digital voltages */ |
|
286 DISP_PWR_MODE_DIGITAL_POWER_OFF = 0x0020, |
|
287 DISP_PWR_MODE_RESET_ACTIVE = 0x0041, /**< Activate external reset signal. With DSI, RAR will be listened. */ |
|
288 DISP_PWR_MODE_RESET_INACTIVE = 0x0040, |
|
289 DISP_PWR_MODE_DISPLAY_ON = 0x0081, /**< Pixel clock for memoryless displays (ViSSI/HiSSI). LP/HS when DSI. */ |
|
290 DISP_PWR_MODE_DISPLAY_OFF = 0x0080, /**< Ultra Low Power State (ULPS) mode when DSI */ |
|
291 } DISPE_PWR_MODE; |
|
292 |
|
293 /** Driver messages - @see dispDriverMessage */ |
|
294 typedef enum |
|
295 { |
|
296 DISP_MSG_PING = 0x00000000, /**< Ping for all drivers. All drivers forwards this msg and |
|
297 gives callback. Doesn't matter what is the 'receiver'-parameter. */ |
|
298 DISP_MSG_SELFTEST = 0x00000001, /**< Selftest */ |
|
299 DISP_MSG_PRODTEST = 0x00000002, /**< Production test */ |
|
300 DISP_MSG_LAST = 0xFFFFFFFF, /**< Not in use */ |
|
301 } DISPE_DRV_MSG; |
|
302 |
|
303 /** Colorkey handling */ |
|
304 typedef enum |
|
305 { |
|
306 DISP_COLORKEYMODE_NONE = 0x0000, /**< No colorkey */ |
|
307 DISP_COLORKEYMODE_SINGLE_KEY = ( 1 << 0 ), /**< One color is colorkey (simplest) */ |
|
308 DISP_COLORKEYMODE_KEY_MASK = ( 1 << 1 ), /**< Colorkey mask. If (pixel_color & mask) -> transparent pixel */ |
|
309 DISP_COLORKEYMODE_ALPHA = ( 1 << 2 ), /**< To utilize alphachannel of source buffer for transparency, |
|
310 works with followings as ARGB : DISP_COLOR_FORMAT_ARGB8888, DISP_COLOR_FORMAT_ARGB1555 */ |
|
311 } DISPE_COLORKEYMODE; |
|
312 |
|
313 /** Tearing synchronisation type */ |
|
314 typedef enum |
|
315 { |
|
316 DISP_TE_SYNC_NO = 0x0000, /**< No HW support for tearing synchronization */ |
|
317 DISP_TE_SYNC_VS_RAISING_EDGE = ( 1 << 0 ),/**< Vertical synchronization when raising edge */ |
|
318 DISP_TE_SYNC_VS_FALLING_EDGE = ( 1 << 1 ),/**< Vertical synchronization when falling edge */ |
|
319 DISP_TE_SYNC_HS_VS = ( 1 << 2 ),/**< Horisontal and vertical tearing synchronization */ |
|
320 DISP_TE_SYNC_VS_BUS_TRIGGER = ( 1 << 3 ),/**< In DSI mode only (TEE) */ |
|
321 } DISPE_TE_SYNC; |
|
322 |
|
323 /** Advanced feature bit masks - Used for capability query */ |
|
324 typedef enum |
|
325 { |
|
326 DISP_FEATURE_NONE = 0x0000, /**< Initialisation value */ |
|
327 DISP_FEATURE_SCALING = ( 1 << 0 ), /**< Scaling */ |
|
328 DISP_FEATURE_ALL_CASES = ( 1 << 1 ), /**< No matter what is the used feature */ |
|
329 DISP_FEATURE_ROTATION = ( 1 << 2 ), /**< 90, 180 or 270 rotation */ |
|
330 DISP_FEATURE_OVERLAY = ( 1 << 3 ), /**< Overlay without colorkey and alpha */ |
|
331 DISP_FEATURE_COLOR_KEY = ( 1 << 4 ), /**< Overlay with colorkey */ |
|
332 DISP_FEATURE_ALPHA_BLEND = ( 1 << 5 ), /**< Overlay with alpha */ |
|
333 DISP_FEATURE_YCBCR = ( 1 << 6 ), /**< YCbCr support */ |
|
334 } DISPE_FEATURE; |
|
335 |
|
336 /** Buffer's cache and MMU settings - Write buffers to be always enabled - Chipset driver is responsible to syncronise caches */ |
|
337 typedef enum |
|
338 { |
|
339 DISP_CACHE_NOTHING = 0x0000, /**< Only writebuffers */ |
|
340 DISP_CACHE_WRITE_THROUGH = ( 1 << 0 ), /**< Write through caches (writes to cache (if hit) and to memory) */ |
|
341 DISP_CACHE_WRITE_ALLOCATION_L1 = ( 1 << 1 ), /**< Cache level 1 -line will be allocated for write access */ |
|
342 DISP_CACHE_WRITE_ALLOCATION_L2 = ( 1 << 2 ), /**< Cache level 2 -line will be allocated for write access */ |
|
343 DISP_CACHE_READ_ALLOCATION_L1 = ( 1 << 3 ), /**< Cache level 1 -line will be allocated for read access */ |
|
344 DISP_CACHE_READ_ALLOCATION_L2 = ( 1 << 4 ), /**< Cache level 2 -line will be allocated for read access */ |
|
345 DISP_CACHE_USER_READ_PRIVILEGE = ( 1 << 5 ), /**< User code (user mode) have read accesses to buffer */ |
|
346 DISP_CACHE_USER_WRITE_PRIVILEGE = ( 1 << 6 ), /**< User code (user mode) have write accesses to buffer */ |
|
347 DISP_CACHE_KERNEL_READ_PRIVILEGE = ( 1 << 7 ), /**< Kernel code (supervisor undefined mode) have read accesses to buffer */ |
|
348 DISP_CACHE_KERNEL_WRITE_PRIVILEGE = ( 1 << 8 ), /**< Kernel code (supervisor undefined mode) have write accesses to buffer */ |
|
349 DISP_CACHE_ARM_ACCESSIBLE = ( 1 << 9 ), /**< To be always defined if ARM can see the buffer. Otherwise can be allocated only for HW. */ |
|
350 } DISPE_CACHE_SETTINGS; |
|
351 |
|
352 /*- Data Structs ------------------------------------------------------------*/ |
|
353 |
|
354 /** Color Space Converter 3x3 matrix. To be defined if DISP_COLOR_MATRIX_CONV is used. |
|
355 Output conversion formula: |
|
356 Red Out = (red[0] * Rin) + (red[1] * Gin) + (red[2] * Bin) + red[3] |
|
357 Green Out = (green[0] * Rin) + (green[1] * Gin) + (green[2] * Bin) + green[3] |
|
358 Blue Out = (blue[0] * Rin) + (blue[1] * Gin) + (blue[2] * Bin) + blue[3] */ |
|
359 typedef struct |
|
360 { |
|
361 /** Fixed point position. E.g: value = ( red.cell1 >> fixedPoint ). E.g: fixedPoint=2 -> b0.00 */ |
|
362 uint8 fixedPoint; |
|
363 /** Conversion matrixes per color component */ |
|
364 int16 red[ 4 ]; |
|
365 int16 green[ 4 ]; |
|
366 int16 blue[ 4 ]; |
|
367 } DISPS_COLOR_SPACE_CONV_MATRIX; |
|
368 |
|
369 /** CIE 1931 color space coordinates. To be defined if DISP_COLOR_COORDINATES is used. |
|
370 When chipset driver knows source and destination coordinates, it can operate |
|
371 conversion from source to destination. Fixed point is 10th bit. |
|
372 E.g. If redX=625, it should be divided by 1024 (2^10) for getting real value 0.61035... */ |
|
373 typedef struct |
|
374 { |
|
375 /** Red chromaticity coordinates */ |
|
376 uint16 redX; |
|
377 uint16 redY; |
|
378 /** Green chromaticity coordinates */ |
|
379 uint16 greenX; |
|
380 uint16 greenY; |
|
381 /** Blue chromaticity coordinates */ |
|
382 uint16 blueX; |
|
383 uint16 blueY; |
|
384 /** White chromaticity coordinates */ |
|
385 uint16 whiteX; |
|
386 uint16 whiteY; |
|
387 } DISPS_COLOR_COORDINATES; |
|
388 |
|
389 /** Rectangle */ |
|
390 typedef struct |
|
391 { |
|
392 /** Begin line (first line is 0) */ |
|
393 uint16 startRow; |
|
394 /** Begin column (first column is 0) */ |
|
395 uint16 startColumn; |
|
396 /** Rectangle height in pixels */ |
|
397 uint16 rows; |
|
398 /** Rectangle width in pixels */ |
|
399 uint16 columns; |
|
400 } DISPS_RECTANGLE; |
|
401 |
|
402 /** Source buffer dimensions and format */ |
|
403 typedef struct |
|
404 { |
|
405 /** Local memory linear address */ |
|
406 void* bufferLinearAddress; |
|
407 /** Local memory physical address */ |
|
408 uint32 bufferPhysicalAddress; |
|
409 /** Can be zero. Required if not-local memory, then addresses can be NULL */ |
|
410 uint32 bufferId; |
|
411 /** Physically linear */ |
|
412 bool8 physicallyLinear; |
|
413 /** Cache/MMU features - bit mask */ |
|
414 DISPE_CACHE_SETTINGS caches; |
|
415 /** Features what to be used for this buffer - This is like usage-hint for chipset driver, and can be ignored */ |
|
416 DISPE_FEATURE bufferUseCases; |
|
417 |
|
418 /** Offset from bufferPhysicalAddress to Y-components (needed if planar, otherwise can be set 0) */ |
|
419 uint32 offsetToY; |
|
420 /** Offset from bufferPhysicalAddress to Cb-components (needed if planar, otherwise can be set 0) */ |
|
421 uint32 offsetToCb; |
|
422 /** Offset from bufferPhysicalAddress to Cr-components (needed if planar, otherwise can be set 0) */ |
|
423 uint32 offsetToCr; |
|
424 |
|
425 /** Source buffer pixel format */ |
|
426 DISPE_COLOR_FORMAT pixelFormat; |
|
427 /** Source buffer color space (normally = DISP_COLOR_SPACE_STANDARD_RGB) */ |
|
428 DISPE_COLOR_SPACE sourceColorSpace; |
|
429 /** Source buffer color space (free) to be defined if sourceColorSpace=DISP_COLOR_COORDINATES */ |
|
430 DISPS_COLOR_COORDINATES sourceColorCoordinates; |
|
431 /** Used if API user wants to use free conversion table, to be defined if sourceColorSpace=DISP_COLOR_MATRIX_CONV */ |
|
432 DISPS_COLOR_SPACE_CONV_MATRIX colorSpaceConversion; |
|
433 /** Required if YCbCr format used */ |
|
434 DISPE_COLOR_YCBCR_BIT_MASK yCbCrBitMask; |
|
435 |
|
436 /** Buffer width in pixels */ |
|
437 uint32 width; |
|
438 /** Buffer height in pixels */ |
|
439 uint32 height; |
|
440 /** One line in bytes. With 420 planar, this tells one line Y-components stride. */ |
|
441 uint32 stride; |
|
442 } DISPS_BUFFER; |
|
443 |
|
444 /** Colorkey - Makes hole to layer */ |
|
445 typedef struct |
|
446 { |
|
447 /** Only one colorkeymode can be defined */ |
|
448 DISPE_COLORKEYMODE mode; |
|
449 /** If DISP_COLORKEYMODE_SINGLE_KEY -> Defines transparency key when needed. Planar not supported. |
|
450 If DISP_COLORKEYMODE_KEY_MASK -> if (pixel_color & colorkey) -> transparent pixel. Then colorkey defines maskColor. */ |
|
451 uint32 colorkey; |
|
452 } DISPS_COLORKEY; |
|
453 |
|
454 /** Layer - one visible layer information */ |
|
455 typedef struct |
|
456 { |
|
457 /** True when this layer is enabled */ |
|
458 bool8 enabled; |
|
459 /** True if forces transfer to display. Forcing means that chipset drv logic cannot do any own decisions |
|
460 (optimising/buffer changes/buffer manipulation) for the transfers. When this is true, buffer content must be |
|
461 visible on display panel after transfer. Normally can be false. */ |
|
462 bool8 forceView; |
|
463 |
|
464 /** Source buffer struct */ |
|
465 DISPS_BUFFER sourceBuffer; |
|
466 |
|
467 /** Input crop. Max size < sourceBuffer.width & height. */ |
|
468 DISPS_RECTANGLE inputScissor; |
|
469 /** Target area coordinates. if source area is different size than target up/downscaling will need to be |
|
470 performed by HW. Return Error if scaling requested but no HW capability. */ |
|
471 DISPS_RECTANGLE targetArea; |
|
472 /* If inputScissor!=targetArea sizes mismatch, then scaling method need to be defined here */ |
|
473 DISPE_SCALING scalingMethod; |
|
474 |
|
475 /** Layer rotation information */ |
|
476 DISPE_ROTATION rotate; |
|
477 |
|
478 /** Colorkey struct which is used in this buffer */ |
|
479 DISPS_COLORKEY colorkey; |
|
480 |
|
481 /** Brightness value on screen, [-100,100]%, may be ignored by the driver. |
|
482 If chipset driver can control only one brightness (not for each layer), |
|
483 then first layer settings are used. */ |
|
484 int16 brightness; |
|
485 /** Contrast value on screen, [-100,100]% |
|
486 If chipset driver can control only one contrast (not for each layer), |
|
487 then first layer settings are used. */ |
|
488 int16 contrast; |
|
489 /** Gamma value on screen, e.g.: 1.00=100, 2.20=220. |
|
490 If chipset driver can control only one gamma (not for each layer), |
|
491 then DISPS_FINAL_VIEW::topLayer settings are used. |
|
492 |
|
493 Formula: output_signal = intensity^( 1 / gamma ) |
|
494 |
|
495 In the C++ language this can be represented as follows: |
|
496 output_signal = pow( double( intensity ), double( 1.0 ) / ( double( gamma ) / 100 ) ); |
|
497 |
|
498 Gamma-correction lookup table can be constructed like this: |
|
499 int32 lut[ 256 ]; |
|
500 for ( int32 intensity = 0; intensity < 256; intensity++ ) |
|
501 lut[ i ] = pow( double( intensity ), double( 1.0 ) / ( double( gamma ) / 100 ) ); |
|
502 |
|
503 Loading this table into the hardware lookup table at the output side of |
|
504 framebuffer will cause RGB intensity values with integer components |
|
505 between 0 and 255 to be gamma-corrected by the hardware as if by the following code: |
|
506 red_signal = lut[ r ]; |
|
507 green_signal = lut[ g ]; |
|
508 blue_signal = lut[ b ]; */ |
|
509 uint16 gamma; |
|
510 /** True when dithering is enabled (if HW does not support, then ignore this without error) */ |
|
511 bool8 enableDithering; |
|
512 /** Per layer alpha if supported, 0x00-0xFF (if HW does not support, then ignore this without error) */ |
|
513 uint8 perLayerAlphaValue; |
|
514 } DISPS_LAYER; |
|
515 |
|
516 /** |
|
517 Final view - composed view information |
|
518 |
|
519 @code |
|
520 __________________________ __________________________ __________________________ |
|
521 | | | | | | |
|
522 | DISPS_COLORKEY (1) | | DISPS_RECTANGLE (2) | | DISPS_BUFFER (1) | |
|
523 | | | | | | |
|
524 ¯¯¯¯¯¯¯¯¯¯¯¯|¯¯¯¯¯¯¯¯¯¯¯¯¯ ¯¯¯¯¯¯¯¯¯¯¯¯|¯¯¯¯¯¯¯¯¯¯¯¯¯ ¯¯¯¯¯¯¯¯¯¯¯¯|¯¯¯¯¯¯¯¯¯¯¯¯¯ |
|
525 `--------------------------|--------------------------´ |
|
526 ____________|_____________ |
|
527 | | |
|
528 | DISPS_LAYER (5) | |
|
529 | | |
|
530 ¯¯¯¯¯¯¯¯¯¯¯¯|¯¯¯¯¯¯¯¯¯¯¯¯¯ |
|
531 ____________|_____________ |
|
532 | | |
|
533 | DISPS_FINAL_VIEW | |
|
534 | | |
|
535 ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ |
|
536 @endcode |
|
537 */ |
|
538 typedef struct /* TODO can be done for n-amount of layers somehow else - perhaps not needed */ |
|
539 { |
|
540 DISPS_LAYER topLayer; /**< top most layer (nearest), normally UI-layer and always defined (but not for pure control bus) */ |
|
541 DISPS_LAYER secondLayer; /**< 2nd */ |
|
542 DISPS_LAYER thirdLayer; /**< 3rd */ |
|
543 DISPS_LAYER fourthLayer; /**< 4th */ |
|
544 DISPS_LAYER fifthLayer; /**< 5th */ |
|
545 uint32 backgroundColor; /**< Latest layer (farthermost). Background color in URGB8888 format. */ |
|
546 } DISPS_FINAL_VIEW; |
|
547 |
|
548 /** |
|
549 Update - Gives changed areas what to be updated. Chipset driver can ignore parameters, if hw cannot handle. |
|
550 |
|
551 @code |
|
552 __________________________ |
|
553 | | |
|
554 | DISPS_RECTANGLE | |
|
555 | | |
|
556 ¯¯¯¯¯¯¯¯¯¯¯¯|¯¯¯¯¯¯¯¯¯¯¯¯¯ |
|
557 ____________|_____________ |
|
558 | | |
|
559 | DISPS_UPDATE | |
|
560 | | |
|
561 ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ |
|
562 @endcode |
|
563 */ |
|
564 typedef struct |
|
565 { |
|
566 /** Changed area of layers - Coordinate space in DISPS_LAYER::sourceBuffer - Shall be inside DISPS_LAYER::inputScissor */ |
|
567 DISPS_RECTANGLE topLayerRect; |
|
568 DISPS_RECTANGLE secondLayerRect; |
|
569 DISPS_RECTANGLE thirdLayerRect; |
|
570 DISPS_RECTANGLE fourthLayerRect; |
|
571 DISPS_RECTANGLE fifthLayerRect; |
|
572 |
|
573 /** Tearing remove use */ |
|
574 DISPE_TE_SYNC teSync; |
|
575 /** If DISP_TE_SYNC_HS_VS sync method chosen, the sync line needs to be defined here */ |
|
576 uint32 hsSyncLine; |
|
577 } DISPS_UPDATE; |
|
578 |
|
579 /** Target device and bus definition */ |
|
580 typedef struct |
|
581 { |
|
582 /** System display number. Normally primary display has 0, secondary 1, etc. Set to 0xFF if unknown. */ |
|
583 uint8 systemDisplayNumber; |
|
584 |
|
585 /** Bus color format */ |
|
586 DISPE_COLOR_FORMAT busColorFormat; |
|
587 /** Native resolution of display */ |
|
588 uint16 panelHeight; |
|
589 /** Native resolution of display */ |
|
590 uint16 panelWidth; |
|
591 /** Destination color space, HW converts space to another if this is not DISP_COLOR_SPACE_NONE |
|
592 If DISPS_BUFFER.sourceColorSpace is same, then conversion is disabled. |
|
593 This operations can be defined platform specific, perhaps similar behavior is not possible for all platforms. */ |
|
594 DISPE_COLOR_SPACE destinationColorSpace; |
|
595 /** Destination color coordinates. With this and sourceColorCoordinates chipset driver should do the conversion. |
|
596 to be defined if destinationColorSpace=DISP_COLOR_COORDINATES */ |
|
597 DISPS_COLOR_COORDINATES destinationColorCoordinates; |
|
598 /** Used for DSI command packet mode. Continue command if pixel data to be splitted for several parts. |
|
599 (normally: Memory Write Continue = 0x3C) If not used at all, then this is 0. */ |
|
600 uint8 memoryWriteContinueCmd; |
|
601 /** Used for DSI. Continue command if read data to be splitted for several parts. |
|
602 (normally: Memory Read Continue = 0x3E) If not used at all, then this is 0. */ |
|
603 uint8 memoryReadContinueCmd; |
|
604 |
|
605 /* Timing and polarities -> */ |
|
606 |
|
607 /** Used bus width. max is DISPS_CAPABILITIES.busWidth. E.g. with MeSSI-8 this is DISP_BUS_8BIT. */ |
|
608 DISPE_BUS_WIDTH outputBusWidth; |
|
609 /** How many clock cycles are used per pixel. E.g. with MeSSI-8 and 24bpp, this is 30 (3 bytes per pixel). |
|
610 1 cycle = 10. 1.5 cycles = 15. 3 cycles = 30 */ |
|
611 uint8 cyclesPerPixel; |
|
612 /** Specifies how many LSB bits will be taken from dispAppendCommand() 'command' -parameter. Normally byte alignment only 8/16/24/32 */ |
|
613 uint8 bitsPerGivenCommand; |
|
614 /** Specifies how many LSB bits will be taken from dispAppendParameter() 'parameter' -parameter. Normally byte alignment only 8/16/24/32 */ |
|
615 uint8 bitsPerGivenParameter; |
|
616 |
|
617 /** (Pixel data) Clock write cycle high time in ns -> chipset HW should adjust highest possible clockrate to meet the requirement. |
|
618 -In DSI case, chipset driver has to detect speed mode according to the timing parameters. High Speed (HS) >= 80Mb/s, |
|
619 Low Power mode (LP) 1Mb/s <= 10Mb/s. @see DISP_PWR_MODE_DISPLAY_OFF. These DSI timings are used for dispFlush() + combined commands. |
|
620 -In ViSSI/CDP-case, these tells max ViSSI/CDP pixel clock speed. */ |
|
621 uint32 clockHighDataWriteNs; |
|
622 /** (Pixel data) Clock write cycle low time in ns -> chipset HW should adjust highest possible clockrate to meet the requirement */ |
|
623 uint32 clockLowDataWriteNs; |
|
624 /** (Pixel data) Clock write cycle total time */ |
|
625 uint32 clockCycleDataWriteNs; |
|
626 |
|
627 /** (Command data) Clock write cycle high time in ns -> chipset HW should adjust highest possible clockrate to meet the requirement. |
|
628 -In DSI case, chipset driver has to detect speed mode according to the timing parameters. High Speed (HS) >= 80Mb/s, |
|
629 Low Speed (LP) 1Mb/s <= 10Mb/s. @see DISP_PWR_MODE_DISPLAY_OFF. These DSI timings are used for dispProcessList(). |
|
630 -In ViSSI/CDP-case, these tells max LoSSI write speed. */ |
|
631 uint32 clockHighCmdWriteNs; |
|
632 /** (Command data) Clock write cycle low time in ns -> chipset HW should adjust highest possible clockrate to meet the requirement */ |
|
633 uint32 clockLowCmdWriteNs; |
|
634 /** (Command data) Clock write cycle total time */ |
|
635 uint32 clockCycleCmdWriteNs; |
|
636 |
|
637 /** Clock read cycle high time in ns -> chipset HW should adjust highest possible clockrate to meet the requirement. |
|
638 -In DSI case, chipset driver has to detect speed mode according to the timing parameters. |
|
639 According to DSI-specification, read is normally LP. These DSI timings are used when dispAppendRead()/dispAppendReadRaw(). |
|
640 -In ViSSI/CDP-case, these tells max LoSSI read speed. */ |
|
641 uint32 clockHighReadNs; |
|
642 /** Clock read cycle low time in ns -> chipset HW should adjust highest possible clockrate to meet the requirement */ |
|
643 uint32 clockLowReadNs; |
|
644 /** Clock read cycle total time */ |
|
645 uint32 clockCycleReadNs; |
|
646 |
|
647 /** Video display: vertical sync polarity */ |
|
648 bool8 vSyncPolarityLow; |
|
649 /** Video display: horisontal sync polarity */ |
|
650 bool8 hSyncPolarityLow; |
|
651 /** Video display: pixel clock polarity */ |
|
652 bool8 pClkActiveFalling; |
|
653 /** Video display: in pixel clock cycles */ |
|
654 uint16 hFrontPorch; |
|
655 /** Video display: in pixel clock cycles */ |
|
656 uint16 hBackPorch; |
|
657 /** Video display: in pixel clock cycles */ |
|
658 uint16 hPulseWidth; |
|
659 /** Video display: in horisontal clock cycles */ |
|
660 uint16 vFrontPorch; |
|
661 /** Video display: in horisontal clock cycles */ |
|
662 uint16 vBackPorch; |
|
663 /** Video display: in horisontal clock cycles */ |
|
664 uint16 vPulseWidth; |
|
665 |
|
666 /** TE-signal GPIO line number. 0 means HW block controlled */ |
|
667 int32 teSignalGpioNumber; |
|
668 |
|
669 /** Chip Select -signal GPIO line number. 0 means HW block controlled */ |
|
670 int32 csSignalGpioNumber; |
|
671 |
|
672 /** Reset signal GPIO line number. 0 means HW block controlled */ |
|
673 int32 resetSignalGpioNumber; |
|
674 /** True when target reset is active low */ |
|
675 bool8 resetActiveLow; |
|
676 |
|
677 /** TE vertical pulse in microseconds (Needed for TE-line detection) */ |
|
678 uint32 vsPulseUs; |
|
679 /** TE horizontal pulse in microseconds (Needed for TE-line detection) */ |
|
680 uint32 hsPulseUs; |
|
681 } DISPS_HW_SETTINGS; |
|
682 |
|
683 /** Defines HW capabilities for one interface */ |
|
684 typedef struct |
|
685 { |
|
686 /** For what interface the capability is defined */ |
|
687 DISPE_BUS busInterface; |
|
688 |
|
689 /** Control bus width */ |
|
690 DISPE_BUS_WIDTH controlBusWidth; |
|
691 /** Data (pxl) bus width */ |
|
692 DISPE_BUS_WIDTH dataBusWidth; |
|
693 |
|
694 /** Scaling represents supported scaling capabilities of the HW interface. |
|
695 --> if HW support for scaling is not available buffer transfer for different viewport dimensions should |
|
696 return DISP_ERROR_NO_HW_CAPABILITY */ |
|
697 DISPE_SCALING scalingMethods; |
|
698 /** Minimum scaling factor. |
|
699 E.g. if 1/2x is min, then this is 200 (100 / scalingMinDenominator). 1x = 100. 0xFFFF = infinity. */ |
|
700 uint16 scalingMinDenominator; |
|
701 /** Maximum scaling factor. |
|
702 E.g. if 2.5x is max, then this is 250 (scalingMaxNumerator / 100). 1x = 100. 0xFFFF = infinity. */ |
|
703 uint16 scalingMaxNumerator; |
|
704 |
|
705 /** Source resolution parameters must be even, if following features are used (bit mask) */ |
|
706 DISPE_FEATURE evenSourceResolution; |
|
707 /** Destination resolution parameters must be even, if following features are used (bit mask) */ |
|
708 DISPE_FEATURE evenDestinationResolution; |
|
709 |
|
710 /** Supported color space conversions from sRGB to DISPE_COLOR_SPACE (bit mask) */ |
|
711 DISPE_COLOR_SPACE supportedColorSpaceConversion; |
|
712 /** True when brightness tuning is supported */ |
|
713 bool8 supportsBrightnessControl; |
|
714 /** True when contrast tuning is supported */ |
|
715 bool8 supportsContrastControl; |
|
716 /** True when gamma tuning is supported */ |
|
717 bool8 supportsGammaControl; |
|
718 /** True when (at least one layer) dithering is supported */ |
|
719 bool8 supportsDithering; |
|
720 |
|
721 /** Rotation represents supported rotation capabilities of HW. */ |
|
722 DISPE_ROTATION rotations; |
|
723 /** True if HW can rotate each layer separately. False if only whole view can be rotated. |
|
724 (Hopefully will not be needed in NGA) */ |
|
725 bool8 separateRotationPerLayer; |
|
726 /** Bitmask for features which needs bound buffers. If 0, then can be done for any input buffer */ |
|
727 DISPE_FEATURE featuresNeedsBindedBuffers; |
|
728 |
|
729 /** All the possible colorkey modes supported by the interface */ |
|
730 DISPE_COLORKEYMODE colorKeyModes; |
|
731 |
|
732 /** How many layers supported, at least 1 */ |
|
733 uint8 layers; |
|
734 /** True when per layer alpha supported */ |
|
735 bool8 perLayerAlpha; |
|
736 |
|
737 /** Partial update can transfer separate rows */ |
|
738 bool8 rowPartialUpdate; |
|
739 /** Partial update can transfer separate columns */ |
|
740 bool8 columnPartialUpdate; |
|
741 |
|
742 /** Supported TE modes for the Hw-block controlled (e.g. DIF module TE capabilities) */ |
|
743 DISPE_TE_SYNC teSyncMethodsHwBlock; |
|
744 /** Supported TE modes for the GPIO controlled (If TE line is connected to GPIO-pin) */ |
|
745 DISPE_TE_SYNC teSyncMethodsGpio; |
|
746 |
|
747 /** Color buffer formats natively supported by HW */ |
|
748 DISPE_COLOR_FORMAT pixelFormats; |
|
749 /** Bit mask for features, which works with 24bpp aligned color mode */ |
|
750 DISPE_FEATURE packedPixelsSupported; |
|
751 |
|
752 /** True when given buffer(s) works as frame buffer (memoryless displays). False when buffer is free after transfer (MeSSI=False) */ |
|
753 bool8 requiresFrameBuffer; |
|
754 |
|
755 /** Bit mask for features, which needs work buffer from host memory - TODO is needed to get sizes for those */ |
|
756 DISPE_FEATURE requiresWorkBuffer; |
|
757 /** True if DMA buffers must be physically linear */ |
|
758 bool8 requiresPhysicallyLinearBuffer; |
|
759 |
|
760 /** True when interface can carry pixel data */ |
|
761 bool8 carryData; |
|
762 /** True when interface can carry control data. Typically this can be false if driver implements ViSSI only, but not LoSSI. */ |
|
763 bool8 carryControl; |
|
764 } DISPS_CAPABILITIES; |
|
765 |
|
766 /*- Constants ---------------------------------------------------------------*/ |
|
767 |
|
768 /** API version number. @see dispApiVersion(). |
|
769 7: memoryReadContinueCmd added |
|
770 6: systemDisplayNumber. ARGB4444. dispDriverMessage. |
|
771 5: Pre-multiplied alpha modes |
|
772 4: Free colorspace |
|
773 3: Callback parameter for DISPT_READY_CB. fetchedArea added to dispGetWorkBuffer(). |
|
774 2: forceView and DISP_CACHE_ARM_ACCESSIBLE added |
|
775 1: First version where dispApiVersion-method exists */ |
|
776 const uint32 KApiVersionNumber = 7; |
|
777 |
|
778 /** Fixed Chipset driver name char array. Name ends to '0', so max name length is 9 + '\0'. */ |
|
779 typedef char CHIPSET_DRV_NAME[ 10 ]; |
|
780 |
|
781 /** Chipset driver calls this, when something is executed. |
|
782 Callback must not be called in the API user thread context. |
|
783 @see dispProcessList |
|
784 @param error An error code |
|
785 @param parameter Given parameter (@see dispBindDisplayNumber()) |
|
786 @param isrContext True when callback is called in interrupt context */ |
|
787 typedef void (*DISPT_READY_CB)(DISPE_ERROR error, void* parameter, bool8 isrContext); |
|
788 |
|
789 /** Chipset driver calls this, when message (dispDriverMessage) is sent and executed. |
|
790 Callback must not be called in the API user thread context. |
|
791 @see dispDriverMessage |
|
792 @param error An error code |
|
793 @param parameter Given parameter (@see dispBindDisplayNumber()) |
|
794 @param receiverForThisMsg Driver name who responded for this message |
|
795 @param responseForThisMsg dispDriverMessage's 'message'-parameter for this message |
|
796 @param value Message specific return value, unique meaning per DISPE_DRV_MSG |
|
797 @param isrContext True when callback is called in interrupt context */ |
|
798 typedef void (*DISPT_MSG_CB)(DISPE_ERROR error, void* parameter, CHIPSET_DRV_NAME receiverForThisMsg, |
|
799 DISPE_DRV_MSG responseForThisMsg, uint32 value, bool8 isrContext); |
|
800 |
|
801 /** Chipset API interface type */ |
|
802 typedef uint32* API_POINTER; |
|
803 |
|
804 /** Identifier type */ |
|
805 typedef uint32 IDENTIFIER; |
|
806 |
|
807 /*- Macros ------------------------------------------------------------------*/ |
|
808 |
|
809 /*- External Data -----------------------------------------------------------*/ |
|
810 |
|
811 /*- Variables ---------------------------------------------------------------*/ |
|
812 |
|
813 /*- Forward Declarations ----------------------------------------------------*/ |
|
814 |
|
815 /*- Functional Prototypes ---------------------------------------------------*/ |
|
816 |
|
817 /* VERSION -> */ |
|
818 /** Gets implemented chipset API version. Verify the return value to KApiVersionNumber. |
|
819 @param api Api interface pointer, fetched from dispGetInterface() |
|
820 @see KApiVersionNumber |
|
821 @return Implemented display chipset API version, KApiVersionNumber (should match to client version) */ |
|
822 inline uint32 dispApiVersion(API_POINTER api); |
|
823 /* <- VERSION */ |
|
824 |
|
825 /* CAPABILITY -> */ |
|
826 /** Gets number of supported capabilities (DISPS_CAPABILITIES). |
|
827 @param api Api interface pointer, fetched from dispGetInterface() |
|
828 @see dispGetCapabilities |
|
829 @return Max value for getCapabilities() */ |
|
830 inline uint32 dispGetNumberOfCapabilities(API_POINTER api); |
|
831 |
|
832 /** Capability query. Capability list has struct for all the supported devices. |
|
833 @see dispGetNumberOfCapabilities |
|
834 @param api Api interface pointer, fetched from dispGetInterface() |
|
835 @param capabilityNumber Capability number, max value is got from dispGetNumberOfCapabilities() |
|
836 @param capability Returned capability for user |
|
837 @return an error code */ |
|
838 inline DISPE_ERROR dispGetCapabilities(API_POINTER api, uint32 capabilityNumber, DISPS_CAPABILITIES* capability); |
|
839 /* <- CAPABILITY */ |
|
840 |
|
841 /* CONTROL -> */ |
|
842 /** Binds display number to Hw (constructor). This method initialises and reserved this DISPE_BUS for this client. |
|
843 This method can be called if settings of bus are wanted to change, so can be called in any time. |
|
844 Settings will be take in use immediately. |
|
845 If client calls this method multiple times, chipset driver should return same identifier each time. |
|
846 @param api Api interface pointer, fetched from dispGetInterface() |
|
847 @param busInterface Wanted busInterface, which to be initialised and reserved |
|
848 @param cbParam Callback parameter, returned in callbacks. Normally can be 'this' pointer in C++. |
|
849 @param identifier Method fills this for user, and user will be recognised with this parameter. |
|
850 @param displaySettings Target settings |
|
851 @return an error code */ |
|
852 inline DISPE_ERROR dispBindDisplayNumber(API_POINTER api, DISPE_BUS busInterface, void* cbParam, IDENTIFIER* identifier, const DISPS_HW_SETTINGS* displaySettings); |
|
853 |
|
854 /** Unbinds and deallocates display Hw (destuctor). After this HW is free for another client use. |
|
855 After call identifier is undefined. Pending callbacks will be completed with DISP_ERROR_CANCELLED-error. |
|
856 @param api Api interface pointer, fetched from dispGetInterface() |
|
857 @param identifier Chipset driver uses this parameter for detecting client |
|
858 @return an error code */ |
|
859 inline DISPE_ERROR dispUnbindDisplayNumber(API_POINTER api, IDENTIFIER identifier); |
|
860 |
|
861 /** Sets all per layer settings for chipset driver. Settings will be used on next dispFlush()-call. |
|
862 In double buffered case, this method to be call every time before dispFlush, with different buffer |
|
863 addresses. Chipset driver is responsible to optimise unneeded reinitialisation. It should store |
|
864 previous settings and compare changed settings of DISPS_FINAL_VIEW, and use that result |
|
865 for HW reinitialisation. |
|
866 @see dispFlush |
|
867 @param api API interface pointer, fetched from dispGetInterface() |
|
868 @param identifier Chipset driver uses this parameter for detecting client |
|
869 @param finalView Source buffer and final composition settings |
|
870 @return an error code */ |
|
871 inline DISPE_ERROR dispSetFinalView(API_POINTER api, IDENTIFIER identifier, const DISPS_FINAL_VIEW* finalView); |
|
872 |
|
873 /** Clones output (dispFlush()) to given destination bus. |
|
874 Source buffer information is fetched from (this client's) dispSetFinalView()-parameters. |
|
875 Bus speed settings are fetched from 'destinationBus' client's dispBindDisplayNumber()-parameters. |
|
876 Commands (control) are still coming from 'destinationBus' client. |
|
877 Stop cloning with DISP_BUS_NONE-parameter. |
|
878 @param api API interface pointer, fetched from dispGetInterface() |
|
879 @param identifier Chipset driver uses this parameter for detecting client (source) |
|
880 @param destinationBus This client's source buffer is cloned to this bus (destination) |
|
881 @return an error code */ |
|
882 inline DISPE_ERROR dispCloneOutput(API_POINTER api, IDENTIFIER identifier, DISPE_BUS destinationBus); |
|
883 |
|
884 /** Power control. Chipset API handles own resources, e.g. HW-block clock resources. |
|
885 @param api API interface pointer, fetched from dispGetInterface() |
|
886 @param identifier Chipset driver uses this parameter for detecting client |
|
887 @param powerMode New wanted power states |
|
888 @param callback To be called when power change is ready, even error occurred. (especially needed when pixelclock). Synchronic call if NULL. |
|
889 @return an error code */ |
|
890 inline DISPE_ERROR dispPowerControl(API_POINTER api, IDENTIFIER identifier, DISPE_PWR_MODE powerMode, DISPT_READY_CB callback); |
|
891 |
|
892 /** This method makes possible to send some messages for whole chipset driver stack. |
|
893 When chipset drivers will get the message call and name does not match for that driver, |
|
894 then it has to forward message for next driver in same driver stack. |
|
895 |
|
896 If message==DISP_MSG_PING: Chipset driver will forward same message for |
|
897 next chipset drivers in the stack, then all drivers call 'callback' with |
|
898 their own name (CHIPSET_DRV_NAME) and got message (DISP_MSG_PING). With this, topmost |
|
899 driver can make query, what components stack has. Topmost caller sets param=0, when chipset |
|
900 driver calls this forward, it increases param by one (param=1). If chipset driver uses to |
|
901 separated chipset drivers, both will to be called with param=1. Then 'param' means stack level. |
|
902 In callback chipset drivers will set given param to DISPT_MSG_CB's 'value'-parameter. |
|
903 |
|
904 If message==DISP_MSG_SELFTEST: If given name (receiver) matches to driver name, then the |
|
905 driver will execute selftest. When selftest is ready, it reports test result with 'callback' |
|
906 for caller. Chipset drivers will forward the same message, if name (receiver) and their own |
|
907 name doesn't match. Doesn't care what is the 'param'-parameter with this message. |
|
908 |
|
909 @param api API interface pointer, fetched from dispGetInterface() |
|
910 @param identifier Chipset driver uses this parameter for detecting client |
|
911 @param receiver Message receiver name (same what is stored in Interface Storage) |
|
912 @param message Message identifier |
|
913 @param param Optional, has different meaning per 'message' |
|
914 @param callback Callback when message actions are executed. Cannot be NULL. |
|
915 @return an error code */ |
|
916 inline DISPE_ERROR dispDriverMessage(API_POINTER api, IDENTIFIER identifier, CHIPSET_DRV_NAME receiver, |
|
917 DISPE_DRV_MSG message, uint32 param, DISPT_MSG_CB callback); |
|
918 /* <- CONTROL */ |
|
919 |
|
920 |
|
921 /* DISPLAY UPDATE -> */ |
|
922 /** Prepares DMA-transfer according to latest dispSetFinalView parameters. |
|
923 After this, if DISPS_CAPABILITIES.requiresWorkBuffer is true (some bit is set), work buffer is ready. |
|
924 This method can be called multiple times, before dispFlush(). |
|
925 @see dispFlush |
|
926 @see dispSetFinalView |
|
927 @param api Api interface pointer, fetched from dispGetInterface() |
|
928 @param identifier Chipset driver uses this parameter for detecting client |
|
929 @param changedArea Changed areas, rectangle per layer. Chipset driver can ignore and transfer bigger part. |
|
930 @param callback To be called when preparation is ready, even error occurred. Synchronic call if NULL. |
|
931 @return an error code */ |
|
932 inline DISPE_ERROR dispPrepareFlush(API_POINTER api, IDENTIFIER identifier, const DISPS_UPDATE* changedArea, DISPT_READY_CB callback); |
|
933 /** Display flush (real DMA-transfer) according to latest not flushed dispPrepareFlush parameters. |
|
934 Special case if is wanted to flush once for ViSSI output. Keep DISP_PWR_MODE_DISPLAY_OFF always, so if |
|
935 power state DISP_PWR_MODE_DISPLAY_OFF is set, and Flush is called, then Hw flushes one frame through ViSSI. |
|
936 |
|
937 DISPS_CAPABILITIES.requiresFrameBuffer==false: |
|
938 callback will be called when display buffer is transferred to the display. |
|
939 DISPS_CAPABILITIES.requiresFrameBuffer==true: |
|
940 callback will be called when display buffer starting to be visible. So when callback is called |
|
941 any pixel of flush is not yet shown. And after that given buffer works as framebuffer |
|
942 until next's flush callback will be called. So caller should be aware of that |
|
943 to avoiding tearing (no draw to buffer if that is still work as framebuffer). |
|
944 |
|
945 If there is pending appended commands+parameters (e.g. dispAppendCommand) the list to be sent before |
|
946 actual image flush. With this method, only dispFlush() callback will be called after ready. |
|
947 |
|
948 If display has TE-line, and TE-line is enabled with DISPS_UPDATE::teSync, chipset driver |
|
949 shall avoid death lock with backup timer if TE will never detected (TE line may be broken). |
|
950 When TE-line is not detected and backup timer is triggered DMA, then DISP_ERROR_TE_MISSED error |
|
951 is reported in return value and/or with callback. |
|
952 |
|
953 @see dispSetFinalView |
|
954 @param api Api interface pointer, fetched from dispGetInterface() |
|
955 @param identifier Chipset driver uses this parameter for detecting client |
|
956 @param callback To be called when transfer (DMA) is ready, even error occurred. Synchronic call if NULL. |
|
957 @return an error code */ |
|
958 inline DISPE_ERROR dispFlush(API_POINTER api, IDENTIFIER identifier, DISPT_READY_CB callback); |
|
959 /* <- DISPLAY UPDATE */ |
|
960 |
|
961 |
|
962 /** COMMANDS/PARAMETERS -> |
|
963 Commands and parameters are collected to dynamic size table or array (linked list or compatible). |
|
964 List is collected with dispAppendXX()-methods, in that order what is called. When display driver |
|
965 is appended all needed commands and parameters, then it calls dispProcessList(), which sends appended data |
|
966 to display bus. After next use, display driver is responsible to clear previous list by dispClearList(). |
|
967 */ |
|
968 /** Clears/resets list. This to be called every time before new list will be collected for chipset driver. |
|
969 Don't ever call if callback waiting is ongoing (between dispProcessList->callback) |
|
970 @param api Api interface pointer, fetched from dispGetInterface() |
|
971 @param identifier Chipset driver uses this parameter for detecting client |
|
972 @return an error code */ |
|
973 inline DISPE_ERROR dispClearList(API_POINTER api, IDENTIFIER identifier); |
|
974 |
|
975 /** Appends command to the list. |
|
976 @param api Api interface pointer, fetched from dispGetInterface() |
|
977 @param identifier Chipset driver uses this parameter for detecting client |
|
978 @param command Command to be sent to display bus (LSB bits taken only, @see bitsPerGivenCommand) |
|
979 @return an error code */ |
|
980 inline DISPE_ERROR dispAppendCommand(API_POINTER api, IDENTIFIER identifier, uint32 command); |
|
981 |
|
982 /** Appends parameter to the list. |
|
983 @param api Api interface pointer, fetched from dispGetInterface() |
|
984 @param identifier Chipset driver uses this parameter for detecting client |
|
985 @param parameter Parameter to be sent to display bus (LSB bits taken only, @see bitsPerGivenParameter) |
|
986 If e.g. dispAppendParameter=16, at least with MeSSI-8 then MSB byte is sent before LSB-byte. |
|
987 E.g. with MeSSI-16, some devices may require 16bit parameters, then dispAppendParameter=16. (See MIPI) |
|
988 @return an error code */ |
|
989 inline DISPE_ERROR dispAppendParameter(API_POINTER api, IDENTIFIER identifier, uint32 parameter); |
|
990 |
|
991 /** Appends read data amount in bytes to given buffer. |
|
992 With DSI: Each read operation shall generate "Set Maximum Return Packet Size" (SMRPS) |
|
993 command for display (before last DCS command), according to lengthInBytes or max HW read fifo size. |
|
994 @param api Api interface pointer, fetched from dispGetInterface() |
|
995 @param identifier Chipset driver uses this parameter for detecting client |
|
996 @param lengthInBytes How many bytes will be read from display bus |
|
997 @param readBuffer Destination where chipset driver writes data after read |
|
998 @return an error code */ |
|
999 inline DISPE_ERROR dispAppendRead(API_POINTER api, IDENTIFIER identifier, uint32 lengthInBytes, void* readBuffer); |
|
1000 |
|
1001 /** Reads raw data (e.g. pixels) to wanted place. |
|
1002 @see dispAppendRead |
|
1003 @param api Api interface pointer, fetched from dispGetInterface() |
|
1004 @param identifier Chipset driver uses this parameter for detecting client |
|
1005 @param lengthInBytes How many bytes will be read from display bus |
|
1006 @param readBuffer Destination where chipset driver writes data after read |
|
1007 @param readBufferOneLine Read buffer one line in bytes (after this will be skipped according to stride) |
|
1008 @param readBufferStride Read buffer stride in bytes. Must be => readBufferOneLine |
|
1009 @return an error code */ |
|
1010 inline DISPE_ERROR dispAppendReadRaw(API_POINTER api, IDENTIFIER identifier, uint32 lengthInBytes, void* readBuffer, uint32 readBufferOneLine, uint32 readBufferStride); |
|
1011 |
|
1012 /** Sends list. Send list in same order than it is filled. Can be skipped if next operation is dispFlush(). |
|
1013 Then dispFlush() prepares flush with sending appended commands before flush. |
|
1014 @param api Api interface pointer, fetched from dispGetInterface() |
|
1015 @param identifier Chipset driver uses this parameter for detecting client |
|
1016 @param callback To be called when the list is sent, even error occurred. Synchronic call if NULL. |
|
1017 @return an error code */ |
|
1018 inline DISPE_ERROR dispProcessList(API_POINTER api, IDENTIFIER identifier, DISPT_READY_CB callback); |
|
1019 /* <- COMMANDS/PARAMETERS */ |
|
1020 |
|
1021 |
|
1022 /** MEMORY MANAGING -> |
|
1023 Memory allocation is needed for hiding all hardwares, and all special buffer modes, like tiled buffers. |
|
1024 Here is couple of use cases, and how they should be handled. |
|
1025 |
|
1026 Use case #1 - Display driver allocated buffer from chipset driver (chipset driver allocates): |
|
1027 -Display driver fills all members, except addresses to bufferInfo. |
|
1028 -Display driver calls dispAllocateBuffer() |
|
1029 -Chipset driver fills allocatedBuffer-struct, and display driver uses that for work |
|
1030 |
|
1031 Use case #2 - Display driver wants allocate buffers by itself: |
|
1032 -Display driver fills all members, except addresses to bufferInfo. |
|
1033 -Display driver calls dispCalculateMemorySize() |
|
1034 -Display driver allocates buffer using OS-services, according to returned neededMemorySize value |
|
1035 -Display driver binds allocated buffer to chipset driver, using dispInitialiseBuffer()-method |
|
1036 -Chipset driver fills allocatedBuffer-struct, and display driver uses that for work |
|
1037 |
|
1038 Use case #3 - Display color mode changed dynamically: |
|
1039 -Display driver gets requirement to change ARGB8888 mode to RGB565 |
|
1040 -Display driver waits that all DMA and other accesses to the buffer are ready (no accesses) |
|
1041 -Display driver calls dispInitialiseBuffer() |
|
1042 -Chipset driver fills allocatedBuffer-struct, and display driver uses that for work |
|
1043 |
|
1044 Use case #4 - Free buffer: |
|
1045 -Display driver waits that all DMA and other accesses to the buffer are ready (no accesses) |
|
1046 -Display driver calls dispDeallocateBuffer() |
|
1047 -Chipset driver deallocates given buffer (buffer must be allocated or bound in chipset driver) |
|
1048 |
|
1049 API client has to fill following parameters before give the buffer for dispAllocateBuffer(), |
|
1050 dispCalculateMemorySize() or dispInitialiseBuffer(): |
|
1051 -At least one of these: bufferLinearAddress, bufferPhysicalAddress, bufferId |
|
1052 -physicallyLinear required or not |
|
1053 -caches |
|
1054 -bufferUseCases |
|
1055 -pixelFormat and yCbCrBitMask |
|
1056 -width and height |
|
1057 Chipset driver has to fill rest data members |
|
1058 |
|
1059 */ |
|
1060 /** Allocates buffer for user. This method makes allocation and display driver does not need do any buffer allocation anymore. |
|
1061 @param api Api interface pointer, fetched from dispGetInterface() |
|
1062 @param identifier Chipset driver uses this parameter for detecting client |
|
1063 @param bufferInfo Display driver gives buffer size and format requirements to chipset driver (not all members filled) |
|
1064 @param allocatedBuffer Chipset driver fills all data members for display driver use |
|
1065 @return an error code */ |
|
1066 inline DISPE_ERROR dispAllocateBuffer(API_POINTER api, IDENTIFIER identifier, const DISPS_BUFFER* bufferInfo, DISPS_BUFFER* allocatedBuffer); |
|
1067 |
|
1068 /** If display driver wants to allocate buffers itself, it can make query from chipset driver, that how much it requires memory |
|
1069 for doing memory allocation. This is needed e.g. if buffer must have some extra alignment for tiling. |
|
1070 After own allocation, display driver must to initialise buffer using dispInitialiseBuffer(). |
|
1071 @see dispInitialiseBuffer() |
|
1072 @param api Api interface pointer, fetched from dispGetInterface() |
|
1073 @param identifier Chipset driver uses this parameter for detecting client |
|
1074 @param bufferInfo Display driver gives new buffer information to chipset driver |
|
1075 @param neededMemorySize Chipset driver fills needed buffer size to display driver (in bytes) |
|
1076 @return an error code */ |
|
1077 inline DISPE_ERROR dispCalculateMemorySize(API_POINTER api, IDENTIFIER identifier, const DISPS_BUFFER* bufferInfo, uint32* neededMemorySize); |
|
1078 |
|
1079 /** If user settings are changed, e.g. colormode or DISPS_BUFFER.bufferUseCases changed, chipset driver can do some changes to buffer settings. |
|
1080 It can change tile size, or re-allocate new version of buffer for user. |
|
1081 This to be called every time when some of bufferInfo or DISPS_BUFFER.bufferUseCases is changed. |
|
1082 Display driver should be aware that any transfer or access to old buffer is not ongoing when this method is called. |
|
1083 If display driver is allocated buffer by itself, it should give allocated buffer to chipset driver using this method. Then |
|
1084 returned buffer (allocatedBuffer) will be used for update and draw purpose (this method binds the buffer). |
|
1085 |
|
1086 @note Any buffer can be tried to give directly to chipset driver (for flush), but if e.g. rotation |
|
1087 requires some special buffer type, chipset driver cannot do all operations for "not initalised" buffers. |
|
1088 So-called external buffers can be tried to flush directly without dispInitialiseBuffer, but then error may occur. |
|
1089 |
|
1090 @see dispCalculateMemorySize() |
|
1091 @param api Api interface pointer, fetched from dispGetInterface() |
|
1092 @param identifier Chipset driver uses this parameter for detecting client |
|
1093 @param bufferInfo Display driver gives new buffer information to chipset driver |
|
1094 @param allocatedBuffer Chipset driver fills all data members for display driver use |
|
1095 @return an error code */ |
|
1096 inline DISPE_ERROR dispInitialiseBuffer(API_POINTER api, IDENTIFIER identifier, const DISPS_BUFFER* bufferInfo, DISPS_BUFFER* allocatedBuffer); |
|
1097 |
|
1098 /** Deallocates and unbinds the buffer. If display driver is allocated buffer itself, this must be done |
|
1099 before the real memory deallocation. |
|
1100 So-called external buffers will not be deallocated with this function. |
|
1101 @param api Api interface pointer, fetched from dispGetInterface() |
|
1102 @param identifier Chipset driver uses this parameter for detecting client |
|
1103 @param bufferToBeRemoved Display driver gives new buffer information to chipset driver |
|
1104 @return an error code */ |
|
1105 inline DISPE_ERROR dispDeallocateBuffer(API_POINTER api, IDENTIFIER identifier, const DISPS_BUFFER* bufferToBeRemoved); |
|
1106 |
|
1107 /** Fetchs chipset driver workbuffer (if exists, DISPS_CAPABILITIES.requiresWorkBuffer) |
|
1108 Work buffer is available when dispPrepareFlush() is called. To be called separately for each dispPrepareFlush() call. |
|
1109 Can fetch also partial buffer, and then can be faster operation, and peek memory consumption will be smaller. |
|
1110 @param api Api interface pointer, fetched from dispGetInterface() |
|
1111 @param identifier Chipset driver uses this parameter for detecting client |
|
1112 @param fetchedArea Rectangle which to be fetched |
|
1113 @param fetchedWorkBuffer Chipset driver fills own work buffer information to this buffer (if in host memory) |
|
1114 @return an error code */ |
|
1115 inline DISPE_ERROR dispGetWorkBuffer(API_POINTER api, IDENTIFIER identifier, const DISPS_RECTANGLE* fetchedArea, DISPS_BUFFER* fetchedWorkBuffer); |
|
1116 |
|
1117 /* <- MEMORY MANAGING */ |
|
1118 |
|
1119 /*- Inline Functions --------------------------------------------------------*/ |
|
1120 |
|
1121 #include "display_chipset_api.inl" |
|
1122 |
|
1123 #endif /* DISPLAY_CHIPSET_API_H */ |
|
1124 |
|
1125 /* End of File */ |
|
1126 |