Modify framebuffer and NGA framebuffer to read screen size from board model dtb file. Optimise memory usuage of frame buffer
authorjohnathan.white@2718R8BGH51.accenture.com
Mon, 08 Mar 2010 18:45:03 +0000
changeset 46 b6935a90ca64
parent 45 01c1ffcc4fca
child 48 34cd6bf038ac
child 67 57a5a30dc911
Modify framebuffer and NGA framebuffer to read screen size from board model dtb file. Optimise memory usuage of frame buffer Add example minigui application with hooks to profiler (which writes results to S:\). Modified NGA framebuffer to run its own dfc queue at high priority
applications/Symbian_MiniGUI_TestApp/BLD.INF
applications/Symbian_MiniGUI_TestApp/Grid.iby
applications/Symbian_MiniGUI_TestApp/Grid.mmp
applications/Symbian_MiniGUI_TestApp/grid.cpp
baseport/syborg/bld.inf
baseport/syborg/fb/syborg_fb.cpp
baseport/syborg/fb/syborg_fb.h
baseport/syborg/rom/base_syborg.iby
baseport/syborg/svpframebuffer/svpframebuffer.cpp
baseport/syborg/svpframebuffer/svpframebuffer.h
baseport/syborg/syborg.dtb
baseport/syborg/syborg.dts
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/applications/Symbian_MiniGUI_TestApp/BLD.INF	Mon Mar 08 18:45:03 2010 +0000
@@ -0,0 +1,21 @@
+/*******************************************************************************
+* Copyright (c) 2009 Accenture
+* All rights reserved. This program and the accompanying materials
+* are made available under the terms of the Eclipse Public License v1.0
+* which accompanies this distribution, and is available at
+* http://www.eclipse.org/legal/epl-v10.html
+*
+* Contributors:
+* Accenture - Johnathan White
+
+*******************************************************************************/
+
+PRJ_PLATFORMS
+ARMV5
+
+PRJ_EXPORTS
+grid.iby \epoc32\rom\include\grid.iby
+
+PRJ_MMPFILES
+grid
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/applications/Symbian_MiniGUI_TestApp/Grid.iby	Mon Mar 08 18:45:03 2010 +0000
@@ -0,0 +1,21 @@
+/*******************************************************************************
+* Copyright (c) 2009 Accenture
+* All rights reserved. This program and the accompanying materials
+* are made available under the terms of the Eclipse Public License v1.0
+* which accompanies this distribution, and is available at
+* http://www.eclipse.org/legal/epl-v10.html
+*
+* Contributors:
+* Accenture - Johnathan White
+
+*******************************************************************************/
+
+#ifndef __SYMBIANMINIGUI_TESTAPP_IBY__
+#define __SYMBIANMINIGUI_TESTAPP_IBY__
+
+
+//actual logo console app
+file=\epoc32\release\armv5\urel\grid.exe sys\bin\grid.exe
+
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/applications/Symbian_MiniGUI_TestApp/Grid.mmp	Mon Mar 08 18:45:03 2010 +0000
@@ -0,0 +1,18 @@
+/*******************************************************************************
+* Copyright (c) 2009 Accenture
+* All rights reserved. This program and the accompanying materials
+* are made available under the terms of the Eclipse Public License v1.0
+* which accompanies this distribution, and is available at
+* http://www.eclipse.org/legal/epl-v10.html
+*
+* Contributors:
+* Accenture - Johnathan White
+
+*******************************************************************************/
+
+TARGET			grid.EXE
+TARGETTYPE		EXE
+SOURCEPATH		.
+SOURCE			grid.cpp
+SYSTEMINCLUDE		\epoc32\include
+LIBRARY			efsrv.lib euser.lib hal.lib ws32.lib 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/applications/Symbian_MiniGUI_TestApp/grid.cpp	Mon Mar 08 18:45:03 2010 +0000
@@ -0,0 +1,83 @@
+#include <w32std.h> 
+#include "profiler.h"
+
+const TSize KSize(64,60);
+const TInt KRow = 4;
+const TInt KCol = 5; 
+
+void MainL()	
+	{	
+	RWsSession ws;
+	ws.Connect();
+ 	CWsScreenDevice* scr = new(ELeave) CWsScreenDevice(ws);
+	scr->Construct();
+ 	CWindowGc* gc = new(ELeave) CWindowGc(scr);
+	gc->Construct();
+ 	RWindowGroup grp(ws);
+	grp.Construct(0xc0decafe, ETrue);
+ 	RWindow win(ws);
+	win.Construct(grp, 0xbeefcafe);
+	win.SetExtent(TPoint(20,160), TSize(320,240));
+	win.Activate();
+ 	win.Invalidate();
+	win.BeginRedraw();
+	gc->Activate(win);
+ 	gc->SetPenStyle(CGraphicsContext::ENullPen);
+	gc->SetBrushStyle(CGraphicsContext::ESolidBrush);
+ 	TBool color = EFalse;
+
+if (Profiler::Start() == KErrNotFound)
+	{
+	_LIT(KProfiler,"profiler");
+	_LIT(KStart,"start -noui -drive=S");
+	RProcess p;
+	if (p.Create(KProfiler,KStart) == KErrNone)
+		{
+		p.Resume();
+		p.Close();
+		}
+	}
+
+	for (TInt col=0; col<KCol; ++col)
+		{
+		color = !color;		
+		for (TInt row=0; row<KRow; ++row)
+			{
+			TRect rect;
+			rect.iTl.iX = col * KSize.iWidth;
+			rect.iTl.iY = row * KSize.iHeight;
+			rect.SetSize(KSize);
+			color = !color;
+			gc->SetBrushColor(color? KRgbGray : KRgbBlack);
+			gc->DrawRect(rect);
+			}
+	}
+	gc->Deactivate();
+	win.EndRedraw();
+	ws.Flush();
+ 	User::After(3000000);
+ 	win.Close();
+	grp.Close();
+	delete gc;
+	delete scr;
+	ws.Close();
+
+	Profiler::Stop();
+	Profiler::Close();
+	Profiler::Unload();
+
+	} 
+
+
+GLDEF_C TInt E32Main()	
+{	
+
+	CTrapCleanup* tc = CTrapCleanup::New();	
+	if (!tc)
+		{		
+		return KErrNoMemory;
+		}
+	TRAPD(err, MainL());
+	delete tc;
+ 	return err;	
+}
\ No newline at end of file
--- a/baseport/syborg/bld.inf	Thu Mar 04 00:55:21 2010 +0000
+++ b/baseport/syborg/bld.inf	Mon Mar 08 18:45:03 2010 +0000
@@ -55,9 +55,6 @@
 serial/serial					// Serial / UART ports
 fb/fb							// Framebuffer
 
