VirtualBox

Changeset 28382 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Apr 15, 2010 6:03:53 PM (15 years ago)
Author:
vboxsync
Message:

wddm: correctly report framebuffer offset to VGA device

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

Legend:

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

    r28322 r28382  
    29282928
    29292929BOOLEAN FASTCALL VBoxVideoSetCurrentModePerform(PDEVICE_EXTENSION DeviceExtension,
    2930         USHORT width, USHORT height, USHORT bpp)
     2930        USHORT width, USHORT height, USHORT bpp
     2931#ifdef VBOXWDDM
     2932        , ULONG offDisplay
     2933#endif
     2934        )
    29312935{
    29322936    /* set the mode characteristics */
     
    29402944    VBoxVideoCmnPortWriteUshort((PUSHORT)VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_ENABLE);
    29412945    VBoxVideoCmnPortWriteUshort((PUSHORT)VBE_DISPI_IOPORT_DATA, VBE_DISPI_ENABLED | VBE_DISPI_LFB_ENABLED);
     2946#ifdef VBOXWDDM
     2947    /* encode linear offDisplay to xOffset & yOffset to ensure offset fits USHORT */
     2948    ULONG cbLine = VBOXWDDM_ROUNDBOUND(((width * bpp) + 7) / 8, 4);
     2949    ULONG xOffset = offDisplay % cbLine;
     2950    ULONG yOffset = offDisplay / cbLine;
     2951    Assert(xOffset <= 0xffff);
     2952    Assert(yOffset <= 0xffff);
     2953    VBoxVideoCmnPortWriteUshort((PUSHORT)VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_X_OFFSET);
     2954    VBoxVideoCmnPortWriteUshort((PUSHORT)VBE_DISPI_IOPORT_DATA, (USHORT)xOffset);
     2955    VBoxVideoCmnPortWriteUshort((PUSHORT)VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_Y_OFFSET);
     2956    VBoxVideoCmnPortWriteUshort((PUSHORT)VBE_DISPI_IOPORT_DATA, (USHORT)yOffset);
     2957#endif
    29422958    /** @todo read from the port to see if the mode switch was successful */
    29432959
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.h

    r28228 r28382  
    8686#define VBE_DISPI_INDEX_VIRT_WIDTH      0x6
    8787#define VBE_DISPI_INDEX_VIRT_HEIGHT     0x7
     88#define VBE_DISPI_INDEX_X_OFFSET        0x8
     89#define VBE_DISPI_INDEX_Y_OFFSET        0x9
    8890#define VBE_DISPI_INDEX_VBOX_VIDEO      0xa
    8991
     
    736738
    737739BOOLEAN FASTCALL VBoxVideoSetCurrentModePerform(PDEVICE_EXTENSION DeviceExtension,
    738         USHORT width, USHORT height, USHORT bpp);
     740        USHORT width, USHORT height, USHORT bpp
     741#ifdef VBOXWDDM
     742        , ULONG offDisplay
     743#endif
     744        );
    739745
    740746BOOLEAN FASTCALL VBoxVideoSetCurrentMode(
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp

    r28322 r28382  
    155155
    156156    if (VBoxVideoSetCurrentModePerform(pDevExt, pAllocation->u.SurfInfo.width,
    157             pAllocation->u.SurfInfo.height, pAllocation->u.SurfInfo.bpp))
     157            pAllocation->u.SurfInfo.height, pAllocation->u.SurfInfo.bpp,
     158            (ULONG)pAllocation->offVram))
    158159        return STATUS_SUCCESS;
    159160
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