VirtualBox

vbox的更動 69047 路徑 trunk/src/VBox


忽略:
時間撮記:
2017-10-11 下午04:24:38 (7 年 以前)
作者:
vboxsync
訊息:

DevVGA+VGABIOS: eliminate defines (VBE_NEW_DYN_LIST and VRAM_SIZE_FIX) which are always there, since the other path is long obsolete

位置:
trunk/src/VBox/Devices/Graphics
檔案:
修改 4 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/Devices/Graphics/BIOS/vbe.c

    r67813 r69047  
    3838 * of the LGPL is applied is otherwise unspecified.
    3939 */
    40 
    41 // Use VBE new dynamic mode list.  Note that without this option, no
    42 // checks are currently done to make sure that modes fit into the
    43 // framebuffer!
    44 #define VBE_NEW_DYN_LIST
    4540
    4641#include <inttypes.h>
     
    169164}
    170165
    171 #ifdef VBE_NEW_DYN_LIST
    172166uint8_t in_byte(uint16_t port, uint16_t addr)
    173167{
     
    175169    return inb(port);
    176170}
    177 #endif
    178171
    179172/* Display "chip" identification helpers. */
     
    207200
    208201/* Find the offset of the desired mode, given its number. */
    209 #ifdef VBE_NEW_DYN_LIST
    210202static uint16_t mode_info_find_mode(uint16_t mode, Boolean using_lfb)
    211203{
     
    246238    return 0;
    247239}
    248 #else
    249 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             else
    262                 cur_info++;
    263         } else
    264             cur_info++;
    265     }
    266     return 0;
    267 }
    268 #endif
    269240
    270241#ifndef VBOX
     
    303274    uint16_t            cur_mode = 0;
    304275    uint16_t            cur_ptr=34;
    305 #ifdef VBE_NEW_DYN_LIST
    306276    uint16_t            cur_info_ofs;
    307277    uint16_t            sig, vmode;
    308 #else
    309     ModeInfoListItem    *cur_info = &mode_info_list;
    310 #endif
    311278    uint16_t            max_bpp = dispi_get_max_bpp();
    312279    VbeInfoBlock __far  *info_block;
     
    314281    info_block = ES :> (VbeInfoBlock *)DI;
    315282
    316 #ifdef VBE_NEW_DYN_LIST
    317283    /* Read VBE Extra Data signature */
    318284    sig = in_word(VBE_EXTRA_PORT, 0);
     
    326292    }
    327293    cur_info_ofs = sizeof(VBEHeader);
    328 #endif
    329294    status = *AX;
    330295
     
    384349    }
    385350
    386 #ifdef VBE_NEW_DYN_LIST
    387351    do
    388352    {
     
    406370    // Add vesa mode list terminator
    407371    write_word(ES, DI + cur_ptr, vmode);
    408 #else
    409     do
    410     {
    411         if (cur_info->info.BitsPerPixel <= max_bpp) {
    412 #ifdef VGA_DEBUG
    413             printf("VBE found mode %x => %x\n", cur_info->mode,cur_mode);
    414 #endif
    415             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 terminator
    423     write_word(ES, DI + cur_ptr, cur_info->mode);
    424 #endif // VBE_NEW_DYN_LIST
    425372    *AX = 0x004F;
    426373}
     
    439386{
    440387    uint16_t            result = 0x0100;
    441 #ifdef VBE_NEW_DYN_LIST
    442388    uint16_t            cur_info_ofs;
    443 #else
    444     ModeInfoListItem    *cur_info;
    445 #endif
    446389    Boolean             using_lfb;
    447390    uint8_t             win_attr;
     
    454397    CX = (CX & 0x1ff);
    455398
    456 #ifdef VBE_NEW_DYN_LIST
    457399    cur_info_ofs = mode_info_find_mode(CX, using_lfb);
    458400
    459401    if (cur_info_ofs) {
    460402        uint16_t    i;
    461 #else
    462     cur_info = mode_info_find_mode(CX, using_lfb);
    463 
    464     if (cur_info != 0) {
    465 #endif
    466403#ifdef VGA_DEBUG
    467404        printf("VBE found mode %x\n",CX);
    468405#endif
    469406        memsetb(ES, DI, 0, 256);    // The mode info size is fixed
    470 #ifdef VBE_NEW_DYN_LIST
    471407        for (i = 0; i < sizeof(ModeInfoBlockCompact); i++) {
    472408            uint8_t b;
     
    475411            write_byte(ES, DI + i, b);
    476412        }
    477 #else
    478         memcpyb(ES, DI, 0xc000, &(cur_info->info), sizeof(ModeInfoBlockCompact));
    479 #endif
    480413        win_attr = read_byte(ES, DI + offsetof(ModeInfoBlock, WinAAttributes));
    481414        if (win_attr & VBE_WINDOW_ATTRIBUTE_RELOCATABLE) {
     
    512445{
    513446    uint16_t            result;
    514 #ifdef VBE_NEW_DYN_LIST
    515447    uint16_t            cur_info_ofs;
    516 #else
    517     ModeInfoListItem    *cur_info;
    518 #endif
    519448    Boolean             using_lfb;
    520449    uint8_t             no_clear;
     
    541470    }
    542471
    543 #ifdef VBE_NEW_DYN_LIST
    544472    cur_info_ofs = mode_info_find_mode(BX, using_lfb);
    545473
     
    557485        printf("\txres%x yres%x bpp%x\n", xres, yres, bpp);
    558486#endif
    559 #else
    560     cur_info = mode_info_find_mode(BX, using_lfb);
    561 
    562     if (cur_info != 0)
    563     {
    564 #ifdef VGA_DEBUG
    565         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 #endif
    571 #endif // VBE_NEW_DYN_LIST
    572487
    573488        // first disable current mode (when switching between vesa modi)
    574489        dispi_set_enable(VBE_DISPI_DISABLED);
    575490
    576 #ifdef VBE_NEW_DYN_LIST
    577491        if (bpp == 4)
    578 #else
    579         if (cur_info->info.BitsPerPixel == 4)
    580 #endif
    581492        {
    582493            biosfn_set_video_mode(0x6a);
    583494        }
    584495
    585 #ifdef VBE_NEW_DYN_LIST
    586496        dispi_set_bpp(bpp);
    587497        dispi_set_xres(xres);
    588498        dispi_set_yres(yres);
    589 #else
    590         dispi_set_bpp(cur_info->info.BitsPerPixel);
    591         dispi_set_xres(cur_info->info.XResolution);
    592         dispi_set_yres(cur_info->info.YResolution);
    593 #endif
    594499        dispi_set_bank(0);
    595500        dispi_set_enable(VBE_DISPI_ENABLED | no_clear | lfb_flag);
  • trunk/src/VBox/Devices/Graphics/DevVGA.cpp

    r69041 r69047  
    6565#define VGASTATE2DEVINS(pVgaState)    ((pVgaState)->CTX_SUFF(pDevIns))
    6666
    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_FIX
    70 
    7167/** Check buffer if an VRAM offset is within the right range or not. */
    7268#if defined(IN_RC) || defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0)
     
    134130#include "DevVGA.h"
    135131
    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)
    137133# include "DevVGAModes.h"
    138134# include <stdio.h> /* sscan */
     
    37033699#ifdef IN_RING3
    37043700
    3705 # ifdef VBE_NEW_DYN_LIST
    37063701/**
    37073702 * @callback_method_impl{FNIOMIOPORTOUT,
     
    37703765    return rc;
    37713766}
    3772 # endif /* VBE_NEW_DYN_LIST */
    37733767
    37743768
     
    60246018    PDMDEV_CHECK_VERSIONS_RETURN_QUIET(pDevIns);
    60256019
    6026 #ifdef VBE_NEW_DYN_LIST
    60276020    PVGASTATE   pThis = PDMINS_2_DATA(pDevIns, PVGASTATE);
    60286021    LogFlow(("vgaR3Destruct:\n"));
     
    60506043        pThis->pbVBEExtraData = NULL;
    60516044    }
    6052 #endif /* VBE_NEW_DYN_LIST */
    60536045    if (pThis->pbVgaBios)
    60546046    {
     
    61176109    int         rc;
    61186110    unsigned    i;
    6119 #ifdef VBE_NEW_DYN_LIST
    61206111    uint32_t    cCustomModes;
    61216112    uint32_t    cyReduction;
     
    61246115    ModeInfoListItem *pCurMode;
    61256116    unsigned    cb;
    6126 #endif
    61276117    PDMDEV_CHECK_VERSIONS_RETURN(pDevIns);
    61286118    PVGASTATE   pThis = PDMINS_2_DATA(pDevIns, PVGASTATE);
     
    67116701    AssertLogRelRCReturn(rc, rc);
    67126702
    6713 #ifdef VBE_NEW_DYN_LIST
    6714 
    67156703    uint16_t maxBiosXRes;
    67166704    rc = CFGMR3QueryU16Def(pCfg, "MaxBiosXRes", &maxBiosXRes, UINT16_MAX);
     
    67506738    pVBEDataHdr->cbData = cb;
    67516739
    6752 # ifndef VRAM_SIZE_FIX
    6753     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 */
    67566740    pCurMode = (ModeInfoListItem *)(pVBEDataHdr + 1);
    67576741    for (i = 0; i < MODE_INFO_SIZE; i++)
     
    67746758        pCurMode++;
    67756759    }
    6776 # endif  /* VRAM_SIZE_FIX defined */
    67776760
    67786761    /*
     
    67836766        ModeInfoListItem *pDefMode = mode_info_list;
    67846767        Log(("vgaR3Construct: cyReduction=%u\n", cyReduction));
    6785 # ifndef VRAM_SIZE_FIX
    6786         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 */
    67936768        for (i = 0; i < MODE_INFO_SIZE; i++, pDefMode++)
    67946769        {
     
    68096784            pCurMode++;
    68106785        }
    6811 # endif  /* VRAM_SIZE_FIX defined */
    68126786    }
    68136787
     
    68416815                }
    68426816                cbPitch = calc_line_pitch(cBits, cx);
    6843 # ifdef VRAM_SIZE_FIX
    68446817                if (cy * cbPitch >= pThis->vram_size)
    68456818                {
     
    68486821                    return VERR_VGA_INVALID_CUSTOM_MODE;
    68496822                }
    6850 # endif  /* VRAM_SIZE_FIX defined */
    68516823                MMR3HeapFree(pszExtraData);
    68526824
     
    69136885    if (RT_FAILURE(rc))
    69146886        return rc;
    6915 #endif /* VBE_NEW_DYN_LIST */
    69166887
    69176888    /*
  • trunk/src/VBox/Devices/Graphics/DevVGA.h

    r69042 r69047  
    4343/** Use VBE bytewise I/O. Only needed for Windows Longhorn/Vista betas and backwards compatibility. */
    4444#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 all
    48  * fit into the framebuffer! See the VRAM_SIZE_FIX define. */
    49 #define VBE_NEW_DYN_LIST
    5045
    5146#ifdef VBOX
     
    382377    uint8_t                     cbWriteVBEData;
    383378    uint8_t                     cbWriteVBEIndex;
    384 #  ifdef VBE_NEW_DYN_LIST
    385379    /** VBE Extra Data write address one byte buffer */
    386380    uint8_t                     cbWriteVBEExtraAddress;
    387381    uint8_t                     Padding5;
    388 #  else
    389     uint8_t                     Padding5[2];
    390 #  endif
    391382# endif
    392383
     
    396387    vga_retrace_s               retrace_state;
    397388
    398 # ifdef VBE_NEW_DYN_LIST
    399389    /** The VBE BIOS extra data. */
    400390    R3PTRTYPE(uint8_t *)        pbVBEExtraData;
     
    404394    uint16_t                    u16VBEExtraAddress;
    405395    uint16_t                    Padding7[2];
    406 # endif
    407396
    408397    /** The BIOS logo data. */
     
    499488#endif
    500489
    501 #ifdef VBE_NEW_DYN_LIST
    502490/**
    503491 * VBE Bios Extra Data structure.
     
    528516 * @remark duplicated in vbe.h. */
    529517#define VBE_PRINTF_PORT      0x3b7
    530 
    531 #endif /* VBE_NEW_DYN_LIST */
    532518
    533519#if !defined(VBOX) || defined(IN_RING3)
  • trunk/src/VBox/Devices/Graphics/DevVGAModes.h

    r65381 r69047  
    1818 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
    1919 */
    20 
    21 #ifdef VBE_NEW_DYN_LIST
    2220
    2321#include <VBoxVideoVBE.h>
     
    192190
    193191#define MODE_INFO_SIZE ( sizeof(mode_info_list) / sizeof(ModeInfoListItem) )
    194 
    195 #endif /* VBE_NEW_DYN_LIST */
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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