VirtualBox

Changeset 2079 in vbox for trunk/src/VBox/Devices/Graphics


Ignore:
Timestamp:
Apr 13, 2007 2:39:03 PM (18 years ago)
Author:
vboxsync
Message:

Added VBE_DISPI_INDEX_CMONITOR indexed register to pass the MonitorCount VM setting
to the guest where the guest driver can read it.

Location:
trunk/src/VBox/Devices/Graphics
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Graphics/DevVGA.cpp

    r2021 r2079  
    5656/** The minimum amount of VRAM. */
    5757#define VGA_VRAM_MIN        (_1M)
     58/** The maximum number of monitors. */
     59#define VGA_MONITORS_MAX    64
    5860
    5961/** The size of the VGA GC mapping.
     
    584586                break;
    585587          }
     588      } else if (s->vbe_index == VBE_DISPI_INDEX_CMONITORS) {
     589            val = s->monitor_count;
    586590      } else {
    587591        val = s->vbe_regs[s->vbe_index];
     
    42864290#ifdef CONFIG_BOCHS_VBE
    42874291    pData->vbe_regs[VBE_DISPI_INDEX_ID] = VBE_DISPI_ID0;
     4292    pData->vbe_regs[VBE_DISPI_INDEX_CMONITORS] = pData->monitor_count;
    42884293    pData->vbe_bank_mask    = ((pData->vram_size >> 16) - 1);
    42894294#endif /* CONFIG_BOCHS_VBE */
     
    45134518    }
    45144519    Log(("VGA: VRamSize=%#x\n", pData->vram_size));
     4520
     4521    rc = CFGMR3QueryU32(pCfgHandle, "MonitorCount", &pData->monitor_count);
     4522    if (VBOX_FAILURE(rc) || !pData->monitor_count)
     4523        pData->monitor_count = 1;
     4524    else if (pData->monitor_count > VGA_MONITORS_MAX)
     4525    {
     4526        AssertMsgFailed(("monitor_count=%d max=%d\n", pData->monitor_count, VGA_MONITORS_MAX));
     4527        pData->monitor_count = 1;
     4528    }
     4529    pData->vbe_regs[VBE_DISPI_INDEX_CMONITORS] = pData->monitor_count;
     4530    Log(("VGA: MonitorCount=%d\n", pData->monitor_count));
    45154531
    45164532    pData->fGCEnabled = true;
  • trunk/src/VBox/Devices/Graphics/DevVGA.h

    r488 r2079  
    7474#define VBE_DISPI_INDEX_X_OFFSET        0x8
    7575#define VBE_DISPI_INDEX_Y_OFFSET        0x9
    76 #define VBE_DISPI_INDEX_NB              0xa
     76#define VBE_DISPI_INDEX_CMONITORS       0xa
     77#define VBE_DISPI_INDEX_NB              0xb
    7778
    7879#define VBE_DISPI_ID0                   0xB0C0
     
    276277    uint32_t                    cMilliesRefreshInterval;
    277278
     279    /** Number of virtual monitors */
     280    uint32_t                    monitor_count;
     281    uint32_t                    Padding0;   /* May be removed if more data is added */
     282
    278283    /** Size of the buffer*/
    279284    uint32_t                    cbExtVRAM;
     
    283288    uint32_t                    Alignment0;
    284289#endif
     290
    285291    /** The PCI device. */
    286292    PCIDEVICE                   Dev;
Note: See TracChangeset for help on using the changeset viewer.

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