VirtualBox

忽略:
時間撮記:
2010-3-30 下午08:31:42 (15 年 以前)
作者:
vboxsync
訊息:

2d: working multi-monitor + some fixing for working with not-using-VRAM mode

檔案:
修改 1 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/Devices/Graphics/DevVGA_VBVA.cpp

    r27682 r27839  
    10011001
    10021002#ifdef VBOX_WITH_VIDEOHWACCEL
    1003 static VBOXVHWACMD* vbvaVHWAHHCommandCreate (PVGASTATE pVGAState, VBOXVHWACMD_TYPE enmCmd, VBOXVHWACMD_LENGTH cbCmd)
     1003static void vbvaVHWAHHCommandReinit(VBOXVHWACMD* pHdr, VBOXVHWACMD_TYPE enmCmd, int32_t iDisplay)
     1004{
     1005    memset(pHdr, 0, VBOXVHWACMD_HEADSIZE());
     1006    pHdr->cRefs = 1;
     1007    pHdr->iDisplay = iDisplay;
     1008    pHdr->rc = VERR_NOT_IMPLEMENTED;
     1009    pHdr->enmCmd = enmCmd;
     1010    pHdr->Flags = VBOXVHWACMD_FLAG_HH_CMD;
     1011}
     1012
     1013static VBOXVHWACMD* vbvaVHWAHHCommandCreate (PVGASTATE pVGAState, VBOXVHWACMD_TYPE enmCmd, int32_t iDisplay, VBOXVHWACMD_LENGTH cbCmd)
    10041014{
    10051015    VBOXVHWACMD* pHdr = (VBOXVHWACMD*)RTMemAlloc(cbCmd + VBOXVHWACMD_HEADSIZE());
    10061016    Assert(pHdr);
    10071017    if (pHdr)
    1008     {
    1009         memset(pHdr, 0, VBOXVHWACMD_HEADSIZE());
    1010         pHdr->cRefs = 1;
    1011         pHdr->rc = VERR_NOT_IMPLEMENTED;
    1012         pHdr->enmCmd = enmCmd;
    1013         pHdr->Flags = VBOXVHWACMD_FLAG_HH_CMD;
    1014     }
     1018        vbvaVHWAHHCommandReinit(pHdr, enmCmd, iDisplay);
    10151019
    10161020    return pHdr;
     
    10791083int vbvaVHWAConstruct (PVGASTATE pVGAState)
    10801084{
    1081     VBOXVHWACMD *pCmd = vbvaVHWAHHCommandCreate(pVGAState, VBOXVHWACMD_TYPE_HH_CONSTRUCT, sizeof(VBOXVHWACMD_HH_CONSTRUCT));
     1085    VBOXVHWACMD *pCmd = vbvaVHWAHHCommandCreate(pVGAState, VBOXVHWACMD_TYPE_HH_CONSTRUCT, 0, sizeof(VBOXVHWACMD_HH_CONSTRUCT));
    10821086    Assert(pCmd);
    10831087    if(pCmd)
    10841088    {
     1089        uint32_t iDisplay = 0;
     1090        int rc = VINF_SUCCESS;
    10851091        VBOXVHWACMD_HH_CONSTRUCT * pBody = VBOXVHWACMD_BODY(pCmd, VBOXVHWACMD_HH_CONSTRUCT);
    1086         memset(pBody, 0, sizeof(VBOXVHWACMD_HH_CONSTRUCT));
    1087 
    1088         PPDMDEVINS pDevIns = pVGAState->pDevInsR3;
    1089         PVM pVM = PDMDevHlpGetVM(pDevIns);
    1090 
    1091         pBody->pVM = pVM;
    1092         pBody->pvVRAM = pVGAState->vram_ptrR3;
    1093         pBody->cbVRAM = pVGAState->vram_size;
    1094 
    1095         int rc = vbvaVHWAHHCommandPost(pVGAState, pCmd);
    1096         AssertRC(rc);
    1097         if(RT_SUCCESS(rc))
    1098         {
    1099             rc = pCmd->rc;
    1100             AssertMsg(RT_SUCCESS(rc) || rc == VERR_NOT_IMPLEMENTED, ("%Rrc\n", rc));
    1101             if(rc == VERR_NOT_IMPLEMENTED)
    1102             {
    1103                 /* @todo: set some flag in pVGAState indicating VHWA is not supported */
    1104                 /* VERR_NOT_IMPLEMENTED is not a failure, we just do not support it */
    1105                 rc = VINF_SUCCESS;
    1106             }
    1107         }
     1092
     1093        do
     1094        {
     1095            memset(pBody, 0, sizeof(VBOXVHWACMD_HH_CONSTRUCT));
     1096
     1097            PPDMDEVINS pDevIns = pVGAState->pDevInsR3;
     1098            PVM pVM = PDMDevHlpGetVM(pDevIns);
     1099
     1100            pBody->pVM = pVM;
     1101            pBody->pvVRAM = pVGAState->vram_ptrR3;
     1102            pBody->cbVRAM = pVGAState->vram_size;
     1103
     1104            rc = vbvaVHWAHHCommandPost(pVGAState, pCmd);
     1105            AssertRC(rc);
     1106            if(RT_SUCCESS(rc))
     1107            {
     1108                rc = pCmd->rc;
     1109                AssertMsg(RT_SUCCESS(rc) || rc == VERR_NOT_IMPLEMENTED, ("%Rrc\n", rc));
     1110                if(rc == VERR_NOT_IMPLEMENTED)
     1111                {
     1112                    /* @todo: set some flag in pVGAState indicating VHWA is not supported */
     1113                    /* VERR_NOT_IMPLEMENTED is not a failure, we just do not support it */
     1114                    rc = VINF_SUCCESS;
     1115                }
     1116
     1117                if (!RT_SUCCESS(rc))
     1118                    break;
     1119            }
     1120            else
     1121                break;
     1122
     1123            ++iDisplay;
     1124            if (iDisplay >= pVGAState->cMonitors)
     1125                break;
     1126            vbvaVHWAHHCommandReinit(pCmd, VBOXVHWACMD_TYPE_HH_CONSTRUCT, (int32_t)iDisplay);
     1127        } while (true);
    11081128
    11091129        vbvaVHWAHHCommandRelease(pCmd);
     
    11171137{
    11181138    /* ensure we have all pending cmds processed and h->g cmds disabled */
    1119     VBOXVHWACMD *pCmd = vbvaVHWAHHCommandCreate(pVGAState, VBOXVHWACMD_TYPE_HH_RESET, 0);
     1139    VBOXVHWACMD *pCmd = vbvaVHWAHHCommandCreate(pVGAState, VBOXVHWACMD_TYPE_HH_RESET, 0, 0);
    11201140    Assert(pCmd);
    11211141    if(pCmd)
    11221142    {
    1123         int rc = vbvaVHWAHHCommandPost(pVGAState, pCmd);
    1124         AssertRC(rc);
    1125         if(RT_SUCCESS(rc))
    1126         {
    1127             rc = pCmd->rc;
    1128             AssertMsg(RT_SUCCESS(rc) || rc == VERR_NOT_IMPLEMENTED, ("%Rrc\n", rc));
    1129             if (rc == VERR_NOT_IMPLEMENTED)
    1130                 rc = VINF_SUCCESS;
    1131         }
     1143        int rc = VINF_SUCCESS;
     1144        uint32_t iDisplay = 0;
     1145
     1146        do
     1147        {
     1148            rc =vbvaVHWAHHCommandPost(pVGAState, pCmd);
     1149            AssertRC(rc);
     1150            if(RT_SUCCESS(rc))
     1151            {
     1152                rc = pCmd->rc;
     1153                AssertMsg(RT_SUCCESS(rc) || rc == VERR_NOT_IMPLEMENTED, ("%Rrc\n", rc));
     1154                if (rc == VERR_NOT_IMPLEMENTED)
     1155                    rc = VINF_SUCCESS;
     1156            }
     1157
     1158            if (!RT_SUCCESS(rc))
     1159                break;
     1160
     1161            ++iDisplay;
     1162            if (iDisplay >= pVGAState->cMonitors)
     1163                break;
     1164            vbvaVHWAHHCommandReinit(pCmd, VBOXVHWACMD_TYPE_HH_RESET, (int32_t)iDisplay);
     1165
     1166        } while (true);
    11321167
    11331168        vbvaVHWAHHCommandRelease(pCmd);
     
    11411176int vbvaVHWADisable (PVGASTATE pVGAState)
    11421177{
    1143     VBOXVHWACMD *pCmd = vbvaVHWAHHCommandCreate(pVGAState, VBOXVHWACMD_TYPE_DISABLE, 0);
     1178    VBOXVHWACMD *pCmd = vbvaVHWAHHCommandCreate(pVGAState, VBOXVHWACMD_TYPE_DISABLE, 0, 0);
    11441179    Assert(pCmd);
    11451180    if(pCmd)
    11461181    {
    1147         int rc = vbvaVHWAHHCommandPost(pVGAState, pCmd);
    1148         AssertRC(rc);
    1149         if(RT_SUCCESS(rc))
    1150         {
    1151             rc = pCmd->rc;
    1152             AssertMsg(RT_SUCCESS(rc) || rc == VERR_NOT_IMPLEMENTED, ("%Rrc\n", rc));
    1153             if(rc == VERR_NOT_IMPLEMENTED)
    1154             {
    1155                 rc = VINF_SUCCESS;
    1156             }
    1157         }
     1182        int rc = VINF_SUCCESS;
     1183        uint32_t iDisplay = 0;
     1184
     1185        do
     1186        {
     1187            rc = vbvaVHWAHHCommandPost(pVGAState, pCmd);
     1188            AssertRC(rc);
     1189            if(RT_SUCCESS(rc))
     1190            {
     1191                rc = pCmd->rc;
     1192                AssertMsg(RT_SUCCESS(rc) || rc == VERR_NOT_IMPLEMENTED, ("%Rrc\n", rc));
     1193                if(rc == VERR_NOT_IMPLEMENTED)
     1194                {
     1195                    rc = VINF_SUCCESS;
     1196                }
     1197            }
     1198
     1199            if (!RT_SUCCESS(rc))
     1200                break;
     1201
     1202            ++iDisplay;
     1203            if (iDisplay >= pVGAState->cMonitors)
     1204                break;
     1205            vbvaVHWAHHCommandReinit(pCmd, VBOXVHWACMD_TYPE_DISABLE, (int32_t)iDisplay);
     1206
     1207        } while (true);
    11581208
    11591209        vbvaVHWAHHCommandRelease(pCmd);
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette