1 /**********************************************************
2 * Copyright 2008-2009 VMware, Inc. All rights reserved.
4 * Permission is hereby granted, free of charge, to any person
5 * obtaining a copy of this software and associated documentation
6 * files (the "Software"), to deal in the Software without
7 * restriction, including without limitation the rights to use, copy,
8 * modify, merge, publish, distribute, sublicense, and/or sell copies
9 * of the Software, and to permit persons to whom the Software is
10 * furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice shall be
13 * included in all copies or substantial portions of the Software.
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
19 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 **********************************************************/
28 * VMware SVGA specific winsys interface.
30 * @author Jose Fonseca <jfonseca@vmware.com>
32 * Documentation taken from the VMware SVGA DDK.
35 #ifndef SVGA_WINSYS_H_
36 #define SVGA_WINSYS_H_
38 #include "svga_types.h"
39 #include "svga3d_types.h"
41 #include "svga3d_reg.h"
43 #include "pipe/p_compiler.h"
44 #include "pipe/p_defines.h"
46 #include "svga_mksstats.h"
48 struct svga_winsys_screen
;
49 struct svga_winsys_buffer
;
52 struct pipe_debug_callback
;
53 struct pipe_fence_handle
;
59 #define SVGA_BUFFER_USAGE_PINNED (1 << 0)
60 #define SVGA_BUFFER_USAGE_WRAPPED (1 << 1)
61 #define SVGA_BUFFER_USAGE_SHADER (1 << 2)
64 * Relocation flags to help with dirty tracking
65 * SVGA_RELOC_WRITE - The command will cause a GPU write to this
67 * SVGA_RELOC_READ - The command will cause a GPU read from this
69 * SVGA_RELOC_INTERNAL The command will only transfer data internally
70 * within the resource, and optionally clear
72 * SVGA_RELOC_DMA - Only set for resource buffer DMA uploads for winsys
73 * implementations that want to track the amount
74 * of such data referenced in the command stream.
76 #define SVGA_RELOC_WRITE (1 << 0)
77 #define SVGA_RELOC_READ (1 << 1)
78 #define SVGA_RELOC_INTERNAL (1 << 2)
79 #define SVGA_RELOC_DMA (1 << 3)
81 #define SVGA_FENCE_FLAG_EXEC (1 << 0)
82 #define SVGA_FENCE_FLAG_QUERY (1 << 1)
84 #define SVGA_SURFACE_USAGE_SHARED (1 << 0)
85 #define SVGA_SURFACE_USAGE_SCANOUT (1 << 1)
86 #define SVGA_SURFACE_USAGE_COHERENT (1 << 2)
88 #define SVGA_QUERY_FLAG_SET (1 << 0)
89 #define SVGA_QUERY_FLAG_REF (1 << 1)
91 #define SVGA_HINT_FLAG_CAN_PRE_FLUSH (1 << 0) /* Can preemptively flush */
92 #define SVGA_HINT_FLAG_EXPORT_FENCE_FD (1 << 1) /* Export a Fence FD */
95 * SVGA mks statistics info
97 struct svga_winsys_stats_timeframe
{
100 uint64 adjustedStartTime
;
101 struct svga_winsys_stats_timeframe
*enclosing
;
104 enum svga_stats_count
{
105 SVGA_STATS_COUNT_BLENDSTATE
,
106 SVGA_STATS_COUNT_BLITBLITTERCOPY
,
107 SVGA_STATS_COUNT_DEPTHSTENCILSTATE
,
108 SVGA_STATS_COUNT_RASTERIZERSTATE
,
109 SVGA_STATS_COUNT_SAMPLER
,
110 SVGA_STATS_COUNT_SAMPLERVIEW
,
111 SVGA_STATS_COUNT_SURFACEWRITEFLUSH
,
112 SVGA_STATS_COUNT_TEXREADBACK
,
113 SVGA_STATS_COUNT_VERTEXELEMENT
,
117 enum svga_stats_time
{
118 SVGA_STATS_TIME_BLIT
,
119 SVGA_STATS_TIME_BLITBLITTER
,
120 SVGA_STATS_TIME_BLITFALLBACK
,
121 SVGA_STATS_TIME_BUFFERSFLUSH
,
122 SVGA_STATS_TIME_BUFFERTRANSFERMAP
,
123 SVGA_STATS_TIME_BUFFERTRANSFERUNMAP
,
124 SVGA_STATS_TIME_CONTEXTFINISH
,
125 SVGA_STATS_TIME_CONTEXTFLUSH
,
126 SVGA_STATS_TIME_COPYREGION
,
127 SVGA_STATS_TIME_COPYREGIONFALLBACK
,
128 SVGA_STATS_TIME_CREATEBACKEDSURFACEVIEW
,
129 SVGA_STATS_TIME_CREATEBUFFER
,
130 SVGA_STATS_TIME_CREATECONTEXT
,
131 SVGA_STATS_TIME_CREATEFS
,
132 SVGA_STATS_TIME_CREATEGS
,
133 SVGA_STATS_TIME_CREATESURFACE
,
134 SVGA_STATS_TIME_CREATESURFACEVIEW
,
135 SVGA_STATS_TIME_CREATETEXTURE
,
136 SVGA_STATS_TIME_CREATEVS
,
137 SVGA_STATS_TIME_DEFINESHADER
,
138 SVGA_STATS_TIME_DESTROYSURFACE
,
139 SVGA_STATS_TIME_DRAWVBO
,
140 SVGA_STATS_TIME_DRAWARRAYS
,
141 SVGA_STATS_TIME_DRAWELEMENTS
,
142 SVGA_STATS_TIME_EMITFS
,
143 SVGA_STATS_TIME_EMITGS
,
144 SVGA_STATS_TIME_EMITVS
,
145 SVGA_STATS_TIME_EMULATESURFACEVIEW
,
146 SVGA_STATS_TIME_FENCEFINISH
,
147 SVGA_STATS_TIME_GENERATEINDICES
,
148 SVGA_STATS_TIME_HWTNLDRAWARRAYS
,
149 SVGA_STATS_TIME_HWTNLDRAWELEMENTS
,
150 SVGA_STATS_TIME_HWTNLFLUSH
,
151 SVGA_STATS_TIME_HWTNLPRIM
,
152 SVGA_STATS_TIME_PROPAGATESURFACE
,
153 SVGA_STATS_TIME_SETSAMPLERVIEWS
,
154 SVGA_STATS_TIME_SURFACEFLUSH
,
155 SVGA_STATS_TIME_SWTNLDRAWVBO
,
156 SVGA_STATS_TIME_SWTNLUPDATEDRAW
,
157 SVGA_STATS_TIME_SWTNLUPDATEVDECL
,
158 SVGA_STATS_TIME_TEXTRANSFERMAP
,
159 SVGA_STATS_TIME_TEXTRANSFERUNMAP
,
160 SVGA_STATS_TIME_TGSIVGPU10TRANSLATE
,
161 SVGA_STATS_TIME_TGSIVGPU9TRANSLATE
,
162 SVGA_STATS_TIME_UPDATESTATE
,
163 SVGA_STATS_TIME_VALIDATESURFACEVIEW
,
164 SVGA_STATS_TIME_VBUFDRAWARRAYS
,
165 SVGA_STATS_TIME_VBUFDRAWELEMENTS
,
166 SVGA_STATS_TIME_VBUFRENDERALLOCVERT
,
167 SVGA_STATS_TIME_VBUFRENDERMAPVERT
,
168 SVGA_STATS_TIME_VBUFRENDERUNMAPVERT
,
169 SVGA_STATS_TIME_VBUFSUBMITSTATE
,
173 #define SVGA_STATS_PREFIX "GuestGL_"
175 #define SVGA_STATS_COUNT_NAMES \
176 SVGA_STATS_PREFIX "BlendState", \
177 SVGA_STATS_PREFIX "BlitBlitterCopy", \
178 SVGA_STATS_PREFIX "DepthStencilState", \
179 SVGA_STATS_PREFIX "RasterizerState", \
180 SVGA_STATS_PREFIX "Sampler", \
181 SVGA_STATS_PREFIX "SamplerView", \
182 SVGA_STATS_PREFIX "SurfaceWriteFlush", \
183 SVGA_STATS_PREFIX "TextureReadback", \
184 SVGA_STATS_PREFIX "VertexElement" \
186 #define SVGA_STATS_TIME_NAMES \
187 SVGA_STATS_PREFIX "Blit", \
188 SVGA_STATS_PREFIX "BlitBlitter", \
189 SVGA_STATS_PREFIX "BlitFallback", \
190 SVGA_STATS_PREFIX "BuffersFlush", \
191 SVGA_STATS_PREFIX "BufferTransferMap", \
192 SVGA_STATS_PREFIX "BufferTransferUnmap", \
193 SVGA_STATS_PREFIX "ContextFinish", \
194 SVGA_STATS_PREFIX "ContextFlush", \
195 SVGA_STATS_PREFIX "CopyRegion", \
196 SVGA_STATS_PREFIX "CopyRegionFallback", \
197 SVGA_STATS_PREFIX "CreateBackedSurfaceView", \
198 SVGA_STATS_PREFIX "CreateBuffer", \
199 SVGA_STATS_PREFIX "CreateContext", \
200 SVGA_STATS_PREFIX "CreateFS", \
201 SVGA_STATS_PREFIX "CreateGS", \
202 SVGA_STATS_PREFIX "CreateSurface", \
203 SVGA_STATS_PREFIX "CreateSurfaceView", \
204 SVGA_STATS_PREFIX "CreateTexture", \
205 SVGA_STATS_PREFIX "CreateVS", \
206 SVGA_STATS_PREFIX "DefineShader", \
207 SVGA_STATS_PREFIX "DestroySurface", \
208 SVGA_STATS_PREFIX "DrawVBO", \
209 SVGA_STATS_PREFIX "DrawArrays", \
210 SVGA_STATS_PREFIX "DrawElements", \
211 SVGA_STATS_PREFIX "EmitFS", \
212 SVGA_STATS_PREFIX "EmitGS", \
213 SVGA_STATS_PREFIX "EmitVS", \
214 SVGA_STATS_PREFIX "EmulateSurfaceView", \
215 SVGA_STATS_PREFIX "FenceFinish", \
216 SVGA_STATS_PREFIX "GenerateIndices", \
217 SVGA_STATS_PREFIX "HWtnlDrawArrays", \
218 SVGA_STATS_PREFIX "HWtnlDrawElements", \
219 SVGA_STATS_PREFIX "HWtnlFlush", \
220 SVGA_STATS_PREFIX "HWtnlPrim", \
221 SVGA_STATS_PREFIX "PropagateSurface", \
222 SVGA_STATS_PREFIX "SetSamplerViews", \
223 SVGA_STATS_PREFIX "SurfaceFlush", \
224 SVGA_STATS_PREFIX "SwtnlDrawVBO", \
225 SVGA_STATS_PREFIX "SwtnlUpdateDraw", \
226 SVGA_STATS_PREFIX "SwtnlUpdateVDecl", \
227 SVGA_STATS_PREFIX "TextureTransferMap", \
228 SVGA_STATS_PREFIX "TextureTransferUnmap", \
229 SVGA_STATS_PREFIX "TGSIVGPU10Translate", \
230 SVGA_STATS_PREFIX "TGSIVGPU9Translate", \
231 SVGA_STATS_PREFIX "UpdateState", \
232 SVGA_STATS_PREFIX "ValidateSurfaceView", \
233 SVGA_STATS_PREFIX "VbufDrawArrays", \
234 SVGA_STATS_PREFIX "VbufDrawElements", \
235 SVGA_STATS_PREFIX "VbufRenderAllocVertices", \
236 SVGA_STATS_PREFIX "VbufRenderMapVertices", \
237 SVGA_STATS_PREFIX "VbufRenderUnmapVertices", \
238 SVGA_STATS_PREFIX "VbufSubmitState"
241 /** Opaque surface handle */
242 struct svga_winsys_surface
;
244 /** Opaque guest-backed objects */
245 struct svga_winsys_gb_shader
;
246 struct svga_winsys_gb_query
;
250 * SVGA per-context winsys interface.
252 struct svga_winsys_context
255 (*destroy
)(struct svga_winsys_context
*swc
);
258 (*reserve
)(struct svga_winsys_context
*swc
,
259 uint32_t nr_bytes
, uint32_t nr_relocs
);
262 * Returns current size of command buffer, in bytes.
265 (*get_command_buffer_size
)(struct svga_winsys_context
*swc
);
268 * Emit a relocation for a host surface.
270 * @param flags bitmask of SVGA_RELOC_* flags
272 * NOTE: Order of this call does matter. It should be the same order
273 * as relocations appear in the command buffer.
276 (*surface_relocation
)(struct svga_winsys_context
*swc
,
279 struct svga_winsys_surface
*surface
,
283 * Emit a relocation for a guest memory region.
285 * @param flags bitmask of SVGA_RELOC_* flags
287 * NOTE: Order of this call does matter. It should be the same order
288 * as relocations appear in the command buffer.
291 (*region_relocation
)(struct svga_winsys_context
*swc
,
292 struct SVGAGuestPtr
*ptr
,
293 struct svga_winsys_buffer
*buffer
,
298 * Emit a relocation for a guest-backed shader object.
300 * NOTE: Order of this call does matter. It should be the same order
301 * as relocations appear in the command buffer.
304 (*shader_relocation
)(struct svga_winsys_context
*swc
,
308 struct svga_winsys_gb_shader
*shader
,
312 * Emit a relocation for a guest-backed context.
314 * NOTE: Order of this call does matter. It should be the same order
315 * as relocations appear in the command buffer.
318 (*context_relocation
)(struct svga_winsys_context
*swc
, uint32
*cid
);
321 * Emit a relocation for a guest Memory OBject.
323 * @param flags bitmask of SVGA_RELOC_* flags
324 * @param offset_into_mob Buffer starts at this offset into the MOB.
326 * Note that not all commands accept an offset into the MOB and
327 * those commands can't use suballocated buffer pools. To trap
328 * errors from improper buffer pool usage, set the offset_into_mob
332 (*mob_relocation
)(struct svga_winsys_context
*swc
,
334 uint32
*offset_into_mob
,
335 struct svga_winsys_buffer
*buffer
,
340 * Emit a relocation for a guest-backed query object.
342 * NOTE: Order of this call does matter. It should be the same order
343 * as relocations appear in the command buffer.
346 (*query_relocation
)(struct svga_winsys_context
*swc
,
348 struct svga_winsys_gb_query
*query
);
351 * Bind queries to context.
352 * \param flags exactly one of SVGA_QUERY_FLAG_SET/REF
355 (*query_bind
)(struct svga_winsys_context
*sws
,
356 struct svga_winsys_gb_query
*query
,
360 (*commit
)(struct svga_winsys_context
*swc
);
363 (*flush
)(struct svga_winsys_context
*swc
,
364 struct pipe_fence_handle
**pfence
);
367 * Context ID used to fill in the commands
369 * Context IDs are arbitrary small non-negative integers,
370 * global to the entire SVGA device.
375 * Flags to hint the current context state
380 * File descriptor for imported fence
382 int32 imported_fence_fd
;
385 ** BEGIN new functions for guest-backed surfaces.
388 boolean have_gb_objects
;
389 boolean force_coherent
;
392 * Map a guest-backed surface.
393 * \param flags bitmaks of PIPE_TRANSFER_x flags
395 * The surface_map() member is allowed to fail due to a
396 * shortage of command buffer space, if the
397 * PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE bit is set in flags.
398 * In that case, the caller must flush the current command
399 * buffer and reissue the map.
402 (*surface_map
)(struct svga_winsys_context
*swc
,
403 struct svga_winsys_surface
*surface
,
404 unsigned flags
, boolean
*retry
);
407 * Unmap a guest-backed surface.
408 * \param rebind returns a flag indicating whether the caller should
409 * issue a SVGA3D_BindGBSurface() call.
412 (*surface_unmap
)(struct svga_winsys_context
*swc
,
413 struct svga_winsys_surface
*surface
,
417 * Create and define a DX GB shader that resides in the device COTable.
418 * Caller of this function will issue the DXDefineShader command.
420 struct svga_winsys_gb_shader
*
421 (*shader_create
)(struct svga_winsys_context
*swc
,
423 SVGA3dShaderType shaderType
,
424 const uint32
*bytecode
,
428 * Destroy a DX GB shader.
429 * This function will issue the DXDestroyShader command.
432 (*shader_destroy
)(struct svga_winsys_context
*swc
,
433 struct svga_winsys_gb_shader
*shader
);
436 * Rebind a DX GB resource to a context.
437 * This is called to reference a DX GB resource in the command stream in
438 * order to page in the associated resource in case the memory has been
439 * paged out, and to fence it if necessary after command submission.
442 (*resource_rebind
)(struct svga_winsys_context
*swc
,
443 struct svga_winsys_surface
*surface
,
444 struct svga_winsys_gb_shader
*shader
,
447 /** To report perf/conformance/etc issues to the state tracker */
448 struct pipe_debug_callback
*debug_callback
;
450 /** The more recent command issued to command buffer */
451 SVGAFifo3dCmdId last_command
;
453 /** For HUD queries */
454 uint64_t num_commands
;
455 uint64_t num_draw_commands
;
460 * SVGA per-screen winsys interface.
462 struct svga_winsys_screen
465 (*destroy
)(struct svga_winsys_screen
*sws
);
467 SVGA3dHardwareVersion
468 (*get_hw_version
)(struct svga_winsys_screen
*sws
);
471 (*get_cap
)(struct svga_winsys_screen
*sws
,
472 SVGA3dDevCapIndex index
,
473 SVGA3dDevCapResult
*result
);
476 * Create a new context.
478 * Context objects encapsulate all render state, and shader
479 * objects are per-context.
481 * Surfaces are not per-context. The same surface can be shared
482 * between multiple contexts, and surface operations can occur
485 struct svga_winsys_context
*
486 (*context_create
)(struct svga_winsys_screen
*sws
);
489 * This creates a "surface" object in the SVGA3D device.
491 * \param sws Pointer to an svga_winsys_context
492 * \param flags Device surface create flags
493 * \param format Format Device surface format
494 * \param usage Winsys usage: bitmask of SVGA_SURFACE_USAGE_x flags
495 * \param size Surface size given in device format
496 * \param numLayers Number of layers of the surface (or cube faces)
497 * \param numMipLevels Number of mipmap levels for each face
499 * Returns the surface ID (sid). Surfaces are generic
500 * containers for host VRAM objects like textures, vertex
501 * buffers, and depth/stencil buffers.
503 * Surfaces are hierarchial:
505 * - Surface may have multiple faces (for cube maps)
507 * - Each face has a list of mipmap levels
509 * - Each mipmap image may have multiple volume
510 * slices for 3D image, or multiple 2D slices for texture array.
512 * - Each slice is a 2D array of 'blocks'
514 * - Each block may be one or more pixels.
515 * (Usually 1, more for DXT or YUV formats.)
517 * Surfaces are generic host VRAM objects. The SVGA3D device
518 * may optimize surfaces according to the format they were
519 * created with, but this format does not limit the ways in
520 * which the surface may be used. For example, a depth surface
521 * can be used as a texture, or a floating point image may
522 * be used as a vertex buffer. Some surface usages may be
523 * lower performance, due to software emulation, but any
524 * usage should work with any surface.
526 struct svga_winsys_surface
*
527 (*surface_create
)(struct svga_winsys_screen
*sws
,
528 SVGA3dSurfaceAllFlags flags
,
529 SVGA3dSurfaceFormat format
,
534 unsigned sampleCount
);
537 * Creates a surface from a winsys handle.
538 * Used to implement pipe_screen::resource_from_handle.
540 struct svga_winsys_surface
*
541 (*surface_from_handle
)(struct svga_winsys_screen
*sws
,
542 struct winsys_handle
*whandle
,
543 SVGA3dSurfaceFormat
*format
);
546 * Get a winsys_handle from a surface.
547 * Used to implement pipe_screen::resource_get_handle.
550 (*surface_get_handle
)(struct svga_winsys_screen
*sws
,
551 struct svga_winsys_surface
*surface
,
553 struct winsys_handle
*whandle
);
556 * Whether this surface is sitting in a validate list
559 (*surface_is_flushed
)(struct svga_winsys_screen
*sws
,
560 struct svga_winsys_surface
*surface
);
563 * Reference a SVGA3D surface object. This allows sharing of a
564 * surface between different objects.
567 (*surface_reference
)(struct svga_winsys_screen
*sws
,
568 struct svga_winsys_surface
**pdst
,
569 struct svga_winsys_surface
*src
);
572 * Check if a resource (texture, buffer) of the given size
573 * and format can be created.
574 * \Return TRUE if OK, FALSE if too large.
577 (*surface_can_create
)(struct svga_winsys_screen
*sws
,
578 SVGA3dSurfaceFormat format
,
585 * Buffer management. Buffer attributes are mostly fixed over its lifetime.
587 * @param usage bitmask of SVGA_BUFFER_USAGE_* flags.
589 * alignment indicates the client's alignment requirements, eg for
592 struct svga_winsys_buffer
*
593 (*buffer_create
)( struct svga_winsys_screen
*sws
,
599 * Map the entire data store of a buffer object into the client's address.
600 * usage is a bitmask of PIPE_TRANSFER_*
603 (*buffer_map
)( struct svga_winsys_screen
*sws
,
604 struct svga_winsys_buffer
*buf
,
608 (*buffer_unmap
)( struct svga_winsys_screen
*sws
,
609 struct svga_winsys_buffer
*buf
);
612 (*buffer_destroy
)( struct svga_winsys_screen
*sws
,
613 struct svga_winsys_buffer
*buf
);
617 * Reference a fence object.
620 (*fence_reference
)( struct svga_winsys_screen
*sws
,
621 struct pipe_fence_handle
**pdst
,
622 struct pipe_fence_handle
*src
);
625 * Checks whether the fence has been signalled.
626 * \param flags driver-specific meaning
627 * \return zero on success.
629 int (*fence_signalled
)( struct svga_winsys_screen
*sws
,
630 struct pipe_fence_handle
*fence
,
634 * Wait for the fence to finish.
635 * \param timeout in nanoseconds (may be PIPE_TIMEOUT_INFINITE).
636 * 0 to return immediately, if the API suports it.
637 * \param flags driver-specific meaning
638 * \return zero on success.
640 int (*fence_finish
)( struct svga_winsys_screen
*sws
,
641 struct pipe_fence_handle
*fence
,
646 * Get the file descriptor associated with the fence
647 * \param duplicate duplicate the fd before returning it
648 * \return zero on success.
650 int (*fence_get_fd
)( struct svga_winsys_screen
*sws
,
651 struct pipe_fence_handle
*fence
,
655 * Create a fence using the given file descriptor
656 * \return zero on success.
658 void (*fence_create_fd
)( struct svga_winsys_screen
*sws
,
659 struct pipe_fence_handle
**fence
,
663 * Accumulates fence FD from other devices into the current context
664 * \param context_fd FD the context will be waiting on
665 * \return zero on success
667 int (*fence_server_sync
)( struct svga_winsys_screen
*sws
,
669 struct pipe_fence_handle
*fence
);
672 ** BEGIN new functions for guest-backed surfaces.
675 /** Are guest-backed objects enabled? */
676 bool have_gb_objects
;
678 /** Can we do DMA with guest-backed objects enabled? */
681 /** Do we support coherent surface memory? */
684 * Create and define a GB shader.
686 struct svga_winsys_gb_shader
*
687 (*shader_create
)(struct svga_winsys_screen
*sws
,
688 SVGA3dShaderType shaderType
,
689 const uint32
*bytecode
,
693 * Destroy a GB shader. It's safe to call this function even
694 * if the shader is referenced in a context's command stream.
697 (*shader_destroy
)(struct svga_winsys_screen
*sws
,
698 struct svga_winsys_gb_shader
*shader
);
701 * Create and define a GB query.
703 struct svga_winsys_gb_query
*
704 (*query_create
)(struct svga_winsys_screen
*sws
, uint32 len
);
707 * Destroy a GB query.
710 (*query_destroy
)(struct svga_winsys_screen
*sws
,
711 struct svga_winsys_gb_query
*query
);
714 * Initialize the query state of the query that resides in the slot
715 * specified in offset
716 * \return zero on success.
719 (*query_init
)(struct svga_winsys_screen
*sws
,
720 struct svga_winsys_gb_query
*query
,
722 SVGA3dQueryState queryState
);
725 * Inquire for the query state and result of the query that resides
726 * in the slot specified in offset
729 (*query_get_result
)(struct svga_winsys_screen
*sws
,
730 struct svga_winsys_gb_query
*query
,
732 SVGA3dQueryState
*queryState
,
733 void *result
, uint32 resultLen
);
736 * Increment a statistic counter
739 (*stats_inc
)(enum svga_stats_count
);
742 * Push a time frame onto the stack
745 (*stats_time_push
)(enum svga_stats_time
, struct svga_winsys_stats_timeframe
*);
754 * Send a host log message
757 (*host_log
)(struct svga_winsys_screen
*sws
, const char *message
);
759 /** Have VGPU v10 hardware? */
762 /** Have SM4_1 hardware? */
765 /** To rebind resources at the beginnning of a new command buffer */
766 boolean need_to_rebind_resources
;
768 boolean have_generate_mipmap_cmd
;
769 boolean have_set_predication_cmd
;
770 boolean have_transfer_from_buffer_cmd
;
771 boolean have_fence_fd
;
772 boolean have_intra_surface_copy
;
776 struct svga_winsys_screen
*
777 svga_winsys_screen(struct pipe_screen
*screen
);
779 struct svga_winsys_context
*
780 svga_winsys_context(struct pipe_context
*context
);
782 struct pipe_resource
*
783 svga_screen_buffer_wrap_surface(struct pipe_screen
*screen
,
784 enum SVGA3dSurfaceFormat format
,
785 struct svga_winsys_surface
*srf
);
787 struct svga_winsys_surface
*
788 svga_screen_buffer_get_winsys_surface(struct pipe_resource
*buffer
);
790 #endif /* SVGA_WINSYS_H_ */