baseport/syborg/svpframebuffer/svpframebuffer.h
author emilioc
Wed, 27 Jan 2010 14:42:12 +0000
branchphonesim-integ
changeset 38 33dfab4ab0fc
child 46 b6935a90ca64
permissions -rw-r--r--
PDD Display Driver for Syborg
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
38
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
     1
/*
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
     2
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
     3
* All rights reserved.
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
     4
* This component and the accompanying materials are made available
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
     5
* under the terms of the License "Eclipse Public License v1.0"
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
     6
* which accompanies this distribution, and is available
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
     8
*
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
     9
* Initial Contributors:
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    11
*
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    12
* Contributors:
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    13
*
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    14
* Description: Minimalistic frame buffer driver
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    15
*
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    16
*/
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    17
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    18
#ifndef _SVPFRAMEBUFFER_H
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    19
#define _SVPFRAMEBUFFER_H
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    20
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    21
#include <display.h>
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    22
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    23
#include <videodriver.h>
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    24
#include <system.h>
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    25
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    26
#define __SVPFRAMEBUFFER_DEBUG
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    27
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    28
#ifdef __SVPFRAMEBUFFER_DEBUG
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    29
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    30
#define  __GCE_DEBUG_PRINT(a) 		Kern::Printf(a)
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    31
#define  __GCE_DEBUG_PRINT2(a,b) 	Kern::Printf(a,b)
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    32
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    33
#else
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    34
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    35
#define  __GCE_DEBUG_PRINT(a)
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    36
#define  __GCE_DEBUG_PRINT2(a,b)
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    37
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    38
#endif
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    39
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    40
// Macro to calculate the screen buffer size
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    41
// aBpp is the number of bits-per-pixel, aPpl is the number of pixels per line and aLpp number of lines per panel
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    42
#define FRAME_BUFFER_SIZE(aBpp,aPpl,aLpp)	((aBpp/8)*aPpl*aLpp)	
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    43
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    44
_LIT(KLitLcd,"SYBORG_FB");
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    45
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    46
const TUint KConfigLcdWidth            = 640;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    47
const TUint	KConfigLcdHeight	       = 480;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    48
const TInt	KConfigLcdWidthInTwips     = 9638;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    49
const TInt	KConfigLcdHeightInTwips    = 7370;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    50
const TBool KConfigIsMono              = 0;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    51
const TBool KConfigIsPalettized        = 0;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    52
const TInt  KCOnfigOffsetToFirstPixel  = 0;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    53
const TBool KConfigPixelOrderRGB       = 0;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    54
const TBool KConfigPixelOrderLandscape = 1;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    55
const TInt  KConfigLcdDisplayMode       = 2;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    56
//const TInt  KConfigLcdDisplayMode       = 1;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    57
const TInt  KConfigLcdNumberOfDisplayModes = 3;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    58
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    59
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    60
const TInt  KConfigBitsPerPixel        = 24;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    61
const TInt  KCOnfigOffsetBetweenLines  = 2560;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    62
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    63
const TInt   KVSyncDfcPriority							= 7 ;   //priority of DFC within the queue (0 to 7, where 7 is highest)
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    64
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    65
/********************************************************************/
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    66
/* Class Definition                                                 */
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    67
/********************************************************************/
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    68
/**
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    69
 * This class defines a callback mechanism that is used by a resource user to specify its callback. It contains a
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    70
 * function pointer and data pointer. The function pointer specifies the user callback function to be invoked by the
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    71
 * resource while the data pointer specifies the data to be passed to the callback function.
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    72
 */
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    73
class TLcdUserCallBack
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    74
    {
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    75
public:
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    76
    // The constructor for the callback mechanism.
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    77
    TLcdUserCallBack(TInt (*aFunction)(TUint aResID, TAny* aPtr), TAny* aPtr)
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    78
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    79
        {
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    80
        iCbFn = aFunction;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    81
        iDataPtr = aPtr;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    82
        }
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    83
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    84
public:
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    85
    // The callback function pointer.
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    86
    TInt (*iCbFn)(TUint aResID, TAny* aPtr);
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    87
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    88
    // Pointer to the data structure to be passed to the callback function.
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    89
    TAny *iDataPtr;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    90
    };
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    91
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    92
class DLcdPowerHandler : public DPowerHandler
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    93
{
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    94
public: // from DPowerHandler
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    95
  void PowerDown(TPowerState);
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    96
  void PowerUp();
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    97
public:	// to prevent a race condition with WServer trying to power up/down at the same time
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    98
  void PowerUpDfc();
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    99
  void PowerDownDfc();
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   100
public:
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   101
  DLcdPowerHandler();
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   102
  TInt Create();
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   103
  void DisplayOn();
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   104
  void DisplayOff();
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   105
  TInt HalFunction(TInt aFunction, TAny* a1, TAny* a2);
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   106
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   107
  void PowerUpLcd(TBool aSecure);
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   108
  void PowerDownLcd();
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   109
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   110
  void ScreenInfo(TScreenInfoV01& aInfo);
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   111
  void WsSwitchOnScreen();
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   112
  void WsSwitchOffScreen();
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   113
  void HandleMsg(TMessageBase* aMsg);
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   114
  void SwitchDisplay(TBool aSecure);
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   115
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   116
private:
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   117
  TInt GetCurrentDisplayModeInfo(TVideoInfoV01& aInfo, TBool aSecure);
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   118
  TInt GetSpecifiedDisplayModeInfo(TInt aMode, TVideoInfoV01& aInfo);
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   119
  TInt SetDisplayMode(TInt aMode);
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   120
  TInt AllocateFrameBuffer();
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   121
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   122
public:
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   123
    IMPORT_C static    TInt    RegisterCallback(TLcdUserCallBack* aCbPtr);
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   124
    IMPORT_C static    void    DeRegisterCallback(TLcdUserCallBack* aCbPtr);
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   125
  
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   126
private:
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   127
  TBool iDisplayOn;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   128
  DPlatChunkHw* iChunk;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   129
  DPlatChunkHw* iSecureChunk;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   130
  TBool iWsSwitchOnScreen;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   131
  TBool iSecureDisplay;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   132
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   133
public:
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   134
  TDfcQue* iDfcQ;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   135
  TMessageQue iMsgQ;					// to prevent a race condition with Power Manager trying to power up/down at the same time
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   136
  TDfc iPowerUpDfc;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   137
  TDfc iPowerDownDfc;	
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   138
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   139
private:
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   140
  NFastMutex iLock;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   141
  TPhysAddr ivRamPhys;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   142
  TPhysAddr iSecurevRamPhys;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   143
  TLcdUserCallBack * iAppCallBk[2];
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   144
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   145
public:
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   146
  TVideoInfoV01 iVideoInfo;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   147
  TVideoInfoV01 iSecureVideoInfo;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   148
  TInt			iSize;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   149
  TLinAddr iPortAddr;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   150
  TPhysAddr		iCompositionPhysical;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   151
  static   DLcdPowerHandler 	* pLcd;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   152
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   153
enum {
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   154
    FB_ID               = 0,
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   155
    FB_BASE             = 1,
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   156
    FB_HEIGHT           = 2,
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   157
    FB_WIDTH            = 3,
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   158
    FB_ORIENTATION      = 4,
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   159
    FB_BLANK            = 5,
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   160
    FB_INT_MASK         = 6,
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   161
    /* begin new interface */
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   162
    FB_INTERRUPT_CAUSE  = 7,
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   163
    FB_BPP              = 8,
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   164
    FB_COLOR_ORDER      = 9,
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   165
    FB_BYTE_ORDER       = 10,
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   166
    FB_PIXEL_ORDER      = 11,
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   167
    FB_ROW_PITCH        = 12,
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   168
    FB_ENABLED          = 13,
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   169
    FB_PALETTE_START    = 0x400 >> 2,
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   170
    FB_PALETTE_END   = FB_PALETTE_START+256-1,
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   171
    /* end new interface */
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   172
    };
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   173
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   174
#define FB_INT_VSYNC            (1U << 0)
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   175
#define FB_INT_BASE_UPDATE_DONE (1U << 1)
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   176
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   177
};
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   178
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   179
class DDisplayPddSyborg : public DDisplayPdd
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   180
	{
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   181
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   182
	public:
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   183
	DDisplayPddSyborg();
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   184
	~DDisplayPddSyborg();
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   185
    
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   186
  	/**  
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   187
    Called by the LDD to handle the device specific part of switching to Legacy mode.
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   188
 
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   189
	@return KErrNone if successful; or one of the other system wide error codes.
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   190
    */    
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   191
    virtual TInt  SetLegacyMode();
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   192
        
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   193
     /**
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   194
     Called by the LDD to handle the device specific part of switching to GCE mode.
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   195
     
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   196
     @return KErrNone if successful; or one of the other system wide error codes.
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   197
     */       
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   198
    virtual TInt  SetGceMode();
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   199
    
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   200
     /**
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   201
     Called by the LDD to handle the device specific part of setting the rotation.
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   202
     
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   203
     @return KErrNone if successful; or one of the other system wide error codes.
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   204
     */       
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   205
    virtual TInt  SetRotation(TInt aRotation);
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   206
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   207
     /**
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   208
     Called by the LDD to handle the device specific part of posting a User Buffer.
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   209
     
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   210
     @return KErrNone if successful; or one of the other system wide error codes.
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   211
     */ 	
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   212
	virtual TInt  PostUserBuffer(TBufferNode* aNode);
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   213
	
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   214
     /**
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   215
     Called by the LDD to handle the device specific part of posting a Composition Buffer
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   216
     
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   217
     @return KErrNone if successful; or one of the other system wide error codes.
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   218
     */ 		
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   219
	virtual TInt  PostCompositionBuffer(TBufferNode* aNode);
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   220
        
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   221
     /**
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   222
     Called by the LDD to handle the device specific part of posting the Legacy Buffuer
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   223
     
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   224
     @return KErrNone if successful; or one of the other system wide error codes.
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   225
     */   
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   226
    virtual TInt  PostLegacyBuffer();
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   227
    
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   228
    /**
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   229
     Called by the LDD to handle device specific cleanup operations when a channel is closed.
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   230
          
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   231
     @return KErrNone if successful; or one of the other system wide error codes.
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   232
     */  
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   233
    virtual TInt  CloseMsg();
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   234
            
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   235
     /**
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   236
     Called by the LDD to handle device specific initialisation tasks when a channel is opened.
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   237
     
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   238
     @param aUnit The screen/hardware unit number.
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   239
     @return KErrNone if successful; or one of the other system wide error codes.
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   240
     */    
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   241
    virtual TInt  CreateChannelSetup(TInt aUnit);
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   242
          
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   243
     /**
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   244
     Called by the LDD in order to detect whether a post operation is pending. This type of 
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   245
     information is specific to the actual physical device.
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   246
     
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   247
     @return ETrue if a Post operation is pending otherwise EFalse.
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   248
     */       
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   249
   	virtual TBool  PostPending();
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   250
    
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   251
    /**
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   252
     Called by the LDD to retrieve the DFC Queue created in the PDD.      
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   253
     
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   254
     @param aUnit The screen/hardware unit number.
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   255
     @return A pointer to the TDfcQue object created in the PDD.
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   256
     */    
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   257
    virtual TDfcQue* DfcQ(TInt  aUnit);    
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   258
            
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   259
public:
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   260
	static void VSyncDfcFn(TAny* aChannel);
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   261
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   262
private:
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   263
	TDfcQue* 		iDfcQ;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   264
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   265
    //generic  display info
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   266
	TVideoInfoV01    	iScreenInfo;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   267
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   268
    //Pointer to a buffer in the Pending state
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   269
    TBufferNode*     	iPendingBuffer;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   270
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   271
     //Pointer to a buffer in the Active state
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   272
    TBufferNode*     	iActiveBuffer;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   273
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   274
    DChunk * 		 	iChunk;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   275
    TLcdUserCallBack*   iLcdCallback;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   276
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   277
 public:
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   278
	TDfc 		     	iVSyncDfc;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   279
	};
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   280
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   281
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   282
/**
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   283
 PDD Factory class
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   284
 */
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   285
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   286
class DDisplayPddFactory : public DPhysicalDevice
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   287
	{
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   288
public:
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   289
	DDisplayPddFactory();
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   290
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   291
	virtual TInt Install();
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   292
	virtual void GetCaps(TDes8& aDes) const;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   293
	virtual TInt Create(DBase*& aChannel, TInt aUnit, const TDesC8* aInfo, const TVersion& aVer);
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   294
	virtual TInt Validate(TInt aDeviceType, const TDesC8* anInfo, const TVersion& aVer);
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   295
	};
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   296
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   297
#endif