VirtualBox

Ignore:
Timestamp:
May 22, 2020 5:34:44 PM (5 years ago)
Author:
vboxsync
Message:

WDDM: VMSVGA mouse pointer masks must have dword aligned scanlines.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp

    r84325 r84465  
    26852685}
    26862686
    2687 BOOL vboxWddmPointerCopyColorData(CONST DXGKARG_SETPOINTERSHAPE* pSetPointerShape, PVIDEO_POINTER_ATTRIBUTES pPointerAttributes)
     2687BOOL vboxWddmPointerCopyColorData(CONST DXGKARG_SETPOINTERSHAPE* pSetPointerShape, PVIDEO_POINTER_ATTRIBUTES pPointerAttributes,
     2688                                  bool fDwordAlignScanlines)
    26882689{
    26892690    ULONG srcMaskW, srcMaskH;
     
    27132714    pDst = pPointerAttributes->Pixels;
    27142715    dstBytesPerLine = (pPointerAttributes->Width+7)/8;
     2716    if (fDwordAlignScanlines)
     2717        dstBytesPerLine = RT_ALIGN_T(dstBytesPerLine, 4, ULONG);
    27152718
    27162719    /* sanity check */
     
    27522755}
    27532756
    2754 BOOL vboxWddmPointerCopyMonoData(CONST DXGKARG_SETPOINTERSHAPE* pSetPointerShape, PVIDEO_POINTER_ATTRIBUTES pPointerAttributes)
     2757BOOL vboxWddmPointerCopyMonoData(CONST DXGKARG_SETPOINTERSHAPE* pSetPointerShape, PVIDEO_POINTER_ATTRIBUTES pPointerAttributes,
     2758                                 bool fDwordAlignScanlines)
    27552759{
    27562760    ULONG srcMaskW, srcMaskH;
     
    27902794    pDst = pPointerAttributes->Pixels;
    27912795    dstBytesPerLine = (pPointerAttributes->Width+7)/8;
     2796    if (fDwordAlignScanlines)
     2797        dstBytesPerLine = RT_ALIGN_T(dstBytesPerLine, 4, ULONG);
    27922798
    27932799    for (y=0; y<pPointerAttributes->Height; ++y)
     
    28142820}
    28152821
    2816 static BOOLEAN vboxVddmPointerShapeToAttributes(CONST DXGKARG_SETPOINTERSHAPE* pSetPointerShape, PVBOXWDDM_POINTER_INFO pPointerInfo)
     2822static BOOLEAN vboxVddmPointerShapeToAttributes(CONST DXGKARG_SETPOINTERSHAPE* pSetPointerShape, PVBOXWDDM_POINTER_INFO pPointerInfo,
     2823                                                bool fDwordAlignScanlines)
    28172824{
    28182825    PVIDEO_POINTER_ATTRIBUTES pPointerAttributes = &pPointerInfo->Attributes.data;
     
    28232830    if (pSetPointerShape->Flags.Color)
    28242831    {
    2825         if (vboxWddmPointerCopyColorData(pSetPointerShape, pPointerAttributes))
     2832        if (vboxWddmPointerCopyColorData(pSetPointerShape, pPointerAttributes, fDwordAlignScanlines))
    28262833        {
    28272834            pPointerAttributes->Flags = VIDEO_MODE_COLOR_POINTER;
     
    28382845    else if (pSetPointerShape->Flags.Monochrome)
    28392846    {
    2840         if (vboxWddmPointerCopyMonoData(pSetPointerShape, pPointerAttributes))
     2847        if (vboxWddmPointerCopyMonoData(pSetPointerShape, pPointerAttributes, fDwordAlignScanlines))
    28412848        {
    28422849            pPointerAttributes->Flags = VIDEO_MODE_MONO_POINTER;
     
    28872894        {
    28882895            /* Size of the pointer data: sizeof(AND mask) + sizeof(XOR mask) */
    2889             cbAndMask = ((((cWidth + 7) / 8) * cHeight + 3) & ~3);
     2896            /* "Each scanline is padded to a 32-bit boundary." */
     2897            cbAndMask = ((((cWidth + 7) / 8) + 3) & ~3) * cHeight;
    28902898            cbXorMask = cWidth * 4 * cHeight;
    28912899
     
    30283036        PVBOXMP_DEVEXT pDevExt = (PVBOXMP_DEVEXT)hAdapter;
    30293037        PVBOXWDDM_POINTER_INFO pPointerInfo = &pDevExt->aSources[pSetPointerShape->VidPnSourceId].PointerInfo;
     3038        bool const fDwordAlignScanlines = pDevExt->enmHwType != VBOXVIDEO_HWTYPE_VBOX;
    30303039        /** @todo to avoid extra data copy and extra heap allocation,
    30313040         *  need to maintain the pre-allocated HGSMI buffer and convert the data directly to it */
    3032         if (vboxVddmPointerShapeToAttributes(pSetPointerShape, pPointerInfo))
     3041        if (vboxVddmPointerShapeToAttributes(pSetPointerShape, pPointerInfo, fDwordAlignScanlines))
    30333042        {
    30343043            pDevExt->PointerInfo.iLastReportedScreen = pSetPointerShape->VidPnSourceId;
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