guestrendering/guestegl/src/guestegl.cpp
branchbug235_bringup_0
changeset 59 d9b81aebba7b
parent 50 a7fcb1229472
child 60 dfe4593146ee
equal deleted inserted replaced
58:021dd2b9ee6a 59:d9b81aebba7b
   263     attributes.iHintCount=0;  
   263     attributes.iHintCount=0;  
   264     attributes.iSurfaceHints = NULL;
   264     attributes.iSurfaceHints = NULL;
   265     attributes.iOffsetBetweenBuffers = 0;
   265     attributes.iOffsetBetweenBuffers = 0;
   266     attributes.iContiguous = ETrue;
   266     attributes.iContiguous = ETrue;
   267     attributes.iCacheAttrib = RSurfaceManager::ENotCached;      // Cache attributes
   267     attributes.iCacheAttrib = RSurfaceManager::ENotCached;      // Cache attributes
       
   268     attributes.iMappable = ETrue;
   268 
   269 
   269 	iDisplayMapLock.WriteLock();
   270 	iDisplayMapLock.WriteLock();
   270 	CEglDisplayInfo** pDispInfo;
   271 	CEglDisplayInfo** pDispInfo;
   271 	pDispInfo = iDisplayMap.Find(aDisplay);
   272 	pDispInfo = iDisplayMap.Find(aDisplay);
   272 	
   273 	
   279 				{
   280 				{
   280 				surfaceInfo->iNativeWindow = (RWindow*)aNativeWindow;
   281 				surfaceInfo->iNativeWindow = (RWindow*)aNativeWindow;
   281 				surfaceInfo->iConfigId = aConfig;
   282 				surfaceInfo->iConfigId = aConfig;
   282 				surfaceInfo->iSurfaceManager.Open();
   283 				surfaceInfo->iSurfaceManager.Open();
   283 				surfaceInfo->iSurfaceManager.CreateSurface(buf, surfaceId);
   284 				surfaceInfo->iSurfaceManager.CreateSurface(buf, surfaceId);
   284 				(void) surfaceInfo->iSurfaceManager.MapSurface(surfaceId, surfaceInfo->iChunk);
   285 				TInt err = surfaceInfo->iSurfaceManager.MapSurface(surfaceId, surfaceInfo->iChunk);
       
   286 				EGL_TRACE("CGuestEGL::eglCreateWindowSurface surface manager returned chunk %x and ret val %d", surfaceInfo->iChunk, err);
   285 				RemoteFunctionCallData rfcdata;
   287 				RemoteFunctionCallData rfcdata;
   286 				EglRFC eglApiData( rfcdata );
   288 				EglRFC eglApiData( rfcdata );
   287 				eglApiData.Init( EglRFC::EeglCreateWindowSurface);
   289 				eglApiData.Init( EglRFC::EeglCreateWindowSurface);
   288 				eglApiData.AppendEGLDisplay(aDisplay);
   290 				eglApiData.AppendEGLDisplay(aDisplay);
   289 				eglApiData.AppendEGLConfig(aConfig);
   291 				eglApiData.AppendEGLConfig(aConfig);
  1262     TUint8 offsetToFirstBuffer = 0; // This is wrong; just stub code
  1264     TUint8 offsetToFirstBuffer = 0; // This is wrong; just stub code
  1263     TUint8 offsetToSecondBuffer = 0; // This is wrong; just stub code
  1265     TUint8 offsetToSecondBuffer = 0; // This is wrong; just stub code
  1264     // FAISALMEMON END OF STUB CODE
  1266     // FAISALMEMON END OF STUB CODE
  1265     
  1267     
  1266     TUint32 chunkHWBase = 0;
  1268     TUint32 chunkHWBase = 0;
  1267     (void)CVghwUtils::MapToHWAddress(aSurfaceInfo.iChunk.Handle(), chunkHWBase);
  1269     TInt err = CVghwUtils::MapToHWAddress(aSurfaceInfo.iChunk.Handle(), chunkHWBase);
       
  1270     EGL_TRACE("CGuestEGL::EglInternalFunction_CreateSurface MapToHWAddress returned %d", err);
  1268     // FAISALMEMON write code to handle errors in the above function
  1271     // FAISALMEMON write code to handle errors in the above function
  1269     EGL_TRACE("CGuestEGL::EglInternalFunction_CreateSurface AFTER VGHWUtils::MapToHWAddress");
  1272     EGL_TRACE("CGuestEGL::EglInternalFunction_CreateSurface AFTER VGHWUtils::MapToHWAddress");
  1270 
  1273 
  1271 	TUint32 surfaceBufferBaseAddress(0);
  1274 	TUint32 surfaceBufferBaseAddress(0);
  1272 	(void)CVghwUtils::GetSurfaceBufferBaseAddress(surfaceBufferBaseAddress);
  1275 	(void)CVghwUtils::GetSurfaceBufferBaseAddress(surfaceBufferBaseAddress);
  1273 	EGL_TRACE("CPlatsimEGL::egliCreateSurface AFTER VGHWUtils::MapToHWAddress");
  1276 	EGL_TRACE("CGuestEGL::egliCreateSurface AFTER VGHWUtils::MapToHWAddress");
  1274 
  1277 	EGL_TRACE("CGuestEGL::egliCreateSurface aSurfaceInfo.iChunk.Base() is %x", aSurfaceInfo.iChunk.Base());
  1275     /* Store the pointer to the pixel data */
  1278     /* Store the pointer to the pixel data */
  1276     aSurfaceInfo.iBuffer0 = aSurfaceInfo.iChunk.Base() + offsetToFirstBuffer;
  1279     aSurfaceInfo.iBuffer0 = aSurfaceInfo.iChunk.Base() + offsetToFirstBuffer;
  1277     aSurfaceInfo.iBuffer1 = aSurfaceInfo.iChunk.Base() + offsetToSecondBuffer;
  1280     aSurfaceInfo.iBuffer1 = aSurfaceInfo.iChunk.Base() + offsetToSecondBuffer;
  1278 
  1281 
  1279     aSurfaceInfo.iBuffer0Index = (chunkHWBase + offsetToFirstBuffer) -  surfaceBufferBaseAddress;
  1282     aSurfaceInfo.iBuffer0Index = (chunkHWBase + offsetToFirstBuffer) -  surfaceBufferBaseAddress;