- 時間撮記:
- 2010-3-30 下午08:31:42 (15 年 以前)
- 檔案:
-
- 修改 1 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Devices/Graphics/DevVGA_VBVA.cpp
r27682 r27839 1001 1001 1002 1002 #ifdef VBOX_WITH_VIDEOHWACCEL 1003 static VBOXVHWACMD* vbvaVHWAHHCommandCreate (PVGASTATE pVGAState, VBOXVHWACMD_TYPE enmCmd, VBOXVHWACMD_LENGTH cbCmd) 1003 static 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 1013 static VBOXVHWACMD* vbvaVHWAHHCommandCreate (PVGASTATE pVGAState, VBOXVHWACMD_TYPE enmCmd, int32_t iDisplay, VBOXVHWACMD_LENGTH cbCmd) 1004 1014 { 1005 1015 VBOXVHWACMD* pHdr = (VBOXVHWACMD*)RTMemAlloc(cbCmd + VBOXVHWACMD_HEADSIZE()); 1006 1016 Assert(pHdr); 1007 1017 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); 1015 1019 1016 1020 return pHdr; … … 1079 1083 int vbvaVHWAConstruct (PVGASTATE pVGAState) 1080 1084 { 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)); 1082 1086 Assert(pCmd); 1083 1087 if(pCmd) 1084 1088 { 1089 uint32_t iDisplay = 0; 1090 int rc = VINF_SUCCESS; 1085 1091 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); 1108 1128 1109 1129 vbvaVHWAHHCommandRelease(pCmd); … … 1117 1137 { 1118 1138 /* 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); 1120 1140 Assert(pCmd); 1121 1141 if(pCmd) 1122 1142 { 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); 1132 1167 1133 1168 vbvaVHWAHHCommandRelease(pCmd); … … 1141 1176 int vbvaVHWADisable (PVGASTATE pVGAState) 1142 1177 { 1143 VBOXVHWACMD *pCmd = vbvaVHWAHHCommandCreate(pVGAState, VBOXVHWACMD_TYPE_DISABLE, 0 );1178 VBOXVHWACMD *pCmd = vbvaVHWAHHCommandCreate(pVGAState, VBOXVHWACMD_TYPE_DISABLE, 0, 0); 1144 1179 Assert(pCmd); 1145 1180 if(pCmd) 1146 1181 { 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); 1158 1208 1159 1209 vbvaVHWAHHCommandRelease(pCmd);
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器