VirtualBox

Changeset 38207 in vbox for trunk/src/VBox/Additions/common


Ignore:
Timestamp:
Jul 27, 2011 9:56:28 PM (14 years ago)
Author:
vboxsync
Message:

Additions/VBoxVideo: move a couple of functions from the X.Org driver to the common code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxVideo/Modesetting.cpp

    r35999 r38207  
    66
    77/*
    8  * Copyright (C) 2006-2010 Oracle Corporation
     8 * Copyright (C) 2006-2011 Oracle Corporation
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    4343        cDisplays = 1;
    4444    return cDisplays;
     45}
     46
     47
     48/**
     49 * Returns the size of the video RAM in bytes.
     50 *
     51 * @returns the size
     52 */
     53RTDECL(uint32_t) VBoxVideoGetVRAMSize(void)
     54{
     55    /** @note A 32bit read on this port returns the VRAM size. */
     56    return VBoxVideoCmnPortReadUlong(VBE_DISPI_IOPORT_DATA);
     57}
     58
     59
     60/**
     61 * Check whether this hardware allows the display width to have non-multiple-
     62 * of-eight values.
     63 *
     64 * @returns true if any width is allowed, false otherwise.
     65 */
     66RTDECL(bool) VBoxVideoAnyWidthAllowed(void)
     67{
     68    unsigned DispiId;
     69    VBoxVideoCmnPortWriteUshort(VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_ID);
     70    VBoxVideoCmnPortWriteUshort(VBE_DISPI_IOPORT_DATA, VBE_DISPI_ID_ANYX);
     71    DispiId = VBoxVideoCmnPortReadUshort(VBE_DISPI_IOPORT_DATA);
     72    return (DispiId == VBE_DISPI_ID_ANYX);
    4573}
    4674
     
    180208
    181209/**
    182  * Get the video mode for the first screen using the port registers.  All
    183  * parameters are optional
    184  * @note  If anyone else needs additional values just extend the function with
    185  *        additional parameters and fix any existing callers.
    186  * @param  pcWidth      where to store the mode width
    187  * @param  pcHeight     where to store the mode height
    188  * @param  pcVirtWidth  where to store the mode pitch
    189  * @param  pcBPP        where to store the colour depth of the mode
    190  * @param  pfFlags      where to store the flags for the mode
     210 * Disable our extended graphics mode and go back to VGA mode.
    191211 */
    192212RTDECL(void) VBoxVideoDisableVBE(void)
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