-fb/fb_landscape
-fb/fb_portrait
-fb/fb_portrait_wvga
 
 keyboard/keyboard				// Keyboard
 pointer/pointer					// Pointer
--- a/baseport/syborg/fb/syborg_fb.cpp	Thu Mar 04 00:55:21 2010 +0000
+++ b/baseport/syborg/fb/syborg_fb.cpp	Mon Mar 08 18:45:03 2010 +0000
@@ -11,6 +11,8 @@
 *
 * Contributors:
 *
+* Accenture Ltd - Syborg framebuffer improvements, now auto determines frame size from board model, performance and memory improvements
+*
 * Description: Minimalistic frame buffer driver
 *
 */
@@ -114,10 +116,10 @@
 
 void DLcdPowerHandler::PowerUpLcd(TBool aSecure)
 {
-#if 1
+
   WriteReg(iPortAddr, FB_ENABLED, 0);
   WriteReg(iPortAddr, FB_BASE, aSecure ? iSecurevRamPhys : ivRamPhys);
-  WriteReg(iPortAddr, FB_WIDTH, iVideoInfo.iSizeInPixels.iWidth);
+
   WriteReg(iPortAddr, FB_BLANK, 0);
   WriteReg(iPortAddr, FB_BPP, 32);
   WriteReg(iPortAddr, FB_COLOR_ORDER, 0);
@@ -125,8 +127,9 @@
   WriteReg(iPortAddr, FB_PIXEL_ORDER, 0);
   WriteReg(iPortAddr, FB_INT_MASK, 0);
   WriteReg(iPortAddr, FB_ENABLED, 1);
-  WriteReg(iPortAddr, FB_HEIGHT, iVideoInfo.iSizeInPixels.iHeight);
-#endif
+
+  // We don't write the Height and Width of the framebuffer, this is controlled by the board model
+
 }
 
 void DLcdPowerHandler::PowerDownLcd()
@@ -202,7 +205,7 @@
 
 	  aInfo.iIsPalettized       = KConfigIsPalettized;
 
