Brian | aa59a93 | 2008-02-26 20:15:14 -0700 | [diff] [blame] | 1 | /************************************************************************** |
| 2 | * |
José Fonseca | 8771285 | 2014-01-17 16:27:50 +0000 | [diff] [blame] | 3 | * Copyright 2008 VMware, Inc. |
Brian | aa59a93 | 2008-02-26 20:15:14 -0700 | [diff] [blame] | 4 | * All Rights Reserved. |
| 5 | * |
| 6 | * Permission is hereby granted, free of charge, to any person obtaining a |
| 7 | * copy of this software and associated documentation files (the |
| 8 | * "Software"), to deal in the Software without restriction, including |
| 9 | * without limitation the rights to use, copy, modify, merge, publish, |
| 10 | * distribute, sub license, and/or sell copies of the Software, and to |
| 11 | * permit persons to whom the Software is furnished to do so, subject to |
| 12 | * the following conditions: |
| 13 | * |
| 14 | * The above copyright notice and this permission notice (including the |
| 15 | * next paragraph) shall be included in all copies or substantial portions |
| 16 | * of the Software. |
| 17 | * |
| 18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
| 19 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 20 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. |
José Fonseca | 8771285 | 2014-01-17 16:27:50 +0000 | [diff] [blame] | 21 | * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR |
Brian | aa59a93 | 2008-02-26 20:15:14 -0700 | [diff] [blame] | 22 | * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
| 23 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
| 24 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 25 | * |
| 26 | **************************************************************************/ |
| 27 | |
| 28 | |
Vinson Lee | d4d48c0 | 2010-09-13 23:42:35 -0700 | [diff] [blame] | 29 | #include "draw/draw_context.h" |
Marcin Slusarz | b5dfc38 | 2011-04-16 22:15:52 +0200 | [diff] [blame] | 30 | #include "util/u_format.h" |
Christopher Egert | 608a4a1 | 2011-04-29 02:13:35 +0200 | [diff] [blame] | 31 | #include "util/u_format_s3tc.h" |
José Fonseca | 2848688 | 2010-02-02 14:42:17 +0000 | [diff] [blame] | 32 | #include "util/u_inlines.h" |
Jakob Bornecrantz | d211006 | 2009-08-30 20:49:01 +0100 | [diff] [blame] | 33 | #include "util/u_memory.h" |
José Fonseca | 5b8fa51 | 2008-04-14 23:55:36 +0900 | [diff] [blame] | 34 | #include "util/u_string.h" |
Brian | aa59a93 | 2008-02-26 20:15:14 -0700 | [diff] [blame] | 35 | |
| 36 | #include "i915_reg.h" |
Jakob Bornecrantz | abbb1bd | 2010-06-12 14:09:59 +0200 | [diff] [blame] | 37 | #include "i915_debug.h" |
José Fonseca | f81b7a6 | 2008-02-27 15:59:09 +0900 | [diff] [blame] | 38 | #include "i915_context.h" |
Brian | aa59a93 | 2008-02-26 20:15:14 -0700 | [diff] [blame] | 39 | #include "i915_screen.h" |
Keith Whitwell | 287c94e | 2010-04-10 16:05:54 +0100 | [diff] [blame] | 40 | #include "i915_resource.h" |
Jakob Bornecrantz | bc88c95 | 2010-03-25 19:19:00 +0100 | [diff] [blame] | 41 | #include "i915_winsys.h" |
Jakob Bornecrantz | c701587 | 2010-06-01 04:38:24 +0100 | [diff] [blame] | 42 | #include "i915_public.h" |
Jakob Bornecrantz | d211006 | 2009-08-30 20:49:01 +0100 | [diff] [blame] | 43 | |
| 44 | |
| 45 | /* |
| 46 | * Probe functions |
| 47 | */ |
Brian | aa59a93 | 2008-02-26 20:15:14 -0700 | [diff] [blame] | 48 | |
| 49 | |
| 50 | static const char * |
Jakob Bornecrantz | 1bb3a2c | 2009-08-30 21:10:36 +0100 | [diff] [blame] | 51 | i915_get_vendor(struct pipe_screen *screen) |
Brian | aa59a93 | 2008-02-26 20:15:14 -0700 | [diff] [blame] | 52 | { |
José Fonseca | a1e528a | 2014-01-20 14:15:04 +0000 | [diff] [blame] | 53 | return "Mesa Project"; |
Brian | aa59a93 | 2008-02-26 20:15:14 -0700 | [diff] [blame] | 54 | } |
| 55 | |
Brian | aa59a93 | 2008-02-26 20:15:14 -0700 | [diff] [blame] | 56 | static const char * |
Jakob Bornecrantz | 1bb3a2c | 2009-08-30 21:10:36 +0100 | [diff] [blame] | 57 | i915_get_name(struct pipe_screen *screen) |
Brian | aa59a93 | 2008-02-26 20:15:14 -0700 | [diff] [blame] | 58 | { |
| 59 | static char buffer[128]; |
| 60 | const char *chipset; |
| 61 | |
Jakob Bornecrantz | 835f5a6 | 2010-05-29 13:29:44 +0200 | [diff] [blame] | 62 | switch (i915_screen(screen)->iws->pci_id) { |
Brian | aa59a93 | 2008-02-26 20:15:14 -0700 | [diff] [blame] | 63 | case PCI_CHIP_I915_G: |
| 64 | chipset = "915G"; |
| 65 | break; |
| 66 | case PCI_CHIP_I915_GM: |
| 67 | chipset = "915GM"; |
| 68 | break; |
| 69 | case PCI_CHIP_I945_G: |
| 70 | chipset = "945G"; |
| 71 | break; |
| 72 | case PCI_CHIP_I945_GM: |
| 73 | chipset = "945GM"; |
| 74 | break; |
| 75 | case PCI_CHIP_I945_GME: |
| 76 | chipset = "945GME"; |
| 77 | break; |
| 78 | case PCI_CHIP_G33_G: |
| 79 | chipset = "G33"; |
| 80 | break; |
| 81 | case PCI_CHIP_Q35_G: |
| 82 | chipset = "Q35"; |
| 83 | break; |
| 84 | case PCI_CHIP_Q33_G: |
| 85 | chipset = "Q33"; |
| 86 | break; |
Daniel Vetter | 8624fe7 | 2010-11-19 23:38:20 +0100 | [diff] [blame] | 87 | case PCI_CHIP_PINEVIEW_G: |
| 88 | chipset = "Pineview G"; |
| 89 | break; |
| 90 | case PCI_CHIP_PINEVIEW_M: |
| 91 | chipset = "Pineview M"; |
| 92 | break; |
Brian | aa59a93 | 2008-02-26 20:15:14 -0700 | [diff] [blame] | 93 | default: |
| 94 | chipset = "unknown"; |
| 95 | break; |
| 96 | } |
| 97 | |
José Fonseca | 5b8fa51 | 2008-04-14 23:55:36 +0900 | [diff] [blame] | 98 | util_snprintf(buffer, sizeof(buffer), "i915 (chipset: %s)", chipset); |
Brian | aa59a93 | 2008-02-26 20:15:14 -0700 | [diff] [blame] | 99 | return buffer; |
| 100 | } |
| 101 | |
Brian | 17188e4 | 2008-02-27 10:15:37 -0700 | [diff] [blame] | 102 | static int |
Jakob Bornecrantz | e3c9bf1 | 2011-02-20 11:45:48 +0100 | [diff] [blame] | 103 | i915_get_shader_param(struct pipe_screen *screen, unsigned shader, enum pipe_shader_cap cap) |
Luca Barbieri | a508d2d | 2010-09-05 20:50:50 +0200 | [diff] [blame] | 104 | { |
| 105 | switch(shader) { |
| 106 | case PIPE_SHADER_VERTEX: |
Marek Olšák | f5bfe54 | 2011-09-27 22:22:06 +0200 | [diff] [blame] | 107 | switch (cap) { |
| 108 | case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS: |
Roland Scheidegger | 2983c03 | 2013-11-26 02:30:41 +0100 | [diff] [blame] | 109 | case PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS: |
Stéphane Marchesin | 8a22064 | 2011-10-08 23:54:53 -0700 | [diff] [blame] | 110 | if (debug_get_bool_option("DRAW_USE_LLVM", TRUE)) |
Brian Paul | cab2fed | 2012-08-09 20:59:44 -0600 | [diff] [blame] | 111 | return PIPE_MAX_SAMPLERS; |
Stéphane Marchesin | 8a22064 | 2011-10-08 23:54:53 -0700 | [diff] [blame] | 112 | else |
| 113 | return 0; |
Stéphane Marchesin | 45fc069 | 2012-06-25 19:45:56 -0700 | [diff] [blame] | 114 | default: |
Marek Olšák | f5bfe54 | 2011-09-27 22:22:06 +0200 | [diff] [blame] | 115 | return draw_get_shader_param(shader, cap); |
| 116 | } |
Luca Barbieri | a508d2d | 2010-09-05 20:50:50 +0200 | [diff] [blame] | 117 | case PIPE_SHADER_FRAGMENT: |
Stéphane Marchesin | 642d11d | 2011-12-08 19:22:13 -0800 | [diff] [blame] | 118 | /* XXX: some of these are just shader model 2.0 values, fix this! */ |
Stéphane Marchesin | cd41960 | 2011-10-08 17:12:37 -0700 | [diff] [blame] | 119 | switch(cap) { |
Luca Barbieri | a508d2d | 2010-09-05 20:50:50 +0200 | [diff] [blame] | 120 | case PIPE_SHADER_CAP_MAX_INSTRUCTIONS: |
Stéphane Marchesin | 0b3842e | 2011-10-17 21:43:19 -0700 | [diff] [blame] | 121 | return I915_MAX_ALU_INSN + I915_MAX_TEX_INSN; |
Luca Barbieri | a508d2d | 2010-09-05 20:50:50 +0200 | [diff] [blame] | 122 | case PIPE_SHADER_CAP_MAX_ALU_INSTRUCTIONS: |
Stéphane Marchesin | 0b3842e | 2011-10-17 21:43:19 -0700 | [diff] [blame] | 123 | return I915_MAX_ALU_INSN; |
Luca Barbieri | a508d2d | 2010-09-05 20:50:50 +0200 | [diff] [blame] | 124 | case PIPE_SHADER_CAP_MAX_TEX_INSTRUCTIONS: |
Stéphane Marchesin | 0b3842e | 2011-10-17 21:43:19 -0700 | [diff] [blame] | 125 | return I915_MAX_TEX_INSN; |
Luca Barbieri | a508d2d | 2010-09-05 20:50:50 +0200 | [diff] [blame] | 126 | case PIPE_SHADER_CAP_MAX_TEX_INDIRECTIONS: |
| 127 | return 8; |
| 128 | case PIPE_SHADER_CAP_MAX_CONTROL_FLOW_DEPTH: |
| 129 | return 0; |
| 130 | case PIPE_SHADER_CAP_MAX_INPUTS: |
| 131 | return 10; |
| 132 | case PIPE_SHADER_CAP_MAX_CONSTS: |
| 133 | return 32; |
| 134 | case PIPE_SHADER_CAP_MAX_CONST_BUFFERS: |
| 135 | return 1; |
| 136 | case PIPE_SHADER_CAP_MAX_TEMPS: |
| 137 | return 12; /* XXX: 12 -> 32 ? */ |
| 138 | case PIPE_SHADER_CAP_MAX_ADDRS: |
| 139 | return 0; |
| 140 | case PIPE_SHADER_CAP_MAX_PREDS: |
| 141 | return 0; |
| 142 | case PIPE_SHADER_CAP_TGSI_CONT_SUPPORTED: |
Brian Paul | 13f3ae5 | 2013-02-01 11:16:54 -0700 | [diff] [blame] | 143 | case PIPE_SHADER_CAP_TGSI_SQRT_SUPPORTED: |
Luca Barbieri | a508d2d | 2010-09-05 20:50:50 +0200 | [diff] [blame] | 144 | return 0; |
Marek Olšák | 5bf7d66 | 2010-11-12 03:03:43 +0100 | [diff] [blame] | 145 | case PIPE_SHADER_CAP_INDIRECT_INPUT_ADDR: |
| 146 | case PIPE_SHADER_CAP_INDIRECT_OUTPUT_ADDR: |
| 147 | case PIPE_SHADER_CAP_INDIRECT_TEMP_ADDR: |
| 148 | case PIPE_SHADER_CAP_INDIRECT_CONST_ADDR: |
| 149 | return 1; |
Marek Olšák | 9aa089e | 2010-11-14 15:34:59 +0100 | [diff] [blame] | 150 | case PIPE_SHADER_CAP_SUBROUTINES: |
| 151 | return 0; |
Bryan Cain | 17b695e | 2011-05-05 21:10:28 -0500 | [diff] [blame] | 152 | case PIPE_SHADER_CAP_INTEGERS: |
| 153 | return 0; |
Marek Olšák | f5bfe54 | 2011-09-27 22:22:06 +0200 | [diff] [blame] | 154 | case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS: |
Roland Scheidegger | 2983c03 | 2013-11-26 02:30:41 +0100 | [diff] [blame] | 155 | case PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS: |
Stéphane Marchesin | 0b3842e | 2011-10-17 21:43:19 -0700 | [diff] [blame] | 156 | return I915_TEX_UNITS; |
Luca Barbieri | a508d2d | 2010-09-05 20:50:50 +0200 | [diff] [blame] | 157 | default: |
Vinson Lee | ac85ab0 | 2011-05-12 23:21:36 -0700 | [diff] [blame] | 158 | debug_printf("%s: Unknown cap %u.\n", __FUNCTION__, cap); |
Vinson Lee | 706380c | 2010-09-13 23:58:42 -0700 | [diff] [blame] | 159 | return 0; |
Stéphane Marchesin | cd41960 | 2011-10-08 17:12:37 -0700 | [diff] [blame] | 160 | } |
Stéphane Marchesin | 8a22064 | 2011-10-08 23:54:53 -0700 | [diff] [blame] | 161 | break; |
Stéphane Marchesin | cd41960 | 2011-10-08 17:12:37 -0700 | [diff] [blame] | 162 | default: |
| 163 | return 0; |
Luca Barbieri | a508d2d | 2010-09-05 20:50:50 +0200 | [diff] [blame] | 164 | } |
Stéphane Marchesin | cd41960 | 2011-10-08 17:12:37 -0700 | [diff] [blame] | 165 | |
Luca Barbieri | a508d2d | 2010-09-05 20:50:50 +0200 | [diff] [blame] | 166 | } |
| 167 | |
Stéphane Marchesin | 8a22064 | 2011-10-08 23:54:53 -0700 | [diff] [blame] | 168 | static int |
| 169 | i915_get_param(struct pipe_screen *screen, enum pipe_cap cap) |
| 170 | { |
| 171 | struct i915_screen *is = i915_screen(screen); |
| 172 | |
| 173 | switch (cap) { |
| 174 | /* Supported features (boolean caps). */ |
| 175 | case PIPE_CAP_ANISOTROPIC_FILTER: |
Stéphane Marchesin | 8a22064 | 2011-10-08 23:54:53 -0700 | [diff] [blame] | 176 | case PIPE_CAP_NPOT_TEXTURES: |
Ilia Mirkin | 12d39b4 | 2013-10-04 04:32:15 -0400 | [diff] [blame] | 177 | case PIPE_CAP_MIXED_FRAMEBUFFER_SIZES: |
Stéphane Marchesin | 8a22064 | 2011-10-08 23:54:53 -0700 | [diff] [blame] | 178 | case PIPE_CAP_POINT_SPRITE: |
| 179 | case PIPE_CAP_PRIMITIVE_RESTART: /* draw module */ |
| 180 | case PIPE_CAP_TEXTURE_SHADOW_MAP: |
| 181 | case PIPE_CAP_TWO_SIDED_STENCIL: |
| 182 | case PIPE_CAP_VERTEX_ELEMENT_INSTANCE_DIVISOR: |
| 183 | case PIPE_CAP_BLEND_EQUATION_SEPARATE: |
Stéphane Marchesin | 9977fb4 | 2011-10-09 17:14:16 -0700 | [diff] [blame] | 184 | case PIPE_CAP_TGSI_INSTANCEID: |
Marek Olšák | bc1c836 | 2012-01-23 03:11:17 +0100 | [diff] [blame] | 185 | case PIPE_CAP_VERTEX_COLOR_CLAMPED: |
Marek Olšák | 978c1aa1 | 2012-04-11 15:40:00 +0200 | [diff] [blame] | 186 | case PIPE_CAP_USER_VERTEX_BUFFERS: |
Marek Olšák | 437ab1d | 2012-04-24 15:19:31 +0200 | [diff] [blame] | 187 | case PIPE_CAP_USER_INDEX_BUFFERS: |
| 188 | case PIPE_CAP_USER_CONSTANT_BUFFERS: |
Stéphane Marchesin | 8a22064 | 2011-10-08 23:54:53 -0700 | [diff] [blame] | 189 | return 1; |
| 190 | |
| 191 | /* Unsupported features (boolean caps). */ |
| 192 | case PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS: |
Marek Olšák | dc4c821 | 2012-01-10 00:19:00 +0100 | [diff] [blame] | 193 | case PIPE_CAP_DEPTH_CLIP_DISABLE: |
Stéphane Marchesin | 8a22064 | 2011-10-08 23:54:53 -0700 | [diff] [blame] | 194 | case PIPE_CAP_INDEP_BLEND_ENABLE: |
| 195 | case PIPE_CAP_INDEP_BLEND_FUNC: |
Stéphane Marchesin | 8a22064 | 2011-10-08 23:54:53 -0700 | [diff] [blame] | 196 | case PIPE_CAP_SHADER_STENCIL_EXPORT: |
| 197 | case PIPE_CAP_TEXTURE_MIRROR_CLAMP: |
| 198 | case PIPE_CAP_TEXTURE_SWIZZLE: |
José Fonseca | 9976216 | 2012-12-09 09:50:34 +0000 | [diff] [blame] | 199 | case PIPE_CAP_QUERY_TIME_ELAPSED: |
Stéphane Marchesin | 8a22064 | 2011-10-08 23:54:53 -0700 | [diff] [blame] | 200 | case PIPE_CAP_SM3: |
| 201 | case PIPE_CAP_SEAMLESS_CUBE_MAP: |
| 202 | case PIPE_CAP_SEAMLESS_CUBE_MAP_PER_TEXTURE: |
Marek Olšák | bc1c836 | 2012-01-23 03:11:17 +0100 | [diff] [blame] | 203 | case PIPE_CAP_FRAGMENT_COLOR_CLAMPED: |
Stéphane Marchesin | 8a22064 | 2011-10-08 23:54:53 -0700 | [diff] [blame] | 204 | case PIPE_CAP_MIXED_COLORBUFFER_FORMATS: |
| 205 | case PIPE_CAP_CONDITIONAL_RENDER: |
| 206 | case PIPE_CAP_TEXTURE_BARRIER: |
Stéphane Marchesin | 3c01aef | 2011-12-15 11:10:32 -0800 | [diff] [blame] | 207 | case PIPE_CAP_TGSI_CAN_COMPACT_CONSTANTS: |
Marek Olšák | bc1c836 | 2012-01-23 03:11:17 +0100 | [diff] [blame] | 208 | case PIPE_CAP_VERTEX_COLOR_UNCLAMPED: |
Christoph Bumiller | 8b4f7b0 | 2012-02-06 16:29:03 +0100 | [diff] [blame] | 209 | case PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION: |
Fredrik Höglund | af37212 | 2012-06-18 22:50:02 +0200 | [diff] [blame] | 210 | case PIPE_CAP_START_INSTANCE: |
Marek Olšák | bcc735a | 2012-07-05 20:04:02 +0200 | [diff] [blame] | 211 | case PIPE_CAP_QUERY_TIMESTAMP: |
Christoph Bumiller | f35e96d | 2013-03-29 13:02:49 +0100 | [diff] [blame] | 212 | case PIPE_CAP_QUERY_PIPELINE_STATISTICS: |
Marek Olšák | b9c9dd4 | 2012-09-11 22:41:20 +0200 | [diff] [blame] | 213 | case PIPE_CAP_TEXTURE_MULTISAMPLE: |
Christoph Bumiller | 729abfd | 2013-04-12 13:42:01 +0200 | [diff] [blame] | 214 | case PIPE_CAP_TEXTURE_BORDER_COLOR_QUIRK: |
Stéphane Marchesin | 023a50d | 2014-01-28 18:28:56 -0800 | [diff] [blame] | 215 | case PIPE_CAP_CUBE_MAP_ARRAY: |
| 216 | case PIPE_CAP_TEXTURE_BUFFER_OBJECTS: |
| 217 | case PIPE_CAP_TGSI_TEXCOORD: |
| 218 | case PIPE_CAP_PREFER_BLIT_BASED_TEXTURE_TRANSFER: |
Dave Airlie | 2fcbec4 | 2013-09-21 18:45:43 +1000 | [diff] [blame] | 219 | case PIPE_CAP_MAX_TEXTURE_GATHER_COMPONENTS: |
| 220 | case PIPE_CAP_TEXTURE_GATHER_SM5: |
Dave Airlie | 76ba50a | 2013-11-27 19:47:51 +1000 | [diff] [blame^] | 221 | case PIPE_CAP_FAKE_SW_MSAA: |
Stéphane Marchesin | 8a22064 | 2011-10-08 23:54:53 -0700 | [diff] [blame] | 222 | return 0; |
Stéphane Marchesin | 023a50d | 2014-01-28 18:28:56 -0800 | [diff] [blame] | 223 | |
Stéphane Marchesin | 7f7c7fd | 2012-11-11 02:10:29 -0800 | [diff] [blame] | 224 | case PIPE_CAP_MAX_DUAL_SOURCE_RENDER_TARGETS: |
| 225 | case PIPE_CAP_STREAM_OUTPUT_PAUSE_RESUME: |
| 226 | case PIPE_CAP_VERTEX_BUFFER_OFFSET_4BYTE_ALIGNED_ONLY: |
| 227 | case PIPE_CAP_VERTEX_BUFFER_STRIDE_4BYTE_ALIGNED_ONLY: |
| 228 | case PIPE_CAP_VERTEX_ELEMENT_SRC_OFFSET_4BYTE_ALIGNED_ONLY: |
Marek Olšák | 1a02bb7 | 2013-11-21 15:25:55 +0100 | [diff] [blame] | 229 | case PIPE_CAP_TGSI_VS_LAYER: |
Marek Olšák | db8886e | 2014-01-27 21:57:42 +0100 | [diff] [blame] | 230 | case PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT: |
Stéphane Marchesin | 023a50d | 2014-01-28 18:28:56 -0800 | [diff] [blame] | 231 | return 0; |
Stéphane Marchesin | 7f7c7fd | 2012-11-11 02:10:29 -0800 | [diff] [blame] | 232 | |
Siavash Eliasi | d273fe7 | 2013-12-03 08:23:06 +0330 | [diff] [blame] | 233 | case PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT: |
| 234 | return 64; |
| 235 | |
Stéphane Marchesin | 7f7c7fd | 2012-11-11 02:10:29 -0800 | [diff] [blame] | 236 | case PIPE_CAP_GLSL_FEATURE_LEVEL: |
| 237 | return 120; |
Stéphane Marchesin | 8a22064 | 2011-10-08 23:54:53 -0700 | [diff] [blame] | 238 | |
Marek Olšák | 1b749dc | 2012-04-24 17:31:17 +0200 | [diff] [blame] | 239 | case PIPE_CAP_CONSTANT_BUFFER_OFFSET_ALIGNMENT: |
| 240 | return 16; |
| 241 | |
Stéphane Marchesin | 8a22064 | 2011-10-08 23:54:53 -0700 | [diff] [blame] | 242 | /* Features we can lie about (boolean caps). */ |
Stéphane Marchesin | 8a22064 | 2011-10-08 23:54:53 -0700 | [diff] [blame] | 243 | case PIPE_CAP_OCCLUSION_QUERY: |
| 244 | return is->debug.lie ? 1 : 0; |
| 245 | |
| 246 | /* Texturing. */ |
Stéphane Marchesin | 8a22064 | 2011-10-08 23:54:53 -0700 | [diff] [blame] | 247 | case PIPE_CAP_MAX_TEXTURE_2D_LEVELS: |
| 248 | return I915_MAX_TEXTURE_2D_LEVELS; |
| 249 | case PIPE_CAP_MAX_TEXTURE_3D_LEVELS: |
| 250 | return I915_MAX_TEXTURE_3D_LEVELS; |
| 251 | case PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS: |
| 252 | return I915_MAX_TEXTURE_2D_LEVELS; |
| 253 | case PIPE_CAP_MIN_TEXEL_OFFSET: |
| 254 | case PIPE_CAP_MAX_TEXEL_OFFSET: |
Stéphane Marchesin | 67e6a40 | 2011-12-15 12:55:18 -0800 | [diff] [blame] | 255 | case PIPE_CAP_MAX_STREAM_OUTPUT_BUFFERS: |
| 256 | case PIPE_CAP_MAX_STREAM_OUTPUT_SEPARATE_COMPONENTS: |
| 257 | case PIPE_CAP_MAX_STREAM_OUTPUT_INTERLEAVED_COMPONENTS: |
Stéphane Marchesin | 8a22064 | 2011-10-08 23:54:53 -0700 | [diff] [blame] | 258 | return 0; |
| 259 | |
| 260 | /* Render targets. */ |
| 261 | case PIPE_CAP_MAX_RENDER_TARGETS: |
| 262 | return 1; |
| 263 | |
Grigori Goronzy | d34d5fd | 2014-02-09 22:56:20 +0100 | [diff] [blame] | 264 | /* Geometry shader output, unsupported. */ |
| 265 | case PIPE_CAP_MAX_GEOMETRY_OUTPUT_VERTICES: |
| 266 | case PIPE_CAP_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS: |
| 267 | return 0; |
| 268 | |
Stéphane Marchesin | 8a22064 | 2011-10-08 23:54:53 -0700 | [diff] [blame] | 269 | /* Fragment coordinate conventions. */ |
| 270 | case PIPE_CAP_TGSI_FS_COORD_ORIGIN_UPPER_LEFT: |
| 271 | case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_HALF_INTEGER: |
| 272 | return 1; |
| 273 | case PIPE_CAP_TGSI_FS_COORD_ORIGIN_LOWER_LEFT: |
| 274 | case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER: |
| 275 | return 0; |
Tom Stellard | 4e90bc9 | 2013-07-09 21:21:39 -0700 | [diff] [blame] | 276 | case PIPE_CAP_ENDIANNESS: |
| 277 | return PIPE_ENDIAN_LITTLE; |
Stéphane Marchesin | 8a22064 | 2011-10-08 23:54:53 -0700 | [diff] [blame] | 278 | |
| 279 | default: |
| 280 | debug_printf("%s: Unknown cap %u.\n", __FUNCTION__, cap); |
| 281 | return 0; |
| 282 | } |
| 283 | } |
| 284 | |
Brian | 17188e4 | 2008-02-27 10:15:37 -0700 | [diff] [blame] | 285 | static float |
Marek Olšák | bb71f92 | 2011-11-19 22:38:22 +0100 | [diff] [blame] | 286 | i915_get_paramf(struct pipe_screen *screen, enum pipe_capf cap) |
Brian | 17188e4 | 2008-02-27 10:15:37 -0700 | [diff] [blame] | 287 | { |
Jakob Bornecrantz | e3c9bf1 | 2011-02-20 11:45:48 +0100 | [diff] [blame] | 288 | switch(cap) { |
Marek Olšák | bb71f92 | 2011-11-19 22:38:22 +0100 | [diff] [blame] | 289 | case PIPE_CAPF_MAX_LINE_WIDTH: |
Brian | 17188e4 | 2008-02-27 10:15:37 -0700 | [diff] [blame] | 290 | /* fall-through */ |
Marek Olšák | bb71f92 | 2011-11-19 22:38:22 +0100 | [diff] [blame] | 291 | case PIPE_CAPF_MAX_LINE_WIDTH_AA: |
Brian | 17188e4 | 2008-02-27 10:15:37 -0700 | [diff] [blame] | 292 | return 7.5; |
| 293 | |
Marek Olšák | bb71f92 | 2011-11-19 22:38:22 +0100 | [diff] [blame] | 294 | case PIPE_CAPF_MAX_POINT_WIDTH: |
Brian | 17188e4 | 2008-02-27 10:15:37 -0700 | [diff] [blame] | 295 | /* fall-through */ |
Marek Olšák | bb71f92 | 2011-11-19 22:38:22 +0100 | [diff] [blame] | 296 | case PIPE_CAPF_MAX_POINT_WIDTH_AA: |
Brian | 17188e4 | 2008-02-27 10:15:37 -0700 | [diff] [blame] | 297 | return 255.0; |
| 298 | |
Marek Olšák | bb71f92 | 2011-11-19 22:38:22 +0100 | [diff] [blame] | 299 | case PIPE_CAPF_MAX_TEXTURE_ANISOTROPY: |
Brian | 17188e4 | 2008-02-27 10:15:37 -0700 | [diff] [blame] | 300 | return 4.0; |
| 301 | |
Marek Olšák | bb71f92 | 2011-11-19 22:38:22 +0100 | [diff] [blame] | 302 | case PIPE_CAPF_MAX_TEXTURE_LOD_BIAS: |
Brian | 17188e4 | 2008-02-27 10:15:37 -0700 | [diff] [blame] | 303 | return 16.0; |
| 304 | |
| 305 | default: |
Vinson Lee | ac85ab0 | 2011-05-12 23:21:36 -0700 | [diff] [blame] | 306 | debug_printf("%s: Unknown cap %u.\n", __FUNCTION__, cap); |
Brian | 17188e4 | 2008-02-27 10:15:37 -0700 | [diff] [blame] | 307 | return 0; |
| 308 | } |
| 309 | } |
| 310 | |
Stéphane Marchesin | 1a69b50 | 2011-06-24 16:18:58 -0700 | [diff] [blame] | 311 | boolean |
Jakob Bornecrantz | 1bb3a2c | 2009-08-30 21:10:36 +0100 | [diff] [blame] | 312 | i915_is_format_supported(struct pipe_screen *screen, |
Roland Scheidegger | bccf31b | 2010-05-17 21:24:04 +0200 | [diff] [blame] | 313 | enum pipe_format format, |
Jakob Bornecrantz | 1bb3a2c | 2009-08-30 21:10:36 +0100 | [diff] [blame] | 314 | enum pipe_texture_target target, |
Roland Scheidegger | bccf31b | 2010-05-17 21:24:04 +0200 | [diff] [blame] | 315 | unsigned sample_count, |
Marek Olšák | e968975 | 2011-03-08 00:01:58 +0100 | [diff] [blame] | 316 | unsigned tex_usage) |
Brian | 364f8ca | 2008-02-27 13:58:06 -0700 | [diff] [blame] | 317 | { |
| 318 | static const enum pipe_format tex_supported[] = { |
José Fonseca | b2b1e89 | 2010-03-01 18:12:19 +0000 | [diff] [blame] | 319 | PIPE_FORMAT_B8G8R8A8_UNORM, |
Stéphane Marchesin | 45fc069 | 2012-06-25 19:45:56 -0700 | [diff] [blame] | 320 | PIPE_FORMAT_B8G8R8A8_SRGB, |
Jakob Bornecrantz | b4b4ac6 | 2010-03-25 00:41:21 +0100 | [diff] [blame] | 321 | PIPE_FORMAT_B8G8R8X8_UNORM, |
Stéphane Marchesin | 465183c | 2011-06-22 16:23:02 -0700 | [diff] [blame] | 322 | PIPE_FORMAT_R8G8B8A8_UNORM, |
| 323 | PIPE_FORMAT_R8G8B8X8_UNORM, |
José Fonseca | b2b1e89 | 2010-03-01 18:12:19 +0000 | [diff] [blame] | 324 | PIPE_FORMAT_B5G6R5_UNORM, |
Stéphane Marchesin | 2e481e5 | 2011-06-28 01:41:57 -0700 | [diff] [blame] | 325 | PIPE_FORMAT_B10G10R10A2_UNORM, |
Brian Paul | 54f94a7 | 2008-04-30 16:50:17 -0600 | [diff] [blame] | 326 | PIPE_FORMAT_L8_UNORM, |
| 327 | PIPE_FORMAT_A8_UNORM, |
| 328 | PIPE_FORMAT_I8_UNORM, |
José Fonseca | b2b1e89 | 2010-03-01 18:12:19 +0000 | [diff] [blame] | 329 | PIPE_FORMAT_L8A8_UNORM, |
| 330 | PIPE_FORMAT_UYVY, |
| 331 | PIPE_FORMAT_YUYV, |
Roland Scheidegger | 4bc7b14 | 2010-05-29 01:28:21 +0200 | [diff] [blame] | 332 | /* XXX why not? |
| 333 | PIPE_FORMAT_Z16_UNORM, */ |
Christopher Egert | 608a4a1 | 2011-04-29 02:13:35 +0200 | [diff] [blame] | 334 | PIPE_FORMAT_DXT1_RGB, |
| 335 | PIPE_FORMAT_DXT1_RGBA, |
| 336 | PIPE_FORMAT_DXT3_RGBA, |
| 337 | PIPE_FORMAT_DXT5_RGBA, |
Roland Scheidegger | 4bc7b14 | 2010-05-29 01:28:21 +0200 | [diff] [blame] | 338 | PIPE_FORMAT_Z24X8_UNORM, |
Dave Airlie | 866f9b1 | 2011-09-11 09:45:10 +0100 | [diff] [blame] | 339 | PIPE_FORMAT_Z24_UNORM_S8_UINT, |
Brian | 364f8ca | 2008-02-27 13:58:06 -0700 | [diff] [blame] | 340 | PIPE_FORMAT_NONE /* list terminator */ |
| 341 | }; |
Roland Scheidegger | bccf31b | 2010-05-17 21:24:04 +0200 | [diff] [blame] | 342 | static const enum pipe_format render_supported[] = { |
José Fonseca | b2b1e89 | 2010-03-01 18:12:19 +0000 | [diff] [blame] | 343 | PIPE_FORMAT_B8G8R8A8_UNORM, |
Vasily Khoruzhick | 1f3c5ea | 2011-11-22 19:04:04 +0300 | [diff] [blame] | 344 | PIPE_FORMAT_B8G8R8X8_UNORM, |
Stéphane Marchesin | 465183c | 2011-06-22 16:23:02 -0700 | [diff] [blame] | 345 | PIPE_FORMAT_R8G8B8A8_UNORM, |
Vasily Khoruzhick | 1f3c5ea | 2011-11-22 19:04:04 +0300 | [diff] [blame] | 346 | PIPE_FORMAT_R8G8B8X8_UNORM, |
José Fonseca | b2b1e89 | 2010-03-01 18:12:19 +0000 | [diff] [blame] | 347 | PIPE_FORMAT_B5G6R5_UNORM, |
Stéphane Marchesin | 2e481e5 | 2011-06-28 01:41:57 -0700 | [diff] [blame] | 348 | PIPE_FORMAT_B10G10R10A2_UNORM, |
Stéphane Marchesin | 465183c | 2011-06-22 16:23:02 -0700 | [diff] [blame] | 349 | PIPE_FORMAT_L8_UNORM, |
| 350 | PIPE_FORMAT_A8_UNORM, |
| 351 | PIPE_FORMAT_I8_UNORM, |
Roland Scheidegger | bccf31b | 2010-05-17 21:24:04 +0200 | [diff] [blame] | 352 | PIPE_FORMAT_NONE /* list terminator */ |
| 353 | }; |
| 354 | static const enum pipe_format depth_supported[] = { |
Roland Scheidegger | 4bc7b14 | 2010-05-29 01:28:21 +0200 | [diff] [blame] | 355 | /* XXX why not? |
| 356 | PIPE_FORMAT_Z16_UNORM, */ |
| 357 | PIPE_FORMAT_Z24X8_UNORM, |
Dave Airlie | 866f9b1 | 2011-09-11 09:45:10 +0100 | [diff] [blame] | 358 | PIPE_FORMAT_Z24_UNORM_S8_UINT, |
Brian | 364f8ca | 2008-02-27 13:58:06 -0700 | [diff] [blame] | 359 | PIPE_FORMAT_NONE /* list terminator */ |
| 360 | }; |
| 361 | const enum pipe_format *list; |
| 362 | uint i; |
| 363 | |
Marek Olšák | 75fa5c9 | 2011-04-11 06:23:00 +0200 | [diff] [blame] | 364 | if (!util_format_is_supported(format, tex_usage)) |
| 365 | return FALSE; |
| 366 | |
Roland Scheidegger | bccf31b | 2010-05-17 21:24:04 +0200 | [diff] [blame] | 367 | if (sample_count > 1) |
| 368 | return FALSE; |
| 369 | |
| 370 | if(tex_usage & PIPE_BIND_DEPTH_STENCIL) |
| 371 | list = depth_supported; |
| 372 | else if (tex_usage & PIPE_BIND_RENDER_TARGET) |
| 373 | list = render_supported; |
Marek Olšák | 79eafc1 | 2012-04-11 15:16:09 +0200 | [diff] [blame] | 374 | else if (tex_usage & PIPE_BIND_SAMPLER_VIEW) |
José Fonseca | 8aafc03 | 2008-07-19 12:04:37 +0900 | [diff] [blame] | 375 | list = tex_supported; |
Marek Olšák | 79eafc1 | 2012-04-11 15:16:09 +0200 | [diff] [blame] | 376 | else |
| 377 | return TRUE; /* PIPE_BIND_{VERTEX,INDEX}_BUFFER */ |
Brian | 364f8ca | 2008-02-27 13:58:06 -0700 | [diff] [blame] | 378 | |
| 379 | for (i = 0; list[i] != PIPE_FORMAT_NONE; i++) { |
| 380 | if (list[i] == format) |
| 381 | return TRUE; |
| 382 | } |
| 383 | |
| 384 | return FALSE; |
| 385 | } |
| 386 | |
Jakob Bornecrantz | d211006 | 2009-08-30 20:49:01 +0100 | [diff] [blame] | 387 | |
| 388 | /* |
| 389 | * Fence functions |
| 390 | */ |
| 391 | |
| 392 | |
| 393 | static void |
| 394 | i915_fence_reference(struct pipe_screen *screen, |
| 395 | struct pipe_fence_handle **ptr, |
| 396 | struct pipe_fence_handle *fence) |
| 397 | { |
| 398 | struct i915_screen *is = i915_screen(screen); |
| 399 | |
| 400 | is->iws->fence_reference(is->iws, ptr, fence); |
| 401 | } |
| 402 | |
Marek Olšák | bfe88e6 | 2011-03-07 22:57:54 +0100 | [diff] [blame] | 403 | static boolean |
Jakob Bornecrantz | d211006 | 2009-08-30 20:49:01 +0100 | [diff] [blame] | 404 | i915_fence_signalled(struct pipe_screen *screen, |
Marek Olšák | bfe88e6 | 2011-03-07 22:57:54 +0100 | [diff] [blame] | 405 | struct pipe_fence_handle *fence) |
Jakob Bornecrantz | d211006 | 2009-08-30 20:49:01 +0100 | [diff] [blame] | 406 | { |
| 407 | struct i915_screen *is = i915_screen(screen); |
| 408 | |
Stéphane Marchesin | 2b4afdb | 2012-01-18 19:23:48 -0800 | [diff] [blame] | 409 | return is->iws->fence_signalled(is->iws, fence) == 1; |
Jakob Bornecrantz | d211006 | 2009-08-30 20:49:01 +0100 | [diff] [blame] | 410 | } |
| 411 | |
Marek Olšák | bfe88e6 | 2011-03-07 22:57:54 +0100 | [diff] [blame] | 412 | static boolean |
Jakob Bornecrantz | d211006 | 2009-08-30 20:49:01 +0100 | [diff] [blame] | 413 | i915_fence_finish(struct pipe_screen *screen, |
| 414 | struct pipe_fence_handle *fence, |
Marek Olšák | b39bccb | 2011-03-05 21:23:54 +0100 | [diff] [blame] | 415 | uint64_t timeout) |
Jakob Bornecrantz | d211006 | 2009-08-30 20:49:01 +0100 | [diff] [blame] | 416 | { |
| 417 | struct i915_screen *is = i915_screen(screen); |
| 418 | |
Stéphane Marchesin | 2b4afdb | 2012-01-18 19:23:48 -0800 | [diff] [blame] | 419 | return is->iws->fence_finish(is->iws, fence) == 1; |
Jakob Bornecrantz | d211006 | 2009-08-30 20:49:01 +0100 | [diff] [blame] | 420 | } |
| 421 | |
| 422 | |
| 423 | /* |
| 424 | * Generic functions |
| 425 | */ |
| 426 | |
| 427 | |
Brian | aa59a93 | 2008-02-26 20:15:14 -0700 | [diff] [blame] | 428 | static void |
Jakob Bornecrantz | ec3c5ac | 2011-02-20 11:46:17 +0100 | [diff] [blame] | 429 | i915_flush_frontbuffer(struct pipe_screen *screen, |
| 430 | struct pipe_resource *resource, |
| 431 | unsigned level, unsigned layer, |
Dave Airlie | ba00f2f | 2013-11-28 11:08:11 +1000 | [diff] [blame] | 432 | void *winsys_drawable_handle, |
| 433 | struct pipe_box *sub_box) |
Jakob Bornecrantz | ec3c5ac | 2011-02-20 11:46:17 +0100 | [diff] [blame] | 434 | { |
| 435 | /* XXX: Dummy right now. */ |
| 436 | (void)screen; |
| 437 | (void)resource; |
| 438 | (void)level; |
| 439 | (void)layer; |
| 440 | (void)winsys_drawable_handle; |
Dave Airlie | ba00f2f | 2013-11-28 11:08:11 +1000 | [diff] [blame] | 441 | (void)sub_box; |
Jakob Bornecrantz | ec3c5ac | 2011-02-20 11:46:17 +0100 | [diff] [blame] | 442 | } |
| 443 | |
| 444 | static void |
Jakob Bornecrantz | 1bb3a2c | 2009-08-30 21:10:36 +0100 | [diff] [blame] | 445 | i915_destroy_screen(struct pipe_screen *screen) |
Brian | aa59a93 | 2008-02-26 20:15:14 -0700 | [diff] [blame] | 446 | { |
Jakob Bornecrantz | d211006 | 2009-08-30 20:49:01 +0100 | [diff] [blame] | 447 | struct i915_screen *is = i915_screen(screen); |
José Fonseca | 9dcb956 | 2008-08-08 12:23:21 +0100 | [diff] [blame] | 448 | |
Jakob Bornecrantz | d211006 | 2009-08-30 20:49:01 +0100 | [diff] [blame] | 449 | if (is->iws) |
| 450 | is->iws->destroy(is->iws); |
José Fonseca | 9dcb956 | 2008-08-08 12:23:21 +0100 | [diff] [blame] | 451 | |
Jakob Bornecrantz | d211006 | 2009-08-30 20:49:01 +0100 | [diff] [blame] | 452 | FREE(is); |
Brian | aa59a93 | 2008-02-26 20:15:14 -0700 | [diff] [blame] | 453 | } |
| 454 | |
Brian | aa59a93 | 2008-02-26 20:15:14 -0700 | [diff] [blame] | 455 | /** |
| 456 | * Create a new i915_screen object |
| 457 | */ |
| 458 | struct pipe_screen * |
Jakob Bornecrantz | 835f5a6 | 2010-05-29 13:29:44 +0200 | [diff] [blame] | 459 | i915_screen_create(struct i915_winsys *iws) |
Brian | aa59a93 | 2008-02-26 20:15:14 -0700 | [diff] [blame] | 460 | { |
Jakob Bornecrantz | 1bb3a2c | 2009-08-30 21:10:36 +0100 | [diff] [blame] | 461 | struct i915_screen *is = CALLOC_STRUCT(i915_screen); |
Brian | aa59a93 | 2008-02-26 20:15:14 -0700 | [diff] [blame] | 462 | |
Jakob Bornecrantz | 1bb3a2c | 2009-08-30 21:10:36 +0100 | [diff] [blame] | 463 | if (!is) |
Brian | aa59a93 | 2008-02-26 20:15:14 -0700 | [diff] [blame] | 464 | return NULL; |
| 465 | |
Jakob Bornecrantz | 835f5a6 | 2010-05-29 13:29:44 +0200 | [diff] [blame] | 466 | switch (iws->pci_id) { |
Brian | aa59a93 | 2008-02-26 20:15:14 -0700 | [diff] [blame] | 467 | case PCI_CHIP_I915_G: |
| 468 | case PCI_CHIP_I915_GM: |
Jakob Bornecrantz | 1bb3a2c | 2009-08-30 21:10:36 +0100 | [diff] [blame] | 469 | is->is_i945 = FALSE; |
Brian | aa59a93 | 2008-02-26 20:15:14 -0700 | [diff] [blame] | 470 | break; |
| 471 | |
| 472 | case PCI_CHIP_I945_G: |
| 473 | case PCI_CHIP_I945_GM: |
| 474 | case PCI_CHIP_I945_GME: |
| 475 | case PCI_CHIP_G33_G: |
| 476 | case PCI_CHIP_Q33_G: |
| 477 | case PCI_CHIP_Q35_G: |
Daniel Vetter | 8624fe7 | 2010-11-19 23:38:20 +0100 | [diff] [blame] | 478 | case PCI_CHIP_PINEVIEW_G: |
| 479 | case PCI_CHIP_PINEVIEW_M: |
Jakob Bornecrantz | 1bb3a2c | 2009-08-30 21:10:36 +0100 | [diff] [blame] | 480 | is->is_i945 = TRUE; |
Brian | aa59a93 | 2008-02-26 20:15:14 -0700 | [diff] [blame] | 481 | break; |
| 482 | |
| 483 | default: |
José Fonseca | baab98a | 2008-03-31 09:02:08 +0900 | [diff] [blame] | 484 | debug_printf("%s: unknown pci id 0x%x, cannot create screen\n", |
Jakob Bornecrantz | 835f5a6 | 2010-05-29 13:29:44 +0200 | [diff] [blame] | 485 | __FUNCTION__, iws->pci_id); |
Vinson Lee | 520b6ab | 2009-11-06 12:00:14 -0800 | [diff] [blame] | 486 | FREE(is); |
Brian | aa59a93 | 2008-02-26 20:15:14 -0700 | [diff] [blame] | 487 | return NULL; |
| 488 | } |
| 489 | |
Jakob Bornecrantz | d211006 | 2009-08-30 20:49:01 +0100 | [diff] [blame] | 490 | is->iws = iws; |
Brian | aa59a93 | 2008-02-26 20:15:14 -0700 | [diff] [blame] | 491 | |
Jakob Bornecrantz | 1bb3a2c | 2009-08-30 21:10:36 +0100 | [diff] [blame] | 492 | is->base.destroy = i915_destroy_screen; |
Jakob Bornecrantz | ec3c5ac | 2011-02-20 11:46:17 +0100 | [diff] [blame] | 493 | is->base.flush_frontbuffer = i915_flush_frontbuffer; |
Brian | aa59a93 | 2008-02-26 20:15:14 -0700 | [diff] [blame] | 494 | |
Jakob Bornecrantz | 1bb3a2c | 2009-08-30 21:10:36 +0100 | [diff] [blame] | 495 | is->base.get_name = i915_get_name; |
| 496 | is->base.get_vendor = i915_get_vendor; |
| 497 | is->base.get_param = i915_get_param; |
Luca Barbieri | a508d2d | 2010-09-05 20:50:50 +0200 | [diff] [blame] | 498 | is->base.get_shader_param = i915_get_shader_param; |
Jakob Bornecrantz | 1bb3a2c | 2009-08-30 21:10:36 +0100 | [diff] [blame] | 499 | is->base.get_paramf = i915_get_paramf; |
| 500 | is->base.is_format_supported = i915_is_format_supported; |
Brian | aa59a93 | 2008-02-26 20:15:14 -0700 | [diff] [blame] | 501 | |
Keith Whitwell | 7f41f54 | 2010-02-08 12:55:59 +0000 | [diff] [blame] | 502 | is->base.context_create = i915_create_context; |
| 503 | |
Jakob Bornecrantz | d211006 | 2009-08-30 20:49:01 +0100 | [diff] [blame] | 504 | is->base.fence_reference = i915_fence_reference; |
| 505 | is->base.fence_signalled = i915_fence_signalled; |
| 506 | is->base.fence_finish = i915_fence_finish; |
| 507 | |
Keith Whitwell | 287c94e | 2010-04-10 16:05:54 +0100 | [diff] [blame] | 508 | i915_init_screen_resource_functions(is); |
Brian | aa59a93 | 2008-02-26 20:15:14 -0700 | [diff] [blame] | 509 | |
Jakob Bornecrantz | abbb1bd | 2010-06-12 14:09:59 +0200 | [diff] [blame] | 510 | i915_debug_init(is); |
| 511 | |
Christopher Egert | 608a4a1 | 2011-04-29 02:13:35 +0200 | [diff] [blame] | 512 | util_format_s3tc_init(); |
| 513 | |
Jakob Bornecrantz | 1bb3a2c | 2009-08-30 21:10:36 +0100 | [diff] [blame] | 514 | return &is->base; |
Brian | aa59a93 | 2008-02-26 20:15:14 -0700 | [diff] [blame] | 515 | } |