VirtualBox

Changeset 25069 in vbox


Ignore:
Timestamp:
Nov 28, 2009 10:17:22 AM (15 years ago)
Author:
vboxsync
Message:

HGSMI/VBVA: enable VRDP commands only if there are connected RDP clients (update).

Location:
trunk/src/VBox/Main
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/DisplayImpl.cpp

    r25054 r25069  
    108108    mfu32PendingVideoAccelDisable = false;
    109109#endif /* VBOX_WITH_OLD_VBVA_LOCK */
     110
     111#ifdef VBOX_WITH_HGSMI
     112    mu32UpdateVBVAFlags = 0;
     113#endif
    110114
    111115    return S_OK;
     
    11811185        }
    11821186    }
     1187}
    11831188
    11841189#ifdef VBOX_WITH_HGSMI
     1190static void vbvaSetMemoryFlagsHGSMI (unsigned uScreenId,
     1191                                     uint32_t fu32SupportedOrders,
     1192                                     bool fVideoAccelVRDP,
     1193                                     DISPLAYFBINFO *pFBInfo)
     1194{
     1195    LogFlowFunc(("HGSMI[%d]: %p\n", uScreenId, pFBInfo->pVBVAHostFlags));
     1196
     1197    if (pFBInfo->pVBVAHostFlags)
     1198    {
     1199        uint32_t fu32HostEvents = VBOX_VIDEO_INFO_HOST_EVENTS_F_VRDP_RESET;
     1200
     1201        if (pFBInfo->fVBVAEnabled)
     1202        {
     1203            fu32HostEvents |= VBVA_F_MODE_ENABLED;
     1204
     1205            if (fVideoAccelVRDP)
     1206            {
     1207                fu32HostEvents |= VBVA_F_MODE_VRDP;
     1208            }
     1209        }
     1210
     1211        ASMAtomicOrU32(&pFBInfo->pVBVAHostFlags->u32HostEvents, fu32HostEvents);
     1212        ASMAtomicWriteU32(&pFBInfo->pVBVAHostFlags->u32SupportedOrders, fu32SupportedOrders);
     1213
     1214        LogFlowFunc(("    fu32HostEvents = 0x%08X, fu32SupportedOrders = 0x%08X\n", fu32HostEvents, fu32SupportedOrders));
     1215    }
     1216}
     1217
     1218static void vbvaSetMemoryFlagsAllHGSMI (uint32_t fu32SupportedOrders,
     1219                                        bool fVideoAccelVRDP,
     1220                                        DISPLAYFBINFO *paFBInfos,
     1221                                        unsigned cFBInfos)
     1222{
     1223    unsigned uScreenId;
     1224
    11851225    for (uScreenId = 0; uScreenId < cFBInfos; uScreenId++)
    11861226    {
    1187         LogFlowFunc(("HGSMI[%d]: %p\n", uScreenId, paFBInfos[uScreenId].pVBVAHostFlags));
    1188         if (paFBInfos[uScreenId].pVBVAHostFlags)
    1189         {
    1190             uint32_t fu32HostEvents = VBOX_VIDEO_INFO_HOST_EVENTS_F_VRDP_RESET;
    1191 
    1192             if (fVideoAccelEnabled)
    1193             {
    1194                 fu32HostEvents |= VBVA_F_MODE_ENABLED;
    1195 
    1196                 if (fVideoAccelVRDP)
    1197                 {
    1198                     fu32HostEvents |= VBVA_F_MODE_VRDP;
    1199                 }
    1200             }
    1201 
    1202             paFBInfos[uScreenId].pVBVAHostFlags->u32HostEvents |= fu32HostEvents;
    1203             paFBInfos[uScreenId].pVBVAHostFlags->u32SupportedOrders = fu32SupportedOrders;
    1204         }
    1205     }
     1227        vbvaSetMemoryFlagsHGSMI(uScreenId, fu32SupportedOrders, fVideoAccelVRDP, &paFBInfos[uScreenId]);
     1228    }
     1229}
    12061230#endif /* VBOX_WITH_HGSMI */
    1207 }
    12081231
    12091232bool Display::VideoAccelAllowed (void)
     
    13871410
    13881411        vbvaSetMemoryFlags (mpVbvaMemory, mfVideoAccelEnabled, mfVideoAccelVRDP, mfu32SupportedOrders, maFramebuffers, mcMonitors);
     1412#ifdef VBOX_WITH_HGSMI
     1413        /* Here is VRDP-IN thread. Process the request in vbvaUpdateBegin under DevVGA lock on an EMT. */
     1414        ASMAtomicIncU32(&mu32UpdateVBVAFlags);
     1415#endif /* VBOX_WITH_HGSMI */
    13891416
    13901417        LogRel(("VBVA: VRDP acceleration has been disabled.\n"));
     
    14021429
    14031430        vbvaSetMemoryFlags (mpVbvaMemory, mfVideoAccelEnabled, mfVideoAccelVRDP, mfu32SupportedOrders, maFramebuffers, mcMonitors);
     1431#ifdef VBOX_WITH_HGSMI
     1432        /* Here is VRDP-IN thread. Process the request in vbvaUpdateBegin under DevVGA lock on an EMT. */
     1433        ASMAtomicIncU32(&mu32UpdateVBVAFlags);
     1434#endif /* VBOX_WITH_HGSMI */
    14041435
    14051436        LogRel(("VBVA: VRDP acceleration has been requested.\n"));
     
    31603191    pThis->maFramebuffers[uScreenId].pVBVAHostFlags = pHostFlags;
    31613192
    3162     vbvaSetMemoryFlags(NULL, true, pThis->mfVideoAccelVRDP, pThis->mfu32SupportedOrders, pThis->maFramebuffers, pThis->mcMonitors);
     3193    vbvaSetMemoryFlagsHGSMI(uScreenId, pThis->mfu32SupportedOrders, pThis->mfVideoAccelVRDP, &pThis->maFramebuffers[uScreenId]);
    31633194
    31643195    return VINF_SUCCESS;
     
    31733204
    31743205    pThis->maFramebuffers[uScreenId].fVBVAEnabled = false;
     3206
     3207    vbvaSetMemoryFlagsHGSMI(uScreenId, 0, false, &pThis->maFramebuffers[uScreenId]);
     3208
    31753209    pThis->maFramebuffers[uScreenId].pVBVAHostFlags = NULL;
    31763210}
     
    31833217    Display *pThis = pDrv->pDisplay;
    31843218    DISPLAYFBINFO *pFBInfo = &pThis->maFramebuffers[uScreenId];
     3219
     3220    if (ASMAtomicReadU32(&pThis->mu32UpdateVBVAFlags) > 0)
     3221    {
     3222        vbvaSetMemoryFlagsAllHGSMI(pThis->mfu32SupportedOrders, pThis->mfVideoAccelVRDP, pThis->maFramebuffers, pThis->mcMonitors);
     3223        ASMAtomicDecU32(&pThis->mu32UpdateVBVAFlags);
     3224    }
    31853225
    31863226    if (RT_LIKELY(pFBInfo->u32ResizeStatus == ResizeStatus_Void))
  • trunk/src/VBox/Main/include/DisplayImpl.h

    r25052 r25069  
    361361    void videoAccelFlush (void);
    362362#endif /* VBOX_WITH_OLD_VBVA_LOCK */
     363
     364#ifdef VBOX_WITH_HGSMI
     365    volatile uint32_t mu32UpdateVBVAFlags;
     366#endif
    363367};
    364368
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