-	  aInfo.iOffsetBetweenLines = KConfigOffsetBetweenLines;
+	  aInfo.iOffsetBetweenLines = iVideoInfo.iSizeInPixels.iWidth*4; //Offset depends on width of framebuffer
 
 	  aInfo.iBitsPerPixel       = KConfigBitsPerPixel;
 	}
@@ -211,11 +214,13 @@
 
 TInt DLcdPowerHandler::AllocateFrameBuffer()
 {
-	// Allocate physical RAM for video
-
-// Added only the comments
-	TInt vSize = TSyborg::VideoRamSize(); // Maximum display now 854 x 854
-
+// Allocate physical RAM for video
+	
+	//read width and height of display from board model and allocate size
+	TInt width = ReadReg(iPortAddr, FB_WIDTH);
+	TInt height = ReadReg(iPortAddr, FB_HEIGHT);
+	
+	TInt vSize = 4*width*height; //*4 as 32bits per pixel
 
 	NKern::ThreadEnterCS();
 	TInt r = Epoc::AllocPhysicalRam(vSize,Syborg::VideoRamPhys);
@@ -255,13 +260,16 @@
 
 	TUint* pV2 = (TUint*)iSecureChunk->LinearAddress();
 
-	iVideoInfo.iSizeInPixels.iWidth  = KConfigLcdWidth;
-	iVideoInfo.iSizeInPixels.iHeight = KConfigLcdHeight;
-	iVideoInfo.iDisplayMode = KConfigLcdDisplayMode;
+	//width and height set by reading board model
+	iVideoInfo.iSizeInPixels.iWidth  = width;
+	iVideoInfo.iSizeInPixels.iHeight = height;
 
+	//offset between lines depends on width of screen
+	iVideoInfo.iOffsetBetweenLines = width*4;
+
+	iVideoInfo.iDisplayMode = KConfigLcdDisplayMode;
 	iVideoInfo.iOffsetToFirstPixel = KConfigOffsetToFirstPixel;
-	iVideoInfo.iOffsetBetweenLines = KConfigOffsetBetweenLines;
-
+	
 	iVideoInfo.iIsPalettized = KConfigIsPalettized;
 	iVideoInfo.iBitsPerPixel = KConfigBitsPerPixel;
 	iVideoInfo.iSizeInTwips.iWidth = KConfigLcdWidthInTwips;
@@ -273,16 +281,6 @@
 
 	iSecureVideoInfo = iVideoInfo;
 	iSecureVideoInfo.iVideoAddress = (TInt)pV2;
-
-#if 0
-	WriteReg(iPortAddr, FB_ENABLED, 0);
-	WriteReg(IPortAddr, FB_INT_MASK, 0);
-	WriteReg(iPortAddr, FB_BASE, iSecureDisplay ? iSecurevRamPhys : ivRamPhys);
-	WriteReg(iPortAddr, FB_WIDTH, iVideoInfo.iSizeInPixels.iWidth);
-	WriteReg(iPortAddr, FB_HEIGHT, iVideoInfo.iSizeInPixels.iHeight);
-	WriteReg(iPortAddr, FB_BLANK, 0);
-	WriteReg(iPortAddr, FB_ENABLED, 1);
-#endif
 	
 	return KErrNone;
 }
@@ -432,45 +430,6 @@
 
 	iPortAddr = KHwBaseClcd;
 
