VirtualBox

Changeset 42043 in vbox for trunk/src


Ignore:
Timestamp:
Jul 6, 2012 5:01:15 PM (13 years ago)
Author:
vboxsync
Message:

Additions/solaris/vboxmouse: preallocate GR request.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/solaris/Mouse/vboxmouse.c

    r42031 r42043  
    218218{
    219219    /** Device handle. */
    220     dev_info_t        *pDip;
     220    dev_info_t           *pDip;
    221221    /** Mutex protecting the guest library against multiple initialistation or
    222222     * uninitialisation. */
    223     kmutex_t           InitMtx;
     223    kmutex_t              InitMtx;
    224224    /** Initialisation counter for the guest library. */
    225     size_t             cInits;
     225    size_t                cInits;
    226226    /** The STREAMS write queue which we need for sending messages up to
    227227     * user-space. */
    228     queue_t           *pWriteQueue;
     228    queue_t              *pWriteQueue;
     229    /** Pre-allocated mouse status VMMDev request for use in the IRQ
     230     * handler. */
     231    VMMDevReqMouseStatus *pMouseStatusReq;
    229232    /* The current greatest horizontal pixel offset on the screen, used for
    230233     * absolute mouse position reporting.
    231234     */
    232     int                cMaxScreenX;
     235    int                   cMaxScreenX;
    233236    /* The current greatest vertical pixel offset on the screen, used for
    234237     * absolute mouse position reporting.
    235238     */
    236     int                cMaxScreenY;
     239    int                   cMaxScreenY;
    237240} VBMSSTATE, *PVBMSSTATE;
    238241
     
    443446    mutex_enter(&g_OpenNodeState.InitMtx);
    444447    if (!g_OpenNodeState.cInits)
     448    {
    445449        rc = VbglInit();
     450        if (RT_SUCCESS(rc))
     451        {
     452            rc = VbglGRAlloc((VMMDevRequestHeader **)
     453                             &g_OpenNodeState.pMouseStatusReq,
     454                             sizeof(*g_OpenNodeState.pMouseStatusReq),
     455                             VMMDevReq_GetMouseStatus);
     456            if (RT_FAILURE(rc))
     457                VbglTerminate();
     458        }
     459    }
    446460    ++g_OpenNodeState.cInits;
    447461    mutex_exit(&g_OpenNodeState.InitMtx);
     
    502516    PVBMSSTATE pState = (PVBMSSTATE)pvState;
    503517    int rc;
    504     uint32_t x, y;
    505518    LogRelFlow((DEVICE_NAME "::NativeISRMousePollEvent:\n"));
    506519
    507     rc = VbglGetMouseStatus(NULL, &x, &y);
     520    pState->pMouseStatusReq->mouseFeatures = 0;
     521    pState->pMouseStatusReq->pointerXPos = 0;
     522    pState->pMouseStatusReq->pointerYPos = 0;
     523    rc = VbglGRPerform(&pState->pMouseStatusReq->header);
    508524    if (RT_SUCCESS(rc))
    509525    {
    510526        int cMaxScreenX  = pState->cMaxScreenX;
    511527        int cMaxScreenY  = pState->cMaxScreenY;
     528        int x = pState->pMouseStatusReq->pointerXPos;
     529        int y = pState->pMouseStatusReq->pointerYPos;
    512530
    513531        if (cMaxScreenX && cMaxScreenY)
     
    541559    if (canput(pReadQueue->q_next))
    542560        putnext(pReadQueue, pMBlk);
    543     else
    544         putbq(pReadQueue, pMBlk);
     561    // else
     562    //     putq(pReadQueue, pMBlk);
    545563}
    546564
     
    577595    --g_OpenNodeState.cInits;
    578596    if (!g_OpenNodeState.cInits)
     597    {
     598        VbglGRFree(&g_OpenNodeState.pMouseStatusReq->header);
    579599        VbglTerminate();
     600    }
    580601    mutex_exit(&g_OpenNodeState.InitMtx);
    581602    return 0;
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