Changeset 27887 in vbox
- Timestamp:
- Mar 31, 2010 12:29:32 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.cpp
r27839 r27887 849 849 } 850 850 851 dprintf(("display = %d, DeviceExtension->iDevice = %d\n", display, DeviceExtension->iDevice)); 852 if (display != DeviceExtension->iDevice) 853 { 854 /* No need to go through the custom mode logic. And no need to clear the custom mode 855 * entry in the next 'for' loop. 856 */ 857 fDisplayChangeRequest = FALSE; 858 } 859 851 860 dprintf(("VBoxVideo: fDisplayChangeRequest = %d\n", fDisplayChangeRequest)); 852 861 … … 859 868 if (fDisplayChangeRequest && iCustomMode == display) 860 869 { 861 /* Do not keep info for this display to make sure that870 /* Do not keep info for this display, which received a video mode hint, to make sure that 862 871 * the new mode will be taken from the alternating index entries actually. 863 872 */ … … 877 886 gNumVideoModes++; 878 887 } 888 889 if (display != DeviceExtension->iDevice) 890 { 891 /* The display change is for another monitor. Just add 2 standard modes to the table 892 * to make enough entries. This is not necessary if it is a first mode set (CurrentMode == 0), 893 * because these 2 entries will be added by "if (fDisplayChangeRequest || DeviceExtension->CurrentMode == 0)" 894 * code branch. 895 */ 896 if (DeviceExtension->CurrentMode != 0) 897 { 898 dprintf(("Filling custom mode entries.\n")); 899 memcpy(&VideoModes[gNumVideoModes], &VideoModes[3], sizeof(VIDEO_MODE_INFORMATION)); 900 VideoModes[gNumVideoModes].ModeIndex = gNumVideoModes + 1; 901 gNumVideoModes++; 902 memcpy(&VideoModes[gNumVideoModes], &VideoModes[3], sizeof(VIDEO_MODE_INFORMATION)); 903 VideoModes[gNumVideoModes].ModeIndex = gNumVideoModes + 1; 904 gNumVideoModes++; 905 } 906 } 879 907 #endif /* VBOX_WITH_MULTIMONITOR_FIX */ 880 908 881 882 909 #ifndef VBOX_WITH_MULTIMONITOR_FIX 883 910 uint32_t xres = 0, yres = 0, bpp = 0, display = 0; … … 907 934 if (!bpp) 908 935 bpp = gCustomBPP; 936 dprintf(("VBoxVideo: using stored custom resolution %dx%dx%d\n", xres, yres, bpp)); 909 937 #else 910 938 if (!xres) 911 xres = CustomVideoModes[ display].VisScreenWidth;939 xres = CustomVideoModes[DeviceExtension->iDevice].VisScreenWidth; 912 940 if (!yres) 913 yres = CustomVideoModes[ display].VisScreenHeight;941 yres = CustomVideoModes[DeviceExtension->iDevice].VisScreenHeight; 914 942 if (!bpp) 915 bpp = CustomVideoModes[display].BitsPerPlane; 943 bpp = CustomVideoModes[DeviceExtension->iDevice].BitsPerPlane; 944 dprintf(("VBoxVideo: using stored custom resolution %dx%dx%d for %d\n", xres, yres, bpp, DeviceExtension->iDevice)); 916 945 #endif /* VBOX_WITH_MULTIMONITOR_FIX */ 917 dprintf(("VBoxVideo: using stored custom resolution %dx%dx%d\n", xres, yres, bpp));918 946 } 919 947 /* round down to multiple of 8 */ … … 1086 1114 #ifdef VBOX_WITH_MULTIMONITOR_FIX 1087 1115 /* Save the mode in the list of custom modes for this display. */ 1088 CustomVideoModes[ display] = VideoModes[gNumVideoModes];1116 CustomVideoModes[DeviceExtension->iDevice] = VideoModes[gNumVideoModes]; 1089 1117 #endif /* VBOX_WITH_MULTIMONITOR_FIX */ 1090 1118 ++gNumVideoModes; … … 1125 1153 #else 1126 1154 /* Save the custom mode for this display. */ 1127 if ( display== 0)1155 if (DeviceExtension->iDevice == 0) 1128 1156 { 1129 1157 /* Name without a suffix */ … … 1141 1169 { 1142 1170 wchar_t keyname[32]; 1143 swprintf(keyname, L"CustomXRes%d", display);1171 swprintf(keyname, L"CustomXRes%d", DeviceExtension->iDevice); 1144 1172 status = VBoxVideoCmnRegSetDword(Reg, keyname, xres); 1145 1173 if (status != NO_ERROR) 1146 dprintf(("VBoxVideo: error %d writing CustomXRes%d\n", status, display));1147 swprintf(keyname, L"CustomYRes%d", display);1174 dprintf(("VBoxVideo: error %d writing CustomXRes%d\n", status, DeviceExtension->iDevice)); 1175 swprintf(keyname, L"CustomYRes%d", DeviceExtension->iDevice); 1148 1176 status = VBoxVideoCmnRegSetDword(Reg, keyname, yres); 1149 1177 if (status != NO_ERROR) 1150 dprintf(("VBoxVideo: error %d writing CustomYRes%d\n", status, display));1151 swprintf(keyname, L"CustomBPP%d", display);1178 dprintf(("VBoxVideo: error %d writing CustomYRes%d\n", status, DeviceExtension->iDevice)); 1179 swprintf(keyname, L"CustomBPP%d", DeviceExtension->iDevice); 1152 1180 status = VBoxVideoCmnRegSetDword(Reg, keyname, bpp); 1153 1181 if (status != NO_ERROR) 1154 dprintf(("VBoxVideo: error %d writing CustomBPP%d\n", status, display));1182 dprintf(("VBoxVideo: error %d writing CustomBPP%d\n", status, DeviceExtension->iDevice)); 1155 1183 } 1156 1184 #endif /* VBOX_WITH_MULTIMONITOR_FIX */ … … 1179 1207 int i; 1180 1208 #ifndef VBOXWDDM 1181 dprintf(("VBoxVideo: VideoModes (CurrentMode = %d )\n", DeviceExtension->CurrentMode));1209 dprintf(("VBoxVideo: VideoModes (CurrentMode = %d, last #%d)\n", DeviceExtension->CurrentMode, gNumVideoModes)); 1182 1210 #endif 1183 for (i =0; i<MAX_VIDEO_MODES + 2; i++)1211 for (i = 0; i < RT_ELEMENTS(VideoModes); i++) 1184 1212 { 1185 1213 if ( VideoModes[i].VisScreenWidth
Note:
See TracChangeset
for help on using the changeset viewer.