-	// !@!
-#if 0	
-	// Map the video RAM
-	TInt vSize = TSyborg::VideoRamSize();
-	ivRamPhys = TSyborg::VideoRamPhys();
-
-	TInt r = DPlatChunkHw::New(iChunk,ivRamPhys,vSize,EMapAttrUserRw|EMapAttrBufferedC);
-	if(r != KErrNone)
-	  return r;
-
-	TUint* pV = (TUint*)iChunk->LinearAddress();
-
-	iSecurevRamPhys = ivRamPhys + vSize;
-	TInt r2 = DPlatChunkHw::New(iSecureChunk,iSecurevRamPhys,vSize,EMapAttrUserRw|EMapAttrBufferedC);
-	if(r2 != KErrNone)
-	  return r2;
-
-	TUint* pV2 = (TUint*)iSecureChunk->LinearAddress();
-#endif
-
-	iVideoInfo.iSizeInPixels.iWidth  = KConfigLcdWidth;
-	iVideoInfo.iSizeInPixels.iHeight = KConfigLcdHeight;
-	iVideoInfo.iDisplayMode = KConfigLcdDisplayMode;
-
-	iVideoInfo.iOffsetToFirstPixel = KConfigOffsetToFirstPixel;
-	iVideoInfo.iOffsetBetweenLines = KConfigOffsetBetweenLines;
-
-	iVideoInfo.iIsPalettized = KConfigIsPalettized;
-	iVideoInfo.iBitsPerPixel = KConfigBitsPerPixel;
-	iVideoInfo.iSizeInTwips.iWidth = KConfigLcdWidthInTwips;
-	iVideoInfo.iSizeInTwips.iHeight = KConfigLcdHeightInTwips;
-	iVideoInfo.iIsMono = KConfigIsMono;
-	// !@!	iVideoInfo.iVideoAddress = (TInt)pV;
-	iVideoInfo.iIsPixelOrderLandscape = KConfigPixelOrderLandscape;
-	iVideoInfo.iIsPixelOrderRGB = KConfigPixelOrderRGB;
-
-	iSecureVideoInfo = iVideoInfo;
-	// !@! iSecureVideoInfo.iVideoAddress = (TInt)pV2;
-
 	AllocateFrameBuffer();
 	TInt r = Kern::AddHalEntry(EHalGroupDisplay,DoHalFunction,this);
 	if(r != KErrNone)
--- a/baseport/syborg/fb/syborg_fb.h	Thu Mar 04 00:55:21 2010 +0000
+++ b/baseport/syborg/fb/syborg_fb.h	Mon Mar 08 18:45:03 2010 +0000
@@ -11,6 +11,8 @@
 *
 * Contributors:
 *
+* Accenture Ltd - Syborg framebuffer improvements, now auto determines frame size from board model, performance and memory improvements
+*
 * Description: Minimalistic frame buffer driver
 *
 */
@@ -25,54 +27,10 @@
 #include <system.h>
 
 
-
-// The definition of __portrait_display__ in the MMP file affects
-// both the display and the pointer component, so both must be
-// rebuilt if this setting is changed.
-
-
 _LIT(KLitLcd,"SYBORG_FB");
 
-
-#ifdef __PORTRAIT_DISPLAY__ // portrait display selected
-
-#	ifdef __DISPLAY_WVGA__
-
-#pragma comment(layout,"Portrait display enabled")
-const TUint KConfigLcdWidth            	= 854; // This must be left at 640, even with only 360 used by S60
-const TUint	KConfigLcdHeight	       	= 854;
-const TInt	KConfigLcdHeightInTwips     = 12860;
-const TInt	KConfigLcdWidthInTwips    	= 12860;
-const TUint	KConfigMouseWidth	       	= 480; // Usable width for the mouse driver
-const TUint	KConfigMouseMin			   	= 0;
-
-#	else //__DISPLAY_WVGA__
-
-#pragma comment(layout,"Portrait display enabled")
-const TUint KConfigLcdWidth            = 640; // This must be left at 640, even with only 360 used by S60
-const TUint	KConfigLcdHeight	       = 640;
-const TInt	KConfigLcdHeightInTwips     = 3550;
-const TInt	KConfigLcdWidthInTwips    = 3550;
-const TUint	KConfigMouseWidth	       = 360; // Usable width for the mouse driver
-
-const TUint	KConfigMouseMin			   = 0;
-#	endif //__DISPLAY_WVGA__
-
-
-
-
-#else // __PORTRAIT_DISPLAY__  Landscape display selected
-
-#pragma comment(layout,"Landscape display enabled")
-const TUint  KConfigLcdWidth            = 640;
-const TUint	KConfigLcdHeight	       = 480;
-const TInt	KConfigLcdWidthInTwips     = 3550;
-const TInt	KConfigLcdHeightInTwips    = 2670;
-const TUint	KConfigMouseWidth	       = 640; // Usable width for the mouse driver
-
-const TUint	KConfigMouseMin			   = 120; // mouse range is 120 - 480, not 0 - 360
-#endif // __PORTRAIT_DISPLAY__
-
+const TInt	KConfigLcdWidthInTwips     = 9638;
+const TInt	KConfigLcdHeightInTwips    = 7370;
 
 const TBool KConfigIsMono              = 0;
 const TBool KConfigIsPalettized        = 0;
