Changeset 31863 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.cpp
- Timestamp:
- Aug 23, 2010 2:31:57 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.cpp
r31827 r31863 1768 1768 USHORT DispiId; 1769 1769 ULONG AdapterMemorySize = VBE_DISPI_TOTAL_VIDEO_MEMORY_BYTES; 1770 VIDEO_ACCESS_RANGE AccessRanges[] =1771 {1772 {1773 {0, VBE_DISPI_LFB_PHYSICAL_ADDRESS},1774 VBE_DISPI_TOTAL_VIDEO_MEMORY_BYTES,1775 0,1776 FALSE,1777 FALSE,1778 01779 }1780 };1781 1770 1782 1771 dprintf(("VBoxVideo::VBoxVideoFindAdapter %p\n", HwDeviceExtension)); … … 1831 1820 VBoxBiosString, 1832 1821 sizeof(VBoxBiosString)); 1822 1823 dprintf(("VBoxVideo::VBoxVideoFindAdapter: calling VideoPortGetAccessRanges\n")); 1824 1833 1825 #ifdef VBOX_WITH_HGSMI 1834 if (VBoxHGSMIIsSupported ((PDEVICE_EXTENSION)HwDeviceExtension)) 1826 ((PDEVICE_EXTENSION)HwDeviceExtension)->u.primary.IOPortHost = (RTIOPORT)VGA_PORT_HGSMI_HOST; 1827 ((PDEVICE_EXTENSION)HwDeviceExtension)->u.primary.IOPortGuest = (RTIOPORT)VGA_PORT_HGSMI_GUEST; 1828 #endif /* VBOX_WITH_HGSMI */ 1829 1830 VIDEO_ACCESS_RANGE tmpRanges[4]; 1831 ULONG slot = 0; 1832 1833 VideoPortZeroMemory(tmpRanges, sizeof(tmpRanges)); 1834 1835 /* need to call VideoPortGetAccessRanges to ensure interrupt info in ConfigInfo gets set up */ 1836 VP_STATUS status; 1837 if (vboxQueryWinVersion() == WINNT4) 1835 1838 { 1836 dprintf(("VBoxVideo::VBoxVideoFindAdapter: calling VideoPortGetAccessRanges\n")); 1837 1838 ((PDEVICE_EXTENSION)HwDeviceExtension)->u.primary.IOPortHost = (RTIOPORT)VGA_PORT_HGSMI_HOST; 1839 ((PDEVICE_EXTENSION)HwDeviceExtension)->u.primary.IOPortGuest = (RTIOPORT)VGA_PORT_HGSMI_GUEST; 1840 1841 VIDEO_ACCESS_RANGE tmpRanges[4]; 1842 ULONG slot = 0; 1843 1844 VideoPortZeroMemory(tmpRanges, sizeof(tmpRanges)); 1845 1846 /* need to call VideoPortGetAccessRanges to ensure interrupt info in ConfigInfo gets set up */ 1847 VP_STATUS status; 1848 if (vboxQueryWinVersion() == WINNT4) 1849 { 1850 /* NT crashes if either of 'vendorId, 'deviceId' or 'slot' parameters is NULL, 1851 * and needs PCI ids for a successful VideoPortGetAccessRanges call. 1852 */ 1853 ULONG vendorId = 0x80EE; 1854 ULONG deviceId = 0xBEEF; 1855 status = VideoPortGetAccessRanges(HwDeviceExtension, 1856 0, 1857 NULL, 1858 sizeof (tmpRanges)/sizeof (tmpRanges[0]), 1859 tmpRanges, 1860 &vendorId, 1861 &deviceId, 1862 &slot); 1863 } 1864 else 1865 { 1866 status = VideoPortGetAccessRanges(HwDeviceExtension, 1867 0, 1868 NULL, 1869 sizeof (tmpRanges)/sizeof (tmpRanges[0]), 1870 tmpRanges, 1871 NULL, 1872 NULL, 1873 &slot); 1874 } 1875 dprintf(("VBoxVideo::VBoxVideoFindAdapter: VideoPortGetAccessRanges status 0x%x\n", status)); 1876 1877 /* no matter what we get with VideoPortGetAccessRanges, we assert the default ranges */ 1839 /* NT crashes if either of 'vendorId, 'deviceId' or 'slot' parameters is NULL, 1840 * and needs PCI ids for a successful VideoPortGetAccessRanges call. 1841 */ 1842 ULONG vendorId = 0x80EE; 1843 ULONG deviceId = 0xBEEF; 1844 status = VideoPortGetAccessRanges(HwDeviceExtension, 1845 0, 1846 NULL, 1847 sizeof (tmpRanges)/sizeof (tmpRanges[0]), 1848 tmpRanges, 1849 &vendorId, 1850 &deviceId, 1851 &slot); 1878 1852 } 1879 #else 1880 rc = VideoPortVerifyAccessRanges(HwDeviceExtension, 1, AccessRanges); 1881 dprintf(("VBoxVideo::VBoxVideoFindAdapter: VideoPortVerifyAccessRanges returned 0x%x\n", rc)); 1882 // @todo for some reason, I get an ERROR_INVALID_PARAMETER from NT4 SP0 1883 // It does not seem to like getting me these port addresses. So I just 1884 // pretend success to make the driver work. 1885 rc = NO_ERROR; 1886 #endif /* VBOX_WITH_HGSMI */ 1853 else 1854 { 1855 status = VideoPortGetAccessRanges(HwDeviceExtension, 1856 0, 1857 NULL, 1858 sizeof (tmpRanges)/sizeof (tmpRanges[0]), 1859 tmpRanges, 1860 NULL, 1861 NULL, 1862 &slot); 1863 } 1864 dprintf(("VBoxVideo::VBoxVideoFindAdapter: VideoPortGetAccessRanges status 0x%x\n", status)); 1865 1866 /* Initialize VBoxGuest library, which is used for requests which go through VMMDev. */ 1867 rc = VbglInit (); 1868 dprintf(("VBoxVideo::VBoxVideoFindAdapter: VbglInit returned 0x%x\n", rc)); 1887 1869 1888 1870 #ifndef VBOX_WITH_HGSMI 1889 /* Initialize VBoxGuest library */1890 rc = VbglInit ();1891 1892 dprintf(("VBoxVideo::VBoxVideoFindAdapter: VbglInit returned 0x%x\n", rc));1893 1894 1871 /* Setup the Device Extension and if possible secondary displays. */ 1895 1872 VBoxSetupDisplays((PDEVICE_EXTENSION)HwDeviceExtension, ConfigInfo, AdapterMemorySize); 1896 1873 #else 1897 /* Initialize VBoxGuest library, which is used for requests which go through VMMDev. */1898 rc = VbglInit ();1899 1900 1874 /* Guest supports only HGSMI, the old VBVA via VMMDev is not supported. Old 1901 1875 * code will be ifdef'ed and later removed.
Note:
See TracChangeset
for help on using the changeset viewer.