Changeset 39887 in vbox
- Timestamp:
- Jan 26, 2012 5:56:17 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA_VBVA.cpp
r39603 r39887 173 173 } 174 174 175 VBVARECORD *pRecord = &pVBVA->aRecords[indexRecordFirst];176 177 LOGVBVABUFFER(("cbRecord = 0x%08X \n", pRecord->cbRecord));178 179 uint32_t cbRecord = pRecord->cbRecord& ~VBVA_F_RECORD_PARTIAL;175 uint32_t cbRecordCurrent = ASMAtomicReadU32(&pVBVA->aRecords[indexRecordFirst].cbRecord); 176 177 LOGVBVABUFFER(("cbRecord = 0x%08X, pPartialRecord->cb = 0x%08X\n", cbRecordCurrent, pPartialRecord->cb)); 178 179 uint32_t cbRecord = cbRecordCurrent & ~VBVA_F_RECORD_PARTIAL; 180 180 181 181 if (pPartialRecord->cb) … … 185 185 186 186 LOGVBVABUFFER(("continue partial record cb = %d cbRecord 0x%08X, first = %d, free = %d\n", 187 pPartialRecord->cb, pRecord->cbRecord, indexRecordFirst, indexRecordFree));187 pPartialRecord->cb, cbRecordCurrent, indexRecordFirst, indexRecordFree)); 188 188 189 189 if (cbRecord > pPartialRecord->cb) … … 196 196 } 197 197 198 if (!( pRecord->cbRecord& VBVA_F_RECORD_PARTIAL))198 if (!(cbRecordCurrent & VBVA_F_RECORD_PARTIAL)) 199 199 { 200 200 /* The record is completed by guest. Return it to the caller. */ … … 216 216 217 217 /* A new record need to be processed. */ 218 if ( pRecord->cbRecord& VBVA_F_RECORD_PARTIAL)218 if (cbRecordCurrent & VBVA_F_RECORD_PARTIAL) 219 219 { 220 220 /* Current record is being written by guest. '=' is important here, … … 232 232 233 233 LOGVBVABUFFER(("started partial record cb = 0x%08X cbRecord 0x%08X, first = %d, free = %d\n", 234 pPartialRecord->cb, pRecord->cbRecord, indexRecordFirst, indexRecordFree));234 pPartialRecord->cb, cbRecordCurrent, indexRecordFirst, indexRecordFree)); 235 235 } 236 236 … … 468 468 } 469 469 470 static int vbvaEnable (unsigned uScreenId, PVGASTATE pVGAState, VBVACONTEXT *pCtx, VBVABUFFER *pVBVA, uint32_t u32Offset )470 static int vbvaEnable (unsigned uScreenId, PVGASTATE pVGAState, VBVACONTEXT *pCtx, VBVABUFFER *pVBVA, uint32_t u32Offset, bool fRestored) 471 471 { 472 472 /* @todo old code did a UpdateDisplayAll at this place. */ … … 492 492 pVBVA->hostFlags.u32HostEvents, pVBVA->hostFlags.u32SupportedOrders)); 493 493 494 pCtx->aViews[uScreenId].partialRecord.pu8 = NULL; 495 pCtx->aViews[uScreenId].partialRecord.cb = 0; 494 if (!fRestored) 495 { 496 /* @todo Actually this function must not touch the partialRecord structure at all, 497 * because initially it is a zero and when VBVA is disabled this should be set to zero. 498 * But I'm not sure that no code depends on zeroing partialRecord here. 499 * So for now (a quick fix for 4.1) just do not do this if the VM was restored, 500 * when partialRecord might be loaded already from the saved state. 501 */ 502 pCtx->aViews[uScreenId].partialRecord.pu8 = NULL; 503 pCtx->aViews[uScreenId].partialRecord.cb = 0; 504 } 496 505 497 506 pCtx->aViews[uScreenId].pVBVA = pVBVA; … … 1600 1609 if (pView->pVBVA) 1601 1610 { 1602 vbvaEnable (iView, pVGAState, pCtx, pView->pVBVA, pView->u32VBVAOffset );1611 vbvaEnable (iView, pVGAState, pCtx, pView->pVBVA, pView->u32VBVAOffset, true /* fRestored */); 1603 1612 vbvaResize (pVGAState, pView, &pView->screen); 1604 1613 } … … 1892 1901 vbvaFlush (pVGAState, pCtx); 1893 1902 1894 rc = vbvaEnable (uScreenId, pVGAState, pCtx, pVBVA, u32Offset );1903 rc = vbvaEnable (uScreenId, pVGAState, pCtx, pVBVA, u32Offset, false /* fRestored */); 1895 1904 } 1896 1905 else
Note:
See TracChangeset
for help on using the changeset viewer.