VirtualBox

Changeset 94076 in vbox for trunk/src


Ignore:
Timestamp:
Mar 3, 2022 3:46:36 PM (3 years ago)
Author:
vboxsync
Message:

Additions: Linux: VBoxDRMClient: sync screen layout with DE representation, ​bugref:10134.

In some cases, screen layout which is reported by DE might differ from what was reported
to VBoxDRMClient by host. In this commit, when receiving DE notification, VBoxClient will
report (to VBoxDRMClient) not just display offsets, but entire layout data. VBoxDRMClient
will then validate this data and apply it to DRM stack if needed.

In particular, sometimes DE might report screen layout which can have overlapping displays.
Such layout will be fixed by VBoxDRMClient (display offsets will be realigned) and re-injected
into DRM stack.

Location:
trunk/src/VBox/Additions/x11/VBoxClient
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/x11/VBoxClient/display-drm.cpp

    r93469 r94076  
    8080 *     It is used by each thread - DrmResizeThread, DrmIpcSRV and IpcCLT-XXX.
    8181 *
    82  * #g_monitorPositionsCritSect - serializes access to host interface when guest Desktop
    83  *     Environment reports display layout changes.
     82 * #g_monitorPositionsCritSect - protects access to display layout data cache and vmwgfx driver
     83 *      handle, serializes access to host interface and vmwgfx driver handle between
     84 *      DrmResizeThread and IpcCLT-%u.
    8485 */
    8586
     
    149150 * changed on the host side. */
    150151static volatile bool g_fDrmIpcRestricted;
     152
     153/** Global handle to vmwgfx file descriptor (protected by #g_monitorPositionsCritSect). */
     154static RTFILE g_hDevice = NIL_RTFILE;
    151155
    152156/** DRM version structure. */
     
    311315/**
    312316 * This function converts input monitors layout array passed from DevVMM
    313  * into monitors layout array to be passed to DRM stack.
     317 * into monitors layout array to be passed to DRM stack. Last validation
     318 * request is cached.
    314319 *
    315320 * @return  VINF_SUCCESS on success, VERR_DUPLICATE if monitors layout was not changed, IPRT error code otherwise.
     
    320325 * @param   pu32PrimaryDisplay  ID of a display which marked as primary.
    321326 * @param   pcActualDisplays    Number of displays to report to DRM stack (number of enabled displays).
     327 * @param   fPartialLayout      Whether aDisplaysIn array contains complete display layout information or not.
     328 *                              When layout is reported by Desktop Environment helper, aDisplaysIn does not have
     329 *                              idDisplay, fDisplayFlags and cBitsPerPixel data (guest has no info about them).
    322330 */
    323331static int vbDrmValidateLayout(VMMDevDisplayDef *aDisplaysIn, uint32_t cDisplaysIn,
    324                              struct VBOX_DRMIPC_VMWRECT *aDisplaysOut, uint32_t *pu32PrimaryDisplay,
    325                              uint32_t cDisplaysOutMax, uint32_t *pcActualDisplays)
     332                               struct VBOX_DRMIPC_VMWRECT *aDisplaysOut, uint32_t *pu32PrimaryDisplay,
     333                               uint32_t cDisplaysOutMax, uint32_t *pcActualDisplays, bool fPartialLayout)
    326334{
    327335    /* This array is a cache of what was received from DevVMM so far.
     
    361369    for (uint32_t i = 0; i < cDisplaysIn; i++)
    362370    {
    363         uint32_t idDisplay = aDisplaysIn[i].idDisplay;
     371        uint32_t idDisplay = !fPartialLayout ? aDisplaysIn[i].idDisplay : i;
    364372        if (idDisplay < VBOX_DRMIPC_MONITORS_MAX)
    365373        {
    366             aVmMonitorsCache[idDisplay].idDisplay = idDisplay;
    367             aVmMonitorsCache[idDisplay].fDisplayFlags = aDisplaysIn[i].fDisplayFlags;
    368             aVmMonitorsCache[idDisplay].cBitsPerPixel = aDisplaysIn[i].cBitsPerPixel;
     374            if (!fPartialLayout)
     375            {
     376                aVmMonitorsCache[idDisplay].idDisplay = idDisplay;
     377                aVmMonitorsCache[idDisplay].fDisplayFlags = aDisplaysIn[i].fDisplayFlags;
     378                aVmMonitorsCache[idDisplay].cBitsPerPixel = aDisplaysIn[i].cBitsPerPixel;
     379            }
     380
    369381            aVmMonitorsCache[idDisplay].cx = aDisplaysIn[i].cx;
    370382            aVmMonitorsCache[idDisplay].cy = aDisplaysIn[i].cy;
     
    438450
    439451            VBClLogVerbose(1, "update monitor %u parameters: %dx%d, (%d, %d)\n",
    440                                i, aDisplaysOut[i].w, aDisplaysOut[i].h, aDisplaysOut[i].x, aDisplaysOut[i].y);
     452                           i, aDisplaysOut[i].w, aDisplaysOut[i].h, aDisplaysOut[i].x, aDisplaysOut[i].y);
    441453        }
    442454
     
    450462/**
    451463 * This function sends screen layout data to DRM stack.
     464 *
     465 * Helper function for vbDrmPushScreenLayout(). Should be called
     466 * under g_monitorPositionsCritSect lock.
    452467 *
    453468 * @return  VINF_SUCCESS on success, IPRT error code otherwise.
     
    492507
    493508/**
    494  * Send monitor positions to host (thread safe).
    495  *
    496  * This function is accessed from DRMResize thread and from IPC Client thread.
     509 * This function converts vmwgfx monitors layout data into an array of monitor offsets
     510 * and sends it back to the host in order to ensure that host and guest have the same
     511 * monitors layout representation.
    497512 *
    498513 * @return  IPRT status code.
     
    500515 * @param   pDisplays   Displays parameters as it was sent to vmwgfx driver.
    501516 */
    502 static int vbDrmSendMonitorPositionsSync(uint32_t cDisplays, struct RTPOINT *pDisplays)
    503 {
    504     int rc;
    505 
    506     rc = RTCritSectEnter(&g_monitorPositionsCritSect);
    507     if (RT_SUCCESS(rc))
    508     {
    509         rc = VbglR3SeamlessSendMonitorPositions(cDisplays, pDisplays);
    510         int rc2 = RTCritSectLeave(&g_monitorPositionsCritSect);
    511         if (RT_FAILURE(rc2))
    512             VBClLogError("vbDrmSendMonitorPositionsSync: unable to leave critical section, rc=%Rrc\n", rc);
    513     }
    514     else
    515         VBClLogError("vbDrmSendMonitorPositionsSync: unable to enter critical section, rc=%Rrc\n", rc);
    516 
    517     return rc;
    518 }
    519 
    520 /**
    521  * This function converts vmwgfx monitors layout data into an array of monitor offsets
    522  * and sends it back to the host in order to ensure that host and guest have the same
    523  * monitors layout representation.
    524  *
    525  * @return  IPRT status code.
    526  * @param   cDisplays   Number of displays (elements in pDisplays).
    527  * @param   pDisplays   Displays parameters as it was sent to vmwgfx driver.
    528  */
    529517static int drmSendMonitorPositions(uint32_t cDisplays, struct VBOX_DRMIPC_VMWRECT *pDisplays)
    530518{
     
    543531    }
    544532
    545     return vbDrmSendMonitorPositionsSync(cDisplays, aPositions);
     533    return VbglR3SeamlessSendMonitorPositions(cDisplays, aPositions);
     534}
     535
     536/**
     537 * Validate and apply screen layout data.
     538 *
     539 * @return  IPRT status code.
     540 * @param   aDisplaysIn     An array with screen layout data.
     541 * @param   cDisplaysIn     Number of elements in aDisplaysIn.
     542 * @param   fPartialLayout  Whether aDisplaysIn array contains complete display layout information or not.
     543 *                          When layout is reported by Desktop Environment helper, aDisplaysIn does not have
     544 *                          idDisplay, fDisplayFlags and cBitsPerPixel data (guest has no info about them).
     545 * @param   fApply          Whether to apply provided display layout data to the DRM stack or send display offsets only.
     546 */
     547static int vbDrmPushScreenLayout(VMMDevDisplayDef *aDisplaysIn, uint32_t cDisplaysIn, bool fPartialLayout, bool fApply)
     548{
     549    int rc;
     550
     551    struct VBOX_DRMIPC_VMWRECT aDisplaysOut[VBOX_DRMIPC_MONITORS_MAX];
     552    uint32_t cDisplaysOut = 0;
     553
     554    uint32_t u32PrimaryDisplay = VBOX_DRMIPC_MONITORS_MAX;
     555
     556    rc = RTCritSectEnter(&g_monitorPositionsCritSect);
     557    if (RT_FAILURE(rc))
     558    {
     559        VBClLogError("unable to lock monitor data cache, rc=%Rrc\n", rc);
     560        return rc;
     561    }
     562
     563    static uint32_t u32PrimaryDisplayLast = VBOX_DRMIPC_MONITORS_MAX;
     564
     565    RT_ZERO(aDisplaysOut);
     566
     567    /* Validate displays layout and push it to DRM stack if valid. */
     568    rc = vbDrmValidateLayout(aDisplaysIn, cDisplaysIn, aDisplaysOut, &u32PrimaryDisplay,
     569                             sizeof(aDisplaysOut), &cDisplaysOut, fPartialLayout);
     570    if (RT_SUCCESS(rc))
     571    {
     572        if (fApply)
     573        {
     574            rc = vbDrmSendHints(g_hDevice, aDisplaysOut, cDisplaysOut);
     575            VBClLogInfo("push screen layout data of %u display(s) to DRM stack, fPartialLayout=%RTbool, rc=%Rrc\n",
     576                        cDisplaysOut, fPartialLayout, rc);
     577        }
     578
     579        /* In addition, notify host that configuration was successfully applied to the guest vmwgfx driver. */
     580        if (RT_SUCCESS(rc))
     581        {
     582            rc = drmSendMonitorPositions(cDisplaysOut, aDisplaysOut);
     583            if (RT_FAILURE(rc))
     584                VBClLogError("cannot send host notification: %Rrc\n", rc);
     585
     586            /* If information about primary display is present in display layout, send it to DE over IPC. */
     587            if (u32PrimaryDisplay != VBOX_DRMIPC_MONITORS_MAX
     588                && u32PrimaryDisplayLast != u32PrimaryDisplay)
     589            {
     590                rc = vbDrmIpcBroadcastPrimaryDisplay(u32PrimaryDisplay);
     591
     592                /* Cache last value in order to avoid sending duplicate data over IPC. */
     593                u32PrimaryDisplayLast = u32PrimaryDisplay;
     594
     595                VBClLogVerbose(2, "DE was notified that display %u is now primary, rc=%Rrc\n", u32PrimaryDisplay, rc);
     596            }
     597            else
     598                VBClLogVerbose(2, "do not notify DE second time that display %u is now primary, rc=%Rrc\n", u32PrimaryDisplay, rc);
     599        }
     600    }
     601    else if (rc == VERR_DUPLICATE)
     602        VBClLogVerbose(2, "do not notify DRM stack about monitors layout change twice, rc=%Rrc\n", rc);
     603    else
     604        VBClLogError("displays layout is invalid, will not notify guest driver, rc=%Rrc\n", rc);
     605
     606    int rc2 = RTCritSectLeave(&g_monitorPositionsCritSect);
     607    if (RT_FAILURE(rc2))
     608        VBClLogError("unable to unlock monitor data cache, rc=%Rrc\n", rc);
     609
     610    return rc;
    546611}
    547612
     
    550615{
    551616    int rc = VERR_GENERAL_FAILURE;
    552     RTFILE hDevice = (RTFILE)pvUser;
    553 
    554     RT_NOREF1(ThreadSelf);
    555 
    556     AssertReturn(hDevice, VERR_INVALID_PARAMETER);
     617
     618    RT_NOREF(ThreadSelf);
     619    RT_NOREF(pvUser);
    557620
    558621    for (;;)
     
    567630        uint32_t cDisplaysIn = 0;
    568631
    569         struct VBOX_DRMIPC_VMWRECT aDisplaysOut[VBOX_DRMIPC_MONITORS_MAX];
    570         uint32_t cDisplaysOut = 0;
    571 
    572632        RT_ZERO(aDisplaysIn);
    573         RT_ZERO(aDisplaysOut);
    574633
    575634        /* Query the first size without waiting.  This lets us e.g. pick up
     
    579638        if (RT_SUCCESS(rc))
    580639        {
    581             uint32_t u32PrimaryDisplay = VBOX_DRMIPC_MONITORS_MAX;
    582             static uint32_t u32PrimaryDisplayLast = VBOX_DRMIPC_MONITORS_MAX;
    583 
    584             /* Validate displays layout and push it to DRM stack if valid. */
    585             rc = vbDrmValidateLayout(aDisplaysIn, cDisplaysIn, aDisplaysOut, &u32PrimaryDisplay, sizeof(aDisplaysOut), &cDisplaysOut);
    586             if (RT_SUCCESS(rc))
    587             {
    588                 rc = vbDrmSendHints(hDevice, aDisplaysOut, cDisplaysOut);
    589                 VBClLogInfo("push screen layout data of %u display(s) to DRM stack has %s (%Rrc)\n",
    590                                 cDisplaysOut, RT_SUCCESS(rc) ? "succeeded" : "failed", rc);
    591                 /* In addition, notify host that configuration was successfully applied to the guest vmwgfx driver. */
    592                 if (RT_SUCCESS(rc))
    593                 {
    594                     rc = drmSendMonitorPositions(cDisplaysOut, aDisplaysOut);
    595                     if (RT_FAILURE(rc))
    596                         VBClLogError("cannot send host notification: %Rrc\n", rc);
    597 
    598                     /* If information about primary display is present in display layout, send it to DE over IPC. */
    599                     if (u32PrimaryDisplay != VBOX_DRMIPC_MONITORS_MAX
    600                         && u32PrimaryDisplayLast != u32PrimaryDisplay)
    601                     {
    602                         rc = vbDrmIpcBroadcastPrimaryDisplay(u32PrimaryDisplay);
    603 
    604                         /* Cache last value in order to avoid sending duplicate data over IPC. */
    605                         u32PrimaryDisplayLast = u32PrimaryDisplay;
    606 
    607                         VBClLogVerbose(2, "DE was notified that display %u is now primary, rc=%Rrc\n", u32PrimaryDisplay, rc);
    608                     }
    609                     else
    610                         VBClLogVerbose(2, "do not notify DE that display %u is now primary, rc=%Rrc\n", u32PrimaryDisplay, rc);
    611                 }
    612             }
    613             else if (rc == VERR_DUPLICATE)
    614                 VBClLogVerbose(2, "do not notify DRM stack about monitors layout change, rc=%Rrc\n", rc);
    615             else
    616                 VBClLogError("displays layout is invalid, will not notify guest driver, rc=%Rrc\n", rc);
     640            rc = vbDrmPushScreenLayout(aDisplaysIn, cDisplaysIn, false, true);
     641            if (RT_FAILURE(rc))
     642                VBClLogError("Failed to push display change as requested by host, rc=%Rrc\n", rc);
    617643        }
    618644        else
     
    622648        {
    623649            rc = VbglR3WaitEvent(VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST, VBOX_DRMIPC_RX_TIMEOUT_MS, &events);
    624         } while (rc == VERR_TIMEOUT && !ASMAtomicReadBool(&g_fShutdown));
     650        } while ((rc == VERR_TIMEOUT || rc == VERR_INTERRUPTED) && !ASMAtomicReadBool(&g_fShutdown));
    625651
    626652        if (ASMAtomicReadBool(&g_fShutdown))
     
    791817
    792818/**
     819 * Convert VBOX_DRMIPC_VMWRECT into VMMDevDisplayDef and check layout correctness.
     820 *
     821 * VBOX_DRMIPC_VMWRECT does not represent enough information needed for
     822 * VMMDevDisplayDef. Missing fields (fDisplayFlags, idDisplay, cBitsPerPixel)
     823 * are initialized with default (invalid) values due to this.
     824 *
     825 * @return  True if given screen layout is correct (i.e., has no displays which overlap), False
     826 *          if it needs to be adjusted before injecting into DRM stack.
     827 * @param   cDisplays Number of displays in configuration data.
     828 * @param   pIn       A pointer to display configuration data array in form of VBOX_DRMIPC_VMWRECT (input).
     829 * @param   pOut      A pointer to display configuration data array in form of VMMDevDisplayDef (output).
     830 */
     831static bool vbDrmVmwRectToDisplayDef(uint32_t cDisplays, struct VBOX_DRMIPC_VMWRECT *pIn, VMMDevDisplayDef *pOut)
     832{
     833    bool fCorrect = true;
     834
     835    for (uint32_t i = 0; i < cDisplays; i++)
     836    {
     837        /* VBOX_DRMIPC_VMWRECT has no information about this fields. */
     838        pOut[i].fDisplayFlags = 0;
     839        pOut[i].idDisplay = VBOX_DRMIPC_MONITORS_MAX;
     840        pOut[i].cBitsPerPixel = 0;
     841
     842        pOut[i].xOrigin = pIn[i].x;
     843        pOut[i].yOrigin = pIn[i].y;
     844        pOut[i].cx = pIn[i].w;
     845        pOut[i].cy = pIn[i].h;
     846
     847        /* Make sure that displays do not overlap within reported screen layout. Ask IPC server to fix layout otherwise. */
     848        fCorrect =    i > 0
     849                  && pIn[i].x != (int32_t)pIn[i - 1].w + pIn[i - 1].x
     850                  ?  false
     851                  :  fCorrect;
     852    }
     853
     854    return fCorrect;
     855}
     856
     857/**
    793858 * @interface_method_impl{VBOX_DRMIPC_CLIENT,pfnRxCb}
    794859 */
     
    804869        case VBOXDRMIPCSRVCMD_REPORT_DISPLAY_OFFSETS:
    805870        {
     871            VMMDevDisplayDef aDisplays[VBOX_DRMIPC_MONITORS_MAX];
     872            bool fCorrect;
     873
    806874            PVBOX_DRMIPC_COMMAND_REPORT_DISPLAY_OFFSETS pCmd = (PVBOX_DRMIPC_COMMAND_REPORT_DISPLAY_OFFSETS)pvData;
    807875            AssertReturn(cbData == sizeof(VBOX_DRMIPC_COMMAND_REPORT_DISPLAY_OFFSETS), VERR_INVALID_PARAMETER);
    808             rc = vbDrmSendMonitorPositionsSync(pCmd->cOffsets, pCmd->paOffsets);
     876            AssertReturn(pCmd->cDisplays < VBOX_DRMIPC_MONITORS_MAX, VERR_INVALID_PARAMETER);
     877
     878            /* Convert input display config into VMMDevDisplayDef representation. */
     879            RT_ZERO(aDisplays);
     880            fCorrect = vbDrmVmwRectToDisplayDef(pCmd->cDisplays, pCmd->aDisplays, aDisplays);
     881
     882            rc = vbDrmPushScreenLayout(aDisplays, pCmd->cDisplays, true, !fCorrect);
     883            if (RT_FAILURE(rc))
     884                VBClLogError("Failed to push display change as requested by Desktop Environment helper, rc=%Rrc\n", rc);
     885
    809886            break;
    810887        }
     
    10591136            if (RT_SUCCESS(rc))
    10601137                vbDrmSetIpcServerAccessPermissions(hIpcServer);
    1061             else if (rc != VERR_TIMEOUT)
     1138            else if (   rc != VERR_TIMEOUT
     1139                     && rc != VERR_INTERRUPTED)
    10621140            {
    10631141                VBClLogError("error on waiting guest property notification, rc=%Rrc\n", rc);
     
    10831161    int ch;
    10841162
    1085     RTFILE hDevice = NIL_RTFILE;
    10861163    RTFILE hPidFile;
    10871164
     
    11461223    }
    11471224
    1148     hDevice = vbDrmOpenVmwgfx();
    1149     if (hDevice == NIL_RTFILE)
     1225    g_hDevice = vbDrmOpenVmwgfx();
     1226    if (g_hDevice == NIL_RTFILE)
    11501227        return RTEXITCODE_FAILURE;
    11511228
     
    12001277
    12011278    /* Attempt to start DRM resize task. */
    1202     rc = RTThreadCreate(&drmResizeThread, vbDrmResizeWorker, (void *)hDevice, 0,
     1279    rc = RTThreadCreate(&drmResizeThread, vbDrmResizeWorker, NULL, 0,
    12031280                        RTTHREADTYPE_DEFAULT, RTTHREADFLAGS_WAITABLE, DRM_RESIZE_THREAD_NAME);
    12041281    if (RT_SUCCESS(rc))
     
    12481325        VBClLogError("unable to destroy g_ipcClientConnectionsListCritSect critsect, rc=%Rrc\n", rc2);
    12491326
    1250     RTFileClose(hDevice);
     1327    RTFileClose(g_hDevice);
    12511328
    12521329    VBClLogInfo("releasing PID file lock\n");
  • trunk/src/VBox/Additions/x11/VBoxClient/display-helper-generic.cpp

    r93423 r94076  
    172172        int rc;
    173173        vbcl_hlp_generic_monitor_list_t pMonitorsInfoList, *pIter;
    174         static RTPOINT aDisplayOffsets[VBOX_DRMIPC_MONITORS_MAX];
     174        struct VBOX_DRMIPC_VMWRECT aDisplays[VBOX_DRMIPC_MONITORS_MAX];
    175175
    176176        RTListInit(&pMonitorsInfoList.Node);
     
    197197            XFree((void *)pszMonitorName);
    198198
    199             aDisplayOffsets[idxDisplay].x = pIter->pMonitorInfo->x;
    200             aDisplayOffsets[idxDisplay].y = pIter->pMonitorInfo->y;
     199            aDisplays[idxDisplay].x = pIter->pMonitorInfo->x;
     200            aDisplays[idxDisplay].y = pIter->pMonitorInfo->y;
     201            aDisplays[idxDisplay].w = pIter->pMonitorInfo->width;
     202            aDisplays[idxDisplay].h = pIter->pMonitorInfo->height;
     203
    201204            idxDisplay++;
    202205        }
     
    208211        if (g_pfnDisplayOffsetChangeCb)
    209212        {
    210             rc = g_pfnDisplayOffsetChangeCb(idxDisplay, aDisplayOffsets);
     213            rc = g_pfnDisplayOffsetChangeCb(idxDisplay, aDisplays);
    211214            if (RT_FAILURE(rc))
    212215                VBClLogError("unable to notify subscriber about monitors info change, rc=%Rrc\n", rc);
  • trunk/src/VBox/Additions/x11/VBoxClient/display-helper.h

    r93551 r94076  
    3131 *
    3232 * @returns IPRT status code.
    33  * @param   cOffsets    Number of displays which have changed their offset.
    34  * @param   paOffsets   Displays offset data.
     33 * @param   cDisplays   Number of displays which have changed their offset.
     34 * @param   aDisplays   Displays offset data.
    3535 */
    36 typedef DECLCALLBACKTYPE(int, FNDISPLAYOFFSETCHANGE, (uint32_t cOffsets, struct RTPOINT *paOffsets));
     36typedef DECLCALLBACKTYPE(int, FNDISPLAYOFFSETCHANGE, (uint32_t cDisplays, struct VBOX_DRMIPC_VMWRECT *aDisplays));
    3737
    3838/**
  • trunk/src/VBox/Additions/x11/VBoxClient/display-ipc.cpp

    r93423 r94076  
    298298 * @return  IPRT status code.
    299299 * @param   pClient     IPC session private data.
    300  * @param   cOffsets    Number of monitors which have offsets changed.
    301  * @param   paOffsets   Offsets data.
    302  */
    303 RTDECL(int) vbDrmIpcReportDisplayOffsets(PVBOX_DRMIPC_CLIENT pClient, uint32_t cOffsets, RTPOINT *paOffsets)
     300 * @param   cDisplays   Number of monitors which have offsets changed.
     301 * @param   aDisplays   Offsets data.
     302 */
     303RTDECL(int) vbDrmIpcReportDisplayOffsets(PVBOX_DRMIPC_CLIENT pClient, uint32_t cDisplays, struct VBOX_DRMIPC_VMWRECT *aDisplays)
    304304{
    305305    int rc = VERR_GENERAL_FAILURE;
     
    315315        pCmd->Hdr.idCmd = VBOXDRMIPCSRVCMD_REPORT_DISPLAY_OFFSETS;
    316316        pCmd->Hdr.cbData = sizeof(VBOX_DRMIPC_COMMAND_REPORT_DISPLAY_OFFSETS);
    317         pCmd->cOffsets = cOffsets;
    318         memcpy(pCmd->paOffsets, paOffsets, cOffsets * sizeof(RTPOINT));
     317        pCmd->cDisplays = cDisplays;
     318        memcpy(pCmd->aDisplays, aDisplays, cDisplays * sizeof(struct VBOX_DRMIPC_VMWRECT));
    319319        pCmd->Hdr.u64Crc = RTCrc64(pCmd, pCmd->Hdr.cbData);
    320320        Assert(pCmd->Hdr.u64Crc);
  • trunk/src/VBox/Additions/x11/VBoxClient/display-ipc.h

    r93423 r94076  
    114114    VBOX_DRMIPC_COMMAND_HEADER Hdr;
    115115    /** Number of displays which have changed offsets. */
    116     uint32_t cOffsets;
     116    uint32_t cDisplays;
    117117    /** Offsets data. */
    118     RTPOINT paOffsets[VBOX_DRMIPC_MONITORS_MAX];
    119 
     118    struct VBOX_DRMIPC_VMWRECT aDisplays[VBOX_DRMIPC_MONITORS_MAX];
    120119} VBOX_DRMIPC_COMMAND_REPORT_DISPLAY_OFFSETS;
    121120
     
    226225 * @return  IPRT status code.
    227226 * @param   pClient     IPC session private data.
    228  * @param   cOffsets    Number of monitors which have offsets changed.
    229  * @param   paOffsets   Offsets data.
    230  */
    231 RTDECL(int) vbDrmIpcReportDisplayOffsets(PVBOX_DRMIPC_CLIENT pClient, uint32_t cOffsets, RTPOINT *paOffsets);
     227 * @param   cDisplays   Number of monitors which have offsets changed.
     228 * @param   aDisplays   Offsets data.
     229 */
     230RTDECL(int) vbDrmIpcReportDisplayOffsets(PVBOX_DRMIPC_CLIENT pClient, uint32_t cDisplays, struct VBOX_DRMIPC_VMWRECT *aDisplays);
    232231
    233232#endif /* !GA_INCLUDED_SRC_x11_VBoxClient_display_ipc_h */
  • trunk/src/VBox/Additions/x11/VBoxClient/display-svga-session.cpp

    r93423 r94076  
    8989 * @param   paOffsets   Display data.
    9090 */
    91 static DECLCALLBACK(int) vbclSVGASessionDisplayOffsetChanged(uint32_t cOffsets, RTPOINT *paOffsets)
     91static DECLCALLBACK(int) vbclSVGASessionDisplayOffsetChanged(uint32_t cDisplays, struct VBOX_DRMIPC_VMWRECT *aDisplays)
    9292{
    9393    int rc = RTCritSectEnter(&g_hClientCritSect);
     
    9595    if (RT_SUCCESS(rc))
    9696    {
    97         rc = vbDrmIpcReportDisplayOffsets(&g_hClient, cOffsets, paOffsets);
     97        rc = vbDrmIpcReportDisplayOffsets(&g_hClient, cDisplays, aDisplays);
    9898        int rc2 = RTCritSectLeave(&g_hClientCritSect);
    9999        if (RT_FAILURE(rc2))
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