VirtualBox

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


Ignore:
Timestamp:
Aug 3, 2007 7:53:12 PM (17 years ago)
Author:
vboxsync
Message:

Direct draw heap and miniport heap memory reservation for Windows guest additions.

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

Legend:

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

    r4014 r4027  
    582582                break;
    583583          }
    584       } else if (s->vbe_index == VBE_DISPI_INDEX_CMONITORS) {
    585             val = s->monitor_count;
     584      } else if (s->vbe_index == VBE_DISPI_INDEX_VBOX_VIDEO) {
     585            switch (s->vbox_video_command)
     586            {
     587                case VBOX_VIDEO_QUERY_MONITOR_COUNT:
     588                    val = s->monitor_count;
     589                    break;
     590                case VBOX_VIDEO_QUERY_OFFSCREEN_HEAP_SIZE:
     591                    val = _1M; /* @todo make configurable */
     592                    break;
     593            }
     594            Log(("VBE: s->vbox_video_command = 0x%x, s->monitor_count = %d read index=0x%x val=0x%x\n", s->monitor_count, s->vbe_index, val));
    586595      } else {
    587596        val = s->vbe_regs[s->vbe_index];
     
    834843            }
    835844            break;
    836         case VBE_DISPI_INDEX_CMONITORS:
     845        case VBE_DISPI_INDEX_VBOX_VIDEO:
    837846#ifdef VBOX
    838847#ifdef IN_RING3
     
    850859                s->pDrv->pfnProcessDisplayData(s->pDrv, s->CTXSUFF(vram_ptr), val & 0xFFFF);
    851860            }
     861            s->vbox_video_command = val;
    852862#endif /* IN_RING3 */
    853863#endif /* VBOX */
     
    27552765     */
    27562766    if (s->vbe_index == VBE_DISPI_INDEX_ENABLE
    2757         || s->vbe_index == VBE_DISPI_INDEX_CMONITORS)
     2767        || s->vbe_index == VBE_DISPI_INDEX_VBOX_VIDEO)
    27582768    {
    27592769        Log(("vgaIOPortWriteVBEData: VBE_DISPI_INDEX_ENABLE - Switching to host...\n"));
     
    28882898    if (cb == 2)
    28892899    {
     2900        /* Reading 16 bit value always reads the count of monitor.
     2901         * That is for compatibility with old additions.
     2902         */
     2903        VGAState *s = PDMINS2DATA(pDevIns, PVGASTATE);
     2904        if (s->vbe_index == VBE_DISPI_INDEX_VBOX_VIDEO)
     2905        {
     2906            s->vbox_video_command = VBOX_VIDEO_QUERY_MONITOR_COUNT;
     2907        }
    28902908        *pu32 = vbe_ioport_read_data(PDMINS2DATA(pDevIns, PVGASTATE), Port);
    28912909        return VINF_SUCCESS;
     
    28932911    else if (cb == 4)
    28942912    {
    2895         /* Quick hack for getting the vram size. */
    28962913        VGAState *s = PDMINS2DATA(pDevIns, PVGASTATE);
    2897         *pu32 = s->vram_size;
     2914        if (s->vbe_index == VBE_DISPI_INDEX_VBOX_VIDEO)
     2915        {
     2916            *pu32 = vbe_ioport_read_data(PDMINS2DATA(pDevIns, PVGASTATE), Port);
     2917        }
     2918        else
     2919        {
     2920           /* Quick hack for getting the vram size. */
     2921           *pu32 = s->vram_size;
     2922        }
    28982923        return VINF_SUCCESS;
    28992924    }
     
    43204345#ifdef CONFIG_BOCHS_VBE
    43214346    pData->vbe_regs[VBE_DISPI_INDEX_ID] = VBE_DISPI_ID0;
    4322     pData->vbe_regs[VBE_DISPI_INDEX_CMONITORS] = pData->monitor_count;
     4347    pData->vbe_regs[VBE_DISPI_INDEX_VBOX_VIDEO] = pData->monitor_count;
    43234348    pData->vbe_bank_mask    = ((pData->vram_size >> 16) - 1);
    43244349#endif /* CONFIG_BOCHS_VBE */
     
    45564581        pData->monitor_count = 1;
    45574582    }
    4558     pData->vbe_regs[VBE_DISPI_INDEX_CMONITORS] = pData->monitor_count;
     4583    pData->vbe_regs[VBE_DISPI_INDEX_VBOX_VIDEO] = pData->monitor_count;
    45594584    Log(("VGA: MonitorCount=%d\n", pData->monitor_count));
    45604585
  • trunk/src/VBox/Devices/Graphics/DevVGA.h

    r3153 r4027  
    7474#define VBE_DISPI_INDEX_X_OFFSET        0x8
    7575#define VBE_DISPI_INDEX_Y_OFFSET        0x9
    76 #define VBE_DISPI_INDEX_CMONITORS       0xa
     76#define VBE_DISPI_INDEX_VBOX_VIDEO      0xa
    7777#define VBE_DISPI_INDEX_NB              0xb
    7878
     
    8282
    8383#ifdef VBOX
    84 /* The VBOX interface id. Indicates support for VBE_DISPI_INDEX_CMONITORS. */
     84/* The VBOX interface id. Indicates support for VBE_DISPI_INDEX_VBOX_VIDEO. */
    8585#define VBE_DISPI_ID_VBOX_VIDEO         0xBE00
    8686#endif /* VBOX */
     
    284284    /** Number of virtual monitors */
    285285    uint32_t                    monitor_count;
    286     uint32_t                    Padding0;   /* May be removed if more data is added */
     286    /** The VBoxVideo extension command issued by guest. */
     287    uint32_t                    vbox_video_command;
    287288
    288289    /** Whether to render the guest VRAM to the framebuffer memory. False only for some LFB modes. */
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