@@ -82,17 +40,14 @@
 const TBool KConfigPixelOrderRGB       = 0;
 const TBool KConfigPixelOrderLandscape = 1;
 const TInt  KConfigLcdDisplayMode       = 2;
-//const TInt  KConfigLcdDisplayMode       = 1;
+
+
 const TInt  KConfigLcdNumberOfDisplayModes = 3;
 
 
 const TInt  KConfigBitsPerPixel        = 24;
 
-#ifdef __DISPLAY_WVGA__
-const TInt  KConfigOffsetBetweenLines  = 3416;
-#else //__DISPLAY_WVGA__
-const TInt  KConfigOffsetBetweenLines  = 2560;
-#endif //__DISPLAY_WVGA__
+
 
 
 class DLcdPowerHandler : public DPowerHandler
--- a/baseport/syborg/rom/base_syborg.iby	Thu Mar 04 00:55:21 2010 +0000
+++ b/baseport/syborg/rom/base_syborg.iby	Mon Mar 08 18:45:03 2010 +0000
@@ -69,19 +69,14 @@
 extension[VARID]=	KERNEL_DIR\DEBUG_DIR\evfp.dll			        \sys\bin\evfp.dll
 
 
-// Changes allowing us of either portrait or landscape mode
-//extension[VARID]=	KERNEL_DIR\DEBUG_DIR\_PLATFORM_NAME_lcd.dll		\sys\bin\lcd.dll
-#ifdef _PORTRAIT_
+// Either include NGA or Non NGA Framebuffer
+#ifdef SYMBIAN_BASE_USE_GCE
+extension[VARID]=KERNEL_DIR\DEBUG_DIR\_PLATFORM_NAME_svpframebuffer.dll	\sys\bin\lcd.dll
+device[VARID]=KERNEL_DIR\DEBUG_DIR\display.ldd				\sys\bin\display0.ldd
+#else
+extension[VARID]=	KERNEL_DIR\DEBUG_DIR\_PLATFORM_NAME_lcd.dll		\sys\bin\lcd.dll
+#endif
 
-#	ifdef _WVGA_
-extension[VARID]=KERNEL_DIR\DEBUG_DIR\_PLATFORM_NAME_lcd_portrait_wvga.dll		    \sys\bin\lcd.dll
-#	else //_WVGA_
-extension[VARID]=KERNEL_DIR\DEBUG_DIR\_PLATFORM_NAME_lcd_portrait.dll		    \sys\bin\lcd.dll
-#	endif //_WVGA_
-
-#else
-extension[VARID]=KERNEL_DIR\DEBUG_DIR\_PLATFORM_NAME_lcd_landscape.dll		    \sys\bin\lcd.dll
-#endif
 
 device[VARID]=		KERNEL_DIR\DEBUG_DIR\_PLATFORM_NAME_eserial.pdd		\sys\bin\euart1.pdd
 device[VARID]=		KERNEL_DIR\DEBUG_DIR\ecomm.ldd				\sys\bin\ecomm.ldd
@@ -133,12 +128,22 @@
 define	ESTART_EXE		_PLATFORM_NAME_e32strt.exe	// customised ESTART
 
 define	KEYMAP_FILE	_PLATFORM_NAME_ekdata
+
+file=ABI_DIR\DEBUG_DIR\KEYMAP_FILE.dll	\sys\bin\ekdata.dll
+
 #define	SCDV_DLL        _PLATFORM_NAME_scdv.dll
 #define	EUSER_DLL	_PLATFORM_NAME_euser.dll
 
+device[VARID] 	=KERNEL_DIR\DEBUG_DIR\pipelib.ldd		\sys\bin\pipelib.ldd
+
 
 device[VARID]	=KERNEL_DIR\DEBUG_DIR\_PLATFORM_NAME_soundsc.pdd	    \sys\bin\soundsc.pdd
 device[VARID]	=KERNEL_DIR\DEBUG_DIR\esoundsc.ldd				            \sys\bin\esoundsc.ldd
 
+//add sampling profiler
+file= KERNEL_DIR\DEBUG_DIR\profiler.exe		\sys\bin\profiler.exe
+device[VARID] =KERNEL_DIR\DEBUG_DIR\sampler.ldd		\sys\bin\sampler.ldd
+
+
 #endif  // __BASE_SYBORG_IBY__
 
