baseport/syborg/svpframebuffer/svpframebuffer.h
author Shimizu Satoshi <s_shimizu@isb.co.jp>
Mon, 18 Oct 2010 19:39:25 +0900
changeset 124 606eafc6d6a8
parent 46 b6935a90ca64
permissions -rw-r--r--
Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
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
*
46
b6935a90ca64 Modify framebuffer and NGA framebuffer to read screen size from board model dtb file. Optimise memory usuage of frame buffer
johnathan.white@2718R8BGH51.accenture.com
parents: 38
diff changeset
    14
* Accenture Ltd - Syborg framebuffer improvements, now auto determines frame size from board model, performance and memory improvements
b6935a90ca64 Modify framebuffer and NGA framebuffer to read screen size from board model dtb file. Optimise memory usuage of frame buffer
johnathan.white@2718R8BGH51.accenture.com
parents: 38
diff changeset
    15
*
38
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    16
* Description: Minimalistic frame buffer driver
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    17
*
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    18
*/
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    19
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    20
#ifndef _SVPFRAMEBUFFER_H
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    21
#define _SVPFRAMEBUFFER_H
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    22
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    23
#include <display.h>
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    24
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    25
#include <videodriver.h>
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    26
#include <system.h>
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    27
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    28
#define __SVPFRAMEBUFFER_DEBUG
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    29
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    30
#ifdef __SVPFRAMEBUFFER_DEBUG
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    31
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    32
#define  __GCE_DEBUG_PRINT(a) 		Kern::Printf(a)
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    33
#define  __GCE_DEBUG_PRINT2(a,b) 	Kern::Printf(a,b)
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    34
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    35
#else
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    36
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    37
#define  __GCE_DEBUG_PRINT(a)
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    38
#define  __GCE_DEBUG_PRINT2(a,b)
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    39
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    40
#endif
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    41
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    42
// Macro to calculate the screen buffer size
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    43
// 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
    44
#define FRAME_BUFFER_SIZE(aBpp,aPpl,aLpp)	((aBpp/8)*aPpl*aLpp)	
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    45
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    46
_LIT(KLitLcd,"SYBORG_FB");
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    47
46
b6935a90ca64 Modify framebuffer and NGA framebuffer to read screen size from board model dtb file. Optimise memory usuage of frame buffer
johnathan.white@2718R8BGH51.accenture.com
parents: 38
diff changeset
    48
b6935a90ca64 Modify framebuffer and NGA framebuffer to read screen size from board model dtb file. Optimise memory usuage of frame buffer
johnathan.white@2718R8BGH51.accenture.com
parents: 38
diff changeset
    49
const TInt	KConfigLcdWidthInTwips     = 1996;
b6935a90ca64 Modify framebuffer and NGA framebuffer to read screen size from board model dtb file. Optimise memory usuage of frame buffer
johnathan.white@2718R8BGH51.accenture.com
parents: 38
diff changeset
    50
const TInt	KConfigLcdHeightInTwips    = 3550;
b6935a90ca64 Modify framebuffer and NGA framebuffer to read screen size from board model dtb file. Optimise memory usuage of frame buffer
johnathan.white@2718R8BGH51.accenture.com
parents: 38
diff changeset
    51
38
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    52
const TBool KConfigIsMono              = 0;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    53
const TBool KConfigIsPalettized        = 0;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    54
const TInt  KCOnfigOffsetToFirstPixel  = 0;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    55
const TBool KConfigPixelOrderRGB       = 0;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    56
const TBool KConfigPixelOrderLandscape = 1;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    57
const TInt  KConfigLcdDisplayMode       = 2;
46
b6935a90ca64 Modify framebuffer and NGA framebuffer to read screen size from board model dtb file. Optimise memory usuage of frame buffer
johnathan.white@2718R8BGH51.accenture.com
parents: 38
diff changeset
    58
b6935a90ca64 Modify framebuffer and NGA framebuffer to read screen size from board model dtb file. Optimise memory usuage of frame buffer
johnathan.white@2718R8BGH51.accenture.com
parents: 38
diff changeset
    59
const TInt KConfigOffsetToFirstPixel =0;
b6935a90ca64 Modify framebuffer and NGA framebuffer to read screen size from board model dtb file. Optimise memory usuage of frame buffer
johnathan.white@2718R8BGH51.accenture.com
parents: 38
diff changeset
    60
38
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    61
const TInt  KConfigLcdNumberOfDisplayModes = 3;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    62
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    63
46
b6935a90ca64 Modify framebuffer and NGA framebuffer to read screen size from board model dtb file. Optimise memory usuage of frame buffer
johnathan.white@2718R8BGH51.accenture.com
parents: 38
diff changeset
    64
