136 |
137 |
137 |
138 |
138 // TO DO: (mandatory) |
139 // TO DO: (mandatory) |
139 // define the physical screen dimensions |
140 // define the physical screen dimensions |
140 // This is only example code... you need to modify it for your hardware |
141 // This is only example code... you need to modify it for your hardware |
141 |
|
142 |
|
143 /* |
|
144 Modified to scale up the display size to a 640x640 , which could be used for VGA layouts as well |
|
145 |
|
146 const TUint KConfigLcdWidth = 360;//640; // 640 pixels per line |
142 const TUint KConfigLcdWidth = 360;//640; // 640 pixels per line |
147 const TUint KConfigLcdHeight = 640;//480; // 480 lines per panel |
143 const TUint KConfigLcdHeight = 640;//480; // 480 lines per panel |
148 */ |
|
149 |
|
150 const TUint KConfigLcdWidth = 640; // 640 pixels per line |
|
151 const TUint KConfigLcdHeight = 640; // 640 lines per panel |
|
152 |
|
153 |
|
154 |
144 |
155 // TO DO: (mandatory) |
145 // TO DO: (mandatory) |
156 // define the characteristics of the LCD display |
146 // define the characteristics of the LCD display |
157 // This is only example code... you need to modify it for your hardware |
147 // This is only example code... you need to modify it for your hardware |
158 const TBool KConfigLcdIsMono = EFalse; |
148 const TBool KConfigLcdIsMono = EFalse; |
159 const TBool KConfigLcdPixelOrderLandscape = ETrue; |
149 const TBool KConfigLcdPixelOrderLandscape = ETrue; |
160 const TBool KConfigLcdPixelOrderRGB = ETrue; |
150 const TBool KConfigLcdPixelOrderRGB = ETrue; |
161 const TInt KConfigLcdMaxDisplayColors = 65536; //24bit: 16777216; |
151 const TInt KConfigLcdMaxDisplayColors = 16777216;//65536; //24bit: 16777216; |
162 |
152 |
163 |
153 |
164 // TO DO: (mandatory) |
154 // TO DO: (mandatory) |
165 // define the display dimensions in TWIPs |
155 // define the display dimensions in TWIPs |
166 // A TWIP is a 20th of a point. A point is a 72nd of an inch |
156 // A TWIP is a 20th of a point. A point is a 72nd of an inch |
167 // Therefore a TWIP is a 1440th of an inch |
157 // Therefore a TWIP is a 1440th of an inch |
168 // This is only example code... you need to modify it for your hardware |
158 // This is only example code... you need to modify it for your hardware |
169 //const TInt KConfigLcdWidthInTwips = 9638;//10800; // = 6.69 inches //15*1440; |
|
170 //const TInt KConfigLcdHeightInTwips = 7370;//11232;//5616; // = 5.11 inches //12*1440; |
|
171 |
|
172 // Modified Twips in accordance with VGA changes - Not sure if it helps or is needed |
|
173 |
|
174 const TInt KConfigLcdWidthInTwips = 2670; // = 6.69 inches //15*1440; |
159 const TInt KConfigLcdWidthInTwips = 2670; // = 6.69 inches //15*1440; |
175 const TInt KConfigLcdHeightInTwips = 3550; //5616; // = 5.11 inches //12*1440; |
160 const TInt KConfigLcdHeightInTwips = 3550; //5616; // = 5.11 inches //12*1440; |
176 |
161 |
177 // TO DO: (mandatory) |
162 // TO DO: (mandatory) |
178 // define the available display modes |
163 // define the available display modes |
1239 } |
1261 } |
1240 return r; |
1262 return r; |
1241 } |
1263 } |
1242 |
1264 |
1243 |
1265 |
|
1266 #ifdef ENABLE_GCE_MODE |
|
1267 DLcdPowerHandler* DLcdPowerHandler::pLcd = NULL; |
|
1268 |
|
1269 void DLcdPowerHandler::ChangeFrameBufferAddress(TUint32 aFbAddr) |
|
1270 { |
|
1271 //TODO: this is guess work |
|
1272 //find out the correct sequence to change LCD DMA address |
|
1273 // |
|
1274 const TInt8 DISPC_GODIGITAL_BITSHIFT = 6; |
|
1275 const TInt8 DISPC_GOLCD_BITSHIFT = 5; |
|
1276 const TUint32 goFlags = (1 << DISPC_GODIGITAL_BITSHIFT) | (1 << DISPC_GOLCD_BITSHIFT); |
|
1277 |
|
1278 const TUint32 ctl = GET_REGISTER(DISPC_CONTROL); |
|
1279 SET_REGISTER(DISPC_GFX_BA1, aFbAddr); |
|
1280 SET_REGISTER(DISPC_CONTROL, ctl | goFlags); |
|
1281 } |
|
1282 |
|
1283 #include <display.h> |
|
1284 |
|
1285 class DDisplayPddBeagle : public DDisplayPdd |
|
1286 { |
|
1287 public: |
|
1288 DDisplayPddBeagle(); |
|
1289 ~DDisplayPddBeagle(); |
|
1290 virtual TInt SetLegacyMode(); |
|
1291 virtual TInt SetGceMode(); |
|
1292 virtual TInt SetRotation(RDisplayChannel::TDisplayRotation aRotation); |
|
1293 virtual TInt PostUserBuffer(TBufferNode* aNode); |
|
1294 virtual TInt PostCompositionBuffer(TBufferNode* aNode); |
|
1295 virtual TInt PostLegacyBuffer(); |
|
1296 virtual TInt CloseMsg(); |
|
1297 virtual TInt CreateChannelSetup(TInt aUnit); |
|
1298 virtual TBool PostPending(); |
|
1299 virtual TDfcQue* DfcQ(TInt aUnit); |
|
1300 |
|
1301 public: |
|
1302 static void VSyncDfcFn(TAny* aChannel); |
|
1303 |
|
1304 private: |
|
1305 TDfcQue* iDfcQ; |
|
1306 TVideoInfoV01 iScreenInfo; |
|
1307 TBufferNode* iPendingBuffer; |
|
1308 TBufferNode* iActiveBuffer; |
|
1309 DChunk* iChunk; |
|
1310 |
|
1311 public: |
|
1312 TDfc iVSyncDfc; |
|
1313 }; |
|
1314 |
|
1315 class DDisplayPddFactory : public DPhysicalDevice |
|
1316 { |
|
1317 public: |
|
1318 DDisplayPddFactory(); |
|
1319 |
|
1320 virtual TInt Install(); |
|
1321 virtual void GetCaps(TDes8& aDes) const; |
|
1322 virtual TInt Create(DBase*& aChannel, TInt aUnit, const TDesC8* aInfo, const TVersion& aVer); |
|
1323 virtual TInt Validate(TInt aDeviceType, const TDesC8* anInfo, const TVersion& aVer); |
|
1324 }; |
|
1325 |
|
1326 const TInt KVSyncDfcPriority = 7 ; //priority of DFC within the queue (0 to 7, where 7 is highest) |
|
1327 |
|
1328 DDisplayPddBeagle::DDisplayPddBeagle(): |
|
1329 iPendingBuffer(NULL), |
|
1330 iActiveBuffer(NULL), |
|
1331 iChunk(NULL), |
|
1332 iVSyncDfc(&VSyncDfcFn, this, KVSyncDfcPriority) |
|
1333 { |
|
1334 __KTRACE_OPT(KEXTENSION, Kern::Printf("DDisplayPddBeagle::DDisplayPddBeagle")); |
|
1335 |
|
1336 iPostFlag = EFalse; |
|
1337 } |
|
1338 |
|
1339 DDisplayPddBeagle::~DDisplayPddBeagle() |
|
1340 { |
|
1341 __KTRACE_OPT(KEXTENSION, Kern::Printf("DDisplayPddBeagle::~DDisplayPddBeagle()")); |
|
1342 |
|
1343 //The DFC Queue is owned by DLcdPowerHandler so we shouldn't call Destroy() at this point. |
|
1344 if (iDfcQ) |
|
1345 { |
|
1346 iDfcQ=NULL; |
|
1347 } |
|
1348 |
|
1349 DChunk* chunk = (DChunk*) __e32_atomic_swp_ord_ptr(&iChunk, 0); |
|
1350 |
|
1351 if(chunk) |
|
1352 { |
|
1353 Kern::ChunkClose(chunk); |
|
1354 } |
|
1355 |
|
1356 } |
|
1357 |
|
1358 TInt DDisplayPddBeagle::SetLegacyMode() |
|
1359 { |
|
1360 __KTRACE_OPT(KEXTENSION, Kern::Printf("DDisplayPddBeagle::SetLegacyMode()")); |
|
1361 return KErrNone; |
|
1362 } |
|
1363 |
|
1364 TInt DDisplayPddBeagle::SetGceMode() |
|
1365 { |
|
1366 __KTRACE_OPT(KEXTENSION, Kern::Printf("DDisplayPddBeagle::SetGceMode()")); |
|
1367 PostCompositionBuffer(&iLdd->iCompositionBuffer[0]); |
|
1368 return KErrNone; |
|
1369 } |
|
1370 |
|
1371 TInt DDisplayPddBeagle::SetRotation(RDisplayChannel::TDisplayRotation aDegOfRot) |
|
1372 { |
|
1373 __KTRACE_OPT(KEXTENSION, Kern::Printf("DDisplayPddBeagle::SetRotation()")); |
|
1374 return KErrNone; |
|
1375 } |
|
1376 |
|
1377 TInt DDisplayPddBeagle::PostUserBuffer(TBufferNode* aNode) |
|
1378 { |
|
1379 __KTRACE_OPT(KEXTENSION, Kern::Printf("DDisplayPddBeagle::PostUserBuffer : aNode->iAddress = %08x\n", aNode->iAddress)); |
|
1380 if(iPendingBuffer) |
|
1381 { |
|
1382 iPendingBuffer->iState = EBufferFree; |
|
1383 if (!(iPendingBuffer->iType == EBufferTypeUser) ) |
|
1384 { |
|
1385 iPendingBuffer->iFree = ETrue; |
|
1386 } |
|
1387 } |
|
1388 aNode->iState = EBufferPending; |
|
1389 iPendingBuffer = aNode; |
|
1390 iPostFlag = ETrue; |
|
1391 |
|
1392 // Activate the posted buffer |
|
1393 TUint32 physicalAddress = Epoc::LinearToPhysical( aNode->iAddress ); |
|
1394 DLcdPowerHandler::pLcd->ChangeFrameBufferAddress(physicalAddress); |
|
1395 |
|
1396 /* Queue a DFC to complete the request*/ |
|
1397 iVSyncDfc.Enque(); |
|
1398 |
|
1399 return KErrNone; |
|
1400 } |
|
1401 |
|
1402 TInt DDisplayPddBeagle::PostCompositionBuffer(TBufferNode* aNode) |
|
1403 { |
|
1404 __KTRACE_OPT(KEXTENSION, Kern::Printf("DDisplayPddBeagle::PostCompositionBuffer : aNode->iAddress = %08x\n", aNode->iAddress)); |
|
1405 |
|
1406 if(iPendingBuffer) |
|
1407 { |
|
1408 iPendingBuffer->iState = EBufferFree; |
|
1409 if (iPendingBuffer->iType == EBufferTypeUser) |
|
1410 { |
|
1411 RequestComplete(RDisplayChannel::EReqPostUserBuffer, KErrCancel); |
|
1412 } |
|
1413 else |
|
1414 { |
|
1415 iPendingBuffer->iFree = ETrue; |
|
1416 } |
|
1417 } |
|
1418 |
|
1419 aNode->iState = EBufferPending; |
|
1420 aNode->iFree = EFalse; |
|
1421 iPendingBuffer = aNode; |
|
1422 iPostFlag = ETrue; |
|
1423 |
|
1424 // Activate the posted buffer |
|
1425 TUint32 physicalAddress = Epoc::LinearToPhysical( aNode->iAddress ); |
|
1426 DLcdPowerHandler::pLcd->ChangeFrameBufferAddress(physicalAddress); |
|
1427 |
|
1428 /* Queue a DFC to complete the request*/ |
|
1429 iVSyncDfc.Enque(); |
|
1430 |
|
1431 return KErrNone; |
|
1432 } |
|
1433 |
|
1434 TInt DDisplayPddBeagle::PostLegacyBuffer() |
|
1435 { |
|
1436 __KTRACE_OPT(KEXTENSION, Kern::Printf("DDisplayPddBeagle::PostLegacyBuffer()")); |
|
1437 |
|
1438 if(iPendingBuffer) |
|
1439 { |
|
1440 iPendingBuffer->iState = EBufferFree; |
|
1441 if (iPendingBuffer->iType == EBufferTypeUser) |
|
1442 { |
|
1443 |
|
1444 RequestComplete(RDisplayChannel::EReqPostUserBuffer, KErrCancel); |
|
1445 } |
|
1446 else |
|
1447 { |
|
1448 iPendingBuffer->iFree = ETrue; |
|
1449 } |
|
1450 } |
|
1451 |
|
1452 iLdd->iLegacyBuffer[0].iState = EBufferPending; |
|
1453 iLdd->iLegacyBuffer[0].iFree = EFalse; |
|
1454 iPendingBuffer = &iLdd->iLegacyBuffer[0]; |
|
1455 iPostFlag = ETrue; |
|
1456 |
|
1457 // Activate the posted buffer |
|
1458 DLcdPowerHandler::pLcd->ChangeFrameBufferAddress(DLcdPowerHandler::pLcd->ivRamPhys); |
|
1459 |
|
1460 /* Queue a DFC to complete the request*/ |
|
1461 iVSyncDfc.Enque(); |
|
1462 |
|
1463 return KErrNone; |
|
1464 } |
|
1465 |
|
1466 TInt DDisplayPddBeagle::CloseMsg() |
|
1467 { |
|
1468 __KTRACE_OPT(KEXTENSION, Kern::Printf("DDisplayPddBeagle::CloseMsg()")); |
|
1469 |
|
1470 iPendingBuffer = NULL; |
|
1471 iActiveBuffer = NULL; |
|
1472 iVSyncDfc.Cancel(); |
|
1473 return KErrNone; |
|
1474 } |
|
1475 |
|
1476 TInt DDisplayPddBeagle::CreateChannelSetup(TInt aUnit) |
|
1477 { |
|
1478 __KTRACE_OPT(KEXTENSION, Kern::Printf("DDisplayPddBeagle::CreateChannelSetup()")); |
|
1479 |
|
1480 iScreenInfo = DLcdPowerHandler::pLcd->iVideoInfo; |
|
1481 iLdd->iUnit = aUnit; |
|
1482 |
|
1483 iLdd->iDisplayInfo.iAvailableRotations = RDisplayChannel::ERotationNormal; |
|
1484 iLdd->iDisplayInfo.iNormal.iOffsetBetweenLines = iScreenInfo.iOffsetBetweenLines; |
|
1485 iLdd->iDisplayInfo.iNormal.iHeight = iScreenInfo.iSizeInPixels.iHeight; |
|
1486 iLdd->iDisplayInfo.iNormal.iWidth = iScreenInfo.iSizeInPixels.iWidth; |
|
1487 iLdd->iDisplayInfo.iNumCompositionBuffers = KDisplayCBMax; |
|
1488 iLdd->iDisplayInfo.iBitsPerPixel = iScreenInfo.iBitsPerPixel; |
|
1489 iLdd->iDisplayInfo.iRefreshRateHz = 60; |
|
1490 |
|
1491 |
|
1492 switch (iScreenInfo.iBitsPerPixel) |
|
1493 { |
|
1494 case 16: |
|
1495 iLdd->iDisplayInfo.iPixelFormat = EUidPixelFormatRGB_565; |
|
1496 break; |
|
1497 case 24: |
|
1498 iLdd->iDisplayInfo.iPixelFormat = EUidPixelFormatRGB_888; |
|
1499 break; |
|
1500 case 32: |
|
1501 iLdd->iDisplayInfo.iPixelFormat = EUidPixelFormatARGB_8888; |
|
1502 break; |
|
1503 default: |
|
1504 iLdd->iDisplayInfo.iPixelFormat = EUidPixelFormatUnknown; |
|
1505 break; |
|
1506 } |
|
1507 |
|
1508 iLdd->iCurrentRotation = RDisplayChannel::ERotationNormal; |
|
1509 |
|
1510 // Open shared chunk to the composition framebuffer |
|
1511 |
|
1512 DChunk* chunk = 0; |
|
1513 TLinAddr chunkKernelAddr = 0; |
|
1514 TUint32 chunkMapAttr = 0; |
|
1515 |
|
1516 // round to twice the page size |
|
1517 TUint round = 2*Kern::RoundToPageSize(DLcdPowerHandler::pLcd->iSize); |
|
1518 |
|
1519 __KTRACE_OPT(KEXTENSION, Kern::Printf("DDisplayPddBeagle::CreateChannelSetup DLcdPowerHandler::pLcd->iSize = %d\n", DLcdPowerHandler::pLcd->iSize)); |
|
1520 |
|
1521 TChunkCreateInfo info; |
|
1522 info.iType = TChunkCreateInfo::ESharedKernelMultiple; |
|
1523 info.iMaxSize = round; |
|
1524 info.iMapAttr = EMapAttrFullyBlocking; |
|
1525 info.iOwnsMemory = EFalse; |
|
1526 info.iDestroyedDfc = 0; |
|
1527 |
|
1528 TInt r = Kern::ChunkCreate(info, chunk, chunkKernelAddr, chunkMapAttr); |
|
1529 |
|
1530 __KTRACE_OPT(KEXTENSION, Kern::Printf("CreateChannelSetup:ChunkCreate called for composition chunk. Set iChunkKernelAddr = %08x\n", chunkKernelAddr)); |
|
1531 |
|
1532 if( r == KErrNone) |
|
1533 { |
|
1534 // map our chunk |
|
1535 r = Kern::ChunkCommitPhysical(chunk, 0,round , DLcdPowerHandler::pLcd->iCompositionPhysical); |
|
1536 __KTRACE_OPT(KEXTENSION, Kern::Printf("Mapping chunk %d", r)); |
|
1537 if(r != KErrNone) |
|
1538 { |
|
1539 Kern::ChunkClose(chunk); |
|
1540 } |
|
1541 } |
|
1542 |
|
1543 if ( r!= KErrNone) |
|
1544 { |
|
1545 return r; |
|
1546 } |
|
1547 |
|
1548 iChunk = chunk; |
|
1549 |
|
1550 // init CB 0 |
|
1551 iLdd->iCompositionBuffer[0].iType = EBufferTypeComposition; |
|
1552 iLdd->iCompositionBuffer[0].iBufferId = 0; |
|
1553 iLdd->iCompositionBuffer[0].iFree = ETrue; |
|
1554 iLdd->iCompositionBuffer[0].iState = EBufferFree; |
|
1555 iLdd->iCompositionBuffer[0].iAddress = chunkKernelAddr; |
|
1556 iLdd->iCompositionBuffer[0].iPhysicalAddress = Epoc::LinearToPhysical(chunkKernelAddr); |
|
1557 iLdd->iCompositionBuffer[0].iChunk = chunk; |
|
1558 iLdd->iCompositionBuffer[0].iHandle = 0; |
|
1559 iLdd->iCompositionBuffer[0].iOffset = 0; |
|
1560 iLdd->iCompositionBuffer[0].iSize = DLcdPowerHandler::pLcd->iSize; |
|
1561 iLdd->iCompositionBuffer[0].iPendingRequest = 0; |
|
1562 |
|
1563 // init CB 1 |
|
1564 iLdd->iCompositionBuffer[1].iType = EBufferTypeComposition; |
|
1565 iLdd->iCompositionBuffer[1].iBufferId = 1; |
|
1566 iLdd->iCompositionBuffer[1].iFree = ETrue; |
|
1567 iLdd->iCompositionBuffer[1].iState = EBufferFree; |
|
1568 iLdd->iCompositionBuffer[1].iAddress = chunkKernelAddr + DLcdPowerHandler::pLcd->iSize; |
|
1569 iLdd->iCompositionBuffer[1].iPhysicalAddress = Epoc::LinearToPhysical(chunkKernelAddr + DLcdPowerHandler::pLcd->iSize); |
|
1570 iLdd->iCompositionBuffer[1].iChunk = chunk; |
|
1571 iLdd->iCompositionBuffer[1].iHandle = 0; |
|
1572 iLdd->iCompositionBuffer[1].iOffset = DLcdPowerHandler::pLcd->iSize; |
|
1573 iLdd->iCompositionBuffer[1].iSize = DLcdPowerHandler::pLcd->iSize; |
|
1574 iLdd->iCompositionBuffer[1].iPendingRequest = 0; |
|
1575 |
|
1576 iLdd->iCompositionBuffIdx = 0; |
|
1577 //Use the same DFC queue created by the DLcdPowerHandler so all hardware accesses are executed under the same DFC thread. |
|
1578 iDfcQ= DLcdPowerHandler::pLcd->iDfcQ; |
|
1579 |
|
1580 // Set the Post DFC. |
|
1581 iVSyncDfc.SetDfcQ(iDfcQ); |
|
1582 |
|
1583 |
|
1584 return KErrNone; |
|
1585 } |
|
1586 |
|
1587 TBool DDisplayPddBeagle::PostPending() |
|
1588 { |
|
1589 return (iPendingBuffer != NULL); |
|
1590 } |
|
1591 |
|
1592 TDfcQue * DDisplayPddBeagle::DfcQ(TInt aUnit) |
|
1593 { |
|
1594 return iDfcQ; |
|
1595 } |
|
1596 |
|
1597 void DDisplayPddBeagle::VSyncDfcFn(TAny* aChannel) |
|
1598 { |
|
1599 DDisplayPddBeagle * channel =(DDisplayPddBeagle*)aChannel; |
|
1600 |
|
1601 if (channel->iPostFlag) |
|
1602 { |
|
1603 channel->iPostFlag = EFalse; |
|
1604 |
|
1605 if (channel->iActiveBuffer) |
|
1606 { |
|
1607 //When a User buffer is registered its iFree member becomes EFalse and Deregister sets it |
|
1608 //back to ETrue. Composition and Legacy buffers are not free when they are in the pending or |
|
1609 //active state. |
|
1610 if (channel->iActiveBuffer->iType == EBufferTypeUser) |
|
1611 { |
|
1612 channel->RequestComplete(RDisplayChannel::EReqPostUserBuffer, KErrNone); |
|
1613 } |
|
1614 else |
|
1615 { |
|
1616 channel->iActiveBuffer->iFree = ETrue; |
|
1617 } |
|
1618 |
|
1619 channel->iActiveBuffer->iState = EBufferFree; |
|
1620 |
|
1621 |
|
1622 //If no buffer was available during a call to GetCompositionBuffer the active buffer has |
|
1623 //been returned as the next available one, so we must set the buffer to the proper state before we |
|
1624 //send the notification. |
|
1625 TInt pendingIndex = channel->iLdd->iPendingIndex[RDisplayChannel::EReqGetCompositionBuffer]; |
|
1626 if(channel->iLdd->iPendingReq[RDisplayChannel::EReqGetCompositionBuffer][pendingIndex].iTClientReq) |
|
1627 { |
|
1628 if(channel->iLdd->iPendingReq[RDisplayChannel::EReqGetCompositionBuffer][pendingIndex].iTClientReq->IsReady()) |
|
1629 { |
|
1630 channel->iActiveBuffer->iState = EBufferCompose; |
|
1631 channel->RequestComplete(RDisplayChannel::EReqGetCompositionBuffer,KErrNone); |
|
1632 } |
|
1633 } |
|
1634 |
|
1635 channel->iActiveBuffer = NULL; |
|
1636 } |
|
1637 |
|
1638 if (channel->iPendingBuffer) |
|
1639 { |
|
1640 __KTRACE_OPT(KEXTENSION, Kern::Printf("DDisplayPddBeagle::VSyncDfcFn moving pending buffer at address %08x to the active state\n", channel->iPendingBuffer->iAddress)); |
|
1641 channel->iActiveBuffer = channel->iPendingBuffer; |
|
1642 channel->iActiveBuffer->iState = EBufferActive; |
|
1643 channel->iPendingBuffer = NULL; |
|
1644 |
|
1645 channel->RequestComplete(RDisplayChannel::EReqWaitForPost, KErrNone); |
|
1646 } |
|
1647 } |
|
1648 } |
|
1649 |
|
1650 DDisplayPddFactory::DDisplayPddFactory() |
|
1651 { |
|
1652 __KTRACE_OPT(KEXTENSION, Kern::Printf("DDisplayPddFactory::DDisplayPddFactory()")); |
|
1653 |
|
1654 iVersion = TVersion(KDisplayChMajorVersionNumber, |
|
1655 KDisplayChMinorVersionNumber, |
|
1656 KDisplayChBuildVersionNumber); |
|
1657 } |
|
1658 |
|
1659 TInt DDisplayPddFactory::Create(DBase*& aChannel, TInt aUnit, const TDesC8* aInfo, const TVersion& aVer) |
|
1660 { |
|
1661 __KTRACE_OPT(KEXTENSION, Kern::Printf("DDisplayPddFactory::Create()")); |
|
1662 |
|
1663 DDisplayPddBeagle *device= new DDisplayPddBeagle() ; |
|
1664 aChannel=device; |
|
1665 if (!device) |
|
1666 { |
|
1667 return KErrNoMemory; |
|
1668 } |
|
1669 return KErrNone; |
|
1670 } |
|
1671 |
|
1672 TInt DDisplayPddFactory::Install() |
|
1673 { |
|
1674 __KTRACE_OPT(KEXTENSION, Kern::Printf("DDisplayPddFactory::Install()")); |
|
1675 |
|
1676 TBuf<32> name(RDisplayChannel::Name()); |
|
1677 _LIT(KPddExtension,".pdd"); |
|
1678 name.Append(KPddExtension); |
|
1679 return SetName(&name); |
|
1680 } |
|
1681 |
|
1682 |
|
1683 void DDisplayPddFactory::GetCaps(TDes8& /*aDes*/) const |
|
1684 { |
|
1685 //Not supported |
|
1686 } |
|
1687 |
|
1688 TInt DDisplayPddFactory::Validate(TInt aUnit, const TDesC8* /*anInfo*/, const TVersion& aVer) |
|
1689 { |
|
1690 __KTRACE_OPT(KEXTENSION, Kern::Printf("DDisplayPddFactory::Validate()")); |
|
1691 |
|
1692 if (!Kern::QueryVersionSupported(iVersion,aVer)) |
|
1693 { |
|
1694 return KErrNotSupported; |
|
1695 } |
|
1696 |
|
1697 if (aUnit != 0) |
|
1698 { |
|
1699 return KErrNotSupported; |
|
1700 } |
|
1701 |
|
1702 return KErrNone; |
|
1703 } |
|
1704 |
|
1705 #endif //ENABLE_GCE_MODE |
|
1706 |
1244 DECLARE_STANDARD_EXTENSION() |
1707 DECLARE_STANDARD_EXTENSION() |
1245 { |
1708 { |
1246 __KTRACE_OPT(KPOWER,Kern::Printf("Starting LCD power manager")); |
1709 __KTRACE_OPT(KEXTENSION, Kern::Printf("Creating DLcdPowerHandler")); |
1247 |
1710 |
1248 // create LCD power handler |
1711 TInt r = KErrNoMemory; |
1249 TInt r=KErrNoMemory; |
|
1250 DLcdPowerHandler* pH=new DLcdPowerHandler; |
1712 DLcdPowerHandler* pH=new DLcdPowerHandler; |
1251 if (pH) |
1713 if (!pH) |
1252 r=pH->Create(); |
1714 { |
1253 |
1715 __KTRACE_OPT(KEXTENSION, Kern::Printf("Failed to create DLcdPowerHandler %d", r)); |
1254 __KTRACE_OPT(KPOWER,Kern::Printf("Returns %d",r)); |
1716 return r; |
|
1717 } |
|
1718 |
|
1719 r = pH->Create(); |
|
1720 if (r != KErrNone) |
|
1721 { |
|
1722 __KTRACE_OPT(KEXTENSION, Kern::Printf("Failed to create DLcdPowerHandler %d", r)); |
|
1723 return r; |
|
1724 } |
|
1725 |
|
1726 #ifdef ENABLE_GCE_MODE |
|
1727 __KTRACE_OPT(KEXTENSION, Kern::Printf("Creating DDisplayPddFactory")); |
|
1728 r = KErrNoMemory; |
|
1729 DDisplayPddFactory * device = new DDisplayPddFactory; |
|
1730 if (!device) |
|
1731 { |
|
1732 __KTRACE_OPT(KEXTENSION, Kern::Printf("Failed to create DLcdPowerHandler %d", r)); |
|
1733 return r; |
|
1734 } |
|
1735 |
|
1736 __KTRACE_OPT(KEXTENSION, Kern::Printf("Installing DDisplayPddFactory")); |
|
1737 r = Kern::InstallPhysicalDevice(device); |
|
1738 if (r != KErrNone) |
|
1739 { |
|
1740 __KTRACE_OPT(KEXTENSION, Kern::Printf("Failed to install DDisplayPddFactory %d", r)); |
|
1741 } |
|
1742 #endif |
|
1743 |
1255 return r; |
1744 return r; |
1256 } |
1745 } |
1257 |
1746 |