init the command bounce buffer details when the driver initializes since it can be...
[AROS.git] / workbench / hidds / vmwaresvga / vmwaresvga_gallium.h
blob83bf30eae103d6702823631d773b0d03076ca04c
1 #ifndef _VMWARESVGA_INTERN_H
2 #define _VMWARESVGA_INTERN_H
4 /*
5 Copyright 2010-2019, The AROS Development Team. All rights reserved.
6 $Id$
7 */
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"
20 #include "svga_cmd.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
33 struct Node bnode;
34 ULONG magic;
35 APTR map;
36 ULONG size;
37 void *ptr;
38 ULONG stride;
39 APTR allocated_map;
40 ULONG allocated_size;
41 ULONG status_index;
42 ULONG flush_num;
45 struct VMWareSVGA3DCap {
46 BOOL has_cap;
47 SVGA3dDevCapResult result;
50 struct HIDDGalliumVMWareSVGAData
52 struct svga_winsys_screen wssbase;
53 OOP_Object *wsgo;
54 struct HWData *hwdata;
56 ULONG ctxcnt;
57 ULONG srfcnt;
59 ULONG use_gbobjects;
61 ULONG size_3dcaps;
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;
72 struct {
73 #if (0)
74 struct vmw_ctx_validate_item items[VMW_SURFACE_RELOCS];
75 #endif
76 ULONG size;
77 ULONG used;
78 ULONG staged;
79 ULONG reserved;
80 } surface;
82 struct {
83 #if (0)
84 struct vmw_buffer_relocation relocs[VMW_REGION_RELOCS];
85 #endif
86 ULONG size;
87 ULONG used;
88 ULONG staged;
89 ULONG reserved;
90 } region;
92 struct {
93 #if (0)
94 struct vmw_ctx_validate_item items[VMW_SHADER_RELOCS];
95 #endif
96 ULONG size;
97 ULONG used;
98 ULONG staged;
99 ULONG reserved;
100 } shader;
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);
145 #endif