2 * Copyright 2003 VMware, Inc.
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:
13 * The above copyright notice and this permission notice (including the
14 * next paragraph) shall be included in all copies or substantial portions
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.
26 #ifndef _INTEL_INIT_H_
27 #define _INTEL_INIT_H_
32 #include <GL/internal/dri_interface.h>
36 #include "brw_bufmgr.h"
37 #include "common/gen_device_info.h"
39 #include "xmlconfig.h"
48 struct gen_device_info devinfo
;
50 __DRIscreen
*driScrnPriv
;
52 uint64_t max_gtt_map_object_size
;
54 /** Bytes of aperture usage beyond which execbuf is likely to fail. */
55 uint64_t aperture_threshold
;
58 bool hw_has_swizzling
;
59 bool has_exec_fence
; /**< I915_PARAM_HAS_EXEC_FENCE */
64 * Does the kernel support context reset notifications?
66 bool has_context_reset_notification
;
69 * Does the kernel support features such as pipelined register access to
72 unsigned kernel_features
;
73 #define KERNEL_ALLOWS_SOL_OFFSET_WRITES (1<<0)
74 #define KERNEL_ALLOWS_PREDICATE_WRITES (1<<1)
75 #define KERNEL_ALLOWS_MI_MATH_AND_LRR (1<<2)
76 #define KERNEL_ALLOWS_HSW_SCRATCH1_AND_ROW_CHICKEN3 (1<<3)
77 #define KERNEL_ALLOWS_COMPUTE_DISPATCH (1<<4)
78 #define KERNEL_ALLOWS_EXEC_CAPTURE (1<<5)
80 struct brw_bufmgr
*bufmgr
;
83 * A unique ID for shader programs.
87 int winsys_msaa_samples_override
;
89 struct brw_compiler
*compiler
;
92 * Configuration cache with default values for all contexts
94 driOptionCache optionCache
;
97 * Version of the command parser reported by the
98 * I915_PARAM_CMD_PARSER_VERSION parameter
100 int cmd_parser_version
;
103 * Number of subslices reported by the I915_PARAM_SUBSLICE_TOTAL parameter
108 * Number of EUs reported by the I915_PARAM_EU_TOTAL parameter
112 bool mesa_format_supports_texture
[MESA_FORMAT_COUNT
];
113 bool mesa_format_supports_render
[MESA_FORMAT_COUNT
];
114 enum isl_format mesa_to_isl_render_format
[MESA_FORMAT_COUNT
];
117 extern void intelDestroyContext(__DRIcontext
* driContextPriv
);
119 extern GLboolean
intelUnbindContext(__DRIcontext
* driContextPriv
);
121 PUBLIC
const __DRIextension
**__driDriverGetExtensions_i965(void);
122 extern const __DRI2fenceExtension intelFenceExtension
;
125 intelMakeCurrent(__DRIcontext
* driContextPriv
,
126 __DRIdrawable
* driDrawPriv
,
127 __DRIdrawable
* driReadPriv
);
129 double get_time(void);
132 intel_supported_msaa_modes(const struct intel_screen
*screen
);
135 can_do_pipelined_register_writes(const struct intel_screen
*screen
)
137 return screen
->kernel_features
& KERNEL_ALLOWS_SOL_OFFSET_WRITES
;
141 can_do_hsw_l3_atomics(const struct intel_screen
*screen
)
143 return screen
->kernel_features
& KERNEL_ALLOWS_HSW_SCRATCH1_AND_ROW_CHICKEN3
;
147 can_do_mi_math_and_lrr(const struct intel_screen
*screen
)
149 return screen
->kernel_features
& KERNEL_ALLOWS_MI_MATH_AND_LRR
;
153 can_do_compute_dispatch(const struct intel_screen
*screen
)
155 return screen
->kernel_features
& KERNEL_ALLOWS_COMPUTE_DISPATCH
;
159 can_do_predicate_writes(const struct intel_screen
*screen
)
161 return screen
->kernel_features
& KERNEL_ALLOWS_PREDICATE_WRITES
;
165 can_do_exec_capture(const struct intel_screen
*screen
)
167 return screen
->kernel_features
& KERNEL_ALLOWS_EXEC_CAPTURE
;