VirtualBox

Changeset 67066 in vbox for trunk/include/VBox/Graphics


Ignore:
Timestamp:
May 24, 2017 1:37:42 PM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
115725
Message:

bugref:8524: Additions/linux: play nicely with distribution-installed Additions
Re-arrange the file structure of the guest graphics APIs to make it easier to only include the necessary parts in the Linux vboxvideo driver.

Location:
trunk/include/VBox/Graphics
Files:
1 edited
2 copied
1 moved

Legend:

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

    r67065 r67066  
    2525
    2626
    27 #ifndef ___VBox_Graphics_HGSMIBuffers_h___
    28 #define ___VBox_Graphics_HGSMIBuffers_h___
     27#ifndef ___VBox_Graphics_HGSMIBase_h___
     28#define ___VBox_Graphics_HGSMIBase_h___
    2929
    3030#include <HGSMI.h>
    31 #include <HGSMIChSetup.h>
     31#include <HGSMIContext.h>
    3232#include <VBoxVideoIPRT.h>
    3333
    34 #ifdef VBOX_WDDM_MINIPORT
    35 # include "wddm/VBoxMPShgsmi.h"
    36  typedef VBOXSHGSMI HGSMIGUESTCMDHEAP;
    37 # define HGSMIGUESTCMDHEAP_GET(_p) (&(_p)->Heap)
    38 #else
    39  typedef HGSMIHEAP HGSMIGUESTCMDHEAP;
    40 # define HGSMIGUESTCMDHEAP_GET(_p) (_p)
    41 #endif
    42 
    4334RT_C_DECLS_BEGIN
    44 
    45 /**
    46  * Structure grouping the context needed for submitting commands to the host
    47  * via HGSMI
    48  */
    49 typedef struct HGSMIGUESTCOMMANDCONTEXT
    50 {
    51     /** Information about the memory heap located in VRAM from which data
    52      * structures to be sent to the host are allocated. */
    53     HGSMIGUESTCMDHEAP heapCtx;
    54     /** The I/O port used for submitting commands to the host by writing their
    55      * offsets into the heap. */
    56     RTIOPORT port;
    57 } HGSMIGUESTCOMMANDCONTEXT, *PHGSMIGUESTCOMMANDCONTEXT;
    58 
    59 
    60 /**
    61  * Structure grouping the context needed for receiving commands from the host
    62  * via HGSMI
    63  */
    64 typedef struct HGSMIHOSTCOMMANDCONTEXT
    65 {
    66     /** Information about the memory area located in VRAM in which the host
    67      * places data structures to be read by the guest. */
    68     HGSMIAREA areaCtx;
    69     /** Convenience structure used for matching host commands to handlers. */
    70     /** @todo handlers are registered individually in code rather than just
    71      * passing a static structure in order to gain extra flexibility.  There is
    72      * currently no expected usage case for this though.  Is the additional
    73      * complexity really justified? */
    74     HGSMICHANNELINFO channels;
    75     /** Flag to indicate that one thread is currently processing the command
    76      * queue. */
    77     volatile bool fHostCmdProcessing;
    78     /* Pointer to the VRAM location where the HGSMI host flags are kept. */
    79     volatile HGSMIHOSTFLAGS *pfHostFlags;
    80     /** The I/O port used for receiving commands from the host as offsets into
    81      * the memory area and sending back confirmations (command completion,
    82      * IRQ acknowlegement). */
    83     RTIOPORT port;
    84 } HGSMIHOSTCOMMANDCONTEXT, *PHGSMIHOSTCOMMANDCONTEXT;
    8535
    8636/** @name Base HGSMI Buffer APIs
     
    9343}
    9444
    95 DECLHIDDEN(void)     VBoxHGSMISetupHostContext(PHGSMIHOSTCOMMANDCONTEXT pCtx,
    96                                                void *pvBaseMapping,
    97                                                uint32_t offHostFlags,
    98                                                void *pvHostAreaMapping,
    99                                                uint32_t offVRAMHostArea,
    100                                                uint32_t cbHostArea);
    101 DECLHIDDEN(void)     VBoxHGSMIHostCmdComplete(PHGSMIHOSTCOMMANDCONTEXT pCtx,
    102                                               void *pvMem);
    103 DECLHIDDEN(void)     VBoxHGSMIProcessHostQueue(PHGSMIHOSTCOMMANDCONTEXT pCtx);
    104 /** @todo we should provide a cleanup function too as part of the API */
    105 DECLHIDDEN(int)      VBoxHGSMISetupGuestContext(PHGSMIGUESTCOMMANDCONTEXT pCtx,
    106                                                 void *pvGuestHeapMemory,
    107                                                 uint32_t cbGuestHeapMemory,
    108                                                 uint32_t offVRAMGuestHeapMemory,
    109                                                 const HGSMIENV *pEnv);
    11045DECLHIDDEN(void *)   VBoxHGSMIBufferAlloc(PHGSMIGUESTCOMMANDCONTEXT pCtx,
    11146                                          HGSMISIZE cbData,
  • trunk/include/VBox/Graphics/HGSMIContext.h

    r66696 r67066  
    11/** @file
    2  * VBox Host Guest Shared Memory Interface (HGSMI) buffer management.
     2 * VBox Host Guest Shared Memory Interface (HGSMI) command contexts.
    33 */
    44
     
    2525
    2626
    27 #ifndef ___VBox_Graphics_HGSMIBuffers_h___
    28 #define ___VBox_Graphics_HGSMIBuffers_h___
     27#ifndef ___VBox_Graphics_HGSMIContext_h___
     28#define ___VBox_Graphics_HGSMIContext_h___
    2929
    3030#include <HGSMI.h>
     
    8484} HGSMIHOSTCOMMANDCONTEXT, *PHGSMIHOSTCOMMANDCONTEXT;
    8585
    86 /** @name Base HGSMI Buffer APIs
     86/** @name HGSMI context initialisation APIs.
    8787 * @{ */
    8888
    89 /** Acknowlege an IRQ. */
    90 DECLINLINE(void) VBoxHGSMIClearIrq(PHGSMIHOSTCOMMANDCONTEXT pCtx)
    91 {
    92     VBVO_PORT_WRITE_U32(pCtx->port, HGSMIOFFSET_VOID);
    93 }
    94 
     89/** @todo we should provide a cleanup function too as part of the API */
     90DECLHIDDEN(int)      VBoxHGSMISetupGuestContext(PHGSMIGUESTCOMMANDCONTEXT pCtx,
     91                                                void *pvGuestHeapMemory,
     92                                                uint32_t cbGuestHeapMemory,
     93                                                uint32_t offVRAMGuestHeapMemory,
     94                                                const HGSMIENV *pEnv);
    9595DECLHIDDEN(void)     VBoxHGSMISetupHostContext(PHGSMIHOSTCOMMANDCONTEXT pCtx,
    9696                                               void *pvBaseMapping,
     
    9999                                               uint32_t offVRAMHostArea,
    100100                                               uint32_t cbHostArea);
    101 DECLHIDDEN(void)     VBoxHGSMIHostCmdComplete(PHGSMIHOSTCOMMANDCONTEXT pCtx,
    102                                               void *pvMem);
    103 DECLHIDDEN(void)     VBoxHGSMIProcessHostQueue(PHGSMIHOSTCOMMANDCONTEXT pCtx);
    104 /** @todo we should provide a cleanup function too as part of the API */
    105 DECLHIDDEN(int)      VBoxHGSMISetupGuestContext(PHGSMIGUESTCOMMANDCONTEXT pCtx,
    106                                                 void *pvGuestHeapMemory,
    107                                                 uint32_t cbGuestHeapMemory,
    108                                                 uint32_t offVRAMGuestHeapMemory,
    109                                                 const HGSMIENV *pEnv);
    110 DECLHIDDEN(void *)   VBoxHGSMIBufferAlloc(PHGSMIGUESTCOMMANDCONTEXT pCtx,
    111                                           HGSMISIZE cbData,
    112                                           uint8_t u8Ch,
    113                                           uint16_t u16Op);
    114 DECLHIDDEN(void)     VBoxHGSMIBufferFree(PHGSMIGUESTCOMMANDCONTEXT pCtx,
    115                                          void *pvBuffer);
    116 DECLHIDDEN(int)      VBoxHGSMIBufferSubmit(PHGSMIGUESTCOMMANDCONTEXT pCtx,
    117                                            void *pvBuffer);
     101
    118102/** @}  */
    119103
  • trunk/include/VBox/Graphics/HGSMIHostCmd.h

    r66696 r67066  
    2525
    2626
    27 #ifndef ___VBox_Graphics_HGSMIBuffers_h___
    28 #define ___VBox_Graphics_HGSMIBuffers_h___
     27#ifndef ___VBox_Graphics_HGSMIHostCmd_h___
     28#define ___VBox_Graphics_HGSMIHostCmd_h___
    2929
    3030#include <HGSMI.h>
    31 #include <HGSMIChSetup.h>
     31#include <HGSMIContext.h>
    3232#include <VBoxVideoIPRT.h>
    33 
    34 #ifdef VBOX_WDDM_MINIPORT
    35 # include "wddm/VBoxMPShgsmi.h"
    36  typedef VBOXSHGSMI HGSMIGUESTCMDHEAP;
    37 # define HGSMIGUESTCMDHEAP_GET(_p) (&(_p)->Heap)
    38 #else
    39  typedef HGSMIHEAP HGSMIGUESTCMDHEAP;
    40 # define HGSMIGUESTCMDHEAP_GET(_p) (_p)
    41 #endif
    4233
    4334RT_C_DECLS_BEGIN
    4435
    45 /**
    46  * Structure grouping the context needed for submitting commands to the host
    47  * via HGSMI
    48  */
    49 typedef struct HGSMIGUESTCOMMANDCONTEXT
    50 {
    51     /** Information about the memory heap located in VRAM from which data
    52      * structures to be sent to the host are allocated. */
    53     HGSMIGUESTCMDHEAP heapCtx;
    54     /** The I/O port used for submitting commands to the host by writing their
    55      * offsets into the heap. */
    56     RTIOPORT port;
    57 } HGSMIGUESTCOMMANDCONTEXT, *PHGSMIGUESTCOMMANDCONTEXT;
    58 
    59 
    60 /**
    61  * Structure grouping the context needed for receiving commands from the host
    62  * via HGSMI
    63  */
    64 typedef struct HGSMIHOSTCOMMANDCONTEXT
    65 {
    66     /** Information about the memory area located in VRAM in which the host
    67      * places data structures to be read by the guest. */
    68     HGSMIAREA areaCtx;
    69     /** Convenience structure used for matching host commands to handlers. */
    70     /** @todo handlers are registered individually in code rather than just
    71      * passing a static structure in order to gain extra flexibility.  There is
    72      * currently no expected usage case for this though.  Is the additional
    73      * complexity really justified? */
    74     HGSMICHANNELINFO channels;
    75     /** Flag to indicate that one thread is currently processing the command
    76      * queue. */
    77     volatile bool fHostCmdProcessing;
    78     /* Pointer to the VRAM location where the HGSMI host flags are kept. */
    79     volatile HGSMIHOSTFLAGS *pfHostFlags;
    80     /** The I/O port used for receiving commands from the host as offsets into
    81      * the memory area and sending back confirmations (command completion,
    82      * IRQ acknowlegement). */
    83     RTIOPORT port;
    84 } HGSMIHOSTCOMMANDCONTEXT, *PHGSMIHOSTCOMMANDCONTEXT;
    85 
    86 /** @name Base HGSMI Buffer APIs
     36/** @name Base HGSMI host command APIs.
    8737 * @{ */
    8838
    89 /** Acknowlege an IRQ. */
    90 DECLINLINE(void) VBoxHGSMIClearIrq(PHGSMIHOSTCOMMANDCONTEXT pCtx)
    91 {
    92     VBVO_PORT_WRITE_U32(pCtx->port, HGSMIOFFSET_VOID);
    93 }
    94 
    95 DECLHIDDEN(void)     VBoxHGSMISetupHostContext(PHGSMIHOSTCOMMANDCONTEXT pCtx,
    96                                                void *pvBaseMapping,
    97                                                uint32_t offHostFlags,
    98                                                void *pvHostAreaMapping,
    99                                                uint32_t offVRAMHostArea,
    100                                                uint32_t cbHostArea);
    10139DECLHIDDEN(void)     VBoxHGSMIHostCmdComplete(PHGSMIHOSTCOMMANDCONTEXT pCtx,
    10240                                              void *pvMem);
    10341DECLHIDDEN(void)     VBoxHGSMIProcessHostQueue(PHGSMIHOSTCOMMANDCONTEXT pCtx);
    104 /** @todo we should provide a cleanup function too as part of the API */
    105 DECLHIDDEN(int)      VBoxHGSMISetupGuestContext(PHGSMIGUESTCOMMANDCONTEXT pCtx,
    106                                                 void *pvGuestHeapMemory,
    107                                                 uint32_t cbGuestHeapMemory,
    108                                                 uint32_t offVRAMGuestHeapMemory,
    109                                                 const HGSMIENV *pEnv);
    110 DECLHIDDEN(void *)   VBoxHGSMIBufferAlloc(PHGSMIGUESTCOMMANDCONTEXT pCtx,
    111                                           HGSMISIZE cbData,
    112                                           uint8_t u8Ch,
    113                                           uint16_t u16Op);
    114 DECLHIDDEN(void)     VBoxHGSMIBufferFree(PHGSMIGUESTCOMMANDCONTEXT pCtx,
    115                                          void *pvBuffer);
    116 DECLHIDDEN(int)      VBoxHGSMIBufferSubmit(PHGSMIGUESTCOMMANDCONTEXT pCtx,
    117                                            void *pvBuffer);
     42
    11843/** @}  */
    11944
  • trunk/include/VBox/Graphics/VBoxVideoGuest.h

    r66685 r67066  
    3030#define ___VBox_Graphics_VBoxVideoGuest_h___
    3131
    32 #include <HGSMIBuffers.h>
     32#include <HGSMIBase.h>
    3333#include <VBoxVideo.h>
    3434#include <VBoxVideoIPRT.h>
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