--- a/baseport/syborg/svpframebuffer/svpframebuffer.cpp	Thu Mar 04 00:55:21 2010 +0000
+++ b/baseport/syborg/svpframebuffer/svpframebuffer.cpp	Mon Mar 08 18:45:03 2010 +0000
@@ -11,6 +11,8 @@
 *
 * Contributors:
 *
+* Accenture Ltd - Syborg framebuffer improvements, now auto determines frame size from board model, performance and memory improvements
+*
 * Description: Minimalistic frame buffer driver
 *
 */
@@ -107,6 +109,7 @@
 void DLcdPowerHandler::PowerDownDfc()
 {
   DisplayOff();
+
   PowerDownDone();
 }
 
@@ -122,10 +125,10 @@
 
 void DLcdPowerHandler::PowerUpLcd(TBool aSecure)
 {
-#if 1
+
   WriteReg(iPortAddr, FB_ENABLED, 0);
   WriteReg(iPortAddr, FB_BASE, aSecure ? iSecurevRamPhys : ivRamPhys);
-  WriteReg(iPortAddr, FB_WIDTH, iVideoInfo.iSizeInPixels.iWidth);
+
   WriteReg(iPortAddr, FB_BLANK, 0);
   WriteReg(iPortAddr, FB_BPP, 32);
   WriteReg(iPortAddr, FB_COLOR_ORDER, 0);
@@ -133,8 +136,9 @@
   WriteReg(iPortAddr, FB_PIXEL_ORDER, 0);
   WriteReg(iPortAddr, FB_INT_MASK, 0);
   WriteReg(iPortAddr, FB_ENABLED, 1);
-  WriteReg(iPortAddr, FB_HEIGHT, iVideoInfo.iSizeInPixels.iHeight);
-#endif
+
+// We don't write the Height and Width of the framebuffer, this is controlled by the board model
+
 }
 
 void DLcdPowerHandler::PowerDownLcd()
@@ -207,7 +211,7 @@
 	{
 	  aInfo.iOffsetToFirstPixel = KCOnfigOffsetToFirstPixel;
 	  aInfo.iIsPalettized       = KConfigIsPalettized;
-	  aInfo.iOffsetBetweenLines = KCOnfigOffsetBetweenLines;
+	  aInfo.iOffsetBetweenLines = iVideoInfo.iSizeInPixels.iWidth*4; //Offset depends on width of framebuffer
 	  aInfo.iBitsPerPixel       = KConfigBitsPerPixel;
 	}
   return KErrNone;
