VirtualBox

Changeset 26556 in vbox for trunk/include/VBox


Ignore:
Timestamp:
Feb 15, 2010 10:10:11 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
57735
Message:

wddm: more impl

Location:
trunk/include/VBox
Files:
3 edited

Legend:

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

    r25062 r26556  
    258258void HGSMIAreaClear (HGSMIAREA *pArea);
    259259
     260DECLINLINE(bool) HGSMIAreaContainsOffset(HGSMIAREA *pArea, HGSMIOFFSET offSet)
     261{
     262    return pArea->offBase <= offSet && pArea->offBase + pArea->cbArea < offSet;
     263}
     264
    260265HGSMIOFFSET HGSMIBufferInitializeSingle (const HGSMIAREA *pArea,
    261266                                         HGSMIBUFFERHEADER *pHeader,
  • trunk/include/VBox/HGSMI/HGSMIChSetup.h

    r22652 r26556  
    5050#define HGSMIHOSTFLAGS_COMMANDS_PENDING 0x1
    5151#define HGSMIHOSTFLAGS_IRQ              0x2
     52#ifdef VBOXVDMA
     53/* one or more guest commands is completed */
     54# define HGSMIHOSTFLAGS_GCOMMAND_COMPLETED 0x4
     55#endif
    5256
    5357typedef struct _HGSMIHOSTFLAGS
  • trunk/include/VBox/VBoxVideo.h

    r26296 r26556  
    797797# define VBVA_VHWA_CMD    9
    798798#endif /* # ifdef VBOX_WITH_VIDEOHWACCEL */
     799#ifdef VBOXVDMA
     800# define VBVA_VDMA_CTL   10 /* setup G<->H DMA channel info */
     801# define VBVA_VDMA_CMD    11 /* G->H DMA command             */
     802#endif
    799803
    800804/* host->guest commands */
    801 # define VBVAHG_EVENT 1
    802 # define VBVAHG_DISPLAY_CUSTOM 2
     805# define VBVAHG_EVENT              1
     806# define VBVAHG_DISPLAY_CUSTOM     2
     807#ifdef VBOXVDMA
     808# define VBVAHG_SHGSMI_COMPLETION  3
     809#endif
    803810
    804811# ifdef VBOX_WITH_VIDEOHWACCEL
     
    988995#endif /* VBOX_WITH_HGSMI */
    989996
     997#ifdef VBOXVDMA
     998# pragma pack(1)
     999
     1000/*
     1001 * VBOXSHGSMI made on top HGSMI and allows receiving notifications
     1002 * about G->H command completion
     1003 */
     1004/* SHGSMI command header */
     1005typedef struct VBOXSHGSMIHEADER
     1006{
     1007    uint64_t pvNext;    /*<- completion processing queue */
     1008    uint32_t fFlags;    /*<- see VBOXSHGSMI_FLAG_XXX Flags */
     1009    uint32_t cRefs;     /*<- command referece count */
     1010    uint64_t u64Info1;  /*<- contents depends on the fFlags value */
     1011    uint64_t u64Info2;  /*<- contents depends on the fFlags value */
     1012} VBOXSHGSMIHEADER, *PVBOXSHGSMIHEADER;
     1013
     1014/* the command processing was asynch, set by the host to indicate asynch command completion
     1015 * must not be cleared once set, the command completion is performed by issuing a host->guest completion command
     1016 * while keeping this flag unchanged */
     1017#define VBOXSHGSMI_FLAG_HG_ASYNCH               0x00010000
     1018///* if set     - asynch completion is performed by issuing the event,
     1019// * if cleared - asynch completion is performed by calling a callback */
     1020//#define VBOXSHGSMI_FLAG_GH_ASYNCH_EVENT         0x00000001
     1021/* issue interrupt on asynch completion, used for critical G->H commands,
     1022 * i.e. for completion of which guest is waiting. */
     1023#define VBOXSHGSMI_FLAG_GH_ASYNCH_IRQ           0x00000002
     1024/* guest does not do any op on completion of this command,
     1025 * the host may copy the command and indicate that it does not need the command anymore
     1026 * by not setting VBOXSHGSMI_FLAG_HG_ASYNCH */
     1027#define VBOXSHGSMI_FLAG_GH_ASYNCH_NOCOMPLETION  0x00000004
     1028/* guest requires the command to be processed asynchronously,
     1029 * not setting VBOXSHGSMI_FLAG_HG_ASYNCH by the host in this case is treated as command failure */
     1030#define VBOXSHGSMI_FLAG_GH_ASYNCH_FORCE         0x00000008
     1031/* force IRQ on cmd completion */
     1032#define VBOXSHGSMI_FLAG_GH_ASYNCH_IRQ_FORCE     0x00000010
     1033/* an IRQ-level callback is associated with the command */
     1034#define VBOXSHGSMI_FLAG_GH_ASYNCH_CALLBACK_IRQ  0x00000020
     1035/* guest expects this command to be completed synchronously */
     1036#define VBOXSHGSMI_FLAG_GH_SYNCH                0x00000040
     1037
     1038/* VDMA - Video DMA */
     1039
     1040/* VDMA Control API */
     1041/* VBOXVDMA_CTL::u32Flags */
     1042#define VBOXVDMA_CTL_NONE    0x00000000
     1043#define VBOXVDMA_CTL_ENABLE  0x00000001
     1044#define VBOXVDMA_CTL_DISABLE 0x00000002
     1045#define VBOXVDMA_CTL_FLUSH   0x00000004
     1046
     1047typedef struct VBOXVDMA_CTL
     1048{
     1049    uint32_t u32Flags;
     1050    uint32_t u32Offset;
     1051    int32_t  i32Result;
     1052} VBOXVDMA_CTL, *PVBOXVDMA_CTL;
     1053
     1054typedef struct VBOXVDMA_RECTL
     1055{
     1056    int16_t left;
     1057    int16_t top;
     1058    uint16_t width;
     1059    uint16_t height;
     1060} VBOXVDMA_RECTL, *PVBOXVDMA_RECTL;
     1061
     1062//typedef uint64_t VBOXVDMAPHADDRESS;
     1063typedef uint64_t VBOXVDMASURFHANDLE;
     1064
     1065typedef enum
     1066{
     1067    VBOXVDMACMD_TYPE_UNDEFINED        = 0,
     1068    VBOXVDMACMD_TYPE_DMATRANSFER      = 1
     1069} VBOXVDMACMD_TYPE;
     1070
     1071/* region specified as a rectangle, otherwize it is a size of memory pointed to by phys address */
     1072#define VBOXVDMAOPERAND_FLAGS_RECTL       0x1
     1073/* Surface handle is valid */
     1074#define VBOXVDMAOPERAND_FLAGS_PRIMARY        0x2
     1075/* address is offset in VRAM */
     1076#define VBOXVDMAOPERAND_FLAGS_VRAMOFFSET  0x4
     1077
     1078typedef struct VBOXVDMA_RANGE_RECTL
     1079{
     1080    VBOXVDMA_RECTL RangeRectl;
     1081    VBOXVDMA_RECTL SurfSize;
     1082}VBOXVDMA_RANGE_RECTL, *PVBOXVDMA_RANGE_RECTL;
     1083
     1084typedef struct VBOXVDMA_RANGE_SIZE
     1085{
     1086    uint32_t cbSize;
     1087    uint32_t u32Reserved;
     1088}VBOXVDMA_RANGE_SIZE, *PVBOXVDMA_RANGE_SIZE;
     1089
     1090typedef struct VBOXVDMAOPERAND
     1091{
     1092    uint32_t fFlags;
     1093    union
     1094    {
     1095        /* for Src specifies num of Dsts */
     1096        uint32_t cDsts;
     1097        /* for Dst specifies Screen ID in case VBOXVDMAOPERAND_FLAGS_PRIMARY flag is present in fFlags */
     1098        uint32_t iScreen;
     1099    } Info;
     1100    RTGCPHYS phAddress;
     1101    union
     1102    {
     1103        VBOXVDMA_RANGE_RECTL Rectl;
     1104        VBOXVDMA_RANGE_SIZE  Size;
     1105    } Range;
     1106} VBOXVDMAOPERAND, *PVBOXVDMAOPERAND;
     1107
     1108/* VBOXVDMACBUF_DR::phBuf specifies offset in VRAM */
     1109#define VBOXVDMACBUF_FLAG_BUF_VRAM_OFFSET 0x00000001
     1110/* command buffer follows the VBOXVDMACBUF_DR in VRAM, VBOXVDMACBUF_DR::phBuf is ignored */
     1111#define VBOXVDMACBUF_FLAG_BUF_FOLLOWS_DR  0x00000002
     1112
     1113/*
     1114 * We can not submit the DMA command via VRAM since we do not have control over
     1115 * DMA command buffer [de]allocation, i.e. we only control the buffer contents.
     1116 * In other words the system may call one of our callbacks to fill a command buffer
     1117 * with the necessary commands and then discard the buffer w/o any notification.
     1118 *
     1119 * We have only DMA command buffer physical address at submission time.
     1120 *
     1121 * so the only way is to */
     1122typedef struct VBOXVDMACBUF_DR
     1123{
     1124    uint32_t fFlags;
     1125    uint32_t cbBuf;
     1126    uint32_t u32FenceId;
     1127    /* RT_SUCCESS()     - on success
     1128     * VERR_INTERRUPTED - on preemption
     1129     * VERR_xxx         - on error */
     1130    int32_t  rc;
     1131    uint64_t phBuf;
     1132} VBOXVDMACBUF_DR, *PVBOXVDMACBUF_DR;
     1133
     1134#define VBOXVDMACBUF_DR_TAIL(_pCmd, _t) ( (_t)(((uint8_t*)(_pCmd)) + sizeof (VBOXVDMACBUF_DR)) )
     1135
     1136typedef struct VBOXVDMACMD
     1137{
     1138    VBOXVDMACMD_TYPE enmType;
     1139    uint32_t cbCmd;
     1140} VBOXVDMACMD, *PVBOXVDMACMD;
     1141
     1142#define VBOXVDMACMD_HEADER_SIZE() sizeof (VBOXVDMACMD)
     1143#define VBOXVDMACMD_BODY_SIZE(_pCmd) ((_pCmd)->cbBody)
     1144#define VBOXVDMACMD_SIZE(_pCmd) (VBOXVDMACMD_HEADER_SIZE() + VBOXVDMACMD_BODY_SIZE(_pCmd))
     1145#define VBOXVDMACMD_BODY(_pCmd, _t) ( (_t)(((uint8_t*)(_pCmd)) + VBOXVDMACMD_HEADER_SIZE()) )
     1146
     1147typedef struct VBOXVDMACMD_DMATRANSFER
     1148{
     1149    VBOXVDMAOPERAND Src;
     1150    /* the size of aDst is specified in Src::u32CmdSpecific*/
     1151    VBOXVDMAOPERAND aDst[1];
     1152} VBOXVDMACMD_DMATRANSFER, *PVBOXVDMACMD_DMATRANSFER;
     1153# pragma pack()
     1154#endif /* #ifdef VBOXVDMA */
     1155
    9901156#endif
Note: See TracChangeset for help on using the changeset viewer.

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