Changeset 20653 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Display/enable.c
- Timestamp:
- Jun 17, 2009 9:26:02 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Display/enable.c
r18246 r20653 101 101 case OPENGL_GETINFO: 102 102 { 103 if ( cjOut >= sizeof(OPENGL_INFO) 104 && pvOut) 105 { 106 POPENGL_INFO pInfo = (POPENGL_INFO)pvOut; 107 108 pInfo->dwVersion = 2; 109 pInfo->dwDriverVersion = 1; 110 pInfo->szDriverName[0] = 'V'; 111 pInfo->szDriverName[1] = 'B'; 112 pInfo->szDriverName[2] = 'o'; 113 pInfo->szDriverName[3] = 'x'; 114 pInfo->szDriverName[4] = 'O'; 115 pInfo->szDriverName[5] = 'G'; 116 pInfo->szDriverName[6] = 'L'; 117 pInfo->szDriverName[7] = 0; 118 119 DISPDBG((0, "OPENGL_GETINFO\n")); 120 return cjOut; 121 } 122 else 103 if ( cjOut >= sizeof(OPENGL_INFO) 104 && pvOut) 105 { 106 POPENGL_INFO pInfo = (POPENGL_INFO)pvOut; 107 108 pInfo->dwVersion = 2; 109 pInfo->dwDriverVersion = 1; 110 pInfo->szDriverName[0] = 'V'; 111 pInfo->szDriverName[1] = 'B'; 112 pInfo->szDriverName[2] = 'o'; 113 pInfo->szDriverName[3] = 'x'; 114 pInfo->szDriverName[4] = 'O'; 115 pInfo->szDriverName[5] = 'G'; 116 pInfo->szDriverName[6] = 'L'; 117 pInfo->szDriverName[7] = 0; 118 119 DISPDBG((0, "OPENGL_GETINFO\n")); 120 return cjOut; 121 } 122 else 123 123 DISPDBG((0, "OPENGL_GETINFO invalid size %d\n", cjOut)); /* It doesn't matter that we fail here. Opengl32 will fall back to software rendering when this escape is not supported. */ 124 124 break; … … 238 238 return 0; 239 239 } 240 240 241 241 BOOL DrvConnect (PVOID x1, PVOID x2, PVOID x3, PVOID x4) 242 242 { … … 318 318 // { 0x50, (PFN) DrvShadowConnect }, // 0x50 319 319 // { 0x51, (PFN) DrvShadowDisconnect }, // 0x51 320 320 321 321 }; 322 322 … … 443 443 444 444 DISPDBG((0, "VBoxDisp::DrvEnablePDEV called\n")); 445 445 446 446 UNREFERENCED_PARAMETER(pwszLogAddress); 447 447 UNREFERENCED_PARAMETER(pwszDeviceName); 448 448 449 449 RtlZeroMemory(&DevInfo, sizeof (DEVINFO)); 450 450 RtlZeroMemory(&GdiInfo, sizeof (GDIINFO)); … … 465 465 466 466 ppdev->hDriver = hDriver; 467 467 468 468 // Get the current screen mode information. Set up device caps and devinfo. 469 469 … … 481 481 DISPDBG((0, "DrvEnablePDEV failed bInitPointer\n")); 482 482 } 483 483 484 484 // Initialize palette information. 485 485 … … 489 489 goto error_free; 490 490 } 491 491 492 492 // // Start a thread that will process notifications from VMMDev 493 493 // if (!bInitNotificationThread(ppdev)) … … 496 496 // goto error_free; 497 497 // } 498 498 499 499 // Copy the devinfo into the engine buffer. 500 500 501 501 DISPDBG((0, "VBoxDisp::DrvEnablePDEV: sizeof(DEVINFO) = %d, cjDevInfo = %d, alpha = %d\n", sizeof(DEVINFO), cjDevInfo, DevInfo.flGraphicsCaps2 & GCAPS2_ALPHACURSOR)); 502 502 503 503 // @todo seems to be not necessary. these bits are initialized in screen.c DevInfo.flGraphicsCaps |= GCAPS_OPAQUERECT | 504 504 // GCAPS_DITHERONREALIZE | … … 509 509 // GCAPS_COLOR_DITHER | 510 510 // GCAPS_ASYNCMOVE; 511 // 511 // 512 512 // DevInfo.flGraphicsCaps |= GCAPS_DITHERONREALIZE; 513 513 514 514 DevInfo.flGraphicsCaps2 |= GCAPS2_RESERVED1; /* @todo figure out what is this. */ 515 515 … … 522 522 523 523 DISPDBG((0, "VBoxDisp::DrvEnablePDEV completed %x\n", ppdev)); 524 524 525 525 return((DHPDEV) ppdev); 526 526 … … 557 557 // vStopNotificationThread ((PPDEV) dhpdev); 558 558 vDisablePalette((PPDEV) dhpdev); 559 559 560 560 /* Free the driver's VBVA resources. */ 561 561 vboxVbvaDisable ((PPDEV) dhpdev); … … 615 615 #endif 616 616 DISPDBG((0, "DISP DrvEnableSurface called\n")); 617 617 618 618 // Create engine bitmap around frame buffer. 619 619 … … 630 630 631 631 DISPDBG((0, "DISP DrvEnableSurface bInitSURF success\n")); 632 632 633 633 sizl.cx = ppdev->cxScreen; 634 634 sizl.cy = ppdev->cyScreen; … … 690 690 ulBitmapType); 691 691 } 692 692 693 693 if ( hsurf == 0 ) 694 694 { … … 701 701 // GDI. We cant do this on NT4.0 hence we call EngAssociateSurface. 702 702 // 703 703 704 704 if(g_bOnNT40) 705 705 { … … 707 707 // We have to associate the surface we just created with our physical 708 708 // device so that GDI can get information related to the PDEV when 709 // it's drawing to the surface (such as, for example, the length of 709 // it's drawing to the surface (such as, for example, the length of 710 710 // styles on the device when simulating styled lines). 711 711 // … … 720 720 { 721 721 DISPDBG((0, "DrvEnableSurface: failed EngAssociateSurface\n")); 722 goto l_Failure; 722 goto l_Failure; 723 723 } 724 724 … … 726 726 // Jam in the value of dhsurf into screen SURFOBJ. We do this to 727 727 // make sure the driver acclerates Drv calls we hook and not 728 // punt them back to GDI as the SURFOBJ's dhsurf = 0. 728 // punt them back to GDI as the SURFOBJ's dhsurf = 0. 729 729 // 730 730 ppdev->psoScreenBitmap = EngLockSurface(hsurf); … … 732 732 { 733 733 DISPDBG((0, "DrvEnableSurface: failed EngLockSurface\n")); 734 goto l_Failure; 734 goto l_Failure; 735 735 } 736 736 … … 767 767 (ppdev->lDeltaScreen > 0) ? BMF_TOPDOWN : 0, 768 768 (PVOID) (ppdev->pjScreen)); 769 769 770 770 if (hsurf == (HSURF) 0) 771 771 { … … 776 776 { 777 777 ppdev->hsurfScreenBitmap = hsurf; 778 778 779 779 if (!EngAssociateSurface(hsurf, ppdev->hdevEng, 0)) 780 780 { … … 785 785 { 786 786 SURFOBJ *pso = EngLockSurface(hsurf); 787 787 788 788 ppdev->psoScreenBitmap = pso; 789 789 790 790 hsurf = (HSURF) EngCreateDeviceSurface((DHSURF)pso, 791 791 sizl, … … 816 816 } 817 817 } 818 #endif /* VBOX_NEW_SURFACE_CODE */ 818 #endif /* VBOX_NEW_SURFACE_CODE */ 819 819 return ppdev->hsurfScreen; 820 820 821 821 l_Failure: 822 822 823 823 DrvDisableSurface(dhpdev); 824 824 825 825 return((HSURF)0); 826 826 } … … 836 836 { 837 837 PPDEV ppdev = (PPDEV)dhpdev; 838 838 839 839 DISPDBG((0, "VBoxDisp::DrvDisableSurface called\n")); 840 840 if (ppdev->psoScreenBitmap) … … 861 861 ppdev->hsurfScreenBitmap = (HSURF)0; 862 862 } 863 #endif 863 #endif 864 865 #ifdef VBOX_WITH_VIDEOHWACCEL 866 /* tells we can not process host commands any more and ensures we've completed processing of the host VHWA commands */ 867 vboxVHWADisable(ppdev); 868 #endif 864 869 vDisableSURF(ppdev); 865 870 } … … 879 884 880 885 DISPDBG((0, "DISP DrvAssertMode called bEnable = %d\n", bEnable)); 881 886 882 887 if (bEnable) 883 888 { … … 898 903 SIZEL sizl; 899 904 SURFOBJ *pso; 900 905 901 906 DISPDBG((0, "DISP DrvAssertMode Screen pointer has changed!!!\n")); 902 907 903 908 sizl.cx = ppdev->cxScreen; 904 909 sizl.cy = ppdev->cyScreen; 905 910 906 911 hsurf = (HSURF) EngCreateBitmap(sizl, 907 912 ppdev->lDeltaScreen, … … 909 914 (ppdev->lDeltaScreen > 0) ? BMF_TOPDOWN : 0, 910 915 (PVOID) (ppdev->pjScreen)); 911 916 912 917 if (hsurf == (HSURF) 0) 913 918 { … … 915 920 return FALSE; 916 921 } 917 922 918 923 pso = EngLockSurface(hsurf); 919 924 920 925 if (ppdev->psoScreenBitmap) 921 926 { … … 929 934 ppdev->hsurfScreenBitmap = (HSURF)0; 930 935 } 931 936 932 937 ppdev->hsurfScreenBitmap = hsurf; 933 938 ppdev->psoScreenBitmap = pso; … … 939 944 return FALSE; 940 945 } 941 946 942 947 if (!EngAssociateSurface(ppdev->hsurfScreen, ppdev->hdevEng, ppdev->flHooks)) 943 948 { … … 945 950 return FALSE; 946 951 } 947 952 948 953 return TRUE; 949 954 } 950 955 else 951 956 { 957 #ifdef VBOX_WITH_VIDEOHWACCEL 958 /* tells we can not process host commands any more and ensures we've completed processing of the host VHWA commands */ 959 vboxVHWADisable(ppdev); 960 #endif 952 961 // 953 962 // We must give up the display. … … 987 996 \******************************************************************************/ 988 997 989 HBITMAP 998 HBITMAP 990 999 DrvCreateDeviceBitmap( 991 1000 DHPDEV dhpdev, … … 1005 1014 \******************************************************************************/ 1006 1015 1007 VOID 1016 VOID 1008 1017 DrvDeleteDeviceBitmap( 1009 1018 DHSURF dhsurf) … … 1149 1158 ppdev->ptlDevOrg = *(PPOINTL)pvData; 1150 1159 #ifndef VBOX_WITH_HGSMI 1151 DISPDBG((3, "DN_DEVICE_ORIGIN: %d, %d (PSO = %p, pInfo = %p)\n", ppdev->ptlDevOrg.x, 1160 DISPDBG((3, "DN_DEVICE_ORIGIN: %d, %d (PSO = %p, pInfo = %p)\n", ppdev->ptlDevOrg.x, 1152 1161 ppdev->ptlDevOrg.y, pso, ppdev->pInfo)); 1153 1162 if (ppdev->pInfo) … … 1158 1167 } 1159 1168 #else 1160 DISPDBG((3, "DN_DEVICE_ORIGIN: %d, %d (PSO = %p)\n", ppdev->ptlDevOrg.x, 1169 DISPDBG((3, "DN_DEVICE_ORIGIN: %d, %d (PSO = %p)\n", ppdev->ptlDevOrg.x, 1161 1170 ppdev->ptlDevOrg.y, pso)); 1162 1171 VBoxProcessDisplayInfo(ppdev); … … 1179 1188 // Parameters 1180 1189 // pDirectDraw-----Points to a DD_DIRECTDRAW_GLOBAL structure that describes 1181 // the DirectDraw object. 1190 // the DirectDraw object. 1182 1191 // pSurface--------Points to a DD_SURFACE_LOCAL structure that describes the 1183 1192 // DirectDraw surface around which to wrap a GDI surface. … … 1250 1259 { 1251 1260 SIZEL sizel; 1252 DWORD ulBitmapType, flHooks; 1261 DWORD ulBitmapType, flHooks; 1253 1262 1254 1263 sizel.cx = pSurfaceGlobal->wWidth; … … 1296 1305 SURFOBJ *surfobj = EngLockSurface ((HSURF)hbmDevice); 1297 1306 DISPDBG((0, "DrvDeriveSurface surfobj %x, hsurf = %x\n", surfobj, surfobj->hsurf)); 1298 1307 1299 1308 surfobj->dhpdev = (DHPDEV)pDev; 1300 1309 1301 1310 EngUnlockSurface(surfobj); 1302 1311 … … 1318 1327 DISPDBG((0, "DrvDeriveSurface return NULL\n")); 1319 1328 DISPDBG((0, "pSurfaceGlobal->ddpfSurface.dwRGBBitCount = %d, lPitch =%ld\n", pSurfaceGlobal->ddpfSurface.dwRGBBitCount,pSurfaceGlobal->lPitch)); 1320 1329 1321 1330 return(0); 1322 1331 }
Note:
See TracChangeset
for help on using the changeset viewer.