VirtualBox

Changeset 66685 in vbox for trunk/include


Ignore:
Timestamp:
Apr 27, 2017 8:30:52 AM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
115077
Message:

bugref:8524: Additions/linux: play nicely with distribution-installed Additions
[PATCH] Add HGSMIBuffers.h header file

Add a HGSMIBuffers.h header file and move the HGSMI heap setup and
buffer free / alloc / submit function declarations there, as the
linux vboxvideo driver is going to provide its own version of these.

Signed-off-by: Hans de Goede <hdegoede@…>

Location:
trunk/include/VBox/Graphics
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/Graphics/VBoxVideoGuest.h

    r66544 r66685  
    3030#define ___VBox_Graphics_VBoxVideoGuest_h___
    3131
    32 #include <HGSMI.h>
    33 #include <HGSMIChSetup.h>
     32#include <HGSMIBuffers.h>
    3433#include <VBoxVideo.h>
    3534#include <VBoxVideoIPRT.h>
    3635
    37 #ifdef VBOX_WDDM_MINIPORT
    38 # include "wddm/VBoxMPShgsmi.h"
    39  typedef VBOXSHGSMI HGSMIGUESTCMDHEAP;
    40 # define HGSMIGUESTCMDHEAP_GET(_p) (&(_p)->Heap)
    41 #else
    42  typedef HGSMIHEAP HGSMIGUESTCMDHEAP;
    43 # define HGSMIGUESTCMDHEAP_GET(_p) (_p)
    44 #endif
    45 
    4636RT_C_DECLS_BEGIN
    47 
    48 /**
    49  * Structure grouping the context needed for submitting commands to the host
    50  * via HGSMI
    51  */
    52 typedef struct HGSMIGUESTCOMMANDCONTEXT
    53 {
    54     /** Information about the memory heap located in VRAM from which data
    55      * structures to be sent to the host are allocated. */
    56     HGSMIGUESTCMDHEAP heapCtx;
    57     /** The I/O port used for submitting commands to the host by writing their
    58      * offsets into the heap. */
    59     RTIOPORT port;
    60 } HGSMIGUESTCOMMANDCONTEXT, *PHGSMIGUESTCOMMANDCONTEXT;
    61 
    62 
    63 /**
    64  * Structure grouping the context needed for receiving commands from the host
    65  * via HGSMI
    66  */
    67 typedef struct HGSMIHOSTCOMMANDCONTEXT
    68 {
    69     /** Information about the memory area located in VRAM in which the host
    70      * places data structures to be read by the guest. */
    71     HGSMIAREA areaCtx;
    72     /** Convenience structure used for matching host commands to handlers. */
    73     /** @todo handlers are registered individually in code rather than just
    74      * passing a static structure in order to gain extra flexibility.  There is
    75      * currently no expected usage case for this though.  Is the additional
    76      * complexity really justified? */
    77     HGSMICHANNELINFO channels;
    78     /** Flag to indicate that one thread is currently processing the command
    79      * queue. */
    80     volatile bool fHostCmdProcessing;
    81     /* Pointer to the VRAM location where the HGSMI host flags are kept. */
    82     volatile HGSMIHOSTFLAGS *pfHostFlags;
    83     /** The I/O port used for receiving commands from the host as offsets into
    84      * the memory area and sending back confirmations (command completion,
    85      * IRQ acknowlegement). */
    86     RTIOPORT port;
    87 } HGSMIHOSTCOMMANDCONTEXT, *PHGSMIHOSTCOMMANDCONTEXT;
    88 
    8937
    9038/**
     
    11260 * @{ */
    11361
    114 /** Acknowlege an IRQ. */
    115 DECLINLINE(void) VBoxHGSMIClearIrq(PHGSMIHOSTCOMMANDCONTEXT pCtx)
    116 {
    117     VBVO_PORT_WRITE_U32(pCtx->port, HGSMIOFFSET_VOID);
    118 }
    119 
    120 DECLHIDDEN(void)     VBoxHGSMIHostCmdComplete(PHGSMIHOSTCOMMANDCONTEXT pCtx,
    121                                               void *pvMem);
    122 DECLHIDDEN(void)     VBoxHGSMIProcessHostQueue(PHGSMIHOSTCOMMANDCONTEXT pCtx);
    12362DECLHIDDEN(bool)     VBoxHGSMIIsSupported(void);
    124 DECLHIDDEN(void *)   VBoxHGSMIBufferAlloc(PHGSMIGUESTCOMMANDCONTEXT pCtx,
    125                                           HGSMISIZE cbData,
    126                                           uint8_t u8Ch,
    127                                           uint16_t u16Op);
    128 DECLHIDDEN(void)     VBoxHGSMIBufferFree(PHGSMIGUESTCOMMANDCONTEXT pCtx,
    129                                          void *pvBuffer);
    130 DECLHIDDEN(int)      VBoxHGSMIBufferSubmit(PHGSMIGUESTCOMMANDCONTEXT pCtx,
    131                                            void *pvBuffer);
    13263DECLHIDDEN(void)     VBoxHGSMIGetBaseMappingInfo(uint32_t cbVRAM,
    13364                                                 uint32_t *poffVRAMBaseMapping,
     
    14071DECLHIDDEN(int)      VBoxHGSMISendCapsInfo(PHGSMIGUESTCOMMANDCONTEXT pCtx,
    14172                                           uint32_t fCaps);
    142 /** @todo we should provide a cleanup function too as part of the API */
    143 DECLHIDDEN(int)      VBoxHGSMISetupGuestContext(PHGSMIGUESTCOMMANDCONTEXT pCtx,
    144                                                 void *pvGuestHeapMemory,
    145                                                 uint32_t cbGuestHeapMemory,
    146                                                 uint32_t offVRAMGuestHeapMemory,
    147                                                 const HGSMIENV *pEnv);
    14873DECLHIDDEN(void)     VBoxHGSMIGetHostAreaMapping(PHGSMIGUESTCOMMANDCONTEXT pCtx,
    14974                                                 uint32_t cbVRAM,
     
    15176                                                 uint32_t *poffVRAMHostArea,
    15277                                                 uint32_t *pcbHostArea);
    153 DECLHIDDEN(void)     VBoxHGSMISetupHostContext(PHGSMIHOSTCOMMANDCONTEXT pCtx,
    154                                                void *pvBaseMapping,
    155                                                uint32_t offHostFlags,
    156                                                void *pvHostAreaMapping,
    157                                                uint32_t offVRAMHostArea,
    158                                                uint32_t cbHostArea);
    15978DECLHIDDEN(int)      VBoxHGSMISendHostCtxInfo(PHGSMIGUESTCOMMANDCONTEXT pCtx,
    16079                                              HGSMIOFFSET offVRAMFlagsLocation,
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