VirtualBox

Changeset 24053 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Oct 23, 2009 6:54:16 PM (15 years ago)
Author:
vboxsync
Message:

2d accel: perform data reset VGA device reset

Location:
trunk/src/VBox/Devices/Graphics
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Graphics/DevVGA.h

    r23985 r24053  
    458458int      VBVAUpdateDisplay (PVGASTATE pVGAState);
    459459void     VBVAReset (PVGASTATE pVGAState);
     460void     HGSMIReset (PHGSMIINSTANCE pIns);
    460461
    461462# ifdef VBOX_WITH_VIDEOHWACCEL
     
    463464int vbvaVHWAConstruct (PVGASTATE pVGAState);
    464465int vbvaVHWADisable (PVGASTATE pVGAState);
     466int vbvaVHWAReset (PVGASTATE pVGAState);
    465467
    466468int vboxVBVASaveStatePrep (PPDMDEVINS pDevIns, PSSMHANDLE pSSM);
  • trunk/src/VBox/Devices/Graphics/DevVGA_VBVA.cpp

    r23793 r24053  
    945945}
    946946
     947int vbvaVHWAReset (PVGASTATE pVGAState)
     948{
     949    /* ensure we have all pending cmds processed and h->g cmds disabled */
     950    VBOXVHWACMD *pCmd = vbvaVHWAHHCommandCreate(pVGAState, VBOXVHWACMD_TYPE_DISABLE, 0);
     951    Assert(pCmd);
     952    if(pCmd)
     953    {
     954        int rc = vbvaVHWAHHCommandPost(pVGAState, pCmd);
     955        Assert(RT_SUCCESS(rc));
     956        if(RT_SUCCESS(rc))
     957        {
     958            rc = pCmd->rc;
     959            Assert(RT_SUCCESS(rc));
     960            vbvaVHWAHHCommandRelease(pCmd);
     961        }
     962        return rc;
     963    }
     964    return VERR_OUT_OF_RESOURCES;
     965}
     966
    947967/* @todo call this also on reset? */
    948968int vbvaVHWADisable (PVGASTATE pVGAState)
     
    13461366    VBVACONTEXT *pCtx = (VBVACONTEXT *)HGSMIContext (pVGAState->pHGSMI);
    13471367
     1368#ifdef VBOX_WITH_VIDEOHWACCEL
     1369    vbvaVHWAReset (pVGAState);
     1370#endif
     1371
     1372    HGSMIReset (pVGAState->pHGSMI);
     1373
    13481374    if (pCtx)
    13491375    {
     
    13571383        }
    13581384    }
     1385
    13591386}
    13601387
  • trunk/src/VBox/Devices/Graphics/HGSMI/HGSMIHost.cpp

    r24044 r24053  
    346346}
    347347
    348 
    349 /* The the guest has finished processing of a buffer previously submitted by the host.
    350  * Called from HGSMI_IO_HOST write handler.
    351  * @thread EMT
    352  */
    353 void HGSMIHostWrite (HGSMIINSTANCE *pIns,
    354                      HGSMIOFFSET offBuffer)
    355 {
    356     LogFlowFunc(("pIns %p offBuffer 0x%x\n", pIns, offBuffer));
    357 
     348static bool hgsmiProcessHostCmdCompletion (HGSMIINSTANCE *pIns,
     349                     HGSMIOFFSET offBuffer,
     350                     bool bCompleteFirst)
     351{
    358352    VM_ASSERT_EMT(pIns->pVM);
    359353
     
    369363            Assert(pEntry->fl == (HGSMI_F_HOST_FIFO_ALLOCATED | HGSMI_F_HOST_FIFO_READ));
    370364
    371             if (pEntry->offBuffer == offBuffer)
     365            if (bCompleteFirst || pEntry->offBuffer == offBuffer)
    372366            {
    373367                break;
     
    386380        LogFlowFunc(("read list entry: %p.\n", pEntry));
    387381
    388         Assert(pEntry);
     382        Assert(pEntry || bCompleteFirst);
    389383
    390384        if (pEntry)
     
    409403            hgsmiHostCommandFreeCallback(pEntry);
    410404#endif
    411         }
    412         else
    413         {
    414             hgsmiFIFOUnlock(pIns);
     405            return true;
     406        }
     407
     408        hgsmiFIFOUnlock(pIns);
     409        if(!bCompleteFirst)
    415410            LogRel(("HGSMI[%s]: ignored invalid write to the host FIFO: 0x%08X!!!\n", pIns->pszName, offBuffer));
    416         }
    417     }
     411    }
     412    return false;
     413}
     414
     415/* The the guest has finished processing of a buffer previously submitted by the host.
     416 * Called from HGSMI_IO_HOST write handler.
     417 * @thread EMT
     418 */
     419void HGSMIHostWrite (HGSMIINSTANCE *pIns,
     420                     HGSMIOFFSET offBuffer)
     421{
     422    LogFlowFunc(("pIns %p offBuffer 0x%x\n", pIns, offBuffer));
     423
     424    hgsmiProcessHostCmdCompletion (pIns, offBuffer, false);
    418425}
    419426
     
    15311538}
    15321539
     1540void HGSMIReset (PHGSMIINSTANCE pIns)
     1541{
     1542    while(hgsmiProcessHostCmdCompletion (pIns, 0, true)) {}
     1543
     1544    HGSMIHeapSetupUnitialized (&pIns->hostHeap);
     1545}
     1546
    15331547void HGSMIDestroy (PHGSMIINSTANCE pIns)
    15341548{
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