1 /**********************************************************
2  * Copyright 2015 VMware, Inc.  All rights reserved.
3  *
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:
11  *
12  * The above copyright notice and this permission notice shall be
13  * included in all copies or substantial portions of the Software.
14  *
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
22  * SOFTWARE.
23  *
24  **********************************************************/
25 
26 #ifndef VMW_DRM_QUERY_H
27 #define VMW_DRM_QUERY_H
28 
29 #include "svga3d_reg.h"
30 
31 
32 
33 /** Guest-backed query */
34 struct svga_winsys_gb_query
35 {
36    struct svga_winsys_buffer *buf;
37 };
38 
39 
40 struct svga_winsys_gb_query *
41 vmw_svga_winsys_query_create(struct svga_winsys_screen *sws,
42                              uint32 queryResultLen);
43 
44 void
45 vmw_svga_winsys_query_destroy(struct svga_winsys_screen *sws,
46                               struct svga_winsys_gb_query *query);
47 
48 int
49 vmw_svga_winsys_query_init(struct svga_winsys_screen *sws,
50                            struct svga_winsys_gb_query *query,
51                            unsigned offset,
52                            SVGA3dQueryState queryState);
53 
54 void
55 vmw_svga_winsys_query_get_result(struct svga_winsys_screen *sws,
56                        struct svga_winsys_gb_query *query,
57                        unsigned offset,
58                        SVGA3dQueryState *queryState,
59                        void *result, uint32 resultLen);
60 
61 enum pipe_error
62 vmw_swc_query_bind(struct svga_winsys_context *swc,
63                    struct svga_winsys_gb_query *query,
64                    unsigned flags);
65 
66 #endif /* VMW_DRM_QUERY_H */
67 
68