blob: c52838b5452d3411f94aa4a451a4e2b75decba2f [file] [log] [blame]
Chia-I Wu214dac62014-08-05 11:07:40 +08001/*
2 * XGL
3 *
4 * Copyright (C) 2014 LunarG, Inc.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included
14 * in all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
Chia-I Wu44e42362014-09-02 08:32:09 +080023 *
24 * Authors:
25 * Chia-I Wu <olv@lunarg.com>
Chia-I Wu214dac62014-08-05 11:07:40 +080026 */
27
28#include <stdio.h>
29#include <sys/types.h>
30#include <sys/stat.h>
31#include <fcntl.h>
32#include <unistd.h>
33
34#include "genhw/genhw.h"
Chia-I Wud8965932014-10-13 13:32:37 +080035#include "kmd/winsys.h"
Chia-I Wuec841722014-08-25 22:36:01 +080036#include "queue.h"
Chia-I Wu214dac62014-08-05 11:07:40 +080037#include "gpu.h"
Chia-I Wu1db76e02014-09-15 14:21:14 +080038#include "wsi_x11.h"
39
40static struct intel_gpu *intel_gpus;
41
Chia-I Wu1076a872015-01-18 16:02:55 +080042static const char * const intel_gpu_exts[INTEL_EXT_COUNT] = {
Chia-I Wu1db76e02014-09-15 14:21:14 +080043#ifdef ENABLE_WSI_X11
44 [INTEL_EXT_WSI_X11] = "XGL_WSI_X11",
45#endif
46};
Chia-I Wu214dac62014-08-05 11:07:40 +080047
Chia-I Wuf07865e2014-09-15 13:52:21 +080048static int gpu_open_primary_node(struct intel_gpu *gpu)
49{
50 /* cannot not open gpu->primary_node directly */
51 return gpu->primary_fd_internal;
52}
53
54static void gpu_close_primary_node(struct intel_gpu *gpu)
55{
Chia-I Wu1db76e02014-09-15 14:21:14 +080056 if (gpu->primary_fd_internal >= 0)
Chia-I Wuf07865e2014-09-15 13:52:21 +080057 gpu->primary_fd_internal = -1;
Chia-I Wuf07865e2014-09-15 13:52:21 +080058}
59
60static int gpu_open_render_node(struct intel_gpu *gpu)
61{
62 if (gpu->render_fd_internal < 0 && gpu->render_node) {
63 gpu->render_fd_internal = open(gpu->render_node, O_RDWR);
64 if (gpu->render_fd_internal < 0) {
65 icd_log(XGL_DBG_MSG_ERROR, XGL_VALIDATION_LEVEL_0, NULL, 0,
66 0, "failed to open %s", gpu->render_node);
67 }
68 }
69
70 return gpu->render_fd_internal;
71}
72
73static void gpu_close_render_node(struct intel_gpu *gpu)
74{
75 if (gpu->render_fd_internal >= 0) {
76 close(gpu->render_fd_internal);
77 gpu->render_fd_internal = -1;
78 }
79}
80
Chia-I Wu214dac62014-08-05 11:07:40 +080081static const char *gpu_get_name(const struct intel_gpu *gpu)
82{
83 const char *name = NULL;
84
85 if (gen_is_hsw(gpu->devid)) {
86 if (gen_is_desktop(gpu->devid))
87 name = "Intel(R) Haswell Desktop";
88 else if (gen_is_mobile(gpu->devid))
89 name = "Intel(R) Haswell Mobile";
90 else if (gen_is_server(gpu->devid))
91 name = "Intel(R) Haswell Server";
92 }
93 else if (gen_is_ivb(gpu->devid)) {
94 if (gen_is_desktop(gpu->devid))
95 name = "Intel(R) Ivybridge Desktop";
96 else if (gen_is_mobile(gpu->devid))
97 name = "Intel(R) Ivybridge Mobile";
98 else if (gen_is_server(gpu->devid))
99 name = "Intel(R) Ivybridge Server";
100 }
101 else if (gen_is_snb(gpu->devid)) {
102 if (gen_is_desktop(gpu->devid))
103 name = "Intel(R) Sandybridge Desktop";
104 else if (gen_is_mobile(gpu->devid))
105 name = "Intel(R) Sandybridge Mobile";
106 else if (gen_is_server(gpu->devid))
107 name = "Intel(R) Sandybridge Server";
108 }
109
110 if (!name)
111 name = "Unknown Intel Chipset";
112
113 return name;
114}
115
Chia-I Wuf07865e2014-09-15 13:52:21 +0800116static struct intel_gpu *gpu_create(int gen, int devid,
117 const char *primary_node,
118 const char *render_node)
Chia-I Wu214dac62014-08-05 11:07:40 +0800119{
120 struct intel_gpu *gpu;
Chia-I Wuf07865e2014-09-15 13:52:21 +0800121 size_t primary_len, render_len;
Chia-I Wu214dac62014-08-05 11:07:40 +0800122
123 gpu = icd_alloc(sizeof(*gpu), 0, XGL_SYSTEM_ALLOC_API_OBJECT);
124 if (!gpu)
125 return NULL;
126
127 memset(gpu, 0, sizeof(*gpu));
128
Chia-I Wu214dac62014-08-05 11:07:40 +0800129 gpu->devid = devid;
130
Chia-I Wuf07865e2014-09-15 13:52:21 +0800131 primary_len = strlen(primary_node);
132 render_len = (render_node) ? strlen(render_node) : 0;
133
134 gpu->primary_node = icd_alloc(primary_len + 1 +
135 ((render_len) ? (render_len + 1) : 0), 0, XGL_SYSTEM_ALLOC_INTERNAL);
136 if (!gpu->primary_node) {
Chia-I Wu214dac62014-08-05 11:07:40 +0800137 icd_free(gpu);
138 return NULL;
139 }
Chia-I Wuf07865e2014-09-15 13:52:21 +0800140
141 memcpy(gpu->primary_node, primary_node, primary_len + 1);
142
143 if (render_node) {
144 gpu->render_node = gpu->primary_node + primary_len + 1;
145 memcpy(gpu->render_node, render_node, render_len + 1);
146 }
Chia-I Wu214dac62014-08-05 11:07:40 +0800147
148 gpu->gen_opaque = gen;
149
Chia-I Wu960f1952014-08-28 23:27:10 +0800150 switch (intel_gpu_gen(gpu)) {
151 case INTEL_GEN(7.5):
152 gpu->gt = gen_get_hsw_gt(devid);
153 break;
154 case INTEL_GEN(7):
155 gpu->gt = gen_get_ivb_gt(devid);
156 break;
157 case INTEL_GEN(6):
158 gpu->gt = gen_get_snb_gt(devid);
159 break;
160 }
161
Chia-I Wu214dac62014-08-05 11:07:40 +0800162 /* 8192 dwords */
Chia-I Wud6109bb2014-08-21 09:12:19 +0800163 gpu->max_batch_buffer_size = sizeof(uint32_t) * 8192;
164
165 /* the winsys is prepared for one reloc every two dwords, then minus 2 */
166 gpu->batch_buffer_reloc_count =
167 gpu->max_batch_buffer_size / sizeof(uint32_t) / 2 - 2;
Chia-I Wu214dac62014-08-05 11:07:40 +0800168
Chia-I Wuf07865e2014-09-15 13:52:21 +0800169 gpu->primary_fd_internal = -1;
170 gpu->render_fd_internal = -1;
171
Chia-I Wu214dac62014-08-05 11:07:40 +0800172 return gpu;
173}
174
175static void gpu_destroy(struct intel_gpu *gpu)
176{
Chia-I Wuf07865e2014-09-15 13:52:21 +0800177 intel_gpu_close(gpu);
Chia-I Wu1db76e02014-09-15 14:21:14 +0800178
179#ifdef ENABLE_WSI_X11
180 if (gpu->x11)
181 intel_wsi_x11_destroy(gpu->x11);
182#endif
183
Chia-I Wuf07865e2014-09-15 13:52:21 +0800184 icd_free(gpu->primary_node);
Chia-I Wu214dac62014-08-05 11:07:40 +0800185 icd_free(gpu);
186}
187
Chia-I Wu214dac62014-08-05 11:07:40 +0800188/**
189 * Return true if \p gpu is a valid intel_gpu.
190 */
191bool intel_gpu_is_valid(const struct intel_gpu *gpu)
192{
193 const struct intel_gpu *iter = intel_gpus;
194
195 while (iter) {
196 if (iter == gpu)
197 return true;
198 iter = iter->next;
199 }
200
201 return false;
202}
203
204static int devid_to_gen(int devid)
205{
206 int gen;
207
208 if (gen_is_hsw(devid))
209 gen = INTEL_GEN(7.5);
210 else if (gen_is_ivb(devid))
211 gen = INTEL_GEN(7);
212 else if (gen_is_snb(devid))
213 gen = INTEL_GEN(6);
214 else
215 gen = -1;
216
Chia-I Wubfce58e2014-08-28 23:23:33 +0800217#ifdef INTEL_GEN_SPECIALIZED
218 if (gen != INTEL_GEN(INTEL_GEN_SPECIALIZED))
219 gen = -1;
220#endif
221
Chia-I Wu214dac62014-08-05 11:07:40 +0800222 return gen;
223}
224
Chia-I Wuf07865e2014-09-15 13:52:21 +0800225XGL_RESULT intel_gpu_add(int devid, const char *primary_node,
226 const char *render_node, struct intel_gpu **gpu_ret)
Chia-I Wu214dac62014-08-05 11:07:40 +0800227{
228 const int gen = devid_to_gen(devid);
229 struct intel_gpu *gpu;
230
231 if (gen < 0) {
232 icd_log(XGL_DBG_MSG_WARNING, XGL_VALIDATION_LEVEL_0, XGL_NULL_HANDLE,
233 0, 0, "unsupported device id 0x%04x", devid);
234 return XGL_ERROR_INITIALIZATION_FAILED;
235 }
236
Chia-I Wuf07865e2014-09-15 13:52:21 +0800237 gpu = gpu_create(gen, devid, primary_node, render_node);
Chia-I Wu214dac62014-08-05 11:07:40 +0800238 if (!gpu)
239 return XGL_ERROR_OUT_OF_MEMORY;
240
241 gpu->next = intel_gpus;
242 intel_gpus = gpu;
243
244 *gpu_ret = gpu;
245
246 return XGL_SUCCESS;
247}
248
249void intel_gpu_remove_all(void)
250{
251 struct intel_gpu *gpu = intel_gpus;
252
253 while (gpu) {
254 struct intel_gpu *next = gpu->next;
255
256 gpu_destroy(gpu);
257 gpu = next;
258 }
259
260 intel_gpus = NULL;
261}
262
263struct intel_gpu *intel_gpu_get_list(void)
264{
265 return intel_gpus;
266}
267
268void intel_gpu_get_props(const struct intel_gpu *gpu,
269 XGL_PHYSICAL_GPU_PROPERTIES *props)
270{
271 const char *name;
272 size_t name_len;
273
274 props->structSize = sizeof(*props);
275
276 props->apiVersion = INTEL_API_VERSION;
277 props->driverVersion = INTEL_DRIVER_VERSION;
278
279 props->vendorId = 0x8086;
280 props->deviceId = gpu->devid;
281
282 props->gpuType = XGL_GPU_TYPE_INTEGRATED;
283
284 /* copy GPU name */
285 name = gpu_get_name(gpu);
286 name_len = strlen(name);
287 if (name_len > sizeof(props->gpuName) - 1)
288 name_len = sizeof(props->gpuName) - 1;
289 memcpy(props->gpuName, name, name_len);
290 props->gpuName[name_len] = '\0';
291
Chia-I Wud6109bb2014-08-21 09:12:19 +0800292 props->maxMemRefsPerSubmission = gpu->batch_buffer_reloc_count;
Chia-I Wu214dac62014-08-05 11:07:40 +0800293
294 props->virtualMemPageSize = 4096;
295
296 /* no size limit, but no bounded buffer could exceed 2GB */
297 props->maxInlineMemoryUpdateSize = 2u << 30;
298
299 props->maxBoundDescriptorSets = 1;
300 props->maxThreadGroupSize = 512;
301
302 /* incremented every 80ns */
303 props->timestampFrequency = 1000 * 1000 * 1000 / 80;
304
305 props->multiColorAttachmentClears = false;
306}
307
308void intel_gpu_get_perf(const struct intel_gpu *gpu,
309 XGL_PHYSICAL_GPU_PERFORMANCE *perf)
310{
311 /* TODO */
312 perf->maxGpuClock = 1.0f;
313 perf->aluPerClock = 1.0f;
314 perf->texPerClock = 1.0f;
315 perf->primsPerClock = 1.0f;
316 perf->pixelsPerClock = 1.0f;
317}
318
319void intel_gpu_get_queue_props(const struct intel_gpu *gpu,
320 enum intel_gpu_engine_type engine,
321 XGL_PHYSICAL_GPU_QUEUE_PROPERTIES *props)
322{
323 props->structSize = sizeof(*props);
324
325 switch (engine) {
326 case INTEL_GPU_ENGINE_3D:
327 props->queueFlags = XGL_QUEUE_GRAPHICS_BIT | XGL_QUEUE_COMPUTE_BIT;
328 props->queueCount = 1;
Chia-I Wuec841722014-08-25 22:36:01 +0800329 props->maxAtomicCounters = INTEL_QUEUE_ATOMIC_COUNTER_COUNT;
Chia-I Wu214dac62014-08-05 11:07:40 +0800330 props->supportsTimestamps = true;
331 break;
332 default:
333 assert(!"unknown engine type");
334 return;
335 }
336}
337
338void intel_gpu_get_memory_props(const struct intel_gpu *gpu,
339 XGL_PHYSICAL_GPU_MEMORY_PROPERTIES *props)
340{
341 props->structSize = sizeof(*props);
342
343 props->supportsMigration = false;
344
345 /* no kernel support yet */
346 props->supportsVirtualMemoryRemapping = false;
347
Chia-I Wu54c0c4b2014-08-06 13:48:25 +0800348 /* no winsys support for DRM_I915_GEM_USERPTR yet */
349 props->supportsPinning = false;
Chia-I Wu214dac62014-08-05 11:07:40 +0800350}
351
Chia-I Wu3f4bd102014-12-19 13:14:42 +0800352int intel_gpu_get_max_threads(const struct intel_gpu *gpu,
353 XGL_PIPELINE_SHADER_STAGE stage)
354{
355 switch (intel_gpu_gen(gpu)) {
356 case INTEL_GEN(7.5):
357 switch (stage) {
358 case XGL_SHADER_STAGE_VERTEX:
359 return (gpu->gt >= 2) ? 280 : 70;
360 case XGL_SHADER_STAGE_FRAGMENT:
361 return (gpu->gt == 3) ? 408 :
362 (gpu->gt == 2) ? 204 : 102;
363 default:
364 break;
365 }
366 break;
367 case INTEL_GEN(7):
368 switch (stage) {
369 case XGL_SHADER_STAGE_VERTEX:
370 return (gpu->gt == 2) ? 128 : 36;
371 case XGL_SHADER_STAGE_FRAGMENT:
372 return (gpu->gt == 2) ? 172 : 48;
373 default:
374 break;
375 }
376 break;
377 case INTEL_GEN(6):
378 switch (stage) {
379 case XGL_SHADER_STAGE_VERTEX:
380 return (gpu->gt == 2) ? 60 : 24;
381 case XGL_SHADER_STAGE_FRAGMENT:
382 return (gpu->gt == 2) ? 80 : 40;
383 default:
384 break;
385 }
386 break;
387 default:
388 break;
389 }
390
391 icd_log(XGL_DBG_MSG_ERROR, XGL_VALIDATION_LEVEL_0, XGL_NULL_HANDLE,
392 0, 0, "unknown Gen or shader stage");
393
394 switch (stage) {
395 case XGL_SHADER_STAGE_VERTEX:
396 return 1;
397 case XGL_SHADER_STAGE_FRAGMENT:
398 return 4;
399 default:
400 return 1;
401 }
402}
403
Chia-I Wu1db76e02014-09-15 14:21:14 +0800404void intel_gpu_associate_x11(struct intel_gpu *gpu,
405 struct intel_wsi_x11 *x11,
406 int fd)
407{
408#ifdef ENABLE_WSI_X11
409 gpu->x11 = x11;
410 gpu->primary_fd_internal = fd;
411#endif
412}
413
Chia-I Wu214dac62014-08-05 11:07:40 +0800414XGL_RESULT intel_gpu_open(struct intel_gpu *gpu)
415{
Chia-I Wud8965932014-10-13 13:32:37 +0800416 int fd;
Chia-I Wu214dac62014-08-05 11:07:40 +0800417
Chia-I Wud8965932014-10-13 13:32:37 +0800418 assert(!gpu->winsys);
419
420 fd = gpu_open_primary_node(gpu);
421 if (fd < 0)
422 fd = gpu_open_render_node(gpu);
423 if (fd < 0)
424 return XGL_ERROR_UNKNOWN;
425
426 gpu->winsys = intel_winsys_create_for_fd(fd);
427 if (!gpu->winsys) {
428 icd_log(XGL_DBG_MSG_ERROR, XGL_VALIDATION_LEVEL_0, XGL_NULL_HANDLE,
429 0, 0, "failed to create GPU winsys");
430 intel_gpu_close(gpu);
431 return XGL_ERROR_UNKNOWN;
432 }
433
434 return XGL_SUCCESS;
Chia-I Wu214dac62014-08-05 11:07:40 +0800435}
436
437void intel_gpu_close(struct intel_gpu *gpu)
438{
Chia-I Wud8965932014-10-13 13:32:37 +0800439 if (gpu->winsys) {
440 intel_winsys_destroy(gpu->winsys);
441 gpu->winsys = NULL;
442 }
443
Chia-I Wuf07865e2014-09-15 13:52:21 +0800444 gpu_close_primary_node(gpu);
445 gpu_close_render_node(gpu);
Chia-I Wu214dac62014-08-05 11:07:40 +0800446}
447
Chia-I Wu1db76e02014-09-15 14:21:14 +0800448enum intel_ext_type intel_gpu_lookup_extension(const struct intel_gpu *gpu,
449 const char *ext)
Chia-I Wu214dac62014-08-05 11:07:40 +0800450{
Chia-I Wu1db76e02014-09-15 14:21:14 +0800451 enum intel_ext_type type;
452
453 for (type = 0; type < ARRAY_SIZE(intel_gpu_exts); type++) {
454 if (intel_gpu_exts[type] && strcmp(intel_gpu_exts[type], ext) == 0)
455 break;
456 }
457
458 assert(type < INTEL_EXT_COUNT || type == INTEL_EXT_INVALID);
459
460 return type;
Chia-I Wu214dac62014-08-05 11:07:40 +0800461}
Chia-I Wubec90a02014-08-06 12:33:03 +0800462
Chia-I Wu96177272015-01-03 15:27:41 +0800463ICD_EXPORT XGL_RESULT XGLAPI xglGetGpuInfo(
Chia-I Wubec90a02014-08-06 12:33:03 +0800464 XGL_PHYSICAL_GPU gpu_,
465 XGL_PHYSICAL_GPU_INFO_TYPE infoType,
466 XGL_SIZE* pDataSize,
467 XGL_VOID* pData)
468{
469 const struct intel_gpu *gpu = intel_gpu(gpu_);
470 XGL_RESULT ret = XGL_SUCCESS;
471
472 switch (infoType) {
473 case XGL_INFO_TYPE_PHYSICAL_GPU_PROPERTIES:
Chia-I Wubec90a02014-08-06 12:33:03 +0800474 *pDataSize = sizeof(XGL_PHYSICAL_GPU_PROPERTIES);
Jon Ashburn408daec2014-12-05 09:23:52 -0700475 if (pData == NULL) {
476 return ret;
477 }
Chia-I Wubec90a02014-08-06 12:33:03 +0800478 intel_gpu_get_props(gpu, pData);
479 break;
480
481 case XGL_INFO_TYPE_PHYSICAL_GPU_PERFORMANCE:
Chia-I Wubec90a02014-08-06 12:33:03 +0800482 *pDataSize = sizeof(XGL_PHYSICAL_GPU_PERFORMANCE);
Jon Ashburn408daec2014-12-05 09:23:52 -0700483 if (pData == NULL) {
484 return ret;
485 }
Chia-I Wubec90a02014-08-06 12:33:03 +0800486 intel_gpu_get_perf(gpu, pData);
487 break;
488
489 case XGL_INFO_TYPE_PHYSICAL_GPU_QUEUE_PROPERTIES:
490 /*
491 * XGL Programmers guide, page 33:
492 * to determine the data size an application calls
493 * xglGetGpuInfo() with a NULL data pointer. The
494 * expected data size for all queue property structures
495 * is returned in pDataSize
496 */
497 *pDataSize = sizeof(XGL_PHYSICAL_GPU_QUEUE_PROPERTIES) *
498 INTEL_GPU_ENGINE_COUNT;
499 if (pData != NULL) {
500 XGL_PHYSICAL_GPU_QUEUE_PROPERTIES *dst = pData;
501 int engine;
502
503 for (engine = 0; engine < INTEL_GPU_ENGINE_COUNT; engine++) {
504 intel_gpu_get_queue_props(gpu, engine, dst);
505 dst++;
506 }
507 }
508 break;
509
510 case XGL_INFO_TYPE_PHYSICAL_GPU_MEMORY_PROPERTIES:
Chia-I Wubec90a02014-08-06 12:33:03 +0800511 *pDataSize = sizeof(XGL_PHYSICAL_GPU_MEMORY_PROPERTIES);
Jon Ashburn408daec2014-12-05 09:23:52 -0700512 if (pData == NULL) {
513 return ret;
514 }
Chia-I Wubec90a02014-08-06 12:33:03 +0800515 intel_gpu_get_memory_props(gpu, pData);
516 break;
517
518 default:
519 ret = XGL_ERROR_INVALID_VALUE;
520 }
521
522 return ret;
523}
524
Chia-I Wu96177272015-01-03 15:27:41 +0800525ICD_EXPORT XGL_RESULT XGLAPI xglGetExtensionSupport(
Chia-I Wubec90a02014-08-06 12:33:03 +0800526 XGL_PHYSICAL_GPU gpu_,
527 const XGL_CHAR* pExtName)
528{
529 struct intel_gpu *gpu = intel_gpu(gpu_);
Chia-I Wu7461fcf2014-12-27 15:16:07 +0800530 const enum intel_ext_type ext = intel_gpu_lookup_extension(gpu, pExtName);
Chia-I Wubec90a02014-08-06 12:33:03 +0800531
Chia-I Wu1db76e02014-09-15 14:21:14 +0800532 return (ext != INTEL_EXT_INVALID) ?
Chia-I Wubec90a02014-08-06 12:33:03 +0800533 XGL_SUCCESS : XGL_ERROR_INVALID_EXTENSION;
534}
Chia-I Wu251e7d92014-08-19 13:35:42 +0800535
Chia-I Wu96177272015-01-03 15:27:41 +0800536ICD_EXPORT XGL_RESULT XGLAPI xglGetMultiGpuCompatibility(
Chia-I Wu452f5e82014-08-31 12:39:05 +0800537 XGL_PHYSICAL_GPU gpu0_,
538 XGL_PHYSICAL_GPU gpu1_,
Chia-I Wu251e7d92014-08-19 13:35:42 +0800539 XGL_GPU_COMPATIBILITY_INFO* pInfo)
540{
Chia-I Wu452f5e82014-08-31 12:39:05 +0800541 const struct intel_gpu *gpu0 = intel_gpu(gpu0_);
542 const struct intel_gpu *gpu1 = intel_gpu(gpu1_);
543 XGL_FLAGS compat = XGL_GPU_COMPAT_IQ_MATCH_BIT |
544 XGL_GPU_COMPAT_PEER_TRANSFER_BIT |
545 XGL_GPU_COMPAT_SHARED_MEMORY_BIT |
546 XGL_GPU_COMPAT_SHARED_GPU0_DISPLAY_BIT |
547 XGL_GPU_COMPAT_SHARED_GPU1_DISPLAY_BIT;
548
549 if (intel_gpu_gen(gpu0) == intel_gpu_gen(gpu1))
550 compat |= XGL_GPU_COMPAT_ASIC_FEATURES_BIT;
551
552 pInfo->compatibilityFlags = compat;
553
554 return XGL_SUCCESS;
Chia-I Wu251e7d92014-08-19 13:35:42 +0800555}