vbox的更動 69047 路徑 trunk/src/VBox
- 時間撮記:
- 2017-10-11 下午04:24:38 (7 年 以前)
- 位置:
- trunk/src/VBox/Devices/Graphics
- 檔案:
-
- 修改 4 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Devices/Graphics/BIOS/vbe.c
r67813 r69047 38 38 * of the LGPL is applied is otherwise unspecified. 39 39 */ 40 41 // Use VBE new dynamic mode list. Note that without this option, no42 // checks are currently done to make sure that modes fit into the43 // framebuffer!44 #define VBE_NEW_DYN_LIST45 40 46 41 #include <inttypes.h> … … 169 164 } 170 165 171 #ifdef VBE_NEW_DYN_LIST172 166 uint8_t in_byte(uint16_t port, uint16_t addr) 173 167 { … … 175 169 return inb(port); 176 170 } 177 #endif178 171 179 172 /* Display "chip" identification helpers. */ … … 207 200 208 201 /* Find the offset of the desired mode, given its number. */ 209 #ifdef VBE_NEW_DYN_LIST210 202 static uint16_t mode_info_find_mode(uint16_t mode, Boolean using_lfb) 211 203 { … … 246 238 return 0; 247 239 } 248 #else249 static ModeInfoListItem* mode_info_find_mode(uint16_t mode, Boolean using_lfb)250 {251 ModeInfoListItem *cur_info = &mode_info_list;252 253 while (cur_info->mode != VBE_VESA_MODE_END_OF_LIST)254 {255 if (cur_info->mode == mode)256 {257 if (!using_lfb)258 return cur_info;259 else if (cur_info->info.ModeAttributes & VBE_MODE_ATTRIBUTE_LINEAR_FRAME_BUFFER_MODE)260 return cur_info;261 else262 cur_info++;263 } else264 cur_info++;265 }266 return 0;267 }268 #endif269 240 270 241 #ifndef VBOX … … 303 274 uint16_t cur_mode = 0; 304 275 uint16_t cur_ptr=34; 305 #ifdef VBE_NEW_DYN_LIST306 276 uint16_t cur_info_ofs; 307 277 uint16_t sig, vmode; 308 #else309 ModeInfoListItem *cur_info = &mode_info_list;310 #endif311 278 uint16_t max_bpp = dispi_get_max_bpp(); 312 279 VbeInfoBlock __far *info_block; … … 314 281 info_block = ES :> (VbeInfoBlock *)DI; 315 282 316 #ifdef VBE_NEW_DYN_LIST317 283 /* Read VBE Extra Data signature */ 318 284 sig = in_word(VBE_EXTRA_PORT, 0); … … 326 292 } 327 293 cur_info_ofs = sizeof(VBEHeader); 328 #endif329 294 status = *AX; 330 295 … … 384 349 } 385 350 386 #ifdef VBE_NEW_DYN_LIST387 351 do 388 352 { … … 406 370 // Add vesa mode list terminator 407 371 write_word(ES, DI + cur_ptr, vmode); 408 #else409 do410 {411 if (cur_info->info.BitsPerPixel <= max_bpp) {412 #ifdef VGA_DEBUG413 printf("VBE found mode %x => %x\n", cur_info->mode,cur_mode);414 #endif415 write_word(ES, DI + cur_ptr, cur_info->mode);416 cur_mode++;417 cur_ptr += 2;418 }419 cur_info++;420 } while (cur_info->mode != VBE_VESA_MODE_END_OF_LIST);421 422 // Add vesa mode list terminator423 write_word(ES, DI + cur_ptr, cur_info->mode);424 #endif // VBE_NEW_DYN_LIST425 372 *AX = 0x004F; 426 373 } … … 439 386 { 440 387 uint16_t result = 0x0100; 441 #ifdef VBE_NEW_DYN_LIST442 388 uint16_t cur_info_ofs; 443 #else444 ModeInfoListItem *cur_info;445 #endif446 389 Boolean using_lfb; 447 390 uint8_t win_attr; … … 454 397 CX = (CX & 0x1ff); 455 398 456 #ifdef VBE_NEW_DYN_LIST457 399 cur_info_ofs = mode_info_find_mode(CX, using_lfb); 458 400 459 401 if (cur_info_ofs) { 460 402 uint16_t i; 461 #else462 cur_info = mode_info_find_mode(CX, using_lfb);463 464 if (cur_info != 0) {465 #endif466 403 #ifdef VGA_DEBUG 467 404 printf("VBE found mode %x\n",CX); 468 405 #endif 469 406 memsetb(ES, DI, 0, 256); // The mode info size is fixed 470 #ifdef VBE_NEW_DYN_LIST471 407 for (i = 0; i < sizeof(ModeInfoBlockCompact); i++) { 472 408 uint8_t b; … … 475 411 write_byte(ES, DI + i, b); 476 412 } 477 #else478 memcpyb(ES, DI, 0xc000, &(cur_info->info), sizeof(ModeInfoBlockCompact));479 #endif480 413 win_attr = read_byte(ES, DI + offsetof(ModeInfoBlock, WinAAttributes)); 481 414 if (win_attr & VBE_WINDOW_ATTRIBUTE_RELOCATABLE) { … … 512 445 { 513 446 uint16_t result; 514 #ifdef VBE_NEW_DYN_LIST515 447 uint16_t cur_info_ofs; 516 #else517 ModeInfoListItem *cur_info;518 #endif519 448 Boolean using_lfb; 520 449 uint8_t no_clear; … … 541 470 } 542 471 543 #ifdef VBE_NEW_DYN_LIST544 472 cur_info_ofs = mode_info_find_mode(BX, using_lfb); 545 473 … … 557 485 printf("\txres%x yres%x bpp%x\n", xres, yres, bpp); 558 486 #endif 559 #else560 cur_info = mode_info_find_mode(BX, using_lfb);561 562 if (cur_info != 0)563 {564 #ifdef VGA_DEBUG565 printf("VBE found mode %x, setting:\n", BX);566 printf("\txres%x yres%x bpp%x\n",567 cur_info->info.XResolution,568 cur_info->info.YResolution,569 cur_info->info.BitsPerPixel);570 #endif571 #endif // VBE_NEW_DYN_LIST572 487 573 488 // first disable current mode (when switching between vesa modi) 574 489 dispi_set_enable(VBE_DISPI_DISABLED); 575 490 576 #ifdef VBE_NEW_DYN_LIST577 491 if (bpp == 4) 578 #else579 if (cur_info->info.BitsPerPixel == 4)580 #endif581 492 { 582 493 biosfn_set_video_mode(0x6a); 583 494 } 584 495 585 #ifdef VBE_NEW_DYN_LIST586 496 dispi_set_bpp(bpp); 587 497 dispi_set_xres(xres); 588 498 dispi_set_yres(yres); 589 #else590 dispi_set_bpp(cur_info->info.BitsPerPixel);591 dispi_set_xres(cur_info->info.XResolution);592 dispi_set_yres(cur_info->info.YResolution);593 #endif594 499 dispi_set_bank(0); 595 500 dispi_set_enable(VBE_DISPI_ENABLED | no_clear | lfb_flag); -
trunk/src/VBox/Devices/Graphics/DevVGA.cpp
r69041 r69047 65 65 #define VGASTATE2DEVINS(pVgaState) ((pVgaState)->CTX_SUFF(pDevIns)) 66 66 67 /** Check that the video modes fit into virtual video memory.68 * Only works when VBE_NEW_DYN_LIST is defined! */69 #define VRAM_SIZE_FIX70 71 67 /** Check buffer if an VRAM offset is within the right range or not. */ 72 68 #if defined(IN_RC) || defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0) … … 134 130 #include "DevVGA.h" 135 131 136 #if defined( VBE_NEW_DYN_LIST) && defined(IN_RING3) && !defined(VBOX_DEVICE_STRUCT_TESTCASE)132 #if defined(IN_RING3) && !defined(VBOX_DEVICE_STRUCT_TESTCASE) 137 133 # include "DevVGAModes.h" 138 134 # include <stdio.h> /* sscan */ … … 3703 3699 #ifdef IN_RING3 3704 3700 3705 # ifdef VBE_NEW_DYN_LIST3706 3701 /** 3707 3702 * @callback_method_impl{FNIOMIOPORTOUT, … … 3770 3765 return rc; 3771 3766 } 3772 # endif /* VBE_NEW_DYN_LIST */3773 3767 3774 3768 … … 6024 6018 PDMDEV_CHECK_VERSIONS_RETURN_QUIET(pDevIns); 6025 6019 6026 #ifdef VBE_NEW_DYN_LIST6027 6020 PVGASTATE pThis = PDMINS_2_DATA(pDevIns, PVGASTATE); 6028 6021 LogFlow(("vgaR3Destruct:\n")); … … 6050 6043 pThis->pbVBEExtraData = NULL; 6051 6044 } 6052 #endif /* VBE_NEW_DYN_LIST */6053 6045 if (pThis->pbVgaBios) 6054 6046 { … … 6117 6109 int rc; 6118 6110 unsigned i; 6119 #ifdef VBE_NEW_DYN_LIST6120 6111 uint32_t cCustomModes; 6121 6112 uint32_t cyReduction; … … 6124 6115 ModeInfoListItem *pCurMode; 6125 6116 unsigned cb; 6126 #endif6127 6117 PDMDEV_CHECK_VERSIONS_RETURN(pDevIns); 6128 6118 PVGASTATE pThis = PDMINS_2_DATA(pDevIns, PVGASTATE); … … 6711 6701 AssertLogRelRCReturn(rc, rc); 6712 6702 6713 #ifdef VBE_NEW_DYN_LIST6714 6715 6703 uint16_t maxBiosXRes; 6716 6704 rc = CFGMR3QueryU16Def(pCfg, "MaxBiosXRes", &maxBiosXRes, UINT16_MAX); … … 6750 6738 pVBEDataHdr->cbData = cb; 6751 6739 6752 # ifndef VRAM_SIZE_FIX6753 pCurMode = memcpy(pVBEDataHdr + 1, &mode_info_list, sizeof(mode_info_list));6754 pCurMode = (ModeInfoListItem *)((uintptr_t)pCurMode + sizeof(mode_info_list));6755 # else /* VRAM_SIZE_FIX defined */6756 6740 pCurMode = (ModeInfoListItem *)(pVBEDataHdr + 1); 6757 6741 for (i = 0; i < MODE_INFO_SIZE; i++) … … 6774 6758 pCurMode++; 6775 6759 } 6776 # endif /* VRAM_SIZE_FIX defined */6777 6760 6778 6761 /* … … 6783 6766 ModeInfoListItem *pDefMode = mode_info_list; 6784 6767 Log(("vgaR3Construct: cyReduction=%u\n", cyReduction)); 6785 # ifndef VRAM_SIZE_FIX6786 for (i = 0; i < MODE_INFO_SIZE; i++, pCurMode++, pDefMode++)6787 {6788 *pCurMode = *pDefMode;6789 pCurMode->mode += 0x30;6790 pCurMode->info.YResolution -= cyReduction;6791 }6792 # else /* VRAM_SIZE_FIX defined */6793 6768 for (i = 0; i < MODE_INFO_SIZE; i++, pDefMode++) 6794 6769 { … … 6809 6784 pCurMode++; 6810 6785 } 6811 # endif /* VRAM_SIZE_FIX defined */6812 6786 } 6813 6787 … … 6841 6815 } 6842 6816 cbPitch = calc_line_pitch(cBits, cx); 6843 # ifdef VRAM_SIZE_FIX6844 6817 if (cy * cbPitch >= pThis->vram_size) 6845 6818 { … … 6848 6821 return VERR_VGA_INVALID_CUSTOM_MODE; 6849 6822 } 6850 # endif /* VRAM_SIZE_FIX defined */6851 6823 MMR3HeapFree(pszExtraData); 6852 6824 … … 6913 6885 if (RT_FAILURE(rc)) 6914 6886 return rc; 6915 #endif /* VBE_NEW_DYN_LIST */6916 6887 6917 6888 /* -
trunk/src/VBox/Devices/Graphics/DevVGA.h
r69042 r69047 43 43 /** Use VBE bytewise I/O. Only needed for Windows Longhorn/Vista betas and backwards compatibility. */ 44 44 #define VBE_BYTEWISE_IO 45 46 /** Use VBE new dynamic mode list.47 * If this is not defined, no checks are carried out to see if the modes all48 * fit into the framebuffer! See the VRAM_SIZE_FIX define. */49 #define VBE_NEW_DYN_LIST50 45 51 46 #ifdef VBOX … … 382 377 uint8_t cbWriteVBEData; 383 378 uint8_t cbWriteVBEIndex; 384 # ifdef VBE_NEW_DYN_LIST385 379 /** VBE Extra Data write address one byte buffer */ 386 380 uint8_t cbWriteVBEExtraAddress; 387 381 uint8_t Padding5; 388 # else389 uint8_t Padding5[2];390 # endif391 382 # endif 392 383 … … 396 387 vga_retrace_s retrace_state; 397 388 398 # ifdef VBE_NEW_DYN_LIST399 389 /** The VBE BIOS extra data. */ 400 390 R3PTRTYPE(uint8_t *) pbVBEExtraData; … … 404 394 uint16_t u16VBEExtraAddress; 405 395 uint16_t Padding7[2]; 406 # endif407 396 408 397 /** The BIOS logo data. */ … … 499 488 #endif 500 489 501 #ifdef VBE_NEW_DYN_LIST502 490 /** 503 491 * VBE Bios Extra Data structure. … … 528 516 * @remark duplicated in vbe.h. */ 529 517 #define VBE_PRINTF_PORT 0x3b7 530 531 #endif /* VBE_NEW_DYN_LIST */532 518 533 519 #if !defined(VBOX) || defined(IN_RING3) -
trunk/src/VBox/Devices/Graphics/DevVGAModes.h
r65381 r69047 18 18 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. 19 19 */ 20 21 #ifdef VBE_NEW_DYN_LIST22 20 23 21 #include <VBoxVideoVBE.h> … … 192 190 193 191 #define MODE_INFO_SIZE ( sizeof(mode_info_list) / sizeof(ModeInfoListItem) ) 194 195 #endif /* VBE_NEW_DYN_LIST */
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器