VirtualBox

Changeset 82668 in vbox for trunk/src/VBox/Additions/x11


Ignore:
Timestamp:
Jan 8, 2020 10:52:32 AM (5 years ago)
Author:
vboxsync
Message:

VMSVGA/X11: bugref:9637. Caching monitor (display) information so that we can send the whole data (not just delta) to drm.

File:
1 edited

Legend:

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

    r82664 r82668  
    9696};
    9797
     98struct DRMVMWRECT aRects[VMW_MAX_HEADS];
     99
    98100static void drmConnect(struct DRMCONTEXT *pContext)
    99101{
     
    184186    unsigned i;
    185187    int rc;
    186     struct DRMVMWRECT aRects[VMW_MAX_HEADS];
    187     unsigned cHeads;
    188188    /* Do not acknowledge the first event we query for to pick up old events,
    189189     * e.g. from before a guest reboot. */
     
    217217        if (cDisplaysOut > 0)
    218218        {
    219             cHeads = 0;
    220219            for (i = 0; i < cDisplaysOut && i < VMW_MAX_HEADS; ++i)
    221220            {
    222221                if (!(aDisplays[i].fDisplayFlags & VMMDEV_DISPLAY_DISABLED))
    223222                {
    224                     if ((i == 0) || (aDisplays[i].fDisplayFlags & VMMDEV_DISPLAY_ORIGIN))
     223                    uint32_t idDisplay = aDisplays[i].idDisplay;
     224                    if (idDisplay < VMW_MAX_HEADS)
    225225                    {
    226                         aRects[cHeads].x = aDisplays[i].xOrigin;
    227                         aRects[cHeads].y = aDisplays[i].yOrigin;
    228                     } else {
    229                         aRects[cHeads].x = aRects[cHeads - 1].x + aRects[cHeads - 1].w;
    230                         aRects[cHeads].y = aRects[cHeads - 1].y;
     226                        if ((idDisplay == 0) || (aDisplays[i].fDisplayFlags & VMMDEV_DISPLAY_ORIGIN))
     227                        {
     228                            aRects[idDisplay].x = aDisplays[i].xOrigin;
     229                            aRects[idDisplay].y = aDisplays[i].yOrigin;
     230                        } else {
     231                            aRects[idDisplay].x = aRects[idDisplay - 1].x + aRects[idDisplay - 1].w;
     232                            aRects[idDisplay].y = aRects[idDisplay - 1].y;
     233                        }
     234                        aRects[idDisplay].w = aDisplays[i].cx;
     235                        aRects[idDisplay].h = aDisplays[i].cy;
    231236                    }
    232                     aRects[cHeads].w = aDisplays[i].cx;
    233                     aRects[cHeads].h = aDisplays[i].cy;
    234                     ++cHeads;
    235237                }
    236238            }
    237             for (i = 0; i < cHeads; ++i)
     239            for (i = 0; i < cDisplaysOut; ++i)
    238240                printf("Head %u: %dx%d, (%d, %d)\n", i, (int)aRects[i].w, (int)aRects[i].h,
    239241                       (int)aRects[i].x, (int)aRects[i].y);
    240             drmSendHints(&drmContext, aRects, cHeads);
     242            drmSendHints(&drmContext, aRects, VMW_MAX_HEADS);
    241243        }
    242244        do
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