1 #ifndef _VMWARESVGA_INTERN_H
2 #define _VMWARESVGA_INTERN_H
5 Copyright 2010-2019, The AROS Development Team. All rights reserved.
9 #include <hidd/gallium.h>
11 #include "vmwaresvga_hardware.h"
13 #include "svga/svga_winsys.h"
14 #include "svga/svga_public.h"
16 #include "util/u_memory.h"
17 #include "pipebuffer/pb_buffer.h"
19 #include "svga3d_caps.h"
22 #define CLID_Hidd_Gallium_VMWareSVGA "hidd.gallium.vmwaresvga"
24 #define VMW_MAX_DEFAULT_TEXTURE_SIZE (128 * 1024 * 1024)
26 #define VMW_COMMAND_SIZE (64*1024)
27 #define VMW_SURFACE_RELOCS (1024)
28 #define VMW_SHADER_RELOCS (1024)
29 #define VMW_REGION_RELOCS (512)
31 struct VMWareSVGAPBBuf
45 struct VMWareSVGA3DCap
{
47 SVGA3dDevCapResult result
;
50 struct HIDDGalliumVMWareSVGAData
52 struct svga_winsys_screen wssbase
;
54 struct HWData
*hwdata
;
62 struct VMWareSVGA3DCap
*cap_3d
;
65 struct HIDDGalliumVMWareSVGACtx
67 struct svga_winsys_context wscbase
;
68 struct svga_winsys_screen
*wscsws
;
70 volatile struct VMWareSVGAFIFO
*command
;
74 struct vmw_ctx_validate_item items
[VMW_SURFACE_RELOCS
];
84 struct vmw_buffer_relocation relocs
[VMW_REGION_RELOCS
];
94 struct vmw_ctx_validate_item items
[VMW_SHADER_RELOCS
];
103 struct HIDDGalliumVMWareSVGASurf
105 struct svga_winsys_buffer
*surfbuf
;
106 struct pipe_reference refcnt
;
107 ULONG sid
; // Hardware surface ID
110 struct HIDDGalliumVMWareSVGAShader
112 struct svga_winsys_buffer
*shaderbuf
;
113 struct pipe_reference refcnt
;
116 /* winsys functions */
117 static inline struct svga_winsys_surface
*VMWareSVGA_WSSurf_WinSysSurfFromHiddSurf(struct HIDDGalliumVMWareSVGASurf
*surf
)
119 return (struct svga_winsys_surface
*)surf
;
122 static inline struct HIDDGalliumVMWareSVGASurf
*VMWareSVGA_WSSurf_HiddSurfFromWinSysSurf(struct svga_winsys_surface
*surf
)
124 return (struct HIDDGalliumVMWareSVGASurf
*)surf
;
127 static inline struct svga_winsys_gb_shader
*VMWareSVGA_WSSurf_WinsysShaderHiddShader(struct HIDDGalliumVMWareSVGAShader
*shader
)
129 return (struct svga_winsys_gb_shader
*)shader
;
132 static inline struct HIDDGalliumVMWareSVGAData
*VMWareSVGA_WSScr_HiddDataFromWinSys(struct svga_winsys_screen
*sws
)
134 return (struct HIDDGalliumVMWareSVGAData
*)sws
;
137 void VMWareSVGA_WSScr_WinSysInit(struct HIDDGalliumVMWareSVGAData
*);
138 void VMWareSVGA_WSCtx_WinSysInit(struct HIDDGalliumVMWareSVGAData
*, struct HIDDGalliumVMWareSVGACtx
*);
140 void *VMWareSVGA_WSSurf_SurfaceMap(struct svga_winsys_context
*swc
, struct svga_winsys_surface
*srf
, unsigned flags
, boolean
*retry
);
141 void VMWareSVGA_WSSurf_SurfaceUnMap(struct svga_winsys_context
*swc
, struct svga_winsys_surface
*srf
, boolean
*rebind
);
142 void VMWareSVGA_WSSurf_SurfaceReference(struct HIDDGalliumVMWareSVGASurf
**, struct HIDDGalliumVMWareSVGASurf
*);
143 enum pipe_error
VMWareSVGA_WSSurf_SurfaceInvalidate(struct svga_winsys_context
*swc
, struct svga_winsys_surface
*surf
);