i965: Remove use of deprecated drm_intel_aub routines
[mesa.git] / src / mesa / drivers / dri / i965 / intel_screen.h
1 /*
2 * Copyright 2003 VMware, Inc.
3 * All Rights Reserved.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the
7 * "Software"), to deal in the Software without restriction, including
8 * without limitation the rights to use, copy, modify, merge, publish,
9 * distribute, sublicense, and/or sell copies of the Software, and to
10 * permit persons to whom the Software is furnished to do so, subject to
11 * the following conditions:
12 *
13 * The above copyright notice and this permission notice (including the
14 * next paragraph) shall be included in all copies or substantial portions
15 * of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20 * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
21 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
22 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 */
25
26 #ifndef _INTEL_INIT_H_
27 #define _INTEL_INIT_H_
28
29 #include <stdbool.h>
30 #include <sys/time.h>
31
32 #include <GL/internal/dri_interface.h>
33
34 #include "dri_util.h"
35 #include "intel_bufmgr.h"
36 #include "common/gen_device_info.h"
37 #include "i915_drm.h"
38 #include "xmlconfig.h"
39
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43
44 struct intel_screen
45 {
46 int deviceID;
47 struct gen_device_info devinfo;
48
49 __DRIscreen *driScrnPriv;
50
51 uint64_t max_gtt_map_object_size;
52
53 bool no_hw;
54 bool hw_has_swizzling;
55 bool has_exec_fence; /**< I915_PARAM_HAS_EXEC_FENCE */
56
57 int hw_has_timestamp;
58
59 /**
60 * Does the kernel support context reset notifications?
61 */
62 bool has_context_reset_notification;
63
64 /**
65 * Does the kernel support features such as pipelined register access to
66 * specific registers?
67 */
68 unsigned kernel_features;
69 #define KERNEL_ALLOWS_SOL_OFFSET_WRITES (1<<0)
70 #define KERNEL_ALLOWS_PREDICATE_WRITES (1<<1)
71 #define KERNEL_ALLOWS_MI_MATH_AND_LRR (1<<2)
72 #define KERNEL_ALLOWS_HSW_SCRATCH1_AND_ROW_CHICKEN3 (1<<3)
73 #define KERNEL_ALLOWS_COMPUTE_DISPATCH (1<<4)
74
75 dri_bufmgr *bufmgr;
76
77 /**
78 * A unique ID for shader programs.
79 */
80 unsigned program_id;
81
82 int winsys_msaa_samples_override;
83
84 struct brw_compiler *compiler;
85
86 /**
87 * Configuration cache with default values for all contexts
88 */
89 driOptionCache optionCache;
90
91 /**
92 * Version of the command parser reported by the
93 * I915_PARAM_CMD_PARSER_VERSION parameter
94 */
95 int cmd_parser_version;
96
97 /**
98 * Number of subslices reported by the I915_PARAM_SUBSLICE_TOTAL parameter
99 */
100 int subslice_total;
101
102 /**
103 * Number of EUs reported by the I915_PARAM_EU_TOTAL parameter
104 */
105 int eu_total;
106 };
107
108 extern void intelDestroyContext(__DRIcontext * driContextPriv);
109
110 extern GLboolean intelUnbindContext(__DRIcontext * driContextPriv);
111
112 PUBLIC const __DRIextension **__driDriverGetExtensions_i965(void);
113 extern const __DRI2fenceExtension intelFenceExtension;
114
115 extern GLboolean
116 intelMakeCurrent(__DRIcontext * driContextPriv,
117 __DRIdrawable * driDrawPriv,
118 __DRIdrawable * driReadPriv);
119
120 double get_time(void);
121
122 const int*
123 intel_supported_msaa_modes(const struct intel_screen *screen);
124
125 static inline bool
126 can_do_pipelined_register_writes(const struct intel_screen *screen)
127 {
128 return screen->kernel_features & KERNEL_ALLOWS_SOL_OFFSET_WRITES;
129 }
130
131 static inline bool
132 can_do_hsw_l3_atomics(const struct intel_screen *screen)
133 {
134 return screen->kernel_features & KERNEL_ALLOWS_HSW_SCRATCH1_AND_ROW_CHICKEN3;
135 }
136
137 static inline bool
138 can_do_mi_math_and_lrr(const struct intel_screen *screen)
139 {
140 return screen->kernel_features & KERNEL_ALLOWS_MI_MATH_AND_LRR;
141 }
142
143 static inline bool
144 can_do_compute_dispatch(const struct intel_screen *screen)
145 {
146 return screen->kernel_features & KERNEL_ALLOWS_COMPUTE_DISPATCH;
147 }
148
149 static inline bool
150 can_do_predicate_writes(const struct intel_screen *screen)
151 {
152 return screen->kernel_features & KERNEL_ALLOWS_PREDICATE_WRITES;
153 }
154
155 #ifdef __cplusplus
156 }
157 #endif
158
159 #endif