Brian | aa59a93 | 2008-02-26 20:15:14 -0700 | [diff] [blame] | 1 | /************************************************************************** |
| 2 | * |
| 3 | * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. |
| 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. |
| 21 | * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR |
| 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" |
José Fonseca | 2848688 | 2010-02-02 14:42:17 +0000 | [diff] [blame] | 30 | #include "util/u_inlines.h" |
Jakob Bornecrantz | d211006 | 2009-08-30 20:49:01 +0100 | [diff] [blame] | 31 | #include "util/u_memory.h" |
José Fonseca | 5b8fa51 | 2008-04-14 23:55:36 +0900 | [diff] [blame] | 32 | #include "util/u_string.h" |
Brian | aa59a93 | 2008-02-26 20:15:14 -0700 | [diff] [blame] | 33 | |
| 34 | #include "i915_reg.h" |
Jakob Bornecrantz | abbb1bd | 2010-06-12 14:09:59 +0200 | [diff] [blame] | 35 | #include "i915_debug.h" |
José Fonseca | f81b7a6 | 2008-02-27 15:59:09 +0900 | [diff] [blame] | 36 | #include "i915_context.h" |
Brian | aa59a93 | 2008-02-26 20:15:14 -0700 | [diff] [blame] | 37 | #include "i915_screen.h" |
Keith Whitwell | 287c94e | 2010-04-10 16:05:54 +0100 | [diff] [blame] | 38 | #include "i915_surface.h" |
| 39 | #include "i915_resource.h" |
Jakob Bornecrantz | bc88c95 | 2010-03-25 19:19:00 +0100 | [diff] [blame] | 40 | #include "i915_winsys.h" |
Jakob Bornecrantz | c701587 | 2010-06-01 04:38:24 +0100 | [diff] [blame] | 41 | #include "i915_public.h" |
Jakob Bornecrantz | d211006 | 2009-08-30 20:49:01 +0100 | [diff] [blame] | 42 | |
| 43 | |
| 44 | /* |
| 45 | * Probe functions |
| 46 | */ |
Brian | aa59a93 | 2008-02-26 20:15:14 -0700 | [diff] [blame] | 47 | |
| 48 | |
| 49 | static const char * |
Jakob Bornecrantz | 1bb3a2c | 2009-08-30 21:10:36 +0100 | [diff] [blame] | 50 | i915_get_vendor(struct pipe_screen *screen) |
Brian | aa59a93 | 2008-02-26 20:15:14 -0700 | [diff] [blame] | 51 | { |
José Fonseca | 21a9493 | 2009-09-22 17:16:35 +0100 | [diff] [blame] | 52 | return "VMware, Inc."; |
Brian | aa59a93 | 2008-02-26 20:15:14 -0700 | [diff] [blame] | 53 | } |
| 54 | |
Brian | aa59a93 | 2008-02-26 20:15:14 -0700 | [diff] [blame] | 55 | static const char * |
Jakob Bornecrantz | 1bb3a2c | 2009-08-30 21:10:36 +0100 | [diff] [blame] | 56 | i915_get_name(struct pipe_screen *screen) |
Brian | aa59a93 | 2008-02-26 20:15:14 -0700 | [diff] [blame] | 57 | { |
| 58 | static char buffer[128]; |
| 59 | const char *chipset; |
| 60 | |
Jakob Bornecrantz | 835f5a6 | 2010-05-29 13:29:44 +0200 | [diff] [blame] | 61 | switch (i915_screen(screen)->iws->pci_id) { |
Brian | aa59a93 | 2008-02-26 20:15:14 -0700 | [diff] [blame] | 62 | case PCI_CHIP_I915_G: |
| 63 | chipset = "915G"; |
| 64 | break; |
| 65 | case PCI_CHIP_I915_GM: |
| 66 | chipset = "915GM"; |
| 67 | break; |
| 68 | case PCI_CHIP_I945_G: |
| 69 | chipset = "945G"; |
| 70 | break; |
| 71 | case PCI_CHIP_I945_GM: |
| 72 | chipset = "945GM"; |
| 73 | break; |
| 74 | case PCI_CHIP_I945_GME: |
| 75 | chipset = "945GME"; |
| 76 | break; |
| 77 | case PCI_CHIP_G33_G: |
| 78 | chipset = "G33"; |
| 79 | break; |
| 80 | case PCI_CHIP_Q35_G: |
| 81 | chipset = "Q35"; |
| 82 | break; |
| 83 | case PCI_CHIP_Q33_G: |
| 84 | chipset = "Q33"; |
| 85 | break; |
| 86 | default: |
| 87 | chipset = "unknown"; |
| 88 | break; |
| 89 | } |
| 90 | |
José Fonseca | 5b8fa51 | 2008-04-14 23:55:36 +0900 | [diff] [blame] | 91 | util_snprintf(buffer, sizeof(buffer), "i915 (chipset: %s)", chipset); |
Brian | aa59a93 | 2008-02-26 20:15:14 -0700 | [diff] [blame] | 92 | return buffer; |
| 93 | } |
| 94 | |
Brian | 17188e4 | 2008-02-27 10:15:37 -0700 | [diff] [blame] | 95 | static int |
José Fonseca | e1238b5 | 2010-05-11 11:11:03 +0100 | [diff] [blame] | 96 | i915_get_param(struct pipe_screen *screen, enum pipe_cap param) |
Brian | 17188e4 | 2008-02-27 10:15:37 -0700 | [diff] [blame] | 97 | { |
| 98 | switch (param) { |
| 99 | case PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS: |
| 100 | return 8; |
Brian Paul | 98e2f6c | 2010-02-22 08:14:05 -0700 | [diff] [blame] | 101 | case PIPE_CAP_MAX_VERTEX_TEXTURE_UNITS: |
| 102 | return 0; |
| 103 | case PIPE_CAP_MAX_COMBINED_SAMPLERS: |
| 104 | return 8; |
Brian | 17188e4 | 2008-02-27 10:15:37 -0700 | [diff] [blame] | 105 | case PIPE_CAP_NPOT_TEXTURES: |
| 106 | return 1; |
| 107 | case PIPE_CAP_TWO_SIDED_STENCIL: |
| 108 | return 1; |
| 109 | case PIPE_CAP_GLSL: |
| 110 | return 0; |
Brian | 17188e4 | 2008-02-27 10:15:37 -0700 | [diff] [blame] | 111 | case PIPE_CAP_ANISOTROPIC_FILTER: |
| 112 | return 0; |
| 113 | case PIPE_CAP_POINT_SPRITE: |
| 114 | return 0; |
| 115 | case PIPE_CAP_MAX_RENDER_TARGETS: |
| 116 | return 1; |
| 117 | case PIPE_CAP_OCCLUSION_QUERY: |
| 118 | return 0; |
Mathias Fröhlich | cdbd5f4 | 2010-05-17 11:48:56 -0700 | [diff] [blame] | 119 | case PIPE_CAP_TIMER_QUERY: |
| 120 | return 0; |
Brian | 17188e4 | 2008-02-27 10:15:37 -0700 | [diff] [blame] | 121 | case PIPE_CAP_TEXTURE_SHADOW_MAP: |
| 122 | return 1; |
| 123 | case PIPE_CAP_MAX_TEXTURE_2D_LEVELS: |
Brian Paul | e0d4f32 | 2010-03-08 13:59:39 -0700 | [diff] [blame] | 124 | return I915_MAX_TEXTURE_2D_LEVELS; |
Brian | 17188e4 | 2008-02-27 10:15:37 -0700 | [diff] [blame] | 125 | case PIPE_CAP_MAX_TEXTURE_3D_LEVELS: |
Brian Paul | e0d4f32 | 2010-03-08 13:59:39 -0700 | [diff] [blame] | 126 | return I915_MAX_TEXTURE_3D_LEVELS; |
Brian | 17188e4 | 2008-02-27 10:15:37 -0700 | [diff] [blame] | 127 | case PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS: |
Brian Paul | e0d4f32 | 2010-03-08 13:59:39 -0700 | [diff] [blame] | 128 | return I915_MAX_TEXTURE_2D_LEVELS; |
Luca Barbieri | 6c403750 | 2010-01-21 05:36:14 +0100 | [diff] [blame] | 129 | case PIPE_CAP_TGSI_FS_COORD_ORIGIN_UPPER_LEFT: |
| 130 | case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_HALF_INTEGER: |
| 131 | return 1; |
| 132 | case PIPE_CAP_TGSI_FS_COORD_ORIGIN_LOWER_LEFT: |
| 133 | case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER: |
| 134 | return 0; |
Roland Scheidegger | 4bc7b14 | 2010-05-29 01:28:21 +0200 | [diff] [blame] | 135 | case PIPE_CAP_DEPTHSTENCIL_CLEAR_SEPARATE: |
| 136 | /* disable for now */ |
| 137 | return 0; |
Brian | 17188e4 | 2008-02-27 10:15:37 -0700 | [diff] [blame] | 138 | default: |
| 139 | return 0; |
| 140 | } |
| 141 | } |
| 142 | |
Luca Barbieri | a508d2d | 2010-09-05 20:50:50 +0200 | [diff] [blame] | 143 | static int |
| 144 | i915_get_shader_param(struct pipe_screen *screen, unsigned shader, enum pipe_shader_cap param) |
| 145 | { |
| 146 | switch(shader) { |
| 147 | case PIPE_SHADER_VERTEX: |
| 148 | return draw_get_shader_param(shader, param); |
| 149 | case PIPE_SHADER_FRAGMENT: |
| 150 | break; |
| 151 | default: |
| 152 | return 0; |
| 153 | } |
| 154 | |
| 155 | /* XXX: these are just shader model 2.0 values, fix this! */ |
| 156 | switch(param) { |
| 157 | case PIPE_SHADER_CAP_MAX_INSTRUCTIONS: |
| 158 | return 96; |
| 159 | case PIPE_SHADER_CAP_MAX_ALU_INSTRUCTIONS: |
| 160 | return 64; |
| 161 | case PIPE_SHADER_CAP_MAX_TEX_INSTRUCTIONS: |
| 162 | return 32; |
| 163 | case PIPE_SHADER_CAP_MAX_TEX_INDIRECTIONS: |
| 164 | return 8; |
| 165 | case PIPE_SHADER_CAP_MAX_CONTROL_FLOW_DEPTH: |
| 166 | return 0; |
| 167 | case PIPE_SHADER_CAP_MAX_INPUTS: |
| 168 | return 10; |
| 169 | case PIPE_SHADER_CAP_MAX_CONSTS: |
| 170 | return 32; |
| 171 | case PIPE_SHADER_CAP_MAX_CONST_BUFFERS: |
| 172 | return 1; |
| 173 | case PIPE_SHADER_CAP_MAX_TEMPS: |
| 174 | return 12; /* XXX: 12 -> 32 ? */ |
| 175 | case PIPE_SHADER_CAP_MAX_ADDRS: |
| 176 | return 0; |
| 177 | case PIPE_SHADER_CAP_MAX_PREDS: |
| 178 | return 0; |
| 179 | case PIPE_SHADER_CAP_TGSI_CONT_SUPPORTED: |
| 180 | return 0; |
| 181 | default: |
| 182 | break; |
| 183 | } |
| 184 | } |
| 185 | |
Brian | 17188e4 | 2008-02-27 10:15:37 -0700 | [diff] [blame] | 186 | static float |
José Fonseca | e1238b5 | 2010-05-11 11:11:03 +0100 | [diff] [blame] | 187 | i915_get_paramf(struct pipe_screen *screen, enum pipe_cap param) |
Brian | 17188e4 | 2008-02-27 10:15:37 -0700 | [diff] [blame] | 188 | { |
| 189 | switch (param) { |
| 190 | case PIPE_CAP_MAX_LINE_WIDTH: |
| 191 | /* fall-through */ |
| 192 | case PIPE_CAP_MAX_LINE_WIDTH_AA: |
| 193 | return 7.5; |
| 194 | |
| 195 | case PIPE_CAP_MAX_POINT_WIDTH: |
| 196 | /* fall-through */ |
| 197 | case PIPE_CAP_MAX_POINT_WIDTH_AA: |
| 198 | return 255.0; |
| 199 | |
| 200 | case PIPE_CAP_MAX_TEXTURE_ANISOTROPY: |
| 201 | return 4.0; |
| 202 | |
| 203 | case PIPE_CAP_MAX_TEXTURE_LOD_BIAS: |
| 204 | return 16.0; |
| 205 | |
| 206 | default: |
| 207 | return 0; |
| 208 | } |
| 209 | } |
| 210 | |
Brian | 364f8ca | 2008-02-27 13:58:06 -0700 | [diff] [blame] | 211 | static boolean |
Jakob Bornecrantz | 1bb3a2c | 2009-08-30 21:10:36 +0100 | [diff] [blame] | 212 | i915_is_format_supported(struct pipe_screen *screen, |
Roland Scheidegger | bccf31b | 2010-05-17 21:24:04 +0200 | [diff] [blame] | 213 | enum pipe_format format, |
Jakob Bornecrantz | 1bb3a2c | 2009-08-30 21:10:36 +0100 | [diff] [blame] | 214 | enum pipe_texture_target target, |
Roland Scheidegger | bccf31b | 2010-05-17 21:24:04 +0200 | [diff] [blame] | 215 | unsigned sample_count, |
| 216 | unsigned tex_usage, |
Jakob Bornecrantz | 1bb3a2c | 2009-08-30 21:10:36 +0100 | [diff] [blame] | 217 | unsigned geom_flags) |
Brian | 364f8ca | 2008-02-27 13:58:06 -0700 | [diff] [blame] | 218 | { |
| 219 | static const enum pipe_format tex_supported[] = { |
José Fonseca | b2b1e89 | 2010-03-01 18:12:19 +0000 | [diff] [blame] | 220 | PIPE_FORMAT_B8G8R8A8_UNORM, |
Jakob Bornecrantz | b4b4ac6 | 2010-03-25 00:41:21 +0100 | [diff] [blame] | 221 | PIPE_FORMAT_B8G8R8X8_UNORM, |
| 222 | PIPE_FORMAT_R8G8B8A8_UNORM, |
| 223 | #if 0 |
| 224 | PIPE_FORMAT_R8G8B8X8_UNORM, |
| 225 | #endif |
José Fonseca | b2b1e89 | 2010-03-01 18:12:19 +0000 | [diff] [blame] | 226 | PIPE_FORMAT_B5G6R5_UNORM, |
Brian Paul | 54f94a7 | 2008-04-30 16:50:17 -0600 | [diff] [blame] | 227 | PIPE_FORMAT_L8_UNORM, |
| 228 | PIPE_FORMAT_A8_UNORM, |
| 229 | PIPE_FORMAT_I8_UNORM, |
José Fonseca | b2b1e89 | 2010-03-01 18:12:19 +0000 | [diff] [blame] | 230 | PIPE_FORMAT_L8A8_UNORM, |
| 231 | PIPE_FORMAT_UYVY, |
| 232 | PIPE_FORMAT_YUYV, |
Roland Scheidegger | 4bc7b14 | 2010-05-29 01:28:21 +0200 | [diff] [blame] | 233 | /* XXX why not? |
| 234 | PIPE_FORMAT_Z16_UNORM, */ |
| 235 | PIPE_FORMAT_Z24X8_UNORM, |
Roland Scheidegger | 6fb364a | 2010-03-30 01:35:49 +0200 | [diff] [blame] | 236 | PIPE_FORMAT_Z24_UNORM_S8_USCALED, |
Brian | 364f8ca | 2008-02-27 13:58:06 -0700 | [diff] [blame] | 237 | PIPE_FORMAT_NONE /* list terminator */ |
| 238 | }; |
Roland Scheidegger | bccf31b | 2010-05-17 21:24:04 +0200 | [diff] [blame] | 239 | static const enum pipe_format render_supported[] = { |
José Fonseca | b2b1e89 | 2010-03-01 18:12:19 +0000 | [diff] [blame] | 240 | PIPE_FORMAT_B8G8R8A8_UNORM, |
| 241 | PIPE_FORMAT_B5G6R5_UNORM, |
Roland Scheidegger | bccf31b | 2010-05-17 21:24:04 +0200 | [diff] [blame] | 242 | PIPE_FORMAT_NONE /* list terminator */ |
| 243 | }; |
| 244 | static const enum pipe_format depth_supported[] = { |
Roland Scheidegger | 4bc7b14 | 2010-05-29 01:28:21 +0200 | [diff] [blame] | 245 | /* XXX why not? |
| 246 | PIPE_FORMAT_Z16_UNORM, */ |
| 247 | PIPE_FORMAT_Z24X8_UNORM, |
Roland Scheidegger | 6fb364a | 2010-03-30 01:35:49 +0200 | [diff] [blame] | 248 | PIPE_FORMAT_Z24_UNORM_S8_USCALED, |
Brian | 364f8ca | 2008-02-27 13:58:06 -0700 | [diff] [blame] | 249 | PIPE_FORMAT_NONE /* list terminator */ |
| 250 | }; |
| 251 | const enum pipe_format *list; |
| 252 | uint i; |
| 253 | |
Roland Scheidegger | bccf31b | 2010-05-17 21:24:04 +0200 | [diff] [blame] | 254 | if (sample_count > 1) |
| 255 | return FALSE; |
| 256 | |
| 257 | if(tex_usage & PIPE_BIND_DEPTH_STENCIL) |
| 258 | list = depth_supported; |
| 259 | else if (tex_usage & PIPE_BIND_RENDER_TARGET) |
| 260 | list = render_supported; |
José Fonseca | 8aafc03 | 2008-07-19 12:04:37 +0900 | [diff] [blame] | 261 | else |
| 262 | list = tex_supported; |
Brian | 364f8ca | 2008-02-27 13:58:06 -0700 | [diff] [blame] | 263 | |
| 264 | for (i = 0; list[i] != PIPE_FORMAT_NONE; i++) { |
| 265 | if (list[i] == format) |
| 266 | return TRUE; |
| 267 | } |
| 268 | |
| 269 | return FALSE; |
| 270 | } |
| 271 | |
Jakob Bornecrantz | d211006 | 2009-08-30 20:49:01 +0100 | [diff] [blame] | 272 | |
| 273 | /* |
| 274 | * Fence functions |
| 275 | */ |
| 276 | |
| 277 | |
| 278 | static void |
| 279 | i915_fence_reference(struct pipe_screen *screen, |
| 280 | struct pipe_fence_handle **ptr, |
| 281 | struct pipe_fence_handle *fence) |
| 282 | { |
| 283 | struct i915_screen *is = i915_screen(screen); |
| 284 | |
| 285 | is->iws->fence_reference(is->iws, ptr, fence); |
| 286 | } |
| 287 | |
| 288 | static int |
| 289 | i915_fence_signalled(struct pipe_screen *screen, |
| 290 | struct pipe_fence_handle *fence, |
| 291 | unsigned flags) |
| 292 | { |
| 293 | struct i915_screen *is = i915_screen(screen); |
| 294 | |
| 295 | return is->iws->fence_signalled(is->iws, fence); |
| 296 | } |
| 297 | |
| 298 | static int |
| 299 | i915_fence_finish(struct pipe_screen *screen, |
| 300 | struct pipe_fence_handle *fence, |
| 301 | unsigned flags) |
| 302 | { |
| 303 | struct i915_screen *is = i915_screen(screen); |
| 304 | |
| 305 | return is->iws->fence_finish(is->iws, fence); |
| 306 | } |
| 307 | |
| 308 | |
| 309 | /* |
| 310 | * Generic functions |
| 311 | */ |
| 312 | |
| 313 | |
Brian | aa59a93 | 2008-02-26 20:15:14 -0700 | [diff] [blame] | 314 | static void |
Jakob Bornecrantz | 1bb3a2c | 2009-08-30 21:10:36 +0100 | [diff] [blame] | 315 | i915_destroy_screen(struct pipe_screen *screen) |
Brian | aa59a93 | 2008-02-26 20:15:14 -0700 | [diff] [blame] | 316 | { |
Jakob Bornecrantz | d211006 | 2009-08-30 20:49:01 +0100 | [diff] [blame] | 317 | struct i915_screen *is = i915_screen(screen); |
José Fonseca | 9dcb956 | 2008-08-08 12:23:21 +0100 | [diff] [blame] | 318 | |
Jakob Bornecrantz | d211006 | 2009-08-30 20:49:01 +0100 | [diff] [blame] | 319 | if (is->iws) |
| 320 | is->iws->destroy(is->iws); |
José Fonseca | 9dcb956 | 2008-08-08 12:23:21 +0100 | [diff] [blame] | 321 | |
Jakob Bornecrantz | d211006 | 2009-08-30 20:49:01 +0100 | [diff] [blame] | 322 | FREE(is); |
Brian | aa59a93 | 2008-02-26 20:15:14 -0700 | [diff] [blame] | 323 | } |
| 324 | |
Brian | aa59a93 | 2008-02-26 20:15:14 -0700 | [diff] [blame] | 325 | /** |
| 326 | * Create a new i915_screen object |
| 327 | */ |
| 328 | struct pipe_screen * |
Jakob Bornecrantz | 835f5a6 | 2010-05-29 13:29:44 +0200 | [diff] [blame] | 329 | i915_screen_create(struct i915_winsys *iws) |
Brian | aa59a93 | 2008-02-26 20:15:14 -0700 | [diff] [blame] | 330 | { |
Jakob Bornecrantz | 1bb3a2c | 2009-08-30 21:10:36 +0100 | [diff] [blame] | 331 | struct i915_screen *is = CALLOC_STRUCT(i915_screen); |
Brian | aa59a93 | 2008-02-26 20:15:14 -0700 | [diff] [blame] | 332 | |
Jakob Bornecrantz | 1bb3a2c | 2009-08-30 21:10:36 +0100 | [diff] [blame] | 333 | if (!is) |
Brian | aa59a93 | 2008-02-26 20:15:14 -0700 | [diff] [blame] | 334 | return NULL; |
| 335 | |
Jakob Bornecrantz | 835f5a6 | 2010-05-29 13:29:44 +0200 | [diff] [blame] | 336 | switch (iws->pci_id) { |
Brian | aa59a93 | 2008-02-26 20:15:14 -0700 | [diff] [blame] | 337 | case PCI_CHIP_I915_G: |
| 338 | case PCI_CHIP_I915_GM: |
Jakob Bornecrantz | 1bb3a2c | 2009-08-30 21:10:36 +0100 | [diff] [blame] | 339 | is->is_i945 = FALSE; |
Brian | aa59a93 | 2008-02-26 20:15:14 -0700 | [diff] [blame] | 340 | break; |
| 341 | |
| 342 | case PCI_CHIP_I945_G: |
| 343 | case PCI_CHIP_I945_GM: |
| 344 | case PCI_CHIP_I945_GME: |
| 345 | case PCI_CHIP_G33_G: |
| 346 | case PCI_CHIP_Q33_G: |
| 347 | case PCI_CHIP_Q35_G: |
Jakob Bornecrantz | 1bb3a2c | 2009-08-30 21:10:36 +0100 | [diff] [blame] | 348 | is->is_i945 = TRUE; |
Brian | aa59a93 | 2008-02-26 20:15:14 -0700 | [diff] [blame] | 349 | break; |
| 350 | |
| 351 | default: |
José Fonseca | baab98a | 2008-03-31 09:02:08 +0900 | [diff] [blame] | 352 | debug_printf("%s: unknown pci id 0x%x, cannot create screen\n", |
Jakob Bornecrantz | 835f5a6 | 2010-05-29 13:29:44 +0200 | [diff] [blame] | 353 | __FUNCTION__, iws->pci_id); |
Vinson Lee | 520b6ab | 2009-11-06 12:00:14 -0800 | [diff] [blame] | 354 | FREE(is); |
Brian | aa59a93 | 2008-02-26 20:15:14 -0700 | [diff] [blame] | 355 | return NULL; |
| 356 | } |
| 357 | |
Jakob Bornecrantz | d211006 | 2009-08-30 20:49:01 +0100 | [diff] [blame] | 358 | is->iws = iws; |
Brian | aa59a93 | 2008-02-26 20:15:14 -0700 | [diff] [blame] | 359 | |
Jakob Bornecrantz | d211006 | 2009-08-30 20:49:01 +0100 | [diff] [blame] | 360 | is->base.winsys = NULL; |
Brian | aa59a93 | 2008-02-26 20:15:14 -0700 | [diff] [blame] | 361 | |
Jakob Bornecrantz | 1bb3a2c | 2009-08-30 21:10:36 +0100 | [diff] [blame] | 362 | is->base.destroy = i915_destroy_screen; |
Brian | aa59a93 | 2008-02-26 20:15:14 -0700 | [diff] [blame] | 363 | |
Jakob Bornecrantz | 1bb3a2c | 2009-08-30 21:10:36 +0100 | [diff] [blame] | 364 | is->base.get_name = i915_get_name; |
| 365 | is->base.get_vendor = i915_get_vendor; |
| 366 | is->base.get_param = i915_get_param; |
Luca Barbieri | a508d2d | 2010-09-05 20:50:50 +0200 | [diff] [blame] | 367 | is->base.get_shader_param = i915_get_shader_param; |
Jakob Bornecrantz | 1bb3a2c | 2009-08-30 21:10:36 +0100 | [diff] [blame] | 368 | is->base.get_paramf = i915_get_paramf; |
| 369 | is->base.is_format_supported = i915_is_format_supported; |
Brian | aa59a93 | 2008-02-26 20:15:14 -0700 | [diff] [blame] | 370 | |
Keith Whitwell | 7f41f54 | 2010-02-08 12:55:59 +0000 | [diff] [blame] | 371 | is->base.context_create = i915_create_context; |
| 372 | |
Jakob Bornecrantz | d211006 | 2009-08-30 20:49:01 +0100 | [diff] [blame] | 373 | is->base.fence_reference = i915_fence_reference; |
| 374 | is->base.fence_signalled = i915_fence_signalled; |
| 375 | is->base.fence_finish = i915_fence_finish; |
| 376 | |
Keith Whitwell | 287c94e | 2010-04-10 16:05:54 +0100 | [diff] [blame] | 377 | i915_init_screen_resource_functions(is); |
| 378 | i915_init_screen_surface_functions(is); |
Brian | aa59a93 | 2008-02-26 20:15:14 -0700 | [diff] [blame] | 379 | |
Jakob Bornecrantz | abbb1bd | 2010-06-12 14:09:59 +0200 | [diff] [blame] | 380 | i915_debug_init(is); |
| 381 | |
Jakob Bornecrantz | 1bb3a2c | 2009-08-30 21:10:36 +0100 | [diff] [blame] | 382 | return &is->base; |
Brian | aa59a93 | 2008-02-26 20:15:14 -0700 | [diff] [blame] | 383 | } |