author | Mike Kinghan <mikek@symbian.org> |
Mon, 22 Nov 2010 14:32:00 +0000 | |
branch | GCC_SURGE |
changeset 121 | ad7caa8e9a62 |
parent 87 | cf5d4fe2473f |
permissions | -rwxr-xr-x |
0 | 1 |
// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 |
// All rights reserved. |
|
3 |
// This component and the accompanying materials are made available |
|
4 |
// under the terms of the License "Eclipse Public License v1.0" |
|
5 |
// which accompanies this distribution, and is available |
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 |
// |
|
8 |
// Initial Contributors: |
|
9 |
// Nokia Corporation - initial contribution. |
|
10 |
// |
|
11 |
// Contributors: |
|
32
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
12 |
// iwanj@users.sourceforge.net added NGA support based on Syborg display PDD |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
13 |
|
0 | 14 |
// Description: |
15 |
// omap3530/beagle_drivers/lcd/lcd.cpp |
|
16 |
// Implementation of an LCD driver. |
|
17 |
// This file is part of the Beagle Base port |
|
18 |
// N.B. This sample code assumes that the display supports setting the backlight on or off, |
|
19 |
// as well as adjusting the contrast and the brightness. |
|
20 |
// |
|
21 |
||
22 |
#include <videodriver.h> |
|
23 |
#include <platform.h> |
|
24 |
#include <nkern.h> |
|
25 |
#include <kernel.h> |
|
26 |
#include <kern_priv.h> |
|
27 |
#include <kpower.h> |
|
28 |
#include <assp/omap3530_assp/omap3530_assp_priv.h> |
|
29 |
#include <assp/omap3530_assp/omap3530_hardware_base.h> |
|
30 |
#include <assp/omap3530_assp/omap3530_prcm.h> |
|
31 |
||
32
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
32 |
//#undef __KTRACE_OPT |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
33 |
//#define __KTRACE_OPT(c,p) p |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
34 |
|
0 | 35 |
#define DSS_SYSCONFIG 0x48050010 |
36 |
#define DISPC_SYSSTATUS 0x48050414 |
|
37 |
||
38 |
#define DISPC_SYSCONFIG 0x48050410 |
|
39 |
#define DISPC_CONFIG 0x48050444 |
|
40 |
#define DISPC_DEFAULT_COLOR0 0x4805044c |
|
41 |
#define DISPC_TRANS_COLOR0 0x48050454 |
|
42 |
||
43 |
#define DISPC_TIMING_H 0x48050464 |
|
44 |
#define DISPC_TIMING_V 0x48050468 |
|
45 |
#define DISPC_POL_FREQ 0x4805046c |
|
46 |
#define DISPC_DIVISOR 0x48050470 |
|
47 |
#define DISPC_SIZE_LCD 0x4805047c |
|
48 |
||
49 |
#define DISPC_GFX_BA1 0x48050480 |
|
50 |
#define DISPC_GFX_BA2 0x48050484 |
|
51 |
#define DISPC_GFX_POSITION 0x48050488 |
|
52 |
#define DISPC_GFX_SIZE 0x4805048c |
|
53 |
#define DISPC_GFX_ATTRIBUTES 0x480504a0 |
|
54 |
||
55 |
#define DISPC_GFX_FIFO_THRESHOLD 0x480504a4 |
|
56 |
#define DISPC_GFX_FIFO_SIZE_STATUS 0x480504a8 |
|
57 |
#define DISPC_GFX_ROW_INC 0x480504ac |
|
58 |
#define DISPC_GFX_PIXEL_INC 0x480504b0 |
|
59 |
#define DISPC_GFX_WINDOW_SKIP 0x480504b4 |
|
60 |
#define DISPC_GFX_TABLE_BA 0x480504b8 |
|
61 |
||
62 |
#define DISPC_CONTROL 0x48050440 |
|
63 |
||
64 |
#define GET_REGISTER(Reg) *( (TUint *) Omap3530HwBase::TVirtual<Reg>::Value ) |
|
65 |
#define SET_REGISTER(Reg,Val) *( (TUint *) Omap3530HwBase::TVirtual<Reg>::Value ) = Val |
|
66 |
||
67 |
#define _MODE_1280x1024_ |
|
68 |
//#define _MODE_1024x768_ |
|
32
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
69 |
|
0 | 70 |
#ifdef _MODE_800x600_ |
71 |
// ModeLine "800x600@60" 40.0 800 840 968 1056 600 601 605 628 +hsync +vsync |
|
72 |
// Decoded by: http://www.tkk.fi/Misc/Electronics/faq/vga2rgb/calc.html |
|
73 |
# define PIXEL_CLK 40000 |
|
74 |
# define H_DISP 800 |
|
75 |
# define H_FPORCH 40 |
|
76 |
# define H_SYNC 128 |
|
77 |
# define H_BPORCH 88 |
|
78 |
# define H_SYNC_POL 1 |
|
79 |
# define V_DISP 600 |
|
80 |
# define V_FPORCH 1 |
|
81 |
# define V_SYNC 4 |
|
82 |
# define V_BPORCH 23 |
|
83 |
# define V_SYNC_POL 1 |
|
84 |
# define INTERLACE_ENABLE 0 |
|
85 |
#endif |
|
86 |
#ifdef _MODE_1024x768_ |
|
87 |
// ModeLine "1024x768@60" 65.0 1024 1048 1184 1344 768 771 777 806 -hsync -vsync |
|
88 |
// Decoded by: http://www.tkk.fi/Misc/Electronics/faq/vga2rgb/calc.html |
|
89 |
# define PIXEL_CLK 65000 |
|
90 |
# define H_DISP 1024 |
|
91 |
# define H_FPORCH 24 |
|
92 |
# define H_SYNC 136 |
|
93 |
# define H_BPORCH 160 |
|
94 |
# define H_SYNC_POL 0 |
|
95 |
# define V_DISP 768 |
|
96 |
# define V_FPORCH 3 |
|
97 |
# define V_SYNC 6 |
|
98 |
# define V_BPORCH 29 |
|
99 |
# define V_SYNC_POL 0 |
|
100 |
# define INTERLACE_ENABLE 0 |
|
101 |
#endif |
|
102 |
#ifdef _MODE_1280x1024_ |
|
103 |
// ModeLine "1280x1024@60" 108.0 1280 1328 1440 1688 1024 1025 1028 1066 +hsync +vsync |
|
104 |
// Decoded by: http://www.tkk.fi/Misc/Electronics/faq/vga2rgb/calc.html |
|
105 |
# define PIXEL_CLK 108000 |
|
106 |
# define H_DISP 1280 |
|
107 |
# define H_FPORCH 48 |
|
108 |
# define H_SYNC 112 |
|
109 |
# define H_BPORCH 248 |
|
110 |
# define H_SYNC_POL 1 |
|
111 |
# define V_DISP 1024 |
|
112 |
# define V_FPORCH 1 |
|
113 |
# define V_SYNC 3 |
|
114 |
# define V_BPORCH 38 |
|
115 |
# define V_SYNC_POL 1 |
|
116 |
# define INTERLACE_ENABLE 0 |
|
117 |
#endif |
|
118 |
||
119 |
||
120 |
||
121 |
// TO DO: (mandatory) |
|
122 |
// If the display supports Contrast and/or Brightness control then supply the following defines: |
|
123 |
// This is only example code... you may need to modify it for your hardware |
|
124 |
const TInt KConfigInitialDisplayContrast = 128; |
|
125 |
const TInt KConfigLcdMinDisplayContrast = 1; |
|
126 |
const TInt KConfigLcdMaxDisplayContrast = 255; |
|
127 |
const TInt KConfigInitialDisplayBrightness = 128; |
|
128 |
const TInt KConfigLcdMinDisplayBrightness = 1; |
|
129 |
const TInt KConfigLcdMaxDisplayBrightness = 255; |
|
130 |
||
131 |
// TO DO: (mandatory) |
|
132 |
// define a macro to calculate the screen buffer size |
|
133 |
// This is only example code... you may need to modify it for your hardware |
|
134 |
// aBpp is the number of bits-per-pixel, aPpl is the number of pixels per line and |
|
135 |
// aLpp number of lines per panel |
|
136 |
#define FRAME_BUFFER_SIZE(aBpp,aPpl,aLpp) (aBpp*aPpl*aLpp)/8 |
|
137 |
||
138 |
||
139 |
// TO DO: (mandatory) |
|
140 |
// define the physical screen dimensions |
|
141 |
// This is only example code... you need to modify it for your hardware |
|
142 |
const TUint KConfigLcdWidth = 360;//640; // 640 pixels per line |
|
143 |
const TUint KConfigLcdHeight = 640;//480; // 480 lines per panel |
|
144 |
||
145 |
// TO DO: (mandatory) |
|
146 |
// define the characteristics of the LCD display |
|
147 |
// This is only example code... you need to modify it for your hardware |
|
148 |
const TBool KConfigLcdIsMono = EFalse; |
|
149 |
const TBool KConfigLcdPixelOrderLandscape = ETrue; |
|
150 |
const TBool KConfigLcdPixelOrderRGB = ETrue; |
|
32
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
151 |
const TInt KConfigLcdMaxDisplayColors = 16777216;//65536; //24bit: 16777216; |
0 | 152 |
|
153 |
||
154 |
// TO DO: (mandatory) |
|
155 |
// define the display dimensions in TWIPs |
|
156 |
// A TWIP is a 20th of a point. A point is a 72nd of an inch |
|
157 |
// Therefore a TWIP is a 1440th of an inch |
|
158 |
// This is only example code... you need to modify it for your hardware |
|
21
524118fd998f
Fixes for the Keyboard mapping , serial Mouse and the LCD drivers
arunabha
parents:
0
diff
changeset
|
159 |
const TInt KConfigLcdWidthInTwips = 2670; // = 6.69 inches //15*1440; |
524118fd998f
Fixes for the Keyboard mapping , serial Mouse and the LCD drivers
arunabha
parents:
0
diff
changeset
|
160 |
const TInt KConfigLcdHeightInTwips = 3550; //5616; // = 5.11 inches //12*1440; |
0 | 161 |
|
162 |
// TO DO: (mandatory) |
|
163 |
// define the available display modes |
|
164 |
// This is only example code... you need to modify it for your hardware |
|
165 |
const TInt KConfigLcdNumberOfDisplayModes = 1; |
|
166 |
const TInt KConfigLcdInitialDisplayMode = 0; |
|
167 |
struct SLcdConfig |
|
168 |
{ |
|
169 |
TInt iMode; |
|
170 |
TInt iOffsetToFirstVideoBuffer; |
|
171 |
TInt iLenghtOfVideoBufferInBytes; |
|
172 |
TInt iOffsetBetweenLines; |
|
173 |
TBool iIsPalettized; |
|
174 |
TInt iBitsPerPixel; |
|
175 |
}; |
|
176 |
static const SLcdConfig Lcd_Mode_Config[KConfigLcdNumberOfDisplayModes]= |
|
177 |
{ |
|
178 |
{ |
|
179 |
0, // iMode |
|
180 |
0, // iOffsetToFirstVideoBuffer |
|
32
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
181 |
FRAME_BUFFER_SIZE(32/*16*/, KConfigLcdWidth, KConfigLcdHeight), // iLenghtOfVideoBufferInBytes |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
182 |
KConfigLcdWidth*4,//2, // iOffsetBetweenLines |
0 | 183 |
EFalse, // iIsPalettized |
32
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
184 |
32,//16 // iBitsPerPixel |
0 | 185 |
} |
186 |
}; |
|
187 |
||
188 |
||
189 |
||
190 |
_LIT(KLitLcd,"LCD"); |
|
191 |
||
192 |
// |
|
193 |
// TO DO: (optional) |
|
194 |
// |
|
195 |
// Add any private functions and data you require |
|
196 |
// |
|
197 |
NONSHARABLE_CLASS(DLcdPowerHandler) : public DPowerHandler |
|
198 |
{ |
|
199 |
public: |
|
200 |
DLcdPowerHandler(); |
|
201 |
||
202 |
// from DPowerHandler |
|
203 |
void PowerDown(TPowerState); |
|
204 |
void PowerUp(); |
|
205 |
||
206 |
void PowerUpDfc(); |
|
207 |
void PowerDownDfc(); |
|
208 |
||
209 |
TInt Create(); |
|
210 |
void DisplayOn(); |
|
211 |
void DisplayOff(); |
|
212 |
TInt HalFunction(TInt aFunction, TAny* a1, TAny* a2); |
|
213 |
||
214 |
void PowerUpLcd(TBool aSecure); |
|
215 |
void PowerDownLcd(); |
|
216 |
||
217 |
void ScreenInfo(TScreenInfoV01& aInfo); |
|
218 |
void WsSwitchOnScreen(); |
|
219 |
void WsSwitchOffScreen(); |
|
220 |
void HandleMsg(); |
|
221 |
void SwitchDisplay(TBool aSecure); |
|
222 |
||
223 |
void SetBacklightState(TBool aState); |
|
224 |
void BacklightOn(); |
|
225 |
void BacklightOff(); |
|
226 |
TInt SetContrast(TInt aContrast); |
|
227 |
TInt SetBrightness(TInt aBrightness); |
|
228 |
||
32
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
229 |
#ifdef ENABLE_GCE_MODE |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
230 |
void ChangeFrameBufferAddress(TUint32 aFbAddr); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
231 |
#endif |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
232 |
|
0 | 233 |
private: |
234 |
TInt SetPaletteEntry(TInt aEntry, TInt aColor); |
|
235 |
TInt GetPaletteEntry(TInt aEntry, TInt* aColor); |
|
236 |
TInt NumberOfPaletteEntries(); |
|
237 |
TInt GetCurrentDisplayModeInfo(TVideoInfoV01& aInfo, TBool aSecure); |
|
238 |
TInt GetSpecifiedDisplayModeInfo(TInt aMode, TVideoInfoV01& aInfo); |
|
239 |
TInt SetDisplayMode(TInt aMode); |
|
240 |
void SplashScreen(); |
|
241 |
TInt GetDisplayColors(TInt* aColors); |
|
242 |
||
32
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
243 |
#ifdef ENABLE_GCE_MODE |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
244 |
public: |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
245 |
static DLcdPowerHandler* pLcd; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
246 |
TInt iSize; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
247 |
TPhysAddr iCompositionPhysical; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
248 |
TVideoInfoV01 iVideoInfo; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
249 |
TDfcQue* iDfcQ; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
250 |
TPhysAddr ivRamPhys; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
251 |
#endif |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
252 |
|
0 | 253 |
private: |
254 |
TBool iIsPalettized; |
|
255 |
TBool iDisplayOn; // to prevent a race condition with WServer trying to power up/down at the same time |
|
256 |
DPlatChunkHw* iChunk; |
|
257 |
DPlatChunkHw* iSecureChunk; |
|
258 |
TBool iWsSwitchOnScreen; |
|
259 |
TBool iSecureDisplay; |
|
260 |
TMessageQue iMsgQ; |
|
261 |
TDfc iPowerUpDfc; |
|
262 |
TDfc iPowerDownDfc; |
|
32
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
263 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
264 |
#ifndef ENABLE_GCE_MODE |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
265 |
TDfcQue* iDfcQ; |
0 | 266 |
TVideoInfoV01 iVideoInfo; |
32
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
267 |
TPhysAddr ivRamPhys; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
268 |
#endif |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
269 |
|
0 | 270 |
TVideoInfoV01 iSecureVideoInfo; |
271 |
NFastMutex iLock; // protects against being preempted whilst manipulating iVideoInfo/iSecureVideoInfo |
|
272 |
TPhysAddr iSecurevRamPhys; |
|
273 |
||
274 |
TBool iBacklightOn; |
|
275 |
TInt iContrast; |
|
276 |
TInt iBrightness; |
|
277 |
}; |
|
278 |
||
279 |
||
280 |
/** |
|
281 |
HAL handler function |
|
282 |
||
283 |
@param aPtr a pointer to an instance of DLcdPowerHandler |
|
284 |
@param aFunction the function number |
|
285 |
@param a1 an arbitrary parameter |
|
286 |
@param a2 an arbitrary parameter |
|
287 |
*/ |
|
288 |
LOCAL_C TInt halFunction(TAny* aPtr, TInt aFunction, TAny* a1, TAny* a2) |
|
289 |
{ |
|
290 |
DLcdPowerHandler* pH=(DLcdPowerHandler*)aPtr; |
|
291 |
return pH->HalFunction(aFunction,a1,a2); |
|
292 |
} |
|
293 |
||
294 |
/** |
|
295 |
DFC for receiving messages from the power handler |
|
296 |
@param aPtr a pointer to an instance of DLcdPowerHandler |
|
297 |
*/ |
|
298 |
void rxMsg(TAny* aPtr) |
|
299 |
{ |
|
300 |
DLcdPowerHandler& h=*(DLcdPowerHandler*)aPtr; |
|
301 |
h.HandleMsg(); |
|
302 |
} |
|
303 |
||
304 |
/** |
|
305 |
DFC for powering up the device |
|
306 |
||
307 |
@param aPtr aPtr a pointer to an instance of DLcdPowerHandler |
|
308 |
*/ |
|
309 |
void power_up_dfc(TAny* aPtr) |
|
310 |
{ |
|
311 |
((DLcdPowerHandler*)aPtr)->PowerUpDfc(); |
|
312 |
} |
|
313 |
||
314 |
/** |
|
315 |
DFC for powering down the device |
|
316 |
||
317 |
@param aPtr aPtr a pointer to an instance of DLcdPowerHandler |
|
318 |
*/ |
|
319 |
void power_down_dfc(TAny* aPtr) |
|
320 |
{ |
|
321 |
((DLcdPowerHandler*)aPtr)->PowerDownDfc(); |
|
322 |
} |
|
323 |
||
324 |
||
325 |
/** |
|
326 |
Default constructor |
|
327 |
*/ |
|
328 |
DLcdPowerHandler::DLcdPowerHandler() : |
|
329 |
DPowerHandler(KLitLcd), |
|
330 |
iMsgQ(rxMsg,this,NULL,1), |
|
331 |
iPowerUpDfc(&power_up_dfc,this,6), |
|
332 |
iPowerDownDfc(&power_down_dfc,this,7), |
|
333 |
iBacklightOn(EFalse), |
|
334 |
iContrast(KConfigInitialDisplayContrast), |
|
335 |
iBrightness(KConfigInitialDisplayBrightness) |
|
336 |
{ |
|
337 |
} |
|
338 |
||
339 |
||
340 |
/** |
|
341 |
Second-phase constructor |
|
342 |
||
343 |
Called by factory function at ordinal 0 |
|
344 |
*/ |
|
345 |
TInt DLcdPowerHandler::Create() |
|
346 |
{ |
|
32
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
347 |
#ifdef ENABLE_GCE_MODE |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
348 |
pLcd = this; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
349 |
#endif |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
350 |
|
0 | 351 |
iDfcQ=Kern::DfcQue0(); // use low priority DFC queue for this driver |
352 |
||
353 |
// map the video RAM |
|
354 |
||
355 |
//TPhysAddr videoRamPhys; |
|
356 |
TInt vSize = Lcd_Mode_Config[KConfigLcdInitialDisplayMode].iLenghtOfVideoBufferInBytes; //KConfigLcdWidth*KConfigLcdHeight*3; //VideoRamSize(); |
|
357 |
TInt r = Epoc::AllocPhysicalRam( 2*vSize, ivRamPhys ); |
|
358 |
if ( r!=KErrNone ) |
|
359 |
{ |
|
360 |
Kern::Fault( "AllocVRam", r ); |
|
361 |
} |
|
362 |
||
363 |
//TInt vSize = ((Omap3530BoardAssp*)Arch::TheAsic())->VideoRamSize(); |
|
364 |
//ivRamPhys = TOmap3530Assp::VideoRamPhys(); // EXAMPLE ONLY: assume TOmap3530Assp interface class |
|
365 |
r = DPlatChunkHw::New(iChunk,ivRamPhys,vSize,EMapAttrUserRw|EMapAttrBufferedC); |
|
366 |
if (r != KErrNone) |
|
367 |
return r; |
|
368 |
||
369 |
//create "secure" screen immediately after normal one |
|
370 |
iSecurevRamPhys = ivRamPhys + vSize; |
|
371 |
TInt r2 = DPlatChunkHw::New(iSecureChunk,iSecurevRamPhys,vSize,EMapAttrUserRw|EMapAttrBufferedC); |
|
372 |
if (r2 != KErrNone) |
|
373 |
return r2; |
|
374 |
||
375 |
TUint* pV=(TUint*)iChunk->LinearAddress(); |
|
376 |
||
377 |
__KTRACE_OPT(KEXTENSION,Kern::Printf("DLcdPowerHandler::Create: VideoRamSize=%x, VideoRamPhys=%08x, VideoRamLin=%08x",vSize,ivRamPhys,pV)); |
|
378 |
||
379 |
// TO DO: (mandatory) |
|
380 |
// initialise the palette for the initial display mode |
|
381 |
// NOTE: the palette could either be a buffer allocated in system RAM (usually contiguous to Video buffer) |
|
382 |
// or could be offered as part of the hardware block that implemenst the lcd control |
|
383 |
// |
|
384 |
||
385 |
TUint* pV2=(TUint*)iSecureChunk->LinearAddress(); |
|
386 |
||
387 |
__KTRACE_OPT(KEXTENSION,Kern::Printf("DLcdPowerHandler::Create: Secure display VideoRamSize=%x, VideoRamPhys=%08x, VideoRamLin=%08x",vSize,iSecurevRamPhys,pV2)); |
|
388 |
||
389 |
// TO DO: (mandatory) |
|
390 |
// initialise the secure screen's palette for the initial display mode |
|
391 |
// |
|
392 |
||
393 |
// setup the video info structure, this'll be used to remember the video settings |
|
394 |
iVideoInfo.iDisplayMode = KConfigLcdInitialDisplayMode; |
|
395 |
iVideoInfo.iOffsetToFirstPixel = Lcd_Mode_Config[KConfigLcdInitialDisplayMode].iOffsetToFirstVideoBuffer; |
|
396 |
iVideoInfo.iIsPalettized = Lcd_Mode_Config[KConfigLcdInitialDisplayMode].iIsPalettized; |
|
397 |
iVideoInfo.iOffsetBetweenLines = Lcd_Mode_Config[KConfigLcdInitialDisplayMode].iOffsetBetweenLines; |
|
398 |
iVideoInfo.iBitsPerPixel = Lcd_Mode_Config[KConfigLcdInitialDisplayMode].iBitsPerPixel; |
|
399 |
||
400 |
iVideoInfo.iSizeInPixels.iWidth = KConfigLcdWidth; |
|
401 |
iVideoInfo.iSizeInPixels.iHeight = KConfigLcdHeight; |
|
402 |
iVideoInfo.iSizeInTwips.iWidth = KConfigLcdWidthInTwips; |
|
403 |
iVideoInfo.iSizeInTwips.iHeight = KConfigLcdHeightInTwips; |
|
404 |
iVideoInfo.iIsMono = KConfigLcdIsMono; |
|
405 |
iVideoInfo.iVideoAddress=(TInt)pV; |
|
406 |
iVideoInfo.iIsPixelOrderLandscape = KConfigLcdPixelOrderLandscape; |
|
407 |
iVideoInfo.iIsPixelOrderRGB = KConfigLcdPixelOrderRGB; |
|
408 |
||
409 |
iSecureVideoInfo = iVideoInfo; |
|
410 |
iSecureVideoInfo.iVideoAddress = (TInt)pV2; |
|
411 |
||
412 |
iDisplayOn = EFalse; |
|
413 |
iSecureDisplay = EFalse; |
|
414 |
||
32
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
415 |
#ifdef ENABLE_GCE_MODE |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
416 |
// Alloc Physical RAM for the Composition Buffers used by the GCE |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
417 |
iSize = Lcd_Mode_Config[KConfigLcdInitialDisplayMode].iLenghtOfVideoBufferInBytes; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
418 |
__KTRACE_OPT(KEXTENSION, Kern::Printf("DLcdPowerHandler.iSize = %d", iSize)); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
419 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
420 |
// double and round the page size |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
421 |
TUint round = 2*Kern::RoundToPageSize(iSize); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
422 |
r = Epoc::AllocPhysicalRam(round , iCompositionPhysical); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
423 |
if(r != KErrNone) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
424 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
425 |
__KTRACE_OPT(KEXTENSION, Kern::Printf("Failed to allocate physical RAM for composition buffer %d", r)); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
426 |
return r; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
427 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
428 |
#endif |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
429 |
|
0 | 430 |
// install the HAL function |
431 |
r=Kern::AddHalEntry(EHalGroupDisplay, halFunction, this); |
|
432 |
if (r!=KErrNone) |
|
433 |
return r; |
|
434 |
||
435 |
iPowerUpDfc.SetDfcQ(iDfcQ); |
|
436 |
iPowerDownDfc.SetDfcQ(iDfcQ); |
|
437 |
iMsgQ.SetDfcQ(iDfcQ); |
|
438 |
iMsgQ.Receive(); |
|
439 |
||
440 |
// install the power handler |
|
441 |
// power up the screen |
|
442 |
Add(); |
|
443 |
DisplayOn(); |
|
444 |
||
445 |
SplashScreen(); |
|
446 |
||
447 |
return KErrNone; |
|
448 |
} |
|
449 |
||
450 |
/** |
|
451 |
Turn the display on |
|
452 |
May be called as a result of a power transition or from the HAL |
|
453 |
If called from HAL, then the display may be already be on (iDisplayOn == ETrue) |
|
454 |
*/ |
|
455 |
void DLcdPowerHandler::DisplayOn() |
|
456 |
{ |
|
457 |
__KTRACE_OPT(KBOOT, Kern::Printf("DisplayOn %d", iDisplayOn)); |
|
458 |
if (!iDisplayOn) // may have been powered up already |
|
459 |
{ |
|
460 |
iDisplayOn = ETrue; |
|
461 |
PowerUpLcd(iSecureDisplay); |
|
462 |
SetContrast(iContrast); |
|
463 |
SetBrightness(iBrightness); |
|
464 |
} |
|
465 |
} |
|
466 |
||
467 |
/** |
|
468 |
Turn the display off |
|
469 |
May be called as a result of a power transition or from the HAL |
|
470 |
If called from Power Manager, then the display may be already be off (iDisplayOn == EFalse) |
|
471 |
if the platform is in silent running mode |
|
472 |
*/ |
|
473 |
void DLcdPowerHandler::DisplayOff() |
|
474 |
{ |
|
475 |
__KTRACE_OPT(KBOOT, Kern::Printf("DisplayOff %d", iDisplayOn)); |
|
476 |
if (iDisplayOn) |
|
477 |
{ |
|
478 |
iDisplayOn = EFalse; |
|
479 |
PowerDownLcd(); |
|
480 |
} |
|
481 |
} |
|
482 |
||
483 |
/** |
|
484 |
Switch between secure and non-secure displays |
|
485 |
||
486 |
@param aSecure ETrue if switching to secure display |
|
487 |
*/ |
|
488 |
void DLcdPowerHandler::SwitchDisplay(TBool aSecure) |
|
489 |
{ |
|
490 |
if (aSecure) |
|
491 |
{ |
|
492 |
if (!iSecureDisplay) |
|
493 |
{ |
|
494 |
//switch to secure display |
|
495 |
DisplayOff(); |
|
496 |
iSecureDisplay = ETrue; |
|
497 |
DisplayOn(); |
|
498 |
} |
|
499 |
} |
|
500 |
else |
|
501 |
{ |
|
502 |
if (iSecureDisplay) |
|
503 |
{ |
|
504 |
//switch from secure display |
|
505 |
DisplayOff(); |
|
506 |
iSecureDisplay = EFalse; |
|
507 |
DisplayOn(); |
|
508 |
} |
|
509 |
} |
|
510 |
} |
|
511 |
||
512 |
/** |
|
513 |
DFC to power up the display |
|
514 |
*/ |
|
515 |
void DLcdPowerHandler::PowerUpDfc() |
|
516 |
{ |
|
517 |
__KTRACE_OPT(KPOWER, Kern::Printf("PowerUpDfc")); |
|
518 |
DisplayOn(); |
|
519 |
||
520 |
PowerUpDone(); // must be called from a different thread than PowerUp() |
|
521 |
} |
|
522 |
||
523 |
/** |
|
524 |
DFC to power down the display |
|
525 |
*/ |
|
526 |
void DLcdPowerHandler::PowerDownDfc() |
|
527 |
{ |
|
528 |
__KTRACE_OPT(KPOWER, Kern::Printf("PowerDownDfc")); |
|
529 |
DisplayOff(); |
|
530 |
PowerDownDone(); // must be called from a different thread than PowerUp() |
|
531 |
} |
|
532 |
||
533 |
/** |
|
534 |
Schedule the power-down DFC |
|
535 |
*/ |
|
536 |
void DLcdPowerHandler::PowerDown(TPowerState) |
|
537 |
{ |
|
538 |
iPowerDownDfc.Enque(); // schedules DFC to execute on this driver's thread |
|
539 |
} |
|
540 |
||
541 |
/** |
|
542 |
Schedule the power-up DFC |
|
543 |
*/ |
|
544 |
void DLcdPowerHandler::PowerUp() |
|
545 |
{ |
|
546 |
iPowerUpDfc.Enque(); // schedules DFC to execute on this driver's thread |
|
547 |
} |
|
548 |
||
549 |
/** |
|
550 |
Power up the display |
|
551 |
||
552 |
@param aSecure ETrue if powering up the secure display |
|
553 |
*/ |
|
554 |
void DLcdPowerHandler::PowerUpLcd(TBool aSecure) |
|
555 |
{ |
|
556 |
||
557 |
TUint32 l = 0x0; |
|
558 |
||
559 |
// Set up the Display Subsystem to control a DVI monitor |
|
560 |
||
561 |
// The following four lines need to be replaced by a call to the GPIO driver which should call the PowerClock driver |
|
562 |
// PowerClock::GpioActive(0, PowerClock::E1s, PowerClock::ECpu10, PowerClock::EBus10); |
|
563 |
// PowerClock::GpioAccess(0, PowerClock::EAuto); |
|
564 |
Prcm::SetClockState( Prcm::EClkGpio1_F, Prcm::EClkOn ); |
|
565 |
Prcm::SetClockState( Prcm::EClkGpio1_I, Prcm::EClkAuto ); |
|
566 |
*( (TUint *) Omap3530HwBase::TVirtual<0x48310034>::Value ) = 0xfefffedf; //GPIO1 output enable p3336 |
|
567 |
*( (TUint *) Omap3530HwBase::TVirtual<0x48310094>::Value ) = 0x01000120; //GPIO1 set data out p3336 |
|
568 |
// const TUint KCM_CLKSEL_DSS = Omap3530HwBase::TVirtual<0x48004E40>::Value; |
|
569 |
// Prcm::Set(KCM_CLKSEL_DSS, 0xffffffffu, 0x00001006); |
|
570 |
||
571 |
Prcm::SetDivider( Prcm::EClkDss1_F, 2 ); |
|
572 |
Prcm::SetDivider( Prcm::EClkTv_F, 1 ); |
|
573 |
||
574 |
||
575 |
SET_REGISTER( DSS_SYSCONFIG, 0x00000010 ); // Display Subsystem reset |
|
576 |
while ( !( GET_REGISTER( DISPC_SYSSTATUS ) & 1 ) ); // Spin until reset complete |
|
577 |
||
578 |
TInt8 MIDLEMODE = 0x2; // Smart Standby. MStandby is asserted based on the internal activity of the module. |
|
579 |
TInt8 CLOCKACTIVITY = 0x0; // interface and functional clocks can be switched off. |
|
580 |
TInt8 SIDLEMODE = 0x2; // Smart idle. Idle request is acknowledged based on the internal activity of the module |
|
581 |
TInt8 ENWAKEUP = 0x1; // Wakeup is enabled. |
|
582 |
TInt8 SOFTRESET = 0x0; // Normal mode |
|
583 |
TInt8 AUTOIDLE = 0x1; // Automatic L3 and L4 interface clock gating strategy is applied based on interface activity |
|
584 |
l = MIDLEMODE<<12 | CLOCKACTIVITY<<8 | SIDLEMODE<<3 | ENWAKEUP<<2 | SOFTRESET<<1 | AUTOIDLE; |
|
585 |
SET_REGISTER( DISPC_SYSCONFIG, l ); |
|
586 |
||
587 |
TInt8 LOADMOAD = 0x2; //Frame data only loaded every frame |
|
588 |
l = LOADMOAD<<1; |
|
589 |
SET_REGISTER( DISPC_CONFIG, l ); |
|
590 |
||
591 |
SET_REGISTER( DISPC_DEFAULT_COLOR0, 0xFFFFFFFF ); |
|
592 |
SET_REGISTER( DISPC_TRANS_COLOR0, 0x00000000 ); |
|
593 |
||
594 |
TUint8 hbp = H_BPORCH - 1; // Horizontal Back Porch |
|
595 |
TUint8 hfp = H_FPORCH - 1; // Horizontal front porch |
|
596 |
TUint8 hsw = H_SYNC - 1; // Horizontal synchronization pulse width |
|
597 |
if ( hsw > 63 ) |
|
598 |
{ |
|
599 |
hsw = 63; |
|
600 |
Kern::Printf("[LCD] H_SYNC too big"); |
|
601 |
} |
|
602 |
l = hbp<<20 | hfp<<8 | hsw; |
|
603 |
SET_REGISTER( DISPC_TIMING_H, l ); |
|
604 |
||
605 |
TUint8 vbp = V_BPORCH; // Vertical back porch |
|
606 |
TUint8 vfp = V_FPORCH; // Vertical front porch |
|
607 |
TUint8 vsw = V_SYNC; // Vertical synchronization pulse width |
|
608 |
__ASSERT_ALWAYS( vbp<=255, Kern::Fault("LCD", 1) ); |
|
609 |
__ASSERT_ALWAYS( vfp<=255, Kern::Fault("LCD", 1) ); |
|
610 |
__ASSERT_ALWAYS( vsw>=1 && vsw<=255, Kern::Fault("LCD", 1) ); |
|
611 |
l = vbp<<20 | vfp<<8 | vsw; |
|
612 |
SET_REGISTER( DISPC_TIMING_V, l ); |
|
613 |
||
614 |
TUint8 onoff= 0; |
|
615 |
TUint8 rf = 0; |
|
616 |
TUint8 ieo = 0; |
|
617 |
TUint8 ipc = 1; // Invert Pixel Clock |
|
618 |
TUint8 ihs = H_SYNC_POL ? 0 : 1; // Invert HSYNC (0: Positive Sync polarity, 1: Negative Sync polarity) |
|
619 |
TUint8 ivs = V_SYNC_POL ? 0 : 1; // Invert VSYNC (0: Positive Sync polarity, 1: Negative Sync polarity) |
|
620 |
TUint8 acbi = 0; |
|
621 |
TUint16 acb = 0x28; // AC-bias pin frequency |
|
622 |
l = onoff<<17 | rf<<16 | ieo<<15 | ipc<<14 | ihs<<13 | ivs<<12 | acbi<<8 | acb; |
|
623 |
SET_REGISTER( DISPC_POL_FREQ, l ); |
|
624 |
||
625 |
TUint8 lcd = 1; // Display Controller Logic Clock Divisor |
|
626 |
TUint8 pcd = ( 432000 + (PIXEL_CLK - 1) ) / PIXEL_CLK; // Pixel Clock Divisor - add (PIXEL_CLK - 1) to avoid rounding error |
|
627 |
__ASSERT_ALWAYS( lcd>=1 && lcd<=255, Kern::Fault("LCD", 1) ); |
|
628 |
__ASSERT_ALWAYS( pcd>=2 && pcd<=255, Kern::Fault("LCD", 1) ); |
|
629 |
l = lcd<<16 | pcd; |
|
630 |
SET_REGISTER( DISPC_DIVISOR, l ); |
|
631 |
||
632 |
TUint16 ppl = H_DISP - 1; // Pixels per line |
|
633 |
TUint16 llp = V_DISP - 1; // Lines per panel |
|
634 |
__ASSERT_ALWAYS( ppl>=1 && ppl<=2048, Kern::Fault("LCD", 1) ); |
|
635 |
__ASSERT_ALWAYS( llp>=1 && llp<=2048, Kern::Fault("LCD", 1) ); |
|
636 |
l = llp<<16 | ppl; |
|
637 |
SET_REGISTER( DISPC_SIZE_LCD, l ); |
|
638 |
||
639 |
||
640 |
// Setup a graphics region (GFX) |
|
641 |
||
642 |
// Set GFX frame buffer |
|
643 |
SET_REGISTER( DISPC_GFX_BA1, ivRamPhys ); |
|
644 |
||
645 |
// Center the GFX |
|
646 |
TInt16 gfxposy = ( V_DISP - KConfigLcdHeight ) / 2; |
|
647 |
TInt16 gfxposx = ( H_DISP - KConfigLcdWidth ) / 2; |
|
648 |
l = ( gfxposy << 16 ) | gfxposx; |
|
649 |
SET_REGISTER( DISPC_GFX_POSITION, l ); |
|
650 |
||
651 |
// Set the GFX dimensions |
|
652 |
TInt16 gfxsizey = KConfigLcdHeight - 1; |
|
653 |
TInt16 gfxsizex = KConfigLcdWidth - 1; |
|
654 |
l = gfxsizey<<16 | gfxsizex; |
|
655 |
SET_REGISTER( DISPC_GFX_SIZE, l ); |
|
656 |
||
657 |
TInt8 GFXSELFREFRESH = 0x0; |
|
658 |
TInt8 GFXARBITRATION = 0x0; |
|
659 |
TInt8 GFXROTATION = 0x0; |
|
660 |
TInt8 GFXFIFOPRELOAD = 0x0; |
|
661 |
TInt8 GFXENDIANNESS = 0x0; |
|
662 |
TInt8 GFXNIBBLEMODE = 0x0; |
|
663 |
TInt8 GFXCHANNELOUT = 0x0; |
|
664 |
TInt8 GFXBURSTSIZE = 0x2; // 16x32bit bursts |
|
665 |
TInt8 GFXREPLICATIONENABLE = 0x0; // Disable Graphics replication logic |
|
32
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
666 |
TInt8 GFXFORMAT = 0x8;//0x6; // RGB16=0x6, RGB24-unpacked=0x8, RGB24-packed=0x9 |
0 | 667 |
TInt8 GFXENABLE = 0x1; // Graphics enabled |
668 |
l = GFXSELFREFRESH<<15 | GFXARBITRATION<<14 | GFXROTATION<<12 | GFXFIFOPRELOAD<<11 | GFXENDIANNESS<<10 | GFXNIBBLEMODE<<9 | GFXCHANNELOUT<8 | GFXBURSTSIZE<<6 | GFXREPLICATIONENABLE<<5 | GFXFORMAT<<1 | GFXENABLE; |
|
669 |
SET_REGISTER( DISPC_GFX_ATTRIBUTES, l ); |
|
670 |
||
671 |
TInt16 GFXFIFOHIGHTHRESHOLD = 0x3fc; // Graphics FIFO High Threshold |
|
672 |
TInt16 GFXFIFOLOWTHRESHOLD = 0x3BC; // Graphics FIFO Low Threshold |
|
673 |
l = GFXFIFOHIGHTHRESHOLD<<16 | GFXFIFOLOWTHRESHOLD; |
|
674 |
SET_REGISTER(DISPC_GFX_FIFO_THRESHOLD, l); |
|
675 |
||
676 |
TInt16 GFXFIFOSIZE = 0x400; // Number of bytes defining the FIFO value |
|
677 |
l = GFXFIFOSIZE; |
|
678 |
SET_REGISTER(DISPC_GFX_FIFO_SIZE_STATUS, l); |
|
679 |
||
680 |
TInt32 GFXROWINC = 0x1; |
|
681 |
l = GFXROWINC; |
|
682 |
SET_REGISTER(DISPC_GFX_ROW_INC, l); |
|
683 |
||
684 |
TInt16 GFXPIXELINC = 0x1; |
|
685 |
l = GFXPIXELINC; |
|
686 |
SET_REGISTER(DISPC_GFX_PIXEL_INC, l); |
|
687 |
||
688 |
TInt32 GFXWINDOWSKIP = 0x0; |
|
689 |
l = GFXWINDOWSKIP; |
|
690 |
SET_REGISTER(DISPC_GFX_WINDOW_SKIP, l); |
|
691 |
||
692 |
// TO DO: Sort out the Gamma table + pallets |
|
693 |
TInt32 GFXTABLEBA = 0x807ff000; |
|
694 |
l = GFXTABLEBA; |
|
695 |
SET_REGISTER(DISPC_GFX_TABLE_BA, l); |
|
696 |
||
697 |
||
698 |
// Propigate all the shadowed registers |
|
699 |
||
700 |
TInt8 SPATIALTEMPORALDITHERINGFRAMES = 0; |
|
701 |
TInt8 LCDENABLEPOL = 0; |
|
702 |
TInt8 LCDENABLESIGNAL = 0; |
|
703 |
TInt8 PCKFREEENABLE = 0; |
|
704 |
TInt8 TDMUNUSEDBITS = 0; |
|
705 |
TInt8 TDMCYCLEFORMAT = 0; |
|
706 |
TInt8 TDMPARALLELMODE = 0; |
|
707 |
TInt8 TDMENABLE = 0; |
|
708 |
TInt8 HT = 0; |
|
709 |
TInt8 GPOUT1 = 1; |
|
710 |
TInt8 GPOUT0 = 1; |
|
711 |
TInt8 GPIN1 = 0; |
|
712 |
TInt8 GPIN0 = 0; |
|
713 |
TInt8 OVERLAYOPTIMIZATION = 0; |
|
714 |
TInt8 RFBIMODE = 0; |
|
715 |
TInt8 SECURE = 0; |
|
716 |
TInt8 TFTDATALINES = 0x3; |
|
717 |
TInt8 STDITHERENABLE = 0; |
|
718 |
TInt8 GODIGITAL = 1; |
|
719 |
TInt8 GOLCD = 1; |
|
720 |
TInt8 M8B = 0; |
|
721 |
TInt8 STNTFT = 1; |
|
722 |
TInt8 MONOCOLOR = 0; |
|
723 |
TInt8 DIGITALENABLE = 1; |
|
724 |
TInt8 LCDENABLE = 1; |
|
725 |
l = SPATIALTEMPORALDITHERINGFRAMES<<30 | LCDENABLEPOL<<29 | LCDENABLESIGNAL<<28 | PCKFREEENABLE<<27 | |
|
726 |
TDMUNUSEDBITS<<25 | TDMCYCLEFORMAT<<23 | TDMPARALLELMODE<<21 | TDMENABLE<<20 | HT<<17 | GPOUT1<<16 | |
|
727 |
GPOUT0<<15 | GPIN1<<14 | GPIN0<<13 | OVERLAYOPTIMIZATION<<12 | RFBIMODE<<11 | SECURE<<10 | |
|
728 |
TFTDATALINES<<8 | STDITHERENABLE<<7 | GODIGITAL<<6 | GOLCD<<5 | M8B<<4 | STNTFT<<3 | |
|
729 |
MONOCOLOR<<2 | DIGITALENABLE<<1 | LCDENABLE; |
|
730 |
NKern::Sleep(1); |
|
731 |
SET_REGISTER(DISPC_CONTROL, l); |
|
732 |
NKern::Sleep(1); |
|
733 |
||
734 |
} |
|
735 |
||
736 |
||
737 |
/** |
|
738 |
Power down the display and the backlight |
|
739 |
*/ |
|
740 |
void DLcdPowerHandler::PowerDownLcd() |
|
741 |
{ |
|
742 |
SetBacklightState(EFalse); |
|
743 |
||
744 |
// TO DO: (mandatory) |
|
745 |
// Power down the display & disable LCD DMA. |
|
746 |
// May need to wait until the current frame has been output |
|
747 |
// |
|
748 |
||
749 |
SET_REGISTER(DISPC_CONTROL, 0); |
|
750 |
||
751 |
} |
|
752 |
||
753 |
/** |
|
754 |
Set the Lcd contrast |
|
755 |
||
756 |
@param aValue the contrast setting |
|
757 |
*/ |
|
758 |
TInt DLcdPowerHandler::SetContrast(TInt aValue) |
|
759 |
{ |
|
760 |
__KTRACE_OPT(KEXTENSION,Kern::Printf("SetContrast(%d)", aValue)); |
|
761 |
||
762 |
if (aValue >= KConfigLcdMinDisplayContrast && aValue <= KConfigLcdMaxDisplayContrast) |
|
763 |
{ |
|
764 |
iContrast=aValue; |
|
765 |
||
766 |
// TO DO: (mandatory) |
|
767 |
// set the contrast |
|
768 |
// |
|
769 |
return KErrNone; |
|
770 |
} |
|
771 |
||
772 |
return KErrArgument; |
|
773 |
} |
|
774 |
||
775 |
/** |
|
776 |
Set the Lcd brightness |
|
777 |
||
778 |
@param aValue the brightness setting |
|
779 |
*/ |
|
780 |
TInt DLcdPowerHandler::SetBrightness(TInt aValue) |
|
781 |
{ |
|
782 |
__KTRACE_OPT(KEXTENSION,Kern::Printf("SetBrightness(%d)", aValue)); |
|
783 |
||
784 |
if (aValue >= KConfigLcdMinDisplayBrightness && aValue <= KConfigLcdMaxDisplayBrightness) |
|
785 |
{ |
|
786 |
iBrightness=aValue; |
|
787 |
||
788 |
// TO DO: (mandatory) |
|
789 |
// set the brightness |
|
790 |
// |
|
791 |
return KErrNone; |
|
792 |
} |
|
793 |
return KErrArgument; |
|
794 |
} |
|
795 |
||
796 |
/** |
|
797 |
Turn the backlight on |
|
798 |
*/ |
|
799 |
void DLcdPowerHandler::BacklightOn() |
|
800 |
{ |
|
801 |
// TO DO: (mandatory) |
|
802 |
// turn the backlight on |
|
803 |
// |
|
804 |
} |
|
805 |
||
806 |
/** |
|
807 |
Turn the backlight off |
|
808 |
*/ |
|
809 |
void DLcdPowerHandler::BacklightOff() |
|
810 |
{ |
|
811 |
// TO DO: (mandatory) |
|
812 |
// turn the backlight off |
|
813 |
// |
|
814 |
} |
|
815 |
||
816 |
/** |
|
817 |
Set the state of the backlight |
|
818 |
||
819 |
@param aState ETrue if setting the backlight on |
|
820 |
*/ |
|
821 |
void DLcdPowerHandler::SetBacklightState(TBool aState) |
|
822 |
{ |
|
823 |
iBacklightOn=aState; |
|
824 |
if (iBacklightOn) |
|
825 |
BacklightOn(); |
|
826 |
else |
|
827 |
BacklightOff(); |
|
828 |
} |
|
829 |
||
830 |
void DLcdPowerHandler::ScreenInfo(TScreenInfoV01& anInfo) |
|
831 |
{ |
|
832 |
__KTRACE_OPT(KEXTENSION,Kern::Printf("DLcdPowerHandler::ScreenInfo")); |
|
833 |
anInfo.iWindowHandleValid=EFalse; |
|
834 |
anInfo.iWindowHandle=NULL; |
|
835 |
anInfo.iScreenAddressValid=ETrue; |
|
836 |
anInfo.iScreenAddress=(TAny *)(iChunk->LinearAddress()); |
|
837 |
anInfo.iScreenSize.iWidth=KConfigLcdWidth; |
|
838 |
anInfo.iScreenSize.iHeight=KConfigLcdHeight; |
|
839 |
} |
|
840 |
||
841 |
/** |
|
842 |
Handle a message from the power handler |
|
843 |
*/ |
|
844 |
void DLcdPowerHandler::HandleMsg(void) |
|
845 |
{ |
|
846 |
||
847 |
TMessageBase* msg = iMsgQ.iMessage; |
|
848 |
if (msg == NULL) |
|
849 |
return; |
|
850 |
||
851 |
if (msg->iValue) |
|
852 |
DisplayOn(); |
|
853 |
else |
|
854 |
DisplayOff(); |
|
855 |
msg->Complete(KErrNone,ETrue); |
|
856 |
} |
|
857 |
||
858 |
/** |
|
859 |
Send a message to the power-handler message queue to turn the display on |
|
860 |
*/ |
|
861 |
void DLcdPowerHandler::WsSwitchOnScreen() |
|
862 |
{ |
|
863 |
TThreadMessage& m=Kern::Message(); |
|
864 |
m.iValue = ETrue; |
|
865 |
m.SendReceive(&iMsgQ); // send a message and block Client thread until keyboard has been powered up |
|
866 |
} |
|
867 |
||
868 |
/** |
|
869 |
Send a message to the power-handler message queue to turn the display off |
|
870 |
*/ |
|
871 |
void DLcdPowerHandler::WsSwitchOffScreen() |
|
872 |
{ |
|
873 |
TThreadMessage& m=Kern::Message(); |
|
874 |
m.iValue = EFalse; |
|
875 |
m.SendReceive(&iMsgQ); // send a message and block Client thread until keyboard has been powered down |
|
876 |
} |
|
877 |
||
878 |
/** |
|
879 |
Return information about the current display mode |
|
880 |
||
881 |
@param aInfo a structure supplied by the caller to be filled by this function. |
|
882 |
@param aSecure ETrue if requesting information about the secure display |
|
883 |
@return KErrNone if successful |
|
884 |
*/ |
|
885 |
TInt DLcdPowerHandler::GetCurrentDisplayModeInfo(TVideoInfoV01& aInfo, TBool aSecure) |
|
886 |
{ |
|
887 |
__KTRACE_OPT(KEXTENSION,Kern::Printf("GetCurrentDisplayModeInfo")); |
|
888 |
NKern::FMWait(&iLock); |
|
889 |
if (aSecure) |
|
890 |
aInfo = iSecureVideoInfo; |
|
891 |
else |
|
892 |
aInfo = iVideoInfo; |
|
893 |
NKern::FMSignal(&iLock); |
|
894 |
return KErrNone; |
|
895 |
} |
|
896 |
||
897 |
/** |
|
898 |
Return information about the specified display mode |
|
899 |
||
900 |
@param aMode the display mode to query |
|
901 |
@param aInfo a structure supplied by the caller to be filled by this function. |
|
902 |
@return KErrNone if successful |
|
903 |
*/ |
|
904 |
TInt DLcdPowerHandler::GetSpecifiedDisplayModeInfo(TInt aMode, TVideoInfoV01& aInfo) |
|
905 |
{ |
|
906 |
__KTRACE_OPT(KEXTENSION,Kern::Printf("GetSpecifiedDisplayModeInfo mode is %d",aMode)); |
|
907 |
||
908 |
if (aMode < 0 || aMode >= KConfigLcdNumberOfDisplayModes) |
|
909 |
return KErrArgument; |
|
910 |
||
911 |
NKern::FMWait(&iLock); |
|
912 |
aInfo = iVideoInfo; |
|
913 |
NKern::FMSignal(&iLock); |
|
914 |
||
915 |
if (aMode != aInfo.iDisplayMode) |
|
916 |
{ |
|
917 |
aInfo.iOffsetToFirstPixel=Lcd_Mode_Config[aMode].iOffsetToFirstVideoBuffer; |
|
918 |
aInfo.iIsPalettized = Lcd_Mode_Config[aMode].iIsPalettized; |
|
919 |
aInfo.iOffsetBetweenLines=Lcd_Mode_Config[aMode].iOffsetBetweenLines; |
|
920 |
aInfo.iBitsPerPixel = Lcd_Mode_Config[aMode].iBitsPerPixel; |
|
921 |
} |
|
922 |
return KErrNone; |
|
923 |
} |
|
924 |
||
925 |
/** |
|
926 |
Set the display mode |
|
927 |
||
928 |
@param aMode the display mode to set |
|
929 |
*/ |
|
930 |
TInt DLcdPowerHandler::SetDisplayMode(TInt aMode) |
|
931 |
{ |
|
932 |
||
933 |
__KTRACE_OPT(KEXTENSION,Kern::Printf("SetDisplayMode = %d", aMode)); |
|
934 |
||
935 |
if (aMode < 0 || aMode >= KConfigLcdNumberOfDisplayModes) |
|
936 |
return KErrArgument; |
|
937 |
||
938 |
NKern::FMWait(&iLock); |
|
939 |
||
940 |
// store the current mode |
|
941 |
iVideoInfo.iDisplayMode = aMode; |
|
942 |
iVideoInfo.iOffsetToFirstPixel = Lcd_Mode_Config[aMode].iOffsetToFirstVideoBuffer; |
|
943 |
iVideoInfo.iIsPalettized = Lcd_Mode_Config[aMode].iIsPalettized; |
|
944 |
iVideoInfo.iOffsetBetweenLines = Lcd_Mode_Config[aMode].iOffsetBetweenLines; |
|
945 |
iVideoInfo.iBitsPerPixel = Lcd_Mode_Config[aMode].iBitsPerPixel; |
|
946 |
||
947 |
// store the current mode for secure screen |
|
948 |
iSecureVideoInfo.iDisplayMode = aMode; |
|
949 |
iSecureVideoInfo.iOffsetToFirstPixel = Lcd_Mode_Config[aMode].iOffsetToFirstVideoBuffer; |
|
950 |
iSecureVideoInfo.iIsPalettized = Lcd_Mode_Config[aMode].iIsPalettized; |
|
951 |
iSecureVideoInfo.iOffsetBetweenLines = Lcd_Mode_Config[aMode].iOffsetBetweenLines; |
|
952 |
iSecureVideoInfo.iBitsPerPixel = Lcd_Mode_Config[aMode].iBitsPerPixel; |
|
953 |
||
954 |
// TO DO: (mandatory) |
|
955 |
// set bits per pixel on hardware |
|
956 |
// May need to reconfigure DMA if video buffer size and location have changed |
|
957 |
// |
|
958 |
NKern::FMSignal(&iLock); |
|
959 |
||
960 |
__KTRACE_OPT(KEXTENSION,Kern::Printf("SetDisplayMode mode = %d, otfp = %d, palettized = %d, bpp = %d, obl = %d", |
|
961 |
aMode, iVideoInfo.iOffsetToFirstPixel, iVideoInfo.iIsPalettized, iVideoInfo.iBitsPerPixel, iVideoInfo.iOffsetBetweenLines)); |
|
962 |
||
963 |
return KErrNone; |
|
964 |
} |
|
965 |
||
966 |
/** |
|
967 |
Fill the video memory with an initial pattern or image |
|
968 |
This will be displayed on boot-up |
|
969 |
*/ |
|
970 |
void DLcdPowerHandler::SplashScreen() |
|
971 |
{ |
|
972 |
// TO DO: (optional) |
|
973 |
// replace the example code below to display a different spash screen |
|
974 |
||
975 |
__KTRACE_OPT(KEXTENSION,Kern::Printf("Splash SCreen +")); |
|
976 |
TUint* pV=(TUint*)(iVideoInfo.iVideoAddress + iVideoInfo.iOffsetToFirstPixel); |
|
977 |
__KTRACE_OPT(KEXTENSION,Kern::Printf("Splash SCreen FB @ %x",pV)); |
|
978 |
||
979 |
//Fill the framebuffer with bars |
|
980 |
||
981 |
for (TInt y = 0; y<KConfigLcdHeight; ++y) |
|
982 |
{ |
|
983 |
for(TInt x = 0; x<KConfigLcdHeight; ++x) |
|
984 |
{ |
|
985 |
TUint8 r = 0x00; |
|
986 |
TUint8 g = 0x00; |
|
987 |
TUint8 b = 0x00; |
|
988 |
TUint16 rgb = ((r&0xf8) << 8) | ((g&0xfc) << 3) | ((b&0xf8) >> 3); |
|
989 |
||
990 |
TUint16* px = reinterpret_cast<TUint16*>(pV) + y*KConfigLcdWidth + x; |
|
991 |
*px = rgb; |
|
992 |
} |
|
993 |
} |
|
994 |
||
995 |
__KTRACE_OPT(KEXTENSION,Kern::Printf("Splash SCreen -")); |
|
996 |
} |
|
997 |
||
998 |
||
999 |
/** |
|
1000 |
Get the size of the pallete |
|
1001 |
||
1002 |
@return the number of pallete entries |
|
1003 |
*/ |
|
1004 |
TInt DLcdPowerHandler::NumberOfPaletteEntries() //only call when holding mutex |
|
1005 |
{ |
|
1006 |
// TO DO: (mandatory) |
|
1007 |
// Calculate the number of Palette entries - this is normally |
|
1008 |
// calculated from the bits per-pixel. |
|
1009 |
// This is only example code... you may need to modify it for your hardware |
|
1010 |
// |
|
1011 |
TInt num = iVideoInfo.iIsPalettized ? 1<<iVideoInfo.iBitsPerPixel : 0; |
|
1012 |
||
1013 |
__KTRACE_OPT(KEXTENSION,Kern::Printf("NumberOfPaletteEntries = %d", num)); |
|
1014 |
||
1015 |
return num; |
|
1016 |
} |
|
1017 |
||
1018 |
||
1019 |
/** |
|
1020 |
Retrieve the palette entry at a particular offset |
|
1021 |
||
1022 |
@param aEntry the palette index |
|
1023 |
@param aColor a caller-supplied pointer to a location where the returned RGB color is to be stored |
|
1024 |
@return KErrNone if successful |
|
1025 |
KErrNotSupported if the current vide mode does not support a palette |
|
1026 |
KErrArgument if aEntry is out of range |
|
1027 |
*/ |
|
1028 |
TInt DLcdPowerHandler::GetPaletteEntry(TInt aEntry, TInt* aColor) |
|
1029 |
{ |
|
1030 |
NKern::FMWait(&iLock); |
|
1031 |
if (!iVideoInfo.iIsPalettized) |
|
1032 |
{ |
|
1033 |
NKern::FMSignal(&iLock); |
|
1034 |
return KErrNotSupported; |
|
1035 |
} |
|
1036 |
||
1037 |
if ((aEntry < 0) || (aEntry >= NumberOfPaletteEntries())) |
|
1038 |
{ |
|
1039 |
NKern::FMSignal(&iLock); |
|
1040 |
return KErrArgument; |
|
1041 |
} |
|
1042 |
||
1043 |
// TO DO: (mandatory) |
|
1044 |
// read the RGB value of the palette entry into aColor |
|
1045 |
// NOTE: the palette could either be a buffer allocated in system RAM (usually contiguous to Video buffer) |
|
1046 |
// or could be offered as part of the hardware block that implemenst the lcd control |
|
1047 |
// |
|
1048 |
NKern::FMSignal(&iLock); |
|
1049 |
||
1050 |
__KTRACE_OPT(KEXTENSION,Kern::Printf("GetPaletteEntry %d color 0x%x", aEntry, aColor)); |
|
1051 |
||
1052 |
return KErrNone; |
|
1053 |
} |
|
1054 |
||
1055 |
/** |
|
1056 |
Set the palette entry at a particular offset |
|
1057 |
||
1058 |
@param aEntry the palette index |
|
1059 |
@param aColor the RGB color to store |
|
1060 |
@return KErrNone if successful |
|
1061 |
KErrNotSupported if the current vide mode does not support a palette |
|
1062 |
KErrArgument if aEntry is out of range |
|
1063 |
*/ |
|
1064 |
TInt DLcdPowerHandler::SetPaletteEntry(TInt aEntry, TInt aColor) |
|
1065 |
{ |
|
1066 |
||
1067 |
NKern::FMWait(&iLock); |
|
1068 |
if (!iVideoInfo.iIsPalettized) |
|
1069 |
{ |
|
1070 |
NKern::FMSignal(&iLock); |
|
1071 |
return KErrNotSupported; |
|
1072 |
} |
|
1073 |
||
1074 |
if ((aEntry < 0) || (aEntry >= NumberOfPaletteEntries())) //check entry in range |
|
1075 |
{ |
|
1076 |
NKern::FMSignal(&iLock); |
|
1077 |
return KErrArgument; |
|
1078 |
} |
|
1079 |
||
1080 |
// TO DO: (mandatory) |
|
1081 |
// update the palette entry for the secure and non-secure screen |
|
1082 |
// NOTE: the palette could either be a buffer allocated in system RAM (usually contiguous to Video buffer) |
|
1083 |
// or could be offered as part of the hardware block that implemenst the lcd control |
|
1084 |
// |
|
1085 |
__KTRACE_OPT(KEXTENSION,Kern::Printf("SetPaletteEntry %d to 0x%x", aEntry, aColor )); |
|
1086 |
||
1087 |
return KErrNone; |
|
1088 |
} |
|
1089 |
||
1090 |
/** |
|
1091 |
a HAL entry handling function for HAL group attribute EHalGroupDisplay |
|
1092 |
||
1093 |
@param a1 an arbitrary argument |
|
1094 |
@param a2 an arbitrary argument |
|
1095 |
@return KErrNone if successful |
|
1096 |
*/ |
|
1097 |
TInt DLcdPowerHandler::HalFunction(TInt aFunction, TAny* a1, TAny* a2) |
|
1098 |
{ |
|
1099 |
TInt r=KErrNone; |
|
1100 |
switch(aFunction) |
|
1101 |
{ |
|
1102 |
case EDisplayHalScreenInfo: |
|
1103 |
{ |
|
1104 |
TPckgBuf<TScreenInfoV01> vPckg; |
|
1105 |
ScreenInfo(vPckg()); |
|
1106 |
Kern::InfoCopy(*(TDes8*)a1,vPckg); |
|
1107 |
break; |
|
1108 |
} |
|
1109 |
||
1110 |
case EDisplayHalWsRegisterSwitchOnScreenHandling: |
|
1111 |
iWsSwitchOnScreen=(TBool)a1; |
|
1112 |
break; |
|
1113 |
||
1114 |
case EDisplayHalWsSwitchOnScreen: |
|
1115 |
WsSwitchOnScreen(); |
|
1116 |
break; |
|
1117 |
||
1118 |
case EDisplayHalMaxDisplayContrast: |
|
1119 |
{ |
|
1120 |
TInt mc=KConfigLcdMaxDisplayContrast; |
|
1121 |
kumemput32(a1,&mc,sizeof(mc)); |
|
1122 |
break; |
|
1123 |
} |
|
1124 |
case EDisplayHalSetDisplayContrast: |
|
1125 |
__KTRACE_OPT(KEXTENSION,Kern::Printf("EDisplayHalSetDisplayContrast")); |
|
1126 |
if(!Kern::CurrentThreadHasCapability(ECapabilityWriteDeviceData,__PLATSEC_DIAGNOSTIC_STRING("Checked by Hal function EDisplayHalSetDisplayContrast"))) |
|
1127 |
return KErrPermissionDenied; |
|
1128 |
r=SetContrast(TInt(a1)); |
|
1129 |
break; |
|
1130 |
||
1131 |
case EDisplayHalDisplayContrast: |
|
1132 |
kumemput32(a1,&iContrast,sizeof(iContrast)); |
|
1133 |
break; |
|
1134 |
||
1135 |
case EDisplayHalMaxDisplayBrightness: |
|
1136 |
{ |
|
1137 |
TInt mc=KConfigLcdMaxDisplayBrightness; |
|
1138 |
kumemput32(a1,&mc,sizeof(mc)); |
|
1139 |
break; |
|
1140 |
} |
|
1141 |
||
1142 |
case EDisplayHalSetDisplayBrightness: |
|
1143 |
__KTRACE_OPT(KEXTENSION,Kern::Printf("EDisplayHalSetDisplayBrightness")); |
|
1144 |
if(!Kern::CurrentThreadHasCapability(ECapabilityWriteDeviceData,__PLATSEC_DIAGNOSTIC_STRING("Checked by Hal function EDisplayHalSetDisplayBrightness"))) |
|
1145 |
return KErrPermissionDenied; |
|
1146 |
r=SetBrightness(TInt(a1)); |
|
1147 |
break; |
|
1148 |
||
1149 |
case EDisplayHalDisplayBrightness: |
|
1150 |
kumemput32(a1,&iBrightness,sizeof(iBrightness)); |
|
1151 |
break; |
|
1152 |
||
1153 |
case EDisplayHalSetBacklightOn: |
|
1154 |
if(!Kern::CurrentThreadHasCapability(ECapabilityWriteDeviceData,__PLATSEC_DIAGNOSTIC_STRING("Checked by Hal function EDisplayHalSetBacklightOn"))) |
|
1155 |
return KErrPermissionDenied; |
|
1156 |
if (Kern::MachinePowerStatus()<ELow) |
|
1157 |
r=KErrBadPower; |
|
1158 |
else |
|
1159 |
SetBacklightState(TBool(a1)); |
|
1160 |
break; |
|
1161 |
||
1162 |
case EDisplayHalBacklightOn: |
|
1163 |
kumemput32(a1,&iBacklightOn,sizeof(TInt)); |
|
1164 |
break; |
|
1165 |
||
1166 |
case EDisplayHalModeCount: |
|
1167 |
{ |
|
1168 |
TInt ndm = KConfigLcdNumberOfDisplayModes; |
|
1169 |
kumemput32(a1, &ndm, sizeof(ndm)); |
|
1170 |
break; |
|
1171 |
} |
|
1172 |
||
1173 |
case EDisplayHalSetMode: |
|
1174 |
if(!Kern::CurrentThreadHasCapability(ECapabilityMultimediaDD,__PLATSEC_DIAGNOSTIC_STRING("Checked by Hal function EDisplayHalSetMode"))) |
|
1175 |
return KErrPermissionDenied; |
|
1176 |
r = SetDisplayMode((TInt)a1); |
|
1177 |
break; |
|
1178 |
||
1179 |
case EDisplayHalMode: |
|
1180 |
kumemput32(a1, &iVideoInfo.iDisplayMode, sizeof(iVideoInfo.iDisplayMode)); |
|
1181 |
break; |
|
1182 |
||
1183 |
case EDisplayHalSetPaletteEntry: |
|
1184 |
if(!Kern::CurrentThreadHasCapability(ECapabilityMultimediaDD,__PLATSEC_DIAGNOSTIC_STRING("Checked by Hal function EDisplayHalSetPaletteEntry"))) |
|
1185 |
return KErrPermissionDenied; |
|
1186 |
r = SetPaletteEntry((TInt)a1, (TInt)a2); |
|
1187 |
break; |
|
1188 |
||
1189 |
case EDisplayHalPaletteEntry: |
|
1190 |
{ |
|
1191 |
TInt entry; |
|
1192 |
kumemget32(&entry, a1, sizeof(TInt)); |
|
1193 |
TInt x; |
|
1194 |
r = GetPaletteEntry(entry, &x); |
|
1195 |
if (r == KErrNone) |
|
1196 |
kumemput32(a2, &x, sizeof(x)); |
|
1197 |
break; |
|
1198 |
} |
|
1199 |
||
1200 |
case EDisplayHalSetState: |
|
1201 |
{ |
|
1202 |
if(!Kern::CurrentThreadHasCapability(ECapabilityPowerMgmt,__PLATSEC_DIAGNOSTIC_STRING("Checked by Hal function EDisplayHalSetState"))) |
|
1203 |
return KErrPermissionDenied; |
|
1204 |
if ((TBool)a1) |
|
1205 |
{ |
|
1206 |
WsSwitchOnScreen(); |
|
1207 |
} |
|
1208 |
else |
|
1209 |
{ |
|
1210 |
WsSwitchOffScreen(); |
|
1211 |
} |
|
1212 |
break; |
|
1213 |
} |
|
1214 |
||
1215 |
case EDisplayHalState: |
|
1216 |
kumemput32(a1, &iDisplayOn, sizeof(TBool)); |
|
1217 |
break; |
|
1218 |
||
1219 |
case EDisplayHalColors: |
|
1220 |
{ |
|
1221 |
TInt mdc = KConfigLcdMaxDisplayColors; |
|
1222 |
kumemput32(a1, &mdc, sizeof(mdc)); |
|
1223 |
break; |
|
1224 |
} |
|
1225 |
||
1226 |
case EDisplayHalCurrentModeInfo: |
|
1227 |
{ |
|
1228 |
TPckgBuf<TVideoInfoV01> vPckg; |
|
1229 |
r = GetCurrentDisplayModeInfo(vPckg(), (TBool)a2); |
|
1230 |
if (KErrNone == r) |
|
1231 |
Kern::InfoCopy(*(TDes8*)a1,vPckg); |
|
1232 |
} |
|
1233 |
break; |
|
1234 |
||
1235 |
case EDisplayHalSpecifiedModeInfo: |
|
1236 |
{ |
|
1237 |
TPckgBuf<TVideoInfoV01> vPckg; |
|
1238 |
TInt mode; |
|
1239 |
kumemget32(&mode, a1, sizeof(mode)); |
|
1240 |
r = GetSpecifiedDisplayModeInfo(mode, vPckg()); |
|
1241 |
if (KErrNone == r) |
|
1242 |
Kern::InfoCopy(*(TDes8*)a2,vPckg); |
|
1243 |
} |
|
1244 |
break; |
|
1245 |
||
1246 |
case EDisplayHalSecure: |
|
1247 |
kumemput32(a1, &iSecureDisplay, sizeof(TBool)); |
|
1248 |
break; |
|
1249 |
||
1250 |
case EDisplayHalSetSecure: |
|
1251 |
{ |
|
1252 |
if(!Kern::CurrentThreadHasCapability(ECapabilityMultimediaDD,__PLATSEC_DIAGNOSTIC_STRING("Checked by Hal function EDisplayHalSetSecure"))) |
|
1253 |
return KErrPermissionDenied; |
|
1254 |
SwitchDisplay((TBool)a1); |
|
1255 |
} |
|
1256 |
break; |
|
1257 |
||
1258 |
default: |
|
1259 |
r=KErrNotSupported; |
|
1260 |
break; |
|
1261 |
} |
|
1262 |
return r; |
|
1263 |
} |
|
1264 |
||
1265 |
||
32
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1266 |
#ifdef ENABLE_GCE_MODE |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1267 |
DLcdPowerHandler* DLcdPowerHandler::pLcd = NULL; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1268 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1269 |
void DLcdPowerHandler::ChangeFrameBufferAddress(TUint32 aFbAddr) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1270 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1271 |
//TODO: this is guess work |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1272 |
//find out the correct sequence to change LCD DMA address |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1273 |
// |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1274 |
const TInt8 DISPC_GODIGITAL_BITSHIFT = 6; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1275 |
const TInt8 DISPC_GOLCD_BITSHIFT = 5; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1276 |
const TUint32 goFlags = (1 << DISPC_GODIGITAL_BITSHIFT) | (1 << DISPC_GOLCD_BITSHIFT); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1277 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1278 |
const TUint32 ctl = GET_REGISTER(DISPC_CONTROL); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1279 |
SET_REGISTER(DISPC_GFX_BA1, aFbAddr); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1280 |
SET_REGISTER(DISPC_CONTROL, ctl | goFlags); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1281 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1282 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1283 |
#include <display.h> |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1284 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1285 |
class DDisplayPddBeagle : public DDisplayPdd |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1286 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1287 |
public: |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1288 |
DDisplayPddBeagle(); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1289 |
~DDisplayPddBeagle(); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1290 |
virtual TInt SetLegacyMode(); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1291 |
virtual TInt SetGceMode(); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1292 |
virtual TInt SetRotation(RDisplayChannel::TDisplayRotation aRotation); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1293 |
virtual TInt PostUserBuffer(TBufferNode* aNode); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1294 |
virtual TInt PostCompositionBuffer(TBufferNode* aNode); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1295 |
virtual TInt PostLegacyBuffer(); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1296 |
virtual TInt CloseMsg(); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1297 |
virtual TInt CreateChannelSetup(TInt aUnit); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1298 |
virtual TBool PostPending(); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1299 |
virtual TDfcQue* DfcQ(TInt aUnit); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1300 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1301 |
public: |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1302 |
static void VSyncDfcFn(TAny* aChannel); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1303 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1304 |
private: |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1305 |
TDfcQue* iDfcQ; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1306 |
TVideoInfoV01 iScreenInfo; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1307 |
TBufferNode* iPendingBuffer; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1308 |
TBufferNode* iActiveBuffer; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1309 |
DChunk* iChunk; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1310 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1311 |
public: |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1312 |
TDfc iVSyncDfc; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1313 |
}; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1314 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1315 |
class DDisplayPddFactory : public DPhysicalDevice |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1316 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1317 |
public: |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1318 |
DDisplayPddFactory(); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1319 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1320 |
virtual TInt Install(); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1321 |
virtual void GetCaps(TDes8& aDes) const; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1322 |
virtual TInt Create(DBase*& aChannel, TInt aUnit, const TDesC8* aInfo, const TVersion& aVer); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1323 |
virtual TInt Validate(TInt aDeviceType, const TDesC8* anInfo, const TVersion& aVer); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1324 |
}; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1325 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1326 |
const TInt KVSyncDfcPriority = 7 ; //priority of DFC within the queue (0 to 7, where 7 is highest) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1327 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1328 |
DDisplayPddBeagle::DDisplayPddBeagle(): |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1329 |
iPendingBuffer(NULL), |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1330 |
iActiveBuffer(NULL), |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1331 |
iChunk(NULL), |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1332 |
iVSyncDfc(&VSyncDfcFn, this, KVSyncDfcPriority) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1333 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1334 |
__KTRACE_OPT(KEXTENSION, Kern::Printf("DDisplayPddBeagle::DDisplayPddBeagle")); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1335 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1336 |
iPostFlag = EFalse; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1337 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1338 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1339 |
DDisplayPddBeagle::~DDisplayPddBeagle() |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1340 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1341 |
__KTRACE_OPT(KEXTENSION, Kern::Printf("DDisplayPddBeagle::~DDisplayPddBeagle()")); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1342 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1343 |
//The DFC Queue is owned by DLcdPowerHandler so we shouldn't call Destroy() at this point. |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1344 |
if (iDfcQ) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1345 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1346 |
iDfcQ=NULL; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1347 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1348 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1349 |
DChunk* chunk = (DChunk*) __e32_atomic_swp_ord_ptr(&iChunk, 0); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1350 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1351 |
if(chunk) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1352 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1353 |
Kern::ChunkClose(chunk); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1354 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1355 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1356 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1357 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1358 |
TInt DDisplayPddBeagle::SetLegacyMode() |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1359 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1360 |
__KTRACE_OPT(KEXTENSION, Kern::Printf("DDisplayPddBeagle::SetLegacyMode()")); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1361 |
return KErrNone; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1362 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1363 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1364 |
TInt DDisplayPddBeagle::SetGceMode() |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1365 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1366 |
__KTRACE_OPT(KEXTENSION, Kern::Printf("DDisplayPddBeagle::SetGceMode()")); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1367 |
PostCompositionBuffer(&iLdd->iCompositionBuffer[0]); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1368 |
return KErrNone; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1369 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1370 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1371 |
TInt DDisplayPddBeagle::SetRotation(RDisplayChannel::TDisplayRotation aDegOfRot) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1372 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1373 |
__KTRACE_OPT(KEXTENSION, Kern::Printf("DDisplayPddBeagle::SetRotation()")); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1374 |
return KErrNone; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1375 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1376 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1377 |
TInt DDisplayPddBeagle::PostUserBuffer(TBufferNode* aNode) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1378 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1379 |
__KTRACE_OPT(KEXTENSION, Kern::Printf("DDisplayPddBeagle::PostUserBuffer : aNode->iAddress = %08x\n", aNode->iAddress)); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1380 |
if(iPendingBuffer) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1381 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1382 |
iPendingBuffer->iState = EBufferFree; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1383 |
if (!(iPendingBuffer->iType == EBufferTypeUser) ) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1384 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1385 |
iPendingBuffer->iFree = ETrue; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1386 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1387 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1388 |
aNode->iState = EBufferPending; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1389 |
iPendingBuffer = aNode; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1390 |
iPostFlag = ETrue; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1391 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1392 |
// Activate the posted buffer |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1393 |
TUint32 physicalAddress = Epoc::LinearToPhysical( aNode->iAddress ); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1394 |
DLcdPowerHandler::pLcd->ChangeFrameBufferAddress(physicalAddress); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1395 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1396 |
/* Queue a DFC to complete the request*/ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1397 |
iVSyncDfc.Enque(); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1398 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1399 |
return KErrNone; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1400 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1401 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1402 |
TInt DDisplayPddBeagle::PostCompositionBuffer(TBufferNode* aNode) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1403 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1404 |
__KTRACE_OPT(KEXTENSION, Kern::Printf("DDisplayPddBeagle::PostCompositionBuffer : aNode->iAddress = %08x\n", aNode->iAddress)); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1405 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1406 |
if(iPendingBuffer) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1407 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1408 |
iPendingBuffer->iState = EBufferFree; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1409 |
if (iPendingBuffer->iType == EBufferTypeUser) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1410 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1411 |
RequestComplete(RDisplayChannel::EReqPostUserBuffer, KErrCancel); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1412 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1413 |
else |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1414 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1415 |
iPendingBuffer->iFree = ETrue; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1416 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1417 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1418 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1419 |
aNode->iState = EBufferPending; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1420 |
aNode->iFree = EFalse; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1421 |
iPendingBuffer = aNode; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1422 |
iPostFlag = ETrue; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1423 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1424 |
// Activate the posted buffer |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1425 |
TUint32 physicalAddress = Epoc::LinearToPhysical( aNode->iAddress ); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1426 |
DLcdPowerHandler::pLcd->ChangeFrameBufferAddress(physicalAddress); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1427 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1428 |
/* Queue a DFC to complete the request*/ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1429 |
iVSyncDfc.Enque(); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1430 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1431 |
return KErrNone; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1432 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1433 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1434 |
TInt DDisplayPddBeagle::PostLegacyBuffer() |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1435 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1436 |
__KTRACE_OPT(KEXTENSION, Kern::Printf("DDisplayPddBeagle::PostLegacyBuffer()")); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1437 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1438 |
if(iPendingBuffer) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1439 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1440 |
iPendingBuffer->iState = EBufferFree; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1441 |
if (iPendingBuffer->iType == EBufferTypeUser) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1442 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1443 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1444 |
RequestComplete(RDisplayChannel::EReqPostUserBuffer, KErrCancel); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1445 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1446 |
else |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1447 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1448 |
iPendingBuffer->iFree = ETrue; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1449 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1450 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1451 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1452 |
iLdd->iLegacyBuffer[0].iState = EBufferPending; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1453 |
iLdd->iLegacyBuffer[0].iFree = EFalse; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1454 |
iPendingBuffer = &iLdd->iLegacyBuffer[0]; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1455 |
iPostFlag = ETrue; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1456 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1457 |
// Activate the posted buffer |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1458 |
DLcdPowerHandler::pLcd->ChangeFrameBufferAddress(DLcdPowerHandler::pLcd->ivRamPhys); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1459 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1460 |
/* Queue a DFC to complete the request*/ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1461 |
iVSyncDfc.Enque(); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1462 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1463 |
return KErrNone; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1464 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1465 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1466 |
TInt DDisplayPddBeagle::CloseMsg() |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1467 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1468 |
__KTRACE_OPT(KEXTENSION, Kern::Printf("DDisplayPddBeagle::CloseMsg()")); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1469 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1470 |
iPendingBuffer = NULL; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1471 |
iActiveBuffer = NULL; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1472 |
iVSyncDfc.Cancel(); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1473 |
return KErrNone; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1474 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1475 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1476 |
TInt DDisplayPddBeagle::CreateChannelSetup(TInt aUnit) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1477 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1478 |
__KTRACE_OPT(KEXTENSION, Kern::Printf("DDisplayPddBeagle::CreateChannelSetup()")); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1479 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1480 |
iScreenInfo = DLcdPowerHandler::pLcd->iVideoInfo; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1481 |
iLdd->iUnit = aUnit; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1482 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1483 |
iLdd->iDisplayInfo.iAvailableRotations = RDisplayChannel::ERotationNormal; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1484 |
iLdd->iDisplayInfo.iNormal.iOffsetBetweenLines = iScreenInfo.iOffsetBetweenLines; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1485 |
iLdd->iDisplayInfo.iNormal.iHeight = iScreenInfo.iSizeInPixels.iHeight; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1486 |
iLdd->iDisplayInfo.iNormal.iWidth = iScreenInfo.iSizeInPixels.iWidth; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1487 |
iLdd->iDisplayInfo.iNumCompositionBuffers = KDisplayCBMax; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1488 |
iLdd->iDisplayInfo.iBitsPerPixel = iScreenInfo.iBitsPerPixel; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1489 |
iLdd->iDisplayInfo.iRefreshRateHz = 60; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1490 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1491 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1492 |
switch (iScreenInfo.iBitsPerPixel) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1493 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1494 |
case 16: |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1495 |
iLdd->iDisplayInfo.iPixelFormat = EUidPixelFormatRGB_565; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1496 |
break; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1497 |
case 24: |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1498 |
iLdd->iDisplayInfo.iPixelFormat = EUidPixelFormatRGB_888; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1499 |
break; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1500 |
case 32: |
87
cf5d4fe2473f
work-a-round for Bug 3645 change ARGB->XRGB pixel format
andy simpson <andrews@symbian.org>
parents:
32
diff
changeset
|
1501 |
iLdd->iDisplayInfo.iPixelFormat = EUidPixelFormatXRGB_8888; |
32
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1502 |
break; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1503 |
default: |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1504 |
iLdd->iDisplayInfo.iPixelFormat = EUidPixelFormatUnknown; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1505 |
break; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1506 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1507 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1508 |
iLdd->iCurrentRotation = RDisplayChannel::ERotationNormal; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1509 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1510 |
// Open shared chunk to the composition framebuffer |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1511 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1512 |
DChunk* chunk = 0; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1513 |
TLinAddr chunkKernelAddr = 0; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1514 |
TUint32 chunkMapAttr = 0; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1515 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1516 |
// round to twice the page size |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1517 |
TUint round = 2*Kern::RoundToPageSize(DLcdPowerHandler::pLcd->iSize); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1518 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1519 |
__KTRACE_OPT(KEXTENSION, Kern::Printf("DDisplayPddBeagle::CreateChannelSetup DLcdPowerHandler::pLcd->iSize = %d\n", DLcdPowerHandler::pLcd->iSize)); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1520 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1521 |
TChunkCreateInfo info; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1522 |
info.iType = TChunkCreateInfo::ESharedKernelMultiple; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1523 |
info.iMaxSize = round; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1524 |
info.iMapAttr = EMapAttrFullyBlocking; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1525 |
info.iOwnsMemory = EFalse; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1526 |
info.iDestroyedDfc = 0; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1527 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1528 |
TInt r = Kern::ChunkCreate(info, chunk, chunkKernelAddr, chunkMapAttr); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1529 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1530 |
__KTRACE_OPT(KEXTENSION, Kern::Printf("CreateChannelSetup:ChunkCreate called for composition chunk. Set iChunkKernelAddr = %08x\n", chunkKernelAddr)); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1531 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1532 |
if( r == KErrNone) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1533 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1534 |
// map our chunk |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1535 |
r = Kern::ChunkCommitPhysical(chunk, 0,round , DLcdPowerHandler::pLcd->iCompositionPhysical); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1536 |
__KTRACE_OPT(KEXTENSION, Kern::Printf("Mapping chunk %d", r)); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1537 |
if(r != KErrNone) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1538 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1539 |
Kern::ChunkClose(chunk); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1540 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1541 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1542 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1543 |
if ( r!= KErrNone) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1544 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1545 |
return r; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1546 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1547 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1548 |
iChunk = chunk; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1549 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1550 |
// init CB 0 |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1551 |
iLdd->iCompositionBuffer[0].iType = EBufferTypeComposition; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1552 |
iLdd->iCompositionBuffer[0].iBufferId = 0; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1553 |
iLdd->iCompositionBuffer[0].iFree = ETrue; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1554 |
iLdd->iCompositionBuffer[0].iState = EBufferFree; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1555 |
iLdd->iCompositionBuffer[0].iAddress = chunkKernelAddr; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1556 |
iLdd->iCompositionBuffer[0].iPhysicalAddress = Epoc::LinearToPhysical(chunkKernelAddr); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1557 |
iLdd->iCompositionBuffer[0].iChunk = chunk; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1558 |
iLdd->iCompositionBuffer[0].iHandle = 0; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1559 |
iLdd->iCompositionBuffer[0].iOffset = 0; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1560 |
iLdd->iCompositionBuffer[0].iSize = DLcdPowerHandler::pLcd->iSize; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1561 |
iLdd->iCompositionBuffer[0].iPendingRequest = 0; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1562 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1563 |
// init CB 1 |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1564 |
iLdd->iCompositionBuffer[1].iType = EBufferTypeComposition; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1565 |
iLdd->iCompositionBuffer[1].iBufferId = 1; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1566 |
iLdd->iCompositionBuffer[1].iFree = ETrue; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1567 |
iLdd->iCompositionBuffer[1].iState = EBufferFree; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1568 |
iLdd->iCompositionBuffer[1].iAddress = chunkKernelAddr + DLcdPowerHandler::pLcd->iSize; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1569 |
iLdd->iCompositionBuffer[1].iPhysicalAddress = Epoc::LinearToPhysical(chunkKernelAddr + DLcdPowerHandler::pLcd->iSize); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1570 |
iLdd->iCompositionBuffer[1].iChunk = chunk; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1571 |
iLdd->iCompositionBuffer[1].iHandle = 0; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1572 |
iLdd->iCompositionBuffer[1].iOffset = DLcdPowerHandler::pLcd->iSize; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1573 |
iLdd->iCompositionBuffer[1].iSize = DLcdPowerHandler::pLcd->iSize; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1574 |
iLdd->iCompositionBuffer[1].iPendingRequest = 0; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1575 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1576 |
iLdd->iCompositionBuffIdx = 0; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1577 |
//Use the same DFC queue created by the DLcdPowerHandler so all hardware accesses are executed under the same DFC thread. |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1578 |
iDfcQ= DLcdPowerHandler::pLcd->iDfcQ; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1579 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1580 |
// Set the Post DFC. |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1581 |
iVSyncDfc.SetDfcQ(iDfcQ); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1582 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1583 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1584 |
return KErrNone; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1585 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1586 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1587 |
TBool DDisplayPddBeagle::PostPending() |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1588 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1589 |
return (iPendingBuffer != NULL); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1590 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1591 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1592 |
TDfcQue * DDisplayPddBeagle::DfcQ(TInt aUnit) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1593 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1594 |
return iDfcQ; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1595 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1596 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1597 |
void DDisplayPddBeagle::VSyncDfcFn(TAny* aChannel) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1598 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1599 |
DDisplayPddBeagle * channel =(DDisplayPddBeagle*)aChannel; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1600 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1601 |
if (channel->iPostFlag) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1602 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1603 |
channel->iPostFlag = EFalse; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1604 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1605 |
if (channel->iActiveBuffer) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1606 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1607 |
//When a User buffer is registered its iFree member becomes EFalse and Deregister sets it |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1608 |
//back to ETrue. Composition and Legacy buffers are not free when they are in the pending or |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1609 |
//active state. |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1610 |
if (channel->iActiveBuffer->iType == EBufferTypeUser) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1611 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1612 |
channel->RequestComplete(RDisplayChannel::EReqPostUserBuffer, KErrNone); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1613 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1614 |
else |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1615 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1616 |
channel->iActiveBuffer->iFree = ETrue; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1617 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1618 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1619 |
channel->iActiveBuffer->iState = EBufferFree; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1620 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1621 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1622 |
//If no buffer was available during a call to GetCompositionBuffer the active buffer has |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1623 |
//been returned as the next available one, so we must set the buffer to the proper state before we |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1624 |
//send the notification. |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1625 |
TInt pendingIndex = channel->iLdd->iPendingIndex[RDisplayChannel::EReqGetCompositionBuffer]; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1626 |
if(channel->iLdd->iPendingReq[RDisplayChannel::EReqGetCompositionBuffer][pendingIndex].iTClientReq) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1627 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1628 |
if(channel->iLdd->iPendingReq[RDisplayChannel::EReqGetCompositionBuffer][pendingIndex].iTClientReq->IsReady()) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1629 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1630 |
channel->iActiveBuffer->iState = EBufferCompose; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1631 |
channel->RequestComplete(RDisplayChannel::EReqGetCompositionBuffer,KErrNone); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1632 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1633 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1634 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1635 |
channel->iActiveBuffer = NULL; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1636 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1637 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1638 |
if (channel->iPendingBuffer) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1639 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1640 |
__KTRACE_OPT(KEXTENSION, Kern::Printf("DDisplayPddBeagle::VSyncDfcFn moving pending buffer at address %08x to the active state\n", channel->iPendingBuffer->iAddress)); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1641 |
channel->iActiveBuffer = channel->iPendingBuffer; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1642 |
channel->iActiveBuffer->iState = EBufferActive; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1643 |
channel->iPendingBuffer = NULL; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1644 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1645 |
channel->RequestComplete(RDisplayChannel::EReqWaitForPost, KErrNone); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1646 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1647 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1648 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1649 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1650 |
DDisplayPddFactory::DDisplayPddFactory() |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1651 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1652 |
__KTRACE_OPT(KEXTENSION, Kern::Printf("DDisplayPddFactory::DDisplayPddFactory()")); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1653 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1654 |
iVersion = TVersion(KDisplayChMajorVersionNumber, |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1655 |
KDisplayChMinorVersionNumber, |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1656 |
KDisplayChBuildVersionNumber); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1657 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1658 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1659 |
TInt DDisplayPddFactory::Create(DBase*& aChannel, TInt aUnit, const TDesC8* aInfo, const TVersion& aVer) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1660 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1661 |
__KTRACE_OPT(KEXTENSION, Kern::Printf("DDisplayPddFactory::Create()")); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1662 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1663 |
DDisplayPddBeagle *device= new DDisplayPddBeagle() ; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1664 |
aChannel=device; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1665 |
if (!device) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1666 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1667 |
return KErrNoMemory; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1668 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1669 |
return KErrNone; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1670 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1671 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1672 |
TInt DDisplayPddFactory::Install() |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1673 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1674 |
__KTRACE_OPT(KEXTENSION, Kern::Printf("DDisplayPddFactory::Install()")); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1675 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1676 |
TBuf<32> name(RDisplayChannel::Name()); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1677 |
_LIT(KPddExtension,".pdd"); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1678 |
name.Append(KPddExtension); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1679 |
return SetName(&name); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1680 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1681 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1682 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1683 |
void DDisplayPddFactory::GetCaps(TDes8& /*aDes*/) const |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1684 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1685 |
//Not supported |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1686 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1687 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1688 |
TInt DDisplayPddFactory::Validate(TInt aUnit, const TDesC8* /*anInfo*/, const TVersion& aVer) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1689 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1690 |
__KTRACE_OPT(KEXTENSION, Kern::Printf("DDisplayPddFactory::Validate()")); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1691 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1692 |
if (!Kern::QueryVersionSupported(iVersion,aVer)) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1693 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1694 |
return KErrNotSupported; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1695 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1696 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1697 |
if (aUnit != 0) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1698 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1699 |
return KErrNotSupported; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1700 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1701 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1702 |
return KErrNone; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1703 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1704 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1705 |
#endif //ENABLE_GCE_MODE |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1706 |
|
0 | 1707 |
DECLARE_STANDARD_EXTENSION() |
1708 |
{ |
|
32
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1709 |
__KTRACE_OPT(KEXTENSION, Kern::Printf("Creating DLcdPowerHandler")); |
0 | 1710 |
|
32
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1711 |
TInt r = KErrNoMemory; |
0 | 1712 |
DLcdPowerHandler* pH=new DLcdPowerHandler; |
32
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1713 |
if (!pH) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1714 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1715 |
__KTRACE_OPT(KEXTENSION, Kern::Printf("Failed to create DLcdPowerHandler %d", r)); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1716 |
return r; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1717 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1718 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1719 |
r = pH->Create(); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1720 |
if (r != KErrNone) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1721 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1722 |
__KTRACE_OPT(KEXTENSION, Kern::Printf("Failed to create DLcdPowerHandler %d", r)); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1723 |
return r; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1724 |
} |
0 | 1725 |
|
32
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1726 |
#ifdef ENABLE_GCE_MODE |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1727 |
__KTRACE_OPT(KEXTENSION, Kern::Printf("Creating DDisplayPddFactory")); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1728 |
r = KErrNoMemory; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1729 |
DDisplayPddFactory * device = new DDisplayPddFactory; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1730 |
if (!device) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1731 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1732 |
__KTRACE_OPT(KEXTENSION, Kern::Printf("Failed to create DLcdPowerHandler %d", r)); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1733 |
return r; |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1734 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1735 |
|
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1736 |
__KTRACE_OPT(KEXTENSION, Kern::Printf("Installing DDisplayPddFactory")); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1737 |
r = Kern::InstallPhysicalDevice(device); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1738 |
if (r != KErrNone) |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1739 |
{ |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1740 |
__KTRACE_OPT(KEXTENSION, Kern::Printf("Failed to install DDisplayPddFactory %d", r)); |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1741 |
} |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1742 |
#endif |
161f6b2f6990
Bug 1471 - Display PDD for Symbian^3 proposed by iwanj@users.sourceforge.net
arunabha
parents:
21
diff
changeset
|
1743 |
|
0 | 1744 |
return r; |
1745 |
} |
|
1746 |