baseport/syborg/fb/syborg_fb.h
changeset 13 73107a0bc259
parent 2 d55eb581a87c
child 46 b6935a90ca64
equal deleted inserted replaced
12:5c4b0c1fa5f8 13:73107a0bc259
    22 #include <nkern.h>
    22 #include <nkern.h>
    23 #include <kernel.h>
    23 #include <kernel.h>
    24 #include <kpower.h>
    24 #include <kpower.h>
    25 #include <system.h>
    25 #include <system.h>
    26 
    26 
       
    27 
       
    28 
       
    29 // The definition of __portrait_display__ in the MMP file affects
       
    30 // both the display and the pointer component, so both must be
       
    31 // rebuilt if this setting is changed.
       
    32 
       
    33 
    27 _LIT(KLitLcd,"SYBORG_FB");
    34 _LIT(KLitLcd,"SYBORG_FB");
    28 
    35 
    29 const TUint KConfigLcdWidth            = 640;
    36 
       
    37 #ifdef __PORTRAIT_DISPLAY__ // portrait display selected
       
    38 
       
    39 #	ifdef __DISPLAY_WVGA__
       
    40 
       
    41 #pragma comment(layout,"Portrait display enabled")
       
    42 const TUint KConfigLcdWidth            	= 854; // This must be left at 640, even with only 360 used by S60
       
    43 const TUint	KConfigLcdHeight	       	= 854;
       
    44 const TInt	KConfigLcdHeightInTwips     = 12860;
       
    45 const TInt	KConfigLcdWidthInTwips    	= 12860;
       
    46 const TUint	KConfigMouseWidth	       	= 480; // Usable width for the mouse driver
       
    47 const TUint	KConfigMouseMin			   	= 0;
       
    48 
       
    49 #	else //__DISPLAY_WVGA__
       
    50 
       
    51 #pragma comment(layout,"Portrait display enabled")
       
    52 const TUint KConfigLcdWidth            = 640; // This must be left at 640, even with only 360 used by S60
       
    53 const TUint	KConfigLcdHeight	       = 640;
       
    54 const TInt	KConfigLcdHeightInTwips     = 3550;
       
    55 const TInt	KConfigLcdWidthInTwips    = 3550;
       
    56 const TUint	KConfigMouseWidth	       = 360; // Usable width for the mouse driver
       
    57 
       
    58 const TUint	KConfigMouseMin			   = 0;
       
    59 #	endif //__DISPLAY_WVGA__
       
    60 
       
    61 
       
    62 
       
    63 
       
    64 #else // __PORTRAIT_DISPLAY__  Landscape display selected
       
    65 
       
    66 #pragma comment(layout,"Landscape display enabled")
       
    67 const TUint  KConfigLcdWidth            = 640;
    30 const TUint	KConfigLcdHeight	       = 480;
    68 const TUint	KConfigLcdHeight	       = 480;
    31 const TInt	KConfigLcdWidthInTwips     = 9638;
    69 const TInt	KConfigLcdWidthInTwips     = 3550;
    32 const TInt	KConfigLcdHeightInTwips    = 7370;
    70 const TInt	KConfigLcdHeightInTwips    = 2670;
       
    71 const TUint	KConfigMouseWidth	       = 640; // Usable width for the mouse driver
       
    72 
       
    73 const TUint	KConfigMouseMin			   = 120; // mouse range is 120 - 480, not 0 - 360
       
    74 #endif // __PORTRAIT_DISPLAY__
       
    75 
       
    76 
    33 const TBool KConfigIsMono              = 0;
    77 const TBool KConfigIsMono              = 0;
    34 const TBool KConfigIsPalettized        = 0;
    78 const TBool KConfigIsPalettized        = 0;
    35 const TInt  KCOnfigOffsetToFirstPixel  = 0;
    79 
       
    80 const TInt  KConfigOffsetToFirstPixel  = 0;
       
    81 
    36 const TBool KConfigPixelOrderRGB       = 0;
    82 const TBool KConfigPixelOrderRGB       = 0;
    37 const TBool KConfigPixelOrderLandscape = 1;
    83 const TBool KConfigPixelOrderLandscape = 1;
    38 const TInt  KConfigLcdDisplayMode       = 2;
    84 const TInt  KConfigLcdDisplayMode       = 2;
    39 //const TInt  KConfigLcdDisplayMode       = 1;
    85 //const TInt  KConfigLcdDisplayMode       = 1;
    40 const TInt  KConfigLcdNumberOfDisplayModes = 3;
    86 const TInt  KConfigLcdNumberOfDisplayModes = 3;
    41 
    87 
    42 
    88 
    43 const TInt  KConfigBitsPerPixel        = 24;
    89 const TInt  KConfigBitsPerPixel        = 24;
    44 const TInt  KCOnfigOffsetBetweenLines  = 2560;
    90 
       
    91 #ifdef __DISPLAY_WVGA__
       
    92 const TInt  KConfigOffsetBetweenLines  = 3416;
       
    93 #else //__DISPLAY_WVGA__
       
    94 const TInt  KConfigOffsetBetweenLines  = 2560;
       
    95 #endif //__DISPLAY_WVGA__
       
    96 
    45 
    97 
    46 class DLcdPowerHandler : public DPowerHandler
    98 class DLcdPowerHandler : public DPowerHandler
    47 {
    99 {
    48 public: // from DPowerHandler
   100 public: // from DPowerHandler
    49   void PowerDown(TPowerState);
   101   void PowerDown(TPowerState);
    70 private:
   122 private:
    71   TInt GetCurrentDisplayModeInfo(TVideoInfoV01& aInfo, TBool aSecure);
   123   TInt GetCurrentDisplayModeInfo(TVideoInfoV01& aInfo, TBool aSecure);
    72   TInt GetSpecifiedDisplayModeInfo(TInt aMode, TVideoInfoV01& aInfo);
   124   TInt GetSpecifiedDisplayModeInfo(TInt aMode, TVideoInfoV01& aInfo);
    73   TInt SetDisplayMode(TInt aMode);
   125   TInt SetDisplayMode(TInt aMode);
    74   TInt AllocateFrameBuffer();
   126   TInt AllocateFrameBuffer();
    75   
   127 
    76   TBool iDisplayOn;
   128   TBool iDisplayOn;
    77   DPlatChunkHw* iChunk;
   129   DPlatChunkHw* iChunk;
    78   DPlatChunkHw* iSecureChunk;
   130   DPlatChunkHw* iSecureChunk;
    79   TBool iWsSwitchOnScreen;
   131   TBool iWsSwitchOnScreen;
    80   TBool iSecureDisplay;
   132   TBool iSecureDisplay;
    81 
   133 
    82 public:
   134 public:
    83   TDfcQue* iDfcQ;
   135   TDfcQue* iDfcQ;
    84   TMessageQue iMsgQ;					// to prevent a race condition with Power Manager trying to power up/down at the same time
   136   TMessageQue iMsgQ;					// to prevent a race condition with Power Manager trying to power up/down at the same time
    85   TDfc iPowerUpDfc;
   137   TDfc iPowerUpDfc;
    86   TDfc iPowerDownDfc;	
   138   TDfc iPowerDownDfc;
    87 
   139 
    88 private:
   140 private:
    89   TVideoInfoV01 iVideoInfo;
   141   TVideoInfoV01 iVideoInfo;
    90   TVideoInfoV01 iSecureVideoInfo;
   142   TVideoInfoV01 iSecureVideoInfo;
    91   NFastMutex iLock;
   143   NFastMutex iLock;