const TInt  KConfigBitsPerPixel        = 32;
b6935a90ca64 Modify framebuffer and NGA framebuffer to read screen size from board model dtb file. Optimise memory usuage of frame buffer
johnathan.white@2718R8BGH51.accenture.com
parents: 38
diff changeset
    65
38
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    66
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    67
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
    68
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    69
/********************************************************************/
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    70
/* Class Definition                                                 */
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    71
/********************************************************************/
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    72
/**
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    73
 * 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
    74
 * 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
    75
 * 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
    76
 */
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    77
class TLcdUserCallBack
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    78
    {
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    79
public:
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    80
    // The constructor for the callback mechanism.
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    81
    TLcdUserCallBack(TInt (*aFunction)(TUint aResID, TAny* aPtr), TAny* 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
        iCbFn = aFunction;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    85
        iDataPtr = aPtr;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    86
        }
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    87
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    88
public:
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    89
    // The callback function pointer.
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    90
    TInt (*iCbFn)(TUint aResID, TAny* aPtr);
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    91
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    92
    // Pointer to the data structure to be passed to the callback function.
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    93
    TAny *iDataPtr;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    94
    };
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    95
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    96
class DLcdPowerHandler : public DPowerHandler
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    97
{
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    98
public: // from DPowerHandler
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
    99
  void PowerDown(TPowerState);
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   100
  void PowerUp();
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   101
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
   102
  void PowerUpDfc();
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   103
  void PowerDownDfc();
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   104
public:
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   105
  DLcdPowerHandler();
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   106
  TInt Create();
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   107
  void DisplayOn();
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   108
  void DisplayOff();
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   109
  TInt HalFunction(TInt aFunction, TAny* a1, TAny* a2);
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   110
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   111
  void PowerUpLcd(TBool aSecure);
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   112
  void PowerDownLcd();
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   113
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   114
  void ScreenInfo(TScreenInfoV01& aInfo);
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   115
  void WsSwitchOnScreen();
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   116
  void WsSwitchOffScreen();
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   117
  void HandleMsg(TMessageBase* aMsg);
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   118
  void SwitchDisplay(TBool aSecure);
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   119
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   120
private:
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   121
  TInt GetCurrentDisplayModeInfo(TVideoInfoV01& aInfo, TBool aSecure);
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   122
  TInt GetSpecifiedDisplayModeInfo(TInt aMode, TVideoInfoV01& aInfo);
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   123
  TInt SetDisplayMode(TInt aMode);
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   124
  TInt AllocateFrameBuffer();
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   125
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   126
public:
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   127
    IMPORT_C static    TInt    RegisterCallback(TLcdUserCallBack* aCbPtr);
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   128
    IMPORT_C static    void    DeRegisterCallback(TLcdUserCallBack* aCbPtr);
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   129
  
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   130
private:
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   131
  TBool iDisplayOn;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   132
  DPlatChunkHw* iChunk;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   133
  DPlatChunkHw* iSecureChunk;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   134
  TBool iWsSwitchOnScreen;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   135
  TBool iSecureDisplay;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   136
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   137
public:
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   138
  TDfcQue* iDfcQ;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   139
  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
   140
  TDfc iPowerUpDfc;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   141
  TDfc iPowerDownDfc;	
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   142
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   143
private:
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   144
  NFastMutex iLock;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   145
  TPhysAddr ivRamPhys;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   146
  TPhysAddr iSecurevRamPhys;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   147
  TLcdUserCallBack * iAppCallBk[2];
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   148
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   149
public:
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   150
  TVideoInfoV01 iVideoInfo;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   151
  TVideoInfoV01 iSecureVideoInfo;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   152
  TInt			iSize;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   153
  TLinAddr iPortAddr;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   154
  TPhysAddr		iCompositionPhysical;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   155
  static   DLcdPowerHandler 	* pLcd;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   156
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   157
enum {
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   158
    FB_ID               = 0,
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   159
    FB_BASE             = 1,
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   160
    FB_HEIGHT           = 2,
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   161
    FB_WIDTH            = 3,
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   162
    FB_ORIENTATION      = 4,
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   163
    FB_BLANK            = 5,
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   164
    FB_INT_MASK         = 6,
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   165
    /* begin new interface */
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   166
    FB_INTERRUPT_CAUSE  = 7,
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   167
    FB_BPP              = 8,
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   168
    FB_COLOR_ORDER      = 9,
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   169
    FB_BYTE_ORDER       = 10,
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   170
    FB_PIXEL_ORDER      = 11,
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   171
    FB_ROW_PITCH        = 12,
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   172
    FB_ENABLED          = 13,
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   173
    FB_PALETTE_START    = 0x400 >> 2,
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   174
    FB_PALETTE_END   = FB_PALETTE_START+256-1,
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   175
    /* end new interface */
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
#define FB_INT_VSYNC            (1U << 0)
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   179
#define FB_INT_BASE_UPDATE_DONE (1U << 1)
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
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   183
class DDisplayPddSyborg : public DDisplayPdd
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   184
	{
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   185
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   186
	public:
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   187
	DDisplayPddSyborg();
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   188
	~DDisplayPddSyborg();
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   189
    
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   190
  	/**  
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   191
    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
   192
 
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   193
	@return KErrNone if successful; or one of the other system wide error codes.
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   194
    */    
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   195
    virtual TInt  SetLegacyMode();
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   196
        
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   197
     /**
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   198
     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
   199
     
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   200
     @return KErrNone if successful; or one of the other system wide error codes.
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   201
     */       
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   202
    virtual TInt  SetGceMode();
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   203
    
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   204
     /**
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   205
     Called by the LDD to handle the device specific part of setting the rotation.
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   206
     
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   207
     @return KErrNone if successful; or one of the other system wide error codes.
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   208
     */       
46
b6935a90ca64 Modify framebuffer and NGA framebuffer to read screen size from board model dtb file. Optimise memory usuage of frame buffer
johnathan.white@2718R8BGH51.accenture.com
parents: 38
diff changeset
   209
	virtual TInt  SetRotation(RDisplayChannel::TDisplayRotation aRotation);
38
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   210
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   211
     /**
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   212
     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
   213
     
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   214
     @return KErrNone if successful; or one of the other system wide error codes.
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   215
     */ 	
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   216
	virtual TInt  PostUserBuffer(TBufferNode* aNode);
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   217
	
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   218
     /**
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   219
     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
   220
     
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   221
     @return KErrNone if successful; or one of the other system wide error codes.
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   222
     */ 		
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   223
	virtual TInt  PostCompositionBuffer(TBufferNode* aNode);
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   224
        
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   225
     /**
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   226
     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
   227
     
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   228
     @return KErrNone if successful; or one of the other system wide error codes.
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   229
     */   
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   230
    virtual TInt  PostLegacyBuffer();
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   231
    
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   232
    /**
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   233
     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
   234
          
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   235
     @return KErrNone if successful; or one of the other system wide error codes.
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   236
     */  
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   237
    virtual TInt  CloseMsg();
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   238
            
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   239
     /**
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   240
     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
   241
     
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   242
     @param aUnit The screen/hardware unit number.
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   243
     @return KErrNone if successful; or one of the other system wide error codes.
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   244
     */    
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   245
    virtual TInt  CreateChannelSetup(TInt aUnit);
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   246
          
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   247
     /**
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   248
     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
   249
     information is specific to the actual physical device.
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   250
     
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   251
     @return ETrue if a Post operation is pending otherwise EFalse.
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   252
     */       
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   253
   	virtual TBool  PostPending();
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   254
    
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   255
    /**
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   256
     Called by the LDD to retrieve the DFC Queue created in the PDD.      
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   257
     
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   258
     @param aUnit The screen/hardware unit number.
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   259
     @return A pointer to the TDfcQue object created in the PDD.
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   260
     */    
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   261
    virtual TDfcQue* DfcQ(TInt  aUnit);    
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   262
            
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   263
public:
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   264
	static void VSyncDfcFn(TAny* aChannel);
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   265
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   266
private:
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   267
	TDfcQue* 		iDfcQ;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   268
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   269
    //generic  display info
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   270
	TVideoInfoV01    	iScreenInfo;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   271
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   272
    //Pointer to a buffer in the Pending state
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   273
    TBufferNode*     	iPendingBuffer;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   274
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   275
     //Pointer to a buffer in the Active state
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   276
    TBufferNode*     	iActiveBuffer;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   277
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   278
    DChunk * 		 	iChunk;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   279
    TLcdUserCallBack*   iLcdCallback;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   280
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   281
 public:
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   282
	TDfc 		     	iVSyncDfc;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   283
	};
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
/**
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   287
 PDD Factory class
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   288
 */
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   289
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   290
class DDisplayPddFactory : public DPhysicalDevice
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   291
	{
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   292
public:
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   293
	DDisplayPddFactory();
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   294
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   295
	virtual TInt Install();
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   296
	virtual void GetCaps(TDes8& aDes) const;
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   297
	virtual TInt Create(DBase*& aChannel, TInt aUnit, const TDesC8* aInfo, const TVersion& aVer);
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   298
	virtual TInt Validate(TInt aDeviceType, const TDesC8* anInfo, const TVersion& aVer);
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   299
	};
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   300
33dfab4ab0fc PDD Display Driver for Syborg
emilioc
parents:
diff changeset
   301
#endif