VirtualBox

Changeset 64185 in vbox for trunk


Ignore:
Timestamp:
Oct 10, 2016 8:40:56 AM (8 years ago)
Author:
vboxsync
Message:

bugref:8614: Additions/common/VBoxVideo: make the code more self-contained: break the VBoxVideo.h dependency on VMMDev.h by moving VBVA and mouse cursor flags to VBoxVideo.h. Now there is a dependency the other way, but I do not think that is such a problem.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/VBoxVideo.h

    r63824 r64185  
    2727#define ___VBox_VBoxVideo_h
    2828
    29 #include <VBox/VMMDev.h>
    3029#include <VBox/Hardware/VBoxVideoVBE.h>
    3130
    3231#include <iprt/cdefs.h>
    3332#include <iprt/types.h>
     33#include <iprt/assert.h>
    3434
    3535/*
     
    8282#define VBOX_VIDEO_NO_SCREEN ~0
    8383
     84/**
     85 * VBVA command header.
     86 *
     87 * @todo Where does this fit in?
     88 */
     89typedef struct VBVACMDHDR
     90{
     91   /** Coordinates of affected rectangle. */
     92   int16_t x;
     93   int16_t y;
     94   uint16_t w;
     95   uint16_t h;
     96} VBVACMDHDR;
     97AssertCompileSize(VBVACMDHDR, 8);
     98
     99/** @name VBVA ring defines.
     100 *
     101 * The VBVA ring buffer is suitable for transferring large (< 2GB) amount of
     102 * data. For example big bitmaps which do not fit to the buffer.
     103 *
     104 * Guest starts writing to the buffer by initializing a record entry in the
     105 * aRecords queue. VBVA_F_RECORD_PARTIAL indicates that the record is being
     106 * written. As data is written to the ring buffer, the guest increases off32End
     107 * for the record.
     108 *
     109 * The host reads the aRecords on flushes and processes all completed records.
     110 * When host encounters situation when only a partial record presents and
     111 * cbRecord & ~VBVA_F_RECORD_PARTIAL >= VBVA_RING_BUFFER_SIZE -
     112 * VBVA_RING_BUFFER_THRESHOLD, the host fetched all record data and updates
     113 * off32Head. After that on each flush the host continues fetching the data
     114 * until the record is completed.
     115 *
     116 */
     117#define VBVA_RING_BUFFER_SIZE        (_4M - _1K)
     118#define VBVA_RING_BUFFER_THRESHOLD   (4 * _1K)
     119
     120#define VBVA_MAX_RECORDS (64)
     121
     122#define VBVA_F_MODE_ENABLED         UINT32_C(0x00000001)
     123#define VBVA_F_MODE_VRDP            UINT32_C(0x00000002)
     124#define VBVA_F_MODE_VRDP_RESET      UINT32_C(0x00000004)
     125#define VBVA_F_MODE_VRDP_ORDER_MASK UINT32_C(0x00000008)
     126
     127#define VBVA_F_STATE_PROCESSING     UINT32_C(0x00010000)
     128
     129#define VBVA_F_RECORD_PARTIAL       UINT32_C(0x80000000)
     130/** @} */
     131
     132/**
     133 * VBVA record.
     134 */
     135typedef struct VBVARECORD
     136{
     137    /** The length of the record. Changed by guest. */
     138    uint32_t cbRecord;
     139} VBVARECORD;
     140AssertCompileSize(VBVARECORD, 4);
     141
    84142/* The size of the information. */
    85143/*
     
    940998} VBVACONF32;
    941999
     1000/** Reserved for historical reasons. */
     1001#define VBOX_VBVA_CURSOR_CAPABILITY_RESERVED0  RT_BIT(0)
     1002/** Guest cursor capability: can the host show a hardware cursor at the host
     1003 * pointer location? */
     1004#define VBOX_VBVA_CURSOR_CAPABILITY_HARDWARE   RT_BIT(1)
     1005/** Reserved for historical reasons. */
     1006#define VBOX_VBVA_CURSOR_CAPABILITY_RESERVED2  RT_BIT(2)
     1007/** Reserved for historical reasons.  Must always be unset. */
     1008#define VBOX_VBVA_CURSOR_CAPABILITY_RESERVED3  RT_BIT(3)
     1009/** Reserved for historical reasons. */
     1010#define VBOX_VBVA_CURSOR_CAPABILITY_RESERVED4  RT_BIT(4)
     1011/** Reserved for historical reasons. */
     1012#define VBOX_VBVA_CURSOR_CAPABILITY_RESERVED5  RT_BIT(5)
     1013
    9421014typedef struct VBVAINFOVIEW
    9431015{
     
    11001172
    11011173} VBVAMOUSEPOINTERSHAPE;
     1174
     1175/** @name VBVAMOUSEPOINTERSHAPE::fu32Flags
     1176 * @note The VBOX_MOUSE_POINTER_* flags are used in the guest video driver,
     1177 *       values must be <= 0x8000 and must not be changed. (try make more sense
     1178 *       of this, please).
     1179 * @{
     1180 */
     1181/** pointer is visible */
     1182#define VBOX_MOUSE_POINTER_VISIBLE (0x0001)
     1183/** pointer has alpha channel */
     1184#define VBOX_MOUSE_POINTER_ALPHA   (0x0002)
     1185/** pointerData contains new pointer shape */
     1186#define VBOX_MOUSE_POINTER_SHAPE   (0x0004)
     1187/** @} */
    11021188
    11031189/* the guest driver can handle asynch guest cmd completion by reading the command offset from io port */
  • trunk/include/VBox/VBoxVideoGuest.h

    r63273 r64185  
    3232#include <VBox/HGSMI/HGSMIChSetup.h>
    3333#include <VBox/VBoxVideo.h>
     34
     35#include <iprt/err.h>  /* The functions in here return IPRT errors. */
    3436
    3537#ifdef VBOX_XPDM_MINIPORT
  • trunk/include/VBox/VMMDev.h

    r62965 r64185  
    2727#define ___VBox_VMMDev_h
    2828
     29#include <VBox/VBoxVideo.h>             /* For VBVA definitions. */
    2930#include <VBox/cdefs.h>
    3031#include <VBox/param.h>                 /* for the PCI IDs. */
     
    348349    /** Header. */
    349350    VMMDevRequestHeader header;
    350     /** VBOX_MOUSE_POINTER_* bit flags. */
     351    /** VBOX_MOUSE_POINTER_* bit flags from VBox/VBoxVideo.h. */
    351352    uint32_t fFlags;
    352353    /** x coordinate of hot spot. */
     
    404405                  sizeof(VMMDevReqMousePointer));
    405406}
    406 
    407 /** @name VMMDevReqMousePointer::fFlags
    408  * @note The VBOX_MOUSE_POINTER_* flags are used in the guest video driver,
    409  *       values must be <= 0x8000 and must not be changed. (try make more sense
    410  *       of this, please).
    411  * @{
    412  */
    413 /** pointer is visible */
    414 #define VBOX_MOUSE_POINTER_VISIBLE (0x0001)
    415 /** pointer has alpha channel */
    416 #define VBOX_MOUSE_POINTER_ALPHA   (0x0002)
    417 /** pointerData contains new pointer shape */
    418 #define VBOX_MOUSE_POINTER_SHAPE   (0x0004)
    419 /** @} */
    420407
    421408
     
    20742061
    20752062/**
    2076  * VBVA command header.
    2077  *
    2078  * @todo Where does this fit in?
    2079  */
    2080 typedef struct VBVACMDHDR
    2081 {
    2082    /** Coordinates of affected rectangle. */
    2083    int16_t x;
    2084    int16_t y;
    2085    uint16_t w;
    2086    uint16_t h;
    2087 } VBVACMDHDR;
    2088 AssertCompileSize(VBVACMDHDR, 8);
    2089 
    2090 /** @name VBVA ring defines.
    2091  *
    2092  * The VBVA ring buffer is suitable for transferring large (< 2GB) amount of
    2093  * data. For example big bitmaps which do not fit to the buffer.
    2094  *
    2095  * Guest starts writing to the buffer by initializing a record entry in the
    2096  * aRecords queue. VBVA_F_RECORD_PARTIAL indicates that the record is being
    2097  * written. As data is written to the ring buffer, the guest increases off32End
    2098  * for the record.
    2099  *
    2100  * The host reads the aRecords on flushes and processes all completed records.
    2101  * When host encounters situation when only a partial record presents and
    2102  * cbRecord & ~VBVA_F_RECORD_PARTIAL >= VBVA_RING_BUFFER_SIZE -
    2103  * VBVA_RING_BUFFER_THRESHOLD, the host fetched all record data and updates
    2104  * off32Head. After that on each flush the host continues fetching the data
    2105  * until the record is completed.
    2106  *
    2107  */
    2108 #define VBVA_RING_BUFFER_SIZE        (_4M - _1K)
    2109 #define VBVA_RING_BUFFER_THRESHOLD   (4 * _1K)
    2110 
    2111 #define VBVA_MAX_RECORDS (64)
    2112 
    2113 #define VBVA_F_MODE_ENABLED         UINT32_C(0x00000001)
    2114 #define VBVA_F_MODE_VRDP            UINT32_C(0x00000002)
    2115 #define VBVA_F_MODE_VRDP_RESET      UINT32_C(0x00000004)
    2116 #define VBVA_F_MODE_VRDP_ORDER_MASK UINT32_C(0x00000008)
    2117 
    2118 #define VBVA_F_STATE_PROCESSING     UINT32_C(0x00010000)
    2119 
    2120 #define VBVA_F_RECORD_PARTIAL       UINT32_C(0x80000000)
    2121 /** @} */
    2122 
    2123 /**
    2124  * VBVA record.
    2125  */
    2126 typedef struct VBVARECORD
    2127 {
    2128     /** The length of the record. Changed by guest. */
    2129     uint32_t cbRecord;
    2130 } VBVARECORD;
    2131 AssertCompileSize(VBVARECORD, 4);
    2132 
    2133 
    2134 /**
    21352063 * VBVA memory layout.
    21362064 *
  • trunk/src/VBox/Additions/linux/drm/vbox_mode.c

    r64172 r64185  
    699699    if (ret)
    700700        return ret;
    701     if (   caps & VMMDEV_MOUSE_HOST_CANNOT_HWPOINTER
    702         || !(caps & VMMDEV_MOUSE_HOST_WANTS_ABSOLUTE))
     701    if (!(caps & VBOX_VBVA_CURSOR_CAPABILITY_HARDWARE))
    703702        /* -EINVAL means cursor_set2() not supported, -EAGAIN means
    704703         * retry at once. */
  • trunk/src/VBox/Additions/x11/vboxvideo/getmode.c

    r63221 r64185  
    168168static bool useHardwareCursor(uint32_t fCursorCapabilities)
    169169{
    170     if (   !(fCursorCapabilities & VMMDEV_MOUSE_HOST_CANNOT_HWPOINTER)
    171         && (fCursorCapabilities & VMMDEV_MOUSE_HOST_WANTS_ABSOLUTE))
     170    if (fCursorCapabilities & VBOX_VBVA_CURSOR_CAPABILITY_HARDWARE)
    172171        return true;
    173172    return false;
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