@@ -216,10 +220,15 @@
 TInt DLcdPowerHandler::AllocateFrameBuffer()
 {
 	// Allocate physical RAM for video
-	TInt vSize = TSyborg::VideoRamSize();
+	
+	//read width and height of display from board model and allocate size
+	TInt width = ReadReg(iPortAddr, FB_WIDTH);
+	TInt height = ReadReg(iPortAddr, FB_HEIGHT);
+	
+	iSize = 4*width*height; //*4 as 32bits per pixel
 
 	NKern::ThreadEnterCS();
-	TInt r = Epoc::AllocPhysicalRam(vSize,Syborg::VideoRamPhys);
+	TInt r = Epoc::AllocPhysicalRam(iSize,Syborg::VideoRamPhys);
 	if (r != KErrNone)
 	{
 	        NKern::ThreadLeaveCS();
@@ -229,7 +238,7 @@
 	// Map the video RAM
 	ivRamPhys = TSyborg::VideoRamPhys();
 
-	r = DPlatChunkHw::New(iChunk,ivRamPhys,vSize,EMapAttrUserRw|EMapAttrBufferedC);
+	r = DPlatChunkHw::New(iChunk,ivRamPhys,iSize,EMapAttrUserRw|EMapAttrBufferedC);
 
 	NKern::ThreadLeaveCS();
 
@@ -240,14 +249,14 @@
 
 	// Allocate physical RAM for secure display
 	NKern::ThreadEnterCS();
-	r = Epoc::AllocPhysicalRam(vSize,Syborg::VideoRamPhysSecure);
+	r = Epoc::AllocPhysicalRam(iSize,Syborg::VideoRamPhysSecure);
 	if (r != KErrNone)
 	{
 	        NKern::ThreadLeaveCS();
 		Kern::Fault("AllocVideoRam 2",r);
 	}
-	iSecurevRamPhys = ivRamPhys + vSize;
-	TInt r2 = DPlatChunkHw::New(iSecureChunk,iSecurevRamPhys,vSize,EMapAttrUserRw|EMapAttrBufferedC);
+	iSecurevRamPhys = ivRamPhys + iSize;
+	TInt r2 = DPlatChunkHw::New(iSecureChunk,iSecurevRamPhys,iSize,EMapAttrUserRw|EMapAttrBufferedC);
 
 	NKern::ThreadLeaveCS();
 
@@ -256,11 +265,16 @@
 
 	TUint* pV2 = (TUint*)iSecureChunk->LinearAddress();
 
-	iVideoInfo.iSizeInPixels.iWidth  = KConfigLcdWidth;
-	iVideoInfo.iSizeInPixels.iHeight = KConfigLcdHeight;
+	//width and height set by reading board model
+	iVideoInfo.iSizeInPixels.iWidth  = width;
+	iVideoInfo.iSizeInPixels.iHeight = height;
+
+	//offset between lines depends on width of screen
+	iVideoInfo.iOffsetBetweenLines = width*4;
+
 	iVideoInfo.iDisplayMode = KConfigLcdDisplayMode;
-	iVideoInfo.iOffsetToFirstPixel = KCOnfigOffsetToFirstPixel;
-	iVideoInfo.iOffsetBetweenLines = KCOnfigOffsetBetweenLines;
+	iVideoInfo.iOffsetToFirstPixel = KConfigOffsetToFirstPixel;
+	
 	iVideoInfo.iIsPalettized = KConfigIsPalettized;
 	iVideoInfo.iBitsPerPixel = KConfigBitsPerPixel;
 	iVideoInfo.iSizeInTwips.iWidth = KConfigLcdWidthInTwips;
@@ -273,9 +287,7 @@
 	iSecureVideoInfo = iVideoInfo;
 	iSecureVideoInfo.iVideoAddress = (TInt)pV2;
 
-	// Alloc Physical RAM for the Composition Buffers used by the GCE
-	iSize = 4*480*640;//FRAME_BUFFER_SIZE( iVideoInfo.iBitsPerPixel, iVideoInfo.iSizeInPixels.iWidth, iVideoInfo.iSizeInPixels.iHeight);
-	__GCE_DEBUG_PRINT2("DLcdPowerHandler.iSize  = %d\n", iSize );
+	// Alloc Physical RAM for the Composition Buffers used by OpenWF
 	// double and round the page size
 	TUint round = 2*Kern::RoundToPageSize(iSize);
 
@@ -434,23 +446,6 @@
 
 	iPortAddr = KHwBaseClcd;
 
-	iVideoInfo.iSizeInPixels.iWidth  = KConfigLcdWidth;
-	iVideoInfo.iSizeInPixels.iHeight = KConfigLcdHeight;
-	iVideoInfo.iDisplayMode = KConfigLcdDisplayMode;
-	iVideoInfo.iOffsetToFirstPixel = KCOnfigOffsetToFirstPixel;
-	iVideoInfo.iOffsetBetweenLines = KCOnfigOffsetBetweenLines;
-	iVideoInfo.iIsPalettized = KConfigIsPalettized;
-	iVideoInfo.iBitsPerPixel = KConfigBitsPerPixel;
-	iVideoInfo.iSizeInTwips.iWidth = KConfigLcdWidthInTwips;
-	iVideoInfo.iSizeInTwips.iHeight = KConfigLcdHeightInTwips;
-	iVideoInfo.iIsMono = KConfigIsMono;
-	// !@!	iVideoInfo.iVideoAddress = (TInt)pV;
-	iVideoInfo.iIsPixelOrderLandscape = KConfigPixelOrderLandscape;
-	iVideoInfo.iIsPixelOrderRGB = KConfigPixelOrderRGB;
-
-	iSecureVideoInfo = iVideoInfo;
-	// !@! iSecureVideoInfo.iVideoAddress = (TInt)pV2;
-
 	TInt r = AllocateFrameBuffer();
 	if(r == KErrNone)
 		{
@@ -617,7 +612,7 @@
 	@param	aDegOfRot  The requested rotation
 	@return KErrNone
 */
-TInt DDisplayPddSyborg::SetRotation(TInt aDegOfRot)
+TInt DDisplayPddSyborg::SetRotation(RDisplayChannel::TDisplayRotation aDegOfRot)
 	{
 	return KErrNone;
 	}
@@ -913,12 +908,16 @@
 			//If no buffer was available during a call to GetCompositionBuffer the active buffer has
 			//been returned as the next available one, so we must set the buffer to the proper state before we
 			//send the notification.
-			if(channel->iLdd->iPendingReq[RDisplayChannel::EReqGetCompositionBuffer].iStatus)
+			TInt pendingIndex = channel->iLdd->iPendingIndex[RDisplayChannel::EReqGetCompositionBuffer];
+			if(channel->iLdd->iPendingReq[RDisplayChannel::EReqGetCompositionBuffer][pendingIndex].iTClientReq)
+			{
+				if(channel->iLdd->iPendingReq[RDisplayChannel::EReqGetCompositionBuffer][pendingIndex].iTClientReq->IsReady())
 				{
-				channel->iActiveBuffer->iState	= EBufferCompose;
-				channel->RequestComplete(RDisplayChannel::EReqGetCompositionBuffer, KErrNone);
+				channel->iActiveBuffer->iState = EBufferCompose;
+				channel->RequestComplete(RDisplayChannel::EReqGetCompositionBuffer,KErrNone);
+				}
 
-				}
+			}
 
 			channel->iActiveBuffer				= NULL;
 			}
@@ -1029,7 +1028,12 @@
 	r = pH->Create();
 	if ( r == KErrNone)
 		{
-		pH->iDfcQ = Kern::DfcQue0();	// use low priority DFC queue for this driver 
+		TInt r = Kern::DfcQCreate(pH->iDfcQ, 29 , &KLitLcd);
+
+		if(r!=KErrNone)
+		{
+			return r;
+		}
 
 		DDisplayPddFactory * device = new DDisplayPddFactory;
 
--- a/baseport/syborg/svpframebuffer/svpframebuffer.h	Thu Mar 04 00:55:21 2010 +0000
+++ b/baseport/syborg/svpframebuffer/svpframebuffer.h	Mon Mar 08 18:45:03 2010 +0000
@@ -11,6 +11,8 @@
 *
 * Contributors:
 *
+* Accenture Ltd - Syborg framebuffer improvements, now auto determines frame size from board model, performance and memory improvements
+*
 * Description: Minimalistic frame buffer driver
 *
 */
@@ -43,22 +45,24 @@
 
 _LIT(KLitLcd,"SYBORG_FB");
 
-const TUint KConfigLcdWidth            = 640;
-const TUint	KConfigLcdHeight	       = 480;
-const TInt	KConfigLcdWidthInTwips     = 9638;
-const TInt	KConfigLcdHeightInTwips    = 7370;
+
+const TInt	KConfigLcdWidthInTwips     = 1996;
+const TInt	KConfigLcdHeightInTwips    = 3550;
+
 const TBool KConfigIsMono              = 0;
 const TBool KConfigIsPalettized        = 0;
 const TInt  KCOnfigOffsetToFirstPixel  = 0;
 const TBool KConfigPixelOrderRGB       = 0;
 const TBool KConfigPixelOrderLandscape = 1;
 const TInt  KConfigLcdDisplayMode       = 2;
-//const TInt  KConfigLcdDisplayMode       = 1;
+
+const TInt KConfigOffsetToFirstPixel =0;
+
 const TInt  KConfigLcdNumberOfDisplayModes = 3;
 
 
-const TInt  KConfigBitsPerPixel        = 24;
-const TInt  KCOnfigOffsetBetweenLines  = 2560;
+const TInt  KConfigBitsPerPixel        = 32;
+
 
 const TInt   KVSyncDfcPriority							= 7 ;   //priority of DFC within the queue (0 to 7, where 7 is highest)
 
@@ -202,7 +206,7 @@
      
      @return KErrNone if successful; or one of the other system wide error codes.
      */       
-    virtual TInt  SetRotation(TInt aRotation);
+	virtual TInt  SetRotation(RDisplayChannel::TDisplayRotation aRotation);
 
      /**
      Called by the LDD to handle the device specific part of posting a User Buffer.
Binary file baseport/syborg/syborg.dtb has changed
--- a/baseport/syborg/syborg.dts	Thu Mar 04 00:55:21 2010 +0000
+++ b/baseport/syborg/syborg.dts	Mon Mar 08 18:45:03 2010 +0000
@@ -50,6 +50,8 @@
         };
         framebuffer@0 {
             compatible = "syborg,framebuffer";
+	    width = <168>;
+            height = <280>;
             reg = <c0005000>;
             interrupts = <4>;
             interrupt-parent = <&intc>;