author | William Roberts <williamr@symbian.org> |
Thu, 08 Oct 2009 20:49:04 +0100 | |
changeset 10 | 1cf69c2c2bbd |
parent 2 | d55eb581a87c |
child 15 | 5fca9e46c6fa |
permissions | -rw-r--r-- |
0
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
1 |
/* |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
3 |
* All rights reserved. |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
5 |
* under the terms of the License "Eclipse Public License v1.0" |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
8 |
* |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
9 |
* Initial Contributors: |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
11 |
* |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
12 |
* Contributors: |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
13 |
* |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
14 |
* Description: Minimalistic frame buffer driver |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
15 |
* |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
16 |
*/ |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
17 |
|
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
18 |
#ifndef _SYBORG_FB_H |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
19 |
#define _SYBORG_FB_H |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
20 |
|
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
21 |
#include <videodriver.h> |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
22 |
#include <nkern.h> |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
23 |
#include <kernel.h> |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
24 |
#include <kpower.h> |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
25 |
#include <system.h> |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
26 |
|
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
27 |
_LIT(KLitLcd,"SYBORG_FB"); |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
28 |
|
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
29 |
const TUint KConfigLcdWidth = 640; |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
30 |
const TUint KConfigLcdHeight = 480; |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
31 |
const TInt KConfigLcdWidthInTwips = 9638; |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
32 |
const TInt KConfigLcdHeightInTwips = 7370; |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
33 |
const TBool KConfigIsMono = 0; |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
34 |
const TBool KConfigIsPalettized = 0; |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
35 |
const TInt KCOnfigOffsetToFirstPixel = 0; |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
36 |
const TBool KConfigPixelOrderRGB = 0; |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
37 |
const TBool KConfigPixelOrderLandscape = 1; |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
38 |
const TInt KConfigLcdDisplayMode = 2; |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
39 |
//const TInt KConfigLcdDisplayMode = 1; |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
40 |
const TInt KConfigLcdNumberOfDisplayModes = 3; |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
41 |
|
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
42 |
|
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
43 |
const TInt KConfigBitsPerPixel = 24; |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
44 |
const TInt KCOnfigOffsetBetweenLines = 2560; |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
45 |
|
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
46 |
class DLcdPowerHandler : public DPowerHandler |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
47 |
{ |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
48 |
public: // from DPowerHandler |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
49 |
void PowerDown(TPowerState); |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
50 |
void PowerUp(); |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
51 |
public: // to prevent a race condition with WServer trying to power up/down at the same time |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
52 |
void PowerUpDfc(); |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
53 |
void PowerDownDfc(); |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
54 |
public: |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
55 |
DLcdPowerHandler(); |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
56 |
TInt Create(); |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
57 |
void DisplayOn(); |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
58 |
void DisplayOff(); |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
59 |
TInt HalFunction(TInt aFunction, TAny* a1, TAny* a2); |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
60 |
|
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
61 |
void PowerUpLcd(TBool aSecure); |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
62 |
void PowerDownLcd(); |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
63 |
|
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
64 |
void ScreenInfo(TScreenInfoV01& aInfo); |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
65 |
void WsSwitchOnScreen(); |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
66 |
void WsSwitchOffScreen(); |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
67 |
void HandleMsg(TMessageBase* aMsg); |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
68 |
void SwitchDisplay(TBool aSecure); |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
69 |
|
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
70 |
private: |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
71 |
TInt GetCurrentDisplayModeInfo(TVideoInfoV01& aInfo, TBool aSecure); |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
72 |
TInt GetSpecifiedDisplayModeInfo(TInt aMode, TVideoInfoV01& aInfo); |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
73 |
TInt SetDisplayMode(TInt aMode); |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
74 |
TInt AllocateFrameBuffer(); |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
75 |
|
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
76 |
TBool iDisplayOn; |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
77 |
DPlatChunkHw* iChunk; |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
78 |
DPlatChunkHw* iSecureChunk; |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
79 |
TBool iWsSwitchOnScreen; |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
80 |
TBool iSecureDisplay; |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
81 |
|
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
82 |
public: |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
83 |
TDfcQue* iDfcQ; |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
84 |
TMessageQue iMsgQ; // to prevent a race condition with Power Manager trying to power up/down at the same time |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
85 |
TDfc iPowerUpDfc; |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
86 |
TDfc iPowerDownDfc; |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
87 |
|
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
88 |
private: |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
89 |
TVideoInfoV01 iVideoInfo; |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
90 |
TVideoInfoV01 iSecureVideoInfo; |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
91 |
NFastMutex iLock; |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
92 |
TPhysAddr ivRamPhys; |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
93 |
TPhysAddr iSecurevRamPhys; |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
94 |
|
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
95 |
public: |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
96 |
TLinAddr iPortAddr; |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
97 |
|
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
98 |
enum { |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
99 |
FB_ID = 0, |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
100 |
FB_BASE = 1, |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
101 |
FB_HEIGHT = 2, |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
102 |
FB_WIDTH = 3, |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
103 |
FB_ORIENTATION = 4, |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
104 |
FB_BLANK = 5, |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
105 |
FB_INT_MASK = 6, |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
106 |
/* begin new interface */ |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
107 |
FB_INTERRUPT_CAUSE = 7, |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
108 |
FB_BPP = 8, |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
109 |
FB_COLOR_ORDER = 9, |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
110 |
FB_BYTE_ORDER = 10, |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
111 |
FB_PIXEL_ORDER = 11, |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
112 |
FB_ROW_PITCH = 12, |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
113 |
FB_ENABLED = 13, |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
114 |
FB_PALETTE_START = 0x400 >> 2, |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
115 |
FB_PALETTE_END = FB_PALETTE_START+256-1, |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
116 |
/* end new interface */ |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
117 |
}; |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
118 |
|
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
119 |
#define FB_INT_VSYNC (1U << 0) |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
120 |
#define FB_INT_BASE_UPDATE_DONE (1U << 1) |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
121 |
|
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
122 |
}; |
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
123 |
|
ffa851df0825
Initial syborg (baseport) and documentation import
martin.trojer@nokia.com
parents:
diff
changeset
|
124 |
#endif |