VirtualBox

Changeset 20478 in vbox for trunk/include/VBox


Ignore:
Timestamp:
Jun 11, 2009 4:54:19 PM (16 years ago)
Author:
vboxsync
Message:

video hw accel: guest driver -> host framebuffer commands processing impl

File:
1 edited

Legend:

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

    r20243 r20478  
    257257typedef enum
    258258{
    259     VBOXVHWACMD_TYPE_SURF_CREATE = 1,
     259    VBOXVHWACMD_TYPE_SURF_CANCREATE = 1,
     260    VBOXVHWACMD_TYPE_SURF_CREATE,
    260261    VBOXVHWACMD_TYPE_SURF_DESTROY,
    261262    VBOXVHWACMD_TYPE_SURF_LOCK,
    262263    VBOXVHWACMD_TYPE_SURF_UNLOCK,
    263     VBOXVHWACMD_TYPE_SURF_BLT
     264    VBOXVHWACMD_TYPE_SURF_BLT,
     265    VBOXVHWACMD_TYPE_QUERY_INFO1,
     266    VBOXVHWACMD_TYPE_QUERY_INFO2
    264267} VBOXVHWACMD_TYPE;
    265268
     269/* the command processing was asynch, set by the host to indicate asynch command completion
     270 * must not be cleared once set, the command completion is performed by issuing a host->guest completion command
     271 * while keeping this flag unchanged */
     272#define VBOXVHWACMD_FLAG_ASYNCH      0x00000001
     273/* asynch completion is performed by issuing the event */
     274#define VBOXVHWACMD_FLAG_ASYNCH_EVENT 0x00000002
     275
    266276typedef struct _VBOXVHWACMD
    267277{
    268278    VBOXVHWACMD_TYPE enmCmd; /* command type */
    269     int32_t rc; /* command result */
     279    volatile int32_t rc; /* command result */
    270280    int32_t iDisplay; /* display index */
    271     int32_t Reserved; /* reserved, must be null*/
     281    volatile int32_t Flags; /* ored VBOXVHWACMD_FLAG_xxx values */
    272282    uint64_t GuestVBVAReserved1; /* field internally used by the guest VBVA cmd handling, must NOT be modified by clients */
    273283    uint64_t GuestVBVAReserved2; /* field internally used by the guest VBVA cmd handling, must NOT be modified by clients */
     
    275285} VBOXVHWACMD;
    276286
    277 #define VBOXVHWACMD_SIZE(_tCmd) (RT_OFFSETOF(VBOXVHWACMD_HDR, body) + sizeof(_tCmd))
     287#define VBOXVHWACMD_HEADSIZE() (RT_OFFSETOF(VBOXVHWACMD, body))
     288#define VBOXVHWACMD_SIZE(_tCmd) (VBOXVHWACMD_HEADSIZE() + sizeof(_tCmd))
    278289typedef unsigned int VBOXVHWACMD_LENGTH;
    279290typedef uint64_t VBOXVHWA_SURFHANDLE;
    280291#define VBOXVHWACMD_SURFHANDLE_INVALID 0
    281292#define VBOXVHWACMD_BODY(_p, _t) ((_t*)(_p)->body)
     293#define VBOXVHWACMD_HEAD(_pb) ((VBOXVHWACMD*)((uint8_t *)(_pb) - RT_OFFSETOF(VBOXVHWACMD, body)))
    282294
    283295typedef struct _VBOXVHWA_RECTL
     
    288300    uint16_t h;
    289301} VBOXVHWA_RECTL;
    290 
    291 #define VBOXVHWASURF_PRIMARY      0x00000001
    292 #define VBOXVHWASURF_OVERLAY      0x00000002
    293302
    294303typedef struct _VBOXVHWA_COLORKEY
     
    339348    uint32_t Reserved;
    340349} VBOXVHWA_SURFINFO;
     350
     351#define VBOXVHWA_CAPS_BLT             0x00000001
     352#define VBOXVHWA_CAPS_BLTCOLORFILL    0x00000002
     353#define VBOXVHWA_CAPS_BLTFOURCC       0x00000004
     354#define VBOXVHWA_CAPS_BLTSTRETCH      0x00000008
     355
     356#define VBOXVHWA_CAPS_OVERLAY         0x00000100
     357#define VBOXVHWA_CAPS_OVERLAYFOURCC   0x00000200
     358#define VBOXVHWA_CAPS_OVERLAYSTRETCH  0x00000400
     359
     360#define VBOXVHWA_CAPS_COLORKEY        0x00001000
     361//#define VBOXVHWA_CAPS_COLORKEYHWASSIST         0x00002000 /* always set COLORKEYHWASSIST in case host reports colorkey support */
     362
     363#define VBOXVHWA_CAPS2_COPYFOURCC   0x00000001
     364
     365#define VBOXVHWA_SCAPS_FLIP             0x00000001
     366#define VBOXVHWA_SCAPS_PRIMARYSURFACE   0x00000002
     367#define VBOXVHWA_SCAPS_OVERLAY          0x00000008
     368
     369#define VBOXVHWA_PF_RGB                 0x00000001
     370#define VBOXVHWA_PF_RGBTOYUV            0x00000002
     371#define VBOXVHWA_PF_YUV                 0x00000008
     372#define VBOXVHWA_PF_FOURCC              0x00000010
     373
     374#define VBOXVHWA_CFG_ENABLED          0x00000001
     375
     376typedef struct _VBOXVHWACMD_QUERYINFO1
     377{
     378    uint32_t cfgFlags;
     379    uint32_t caps;
     380    uint32_t colorKeyCaps;
     381    uint32_t stretchCaps;
     382    uint32_t surfaceCaps;
     383    uint32_t numOverlays;
     384    uint32_t numFourCC;
     385
     386} VBOXVHWACMD_QUERYINFO1;
     387
     388typedef struct _VBOXVHWACMD_QUERYINFO2
     389{
     390    uint32_t numFourCC;
     391    uint32_t FourCC[1];
     392} VBOXVHWACMD_QUERYINFO2;
     393
     394#define VBOXVHWAINFO2_SIZE(_cFourCC) RT_OFFSETOF(VBOXVHWAINFO2, FourCC[_cFourCC])
     395
     396typedef struct _VBOXVHWACMD_SURF_CANCREATE
     397{
     398    union
     399    {
     400        struct
     401        {
     402            VBOXVHWA_SURFINFO SurfInfo;
     403        } in;
     404
     405        struct
     406        {
     407            uint32_t ErrInfo;
     408        } out;
     409    } u;
     410} VBOXVHWACMD_SURF_CANCREATE;
    341411
    342412typedef struct _VBOXVHWACMD_SURF_CREATE
     
    447517#define VBVA_ENABLE       7
    448518#define VBVA_MOUSE_POINTER_SHAPE 8
     519#ifdef VBOX_WITH_VIDEOHWACCEL
     520# define VBVA_VHWA_CMD    9
     521#endif /* # ifdef VBOX_WITH_VIDEOHWACCEL */
     522
     523/* host->guest commands */
     524# define VBVAHG_EVENT 1
     525# define VBVAHG_DISPLAY_CUSTOM 2
     526
    449527# ifdef VBOX_WITH_VIDEOHWACCEL
    450 # define VBVA_INFO_VHWA   9
    451 # define VBVA_VHWA_CMD    10
    452 # endif /* # ifdef VBOX_WITH_VIDEOHWACCEL */
    453 
    454 /* host->guest commands */
    455 # ifdef VBOX_WITH_VIDEOHWACCEL
    456 # define VBVAHG_VHWA_CMDCOMPLETE 1
    457 
     528#define VBVAHG_DCUSTOM_VHWA_CMDCOMPLETE 1
     529#pragma pack(1)
    458530typedef struct _VBVAHOSTCMDVHWACMDCOMPLETE
    459531{
    460532    uint32_t offCmd;
    461533}VBVAHOSTCMDVHWACMDCOMPLETE;
     534#pragma pack()
    462535# endif /* # ifdef VBOX_WITH_VIDEOHWACCEL */
    463536
    464537#pragma pack(1)
     538typedef enum
     539{
     540    VBVAHOSTCMD_OP_EVENT = 1,
     541    VBVAHOSTCMD_OP_CUSTOM
     542}VBVAHOSTCMD_OP_TYPE;
     543
     544typedef struct _VBVAHOSTCMDEVENT
     545{
     546    uint64_t pEvent;
     547}VBVAHOSTCMDEVENT;
     548
     549
    465550typedef struct _VBVAHOSTCMD
    466551{
    467552    /* destination ID if >=0 specifies display index, otherwize the command is directed to the miniport */
    468553    int32_t iDstID;
    469     uint32_t Reserved;
     554    int32_t customOpCode;
     555    union
     556    {
     557        struct _VBVAHOSTCMD *pNext;
     558        uint64_t Data; /* the body is 64-bit alligned */
     559    } u;
    470560    char body[1];
    471561}VBVAHOSTCMD;
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