Changeset 4265 in vbox
- Timestamp:
- Aug 21, 2007 3:44:41 PM (17 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Display
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Display/dd.c
r4061 r4265 153 153 pVm->dwFlags = VIDMEM_ISLINEAR ; 154 154 pVm->fpStart = pDev->layout.offDDRAWHeap; 155 pVm->fpEnd = pDev->layout.offDDRAWHeap + pDev->layout.cbDDRAWHeap ;155 pVm->fpEnd = pDev->layout.offDDRAWHeap + pDev->layout.cbDDRAWHeap - 1; /* inclusive */ 156 156 157 157 pVm->ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; 158 DISPDBG((0, "fpStart % ld fpEnd %ld\n", pVm->fpStart, pVm->fpEnd));158 DISPDBG((0, "fpStart %x fpEnd %x\n", pVm->fpStart, pVm->fpEnd)); 159 159 160 160 pVm++; … … 508 508 DISPDBG((0, "BPP %d lPitch=%d\n", lBpp, lPitch)); 509 509 510 lpSurfaceGlobal->dwBlockSizeX = lPitch * lpSurfaceGlobal->wHeight;511 lpSurfaceGlobal->dwBlockSizeY = 1;510 lpSurfaceGlobal->dwBlockSizeX = lPitch; 511 lpSurfaceGlobal->dwBlockSizeY = lpSurfaceGlobal->wHeight; 512 512 lpSurfaceGlobal->lPitch = lPitch; 513 513 … … 524 524 { 525 525 DISPDBG((0, "-> secondary surface\n")); 526 lpSurfaceGlobal->dwUserMemSize = lPitch * (DWORD)(lpSurfaceGlobal->wHeight);527 526 lpSurfaceGlobal->fpVidMem = DDHAL_PLEASEALLOC_BLOCKSIZE; 528 527 } -
trunk/src/VBox/Additions/WINNT/Graphics/Display/driver.h
r4181 r4265 208 208 if (ppdev) 209 209 { 210 if (ppdev->psoScreenBitmap && bIsScreenSurface(pso))210 if (ppdev->psoScreenBitmap && pso->hsurf == ppdev->hsurfScreen) 211 211 { 212 /* Convert the device PSO to the bitmap PSO which can be passed to Eng*. */ 212 213 pso = ppdev->psoScreenBitmap; 213 214 } -
trunk/src/VBox/Additions/WINNT/Graphics/Display/drv.c
r4181 r4265 83 83 { 84 84 PPDEV ppdev = (PPDEV)pso->dhpdev; 85 return (ppdev && pso->hsurf == ppdev->hsurfScreen); 85 86 /* The screen surface has the 'pso->dhpdev' field, 87 * and is either the screen device surface with handle = hsurfScreen, 88 * or a surface derived from DDRAW with address equal to the framebuffer. 89 */ 90 if ( ppdev 91 && ( pso->hsurf == ppdev->hsurfScreen 92 || pso->pvBits == ppdev->pjScreen 93 ) 94 ) 95 { 96 return TRUE; 97 } 86 98 } 87 99 -
trunk/src/VBox/Additions/WINNT/Graphics/Display/enable.c
r4262 r4265 30 30 { INDEX_DrvOffset, (PFN) DrvOffset }, // 6 31 31 { INDEX_DrvDisableDriver, (PFN) DrvDisableDriver }, // 8 32 { INDEX_DrvCreateDeviceBitmap, (PFN) DrvCreateDeviceBitmap }, // 1033 { INDEX_DrvDeleteDeviceBitmap, (PFN) DrvDeleteDeviceBitmap }, // 1132 // { INDEX_DrvCreateDeviceBitmap, (PFN) DrvCreateDeviceBitmap }, // 10 33 // { INDEX_DrvDeleteDeviceBitmap, (PFN) DrvDeleteDeviceBitmap }, // 11 34 34 { INDEX_DrvRealizeBrush, (PFN) DrvRealizeBrush }, // 12 35 35 { INDEX_DrvDitherColor, (PFN) DrvDitherColor }, // 13 … … 53 53 { INDEX_DrvEnableDirectDraw, (PFN) DrvEnableDirectDraw }, // 60 0x3c 54 54 { INDEX_DrvDisableDirectDraw, (PFN) DrvDisableDirectDraw }, // 61 0x3d 55 { INDEX_DrvDeriveSurface, (PFN) DrvDeriveSurface }, // 85 0x55 55 56 #endif 56 57 }; … … 248 249 { INDEX_DrvAssertMode, (PFN) DrvAssertMode }, // 5 0x5 249 250 { INDEX_DrvDisableDriver, (PFN) DrvDisableDriver }, // 8 0x8 250 { INDEX_DrvCreateDeviceBitmap, (PFN) DrvCreateDeviceBitmap }, // 10251 { INDEX_DrvDeleteDeviceBitmap, (PFN) DrvDeleteDeviceBitmap }, // 11251 // { INDEX_DrvCreateDeviceBitmap, (PFN) DrvCreateDeviceBitmap }, // 10 252 // { INDEX_DrvDeleteDeviceBitmap, (PFN) DrvDeleteDeviceBitmap }, // 11 252 253 { INDEX_DrvRealizeBrush, (PFN) DrvRealizeBrush }, // 12 0xc 253 254 { INDEX_DrvDitherColor, (PFN) DrvDitherColor }, // 13 0xd … … 271 272 { INDEX_DrvEnableDirectDraw, (PFN) DrvEnableDirectDraw }, // 60 0x3c 272 273 { INDEX_DrvDisableDirectDraw, (PFN) DrvDisableDirectDraw }, // 61 0x3d 273 /** @todo */ 274 //// { INDEX_DrvDeriveSurface, (PFN) DrvDeriveSurface }, // 85 274 { INDEX_DrvDeriveSurface, (PFN) DrvDeriveSurface }, // 85 0x55 275 275 #endif 276 276 { INDEX_DrvNotify, (PFN) DrvNotify }, // 87 0x57 … … 482 482 memcpy(pGdiInfo, &GdiInfo, min(cjGdiInfo, sizeof(GDIINFO))); 483 483 484 DISPDBG((0, "VBoxDisp::DrvEnablePDEV completed \n"));484 DISPDBG((0, "VBoxDisp::DrvEnablePDEV completed %x\n", ppdev)); 485 485 486 486 return((DHPDEV) ppdev); … … 501 501 VOID DrvCompletePDEV(DHPDEV dhpdev, HDEV hdev) 502 502 { 503 DISPDBG((0, "VBoxDisp::DrvCompletePDEV called \n"));503 DISPDBG((0, "VBoxDisp::DrvCompletePDEV called %x\n", dhpdev)); 504 504 ((PPDEV) dhpdev)->hdevEng = hdev; 505 505 } … … 515 515 VOID DrvDisablePDEV(DHPDEV dhpdev) 516 516 { 517 DISPDBG((0, "VBoxDisp::DrvDisablePDEV called \n"));517 DISPDBG((0, "VBoxDisp::DrvDisablePDEV called %x\n", dhpdev)); 518 518 // vStopNotificationThread ((PPDEV) dhpdev); 519 519 vDisablePalette((PPDEV) dhpdev); … … 934 934 } 935 935 936 #if 0 936 937 /******************************Public*Routine**********************************\ 937 938 * HBITMAP DrvCreateDeviceBitmap … … 971 972 DISPDBG((0, "DISP DrvDeleteDeviceBitmap %x", dhsurf)); 972 973 } 974 #endif /* 0 */ 973 975 974 976 /******************************Public*Routine******************************\ … … 1175 1177 if (pSurface->ddsCaps.dwCaps & DDSCAPS_NONLOCALVIDMEM) 1176 1178 { 1177 DISPDBG((0, "DrvDeriveSurface return NULL, surface in AGP memory "));1179 DISPDBG((0, "DrvDeriveSurface return NULL, surface in AGP memory\n")); 1178 1180 return 0; 1179 1181 } … … 1183 1185 if (pSurface->lpSurfMore->ddsCapsEx.dwCaps2 & DDSCAPS2_TEXTUREMANAGE) 1184 1186 { 1185 DISPDBG((0, "DrvDeriveSurface return NULL, surface is managed "));1187 DISPDBG((0, "DrvDeriveSurface return NULL, surface is managed\n")); 1186 1188 return 0; 1187 1189 } … … 1229 1231 } 1230 1232 1233 /* Create a bitmap that represents the DDRAW bits. 1234 * Important is to calculate the address of the bitmap. 1235 */ 1231 1236 hbmDevice = EngCreateBitmap(sizel, 1232 p Dev->lDeltaScreen,1237 pSurfaceGlobal->lPitch, 1233 1238 ulBitmapType, 1234 1239 (pDev->lDeltaScreen > 0) ? BMF_TOPDOWN : 0, 1235 (PVOID) (pDev->pjScreen ));1240 (PVOID) (pDev->pjScreen + pSurfaceGlobal->fpVidMem)); 1236 1241 if (hbmDevice) 1237 1242 { 1238 VOID* pvScan0 = pDev->pjScreen + pSurfaceGlobal->fpVidMem; 1239 1240 // 1241 // Note that HOOK_SYNCHRONIZE must always be hooked when we 1242 // give GDI a pointer to the bitmap bits. We don't need to 1243 // do it here since HOOK_SYNCHRONIZE is always set in our 1244 // pdev->flHooks 1245 // 1246 ULONG flags = MS_NOTSYSTEMMEMORY; 1247 1248 if ( EngModifySurface((HSURF)hbmDevice, 1249 pDev->hdevEng, 1250 pDev->flHooks, 1251 flags, 1252 (DHSURF)hbmDevice, 1253 pvScan0, 1254 pSurfaceGlobal->lPitch, 1255 NULL) ) 1256 { 1257 SURFOBJ* surfobj = EngLockSurface((HSURF) hbmDevice); 1258 AssertMsg(surfobj->iType == STYPE_BITMAP, ("expected STYPE_BITMAP")); 1259 surfobj->iType = STYPE_DEVBITMAP; 1260 EngUnlockSurface(surfobj); 1261 1262 DISPDBG((0, "DrvDeriveSurface return succeed\n")); 1243 if (pSurfaceGlobal->fpVidMem == 0) 1244 { 1245 /* Screen surface, mark it so it will be recognized by the driver. 1246 * and so the driver will be called on any operations on the surface 1247 * (required for VBVA and VRDP). 1248 */ 1249 if (EngAssociateSurface((HSURF)hbmDevice, pDev->hdevEng, flHooks)) 1250 { 1251 SURFOBJ *surfobj = EngLockSurface ((HSURF)hbmDevice); 1252 DISPDBG((0, "DrvDeriveSurface surfobj %x, hsurf = %x\n", surfobj, surfobj->hsurf)); 1253 1254 surfobj->dhpdev = (DHPDEV)pDev; 1255 1256 EngUnlockSurface(surfobj); 1257 1258 DISPDBG((0, "DrvDeriveSurface return succeed %x at %x\n", hbmDevice, pSurfaceGlobal->fpVidMem)); 1259 return(hbmDevice); 1260 } 1261 } 1262 else 1263 { 1264 DISPDBG((0, "DrvDeriveSurface return succeed %x at %x\n", hbmDevice, pSurfaceGlobal->fpVidMem)); 1263 1265 return(hbmDevice); 1264 1266 } 1265 1267 1266 DISPDBG((0, "DrvDeriveSurface: Eng ModifySurface failed\n"));1268 DISPDBG((0, "DrvDeriveSurface: EngAssociateSurface failed\n")); 1267 1269 EngDeleteSurface((HSURF)hbmDevice); 1268 1270 }
Note:
See TracChangeset
for help on using the changeset viewer.