VirtualBox

Ignore:
Timestamp:
Oct 20, 2010 2:29:45 PM (14 years ago)
Author:
vboxsync
Message:

Additions/Win: Allow any horizontal resolution if graphics device supports it.

Location:
trunk/src/VBox/Additions/WINNT/Graphics/Miniport
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.cpp

    r33252 r33264  
    764764            break;
    765765
    766         /* round down width to be a multiple of 8 */
    767         xres &= 0xFFF8;
     766        /* round down width to be a multiple of 8 if necessary */
     767        if (!DeviceExtension->fAnyX)
     768            xres &= 0xFFF8;
    768769
    769770        /* second test: does it fit within our VRAM? */
     
    976977#endif /* VBOX_WITH_MULTIMONITOR_FIX */
    977978        }
    978         /* round down to multiple of 8 */
    979         if ((xres & 0xfff8) != xres)
    980             dprintf(("VBoxVideo: rounding down xres from %d to %d\n", xres, xres & 0xfff8));
    981         xres &= 0xfff8;
     979        /* round down to multiple of 8 if necessary */
     980        if (!DeviceExtension->fAnyX) {
     981            if ((xres & 0xfff8) != xres)
     982                dprintf(("VBoxVideo: rounding down xres from %d to %d\n", xres, xres & 0xfff8));
     983            xres &= 0xfff8;
     984        }
    982985        /* take the current values for the fields that are not set */
    983986#ifndef VBOX_WITH_WDDM
     
    17351738
    17361739    PDEVICE_EXTENSION pDevExt = (PDEVICE_EXTENSION)HwDeviceExtension;
     1740    USHORT DispiId;
    17371741
    17381742    /* Initialize the request pointer. */
    17391743    pDevExt->u.primary.pvReqFlush = NULL;
    17401744
     1745    /* Check if the chip restricts horizontal resolution or not. */
     1746    VideoPortWritePortUshort((PUSHORT)VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_ID);
     1747    VideoPortWritePortUshort((PUSHORT)VBE_DISPI_IOPORT_DATA, VBE_DISPI_ID_ANYX);
     1748    DispiId = VideoPortReadPortUshort((PUSHORT)VBE_DISPI_IOPORT_DATA);
     1749    if (DispiId == VBE_DISPI_ID_ANYX)
     1750        pDevExt->fAnyX = TRUE;
     1751    else
     1752        pDevExt->fAnyX = FALSE;
     1753   
    17411754    vboxVideoInitCustomVideoModes(pDevExt);
    17421755
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.h

    r33252 r33264  
    9595#define VBE_DISPI_ID_VBOX_VIDEO         0xBE00
    9696#define VBE_DISPI_ID_HGSMI              0xBE01
     97#define VBE_DISPI_ID_ANYX               0xBE02
    9798#define VBE_DISPI_DISABLED              0x00
    9899#define VBE_DISPI_ENABLED               0x01
     
    332333   VBOXWDDM_TARGET aTargets[VBOX_VIDEO_MAX_SCREENS];
    333334#endif
     335   BOOLEAN fAnyX;   /* Unrestricted horizontal resolution flag. */
    334336} DEVICE_EXTENSION, *PDEVICE_EXTENSION;
    335337
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette