blob: 7a67fc05a4a2b010b065af6dc447fd1fefacc9c9 [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
Chia-I Wu214dac62014-08-05 11:07:40 +0800294 /* no size limit, but no bounded buffer could exceed 2GB */
295 props->maxInlineMemoryUpdateSize = 2u << 30;
296
297 props->maxBoundDescriptorSets = 1;
298 props->maxThreadGroupSize = 512;
299
300 /* incremented every 80ns */
301 props->timestampFrequency = 1000 * 1000 * 1000 / 80;
302
303 props->multiColorAttachmentClears = false;
304}
305
306void intel_gpu_get_perf(const struct intel_gpu *gpu,
307 XGL_PHYSICAL_GPU_PERFORMANCE *perf)
308{
309 /* TODO */
310 perf->maxGpuClock = 1.0f;
311 perf->aluPerClock = 1.0f;
312 perf->texPerClock = 1.0f;
313 perf->primsPerClock = 1.0f;
314 perf->pixelsPerClock = 1.0f;
315}
316
317void intel_gpu_get_queue_props(const struct intel_gpu *gpu,
318 enum intel_gpu_engine_type engine,
319 XGL_PHYSICAL_GPU_QUEUE_PROPERTIES *props)
320{
321 props->structSize = sizeof(*props);
322
323 switch (engine) {
324 case INTEL_GPU_ENGINE_3D:
325 props->queueFlags = XGL_QUEUE_GRAPHICS_BIT | XGL_QUEUE_COMPUTE_BIT;
326 props->queueCount = 1;
Chia-I Wuec841722014-08-25 22:36:01 +0800327 props->maxAtomicCounters = INTEL_QUEUE_ATOMIC_COUNTER_COUNT;
Chia-I Wu214dac62014-08-05 11:07:40 +0800328 props->supportsTimestamps = true;
329 break;
330 default:
331 assert(!"unknown engine type");
332 return;
333 }
334}
335
336void intel_gpu_get_memory_props(const struct intel_gpu *gpu,
337 XGL_PHYSICAL_GPU_MEMORY_PROPERTIES *props)
338{
339 props->structSize = sizeof(*props);
340
341 props->supportsMigration = false;
342
Chia-I Wu54c0c4b2014-08-06 13:48:25 +0800343 /* no winsys support for DRM_I915_GEM_USERPTR yet */
344 props->supportsPinning = false;
Chia-I Wu214dac62014-08-05 11:07:40 +0800345}
346
Chia-I Wu3f4bd102014-12-19 13:14:42 +0800347int intel_gpu_get_max_threads(const struct intel_gpu *gpu,
348 XGL_PIPELINE_SHADER_STAGE stage)
349{
350 switch (intel_gpu_gen(gpu)) {
351 case INTEL_GEN(7.5):
352 switch (stage) {
353 case XGL_SHADER_STAGE_VERTEX:
354 return (gpu->gt >= 2) ? 280 : 70;
355 case XGL_SHADER_STAGE_FRAGMENT:
356 return (gpu->gt == 3) ? 408 :
357 (gpu->gt == 2) ? 204 : 102;
358 default:
359 break;
360 }
361 break;
362 case INTEL_GEN(7):
363 switch (stage) {
364 case XGL_SHADER_STAGE_VERTEX:
365 return (gpu->gt == 2) ? 128 : 36;
366 case XGL_SHADER_STAGE_FRAGMENT:
367 return (gpu->gt == 2) ? 172 : 48;
368 default:
369 break;
370 }
371 break;
372 case INTEL_GEN(6):
373 switch (stage) {
374 case XGL_SHADER_STAGE_VERTEX:
375 return (gpu->gt == 2) ? 60 : 24;
376 case XGL_SHADER_STAGE_FRAGMENT:
377 return (gpu->gt == 2) ? 80 : 40;
378 default:
379 break;
380 }
381 break;
382 default:
383 break;
384 }
385
386 icd_log(XGL_DBG_MSG_ERROR, XGL_VALIDATION_LEVEL_0, XGL_NULL_HANDLE,
387 0, 0, "unknown Gen or shader stage");
388
389 switch (stage) {
390 case XGL_SHADER_STAGE_VERTEX:
391 return 1;
392 case XGL_SHADER_STAGE_FRAGMENT:
393 return 4;
394 default:
395 return 1;
396 }
397}
398
Chia-I Wu1db76e02014-09-15 14:21:14 +0800399void intel_gpu_associate_x11(struct intel_gpu *gpu,
400 struct intel_wsi_x11 *x11,
401 int fd)
402{
403#ifdef ENABLE_WSI_X11
404 gpu->x11 = x11;
405 gpu->primary_fd_internal = fd;
406#endif
407}
408
Chia-I Wu214dac62014-08-05 11:07:40 +0800409XGL_RESULT intel_gpu_open(struct intel_gpu *gpu)
410{
Chia-I Wud8965932014-10-13 13:32:37 +0800411 int fd;
Chia-I Wu214dac62014-08-05 11:07:40 +0800412
Chia-I Wud8965932014-10-13 13:32:37 +0800413 assert(!gpu->winsys);
414
415 fd = gpu_open_primary_node(gpu);
416 if (fd < 0)
417 fd = gpu_open_render_node(gpu);
418 if (fd < 0)
419 return XGL_ERROR_UNKNOWN;
420
421 gpu->winsys = intel_winsys_create_for_fd(fd);
422 if (!gpu->winsys) {
423 icd_log(XGL_DBG_MSG_ERROR, XGL_VALIDATION_LEVEL_0, XGL_NULL_HANDLE,
424 0, 0, "failed to create GPU winsys");
425 intel_gpu_close(gpu);
426 return XGL_ERROR_UNKNOWN;
427 }
428
429 return XGL_SUCCESS;
Chia-I Wu214dac62014-08-05 11:07:40 +0800430}
431
432void intel_gpu_close(struct intel_gpu *gpu)
433{
Chia-I Wud8965932014-10-13 13:32:37 +0800434 if (gpu->winsys) {
435 intel_winsys_destroy(gpu->winsys);
436 gpu->winsys = NULL;
437 }
438
Chia-I Wuf07865e2014-09-15 13:52:21 +0800439 gpu_close_primary_node(gpu);
440 gpu_close_render_node(gpu);
Chia-I Wu214dac62014-08-05 11:07:40 +0800441}
442
Chia-I Wu1db76e02014-09-15 14:21:14 +0800443enum intel_ext_type intel_gpu_lookup_extension(const struct intel_gpu *gpu,
444 const char *ext)
Chia-I Wu214dac62014-08-05 11:07:40 +0800445{
Chia-I Wu1db76e02014-09-15 14:21:14 +0800446 enum intel_ext_type type;
447
448 for (type = 0; type < ARRAY_SIZE(intel_gpu_exts); type++) {
449 if (intel_gpu_exts[type] && strcmp(intel_gpu_exts[type], ext) == 0)
450 break;
451 }
452
453 assert(type < INTEL_EXT_COUNT || type == INTEL_EXT_INVALID);
454
455 return type;
Chia-I Wu214dac62014-08-05 11:07:40 +0800456}
Chia-I Wubec90a02014-08-06 12:33:03 +0800457
Chia-I Wu96177272015-01-03 15:27:41 +0800458ICD_EXPORT XGL_RESULT XGLAPI xglGetGpuInfo(
Chia-I Wubec90a02014-08-06 12:33:03 +0800459 XGL_PHYSICAL_GPU gpu_,
460 XGL_PHYSICAL_GPU_INFO_TYPE infoType,
461 XGL_SIZE* pDataSize,
462 XGL_VOID* pData)
463{
464 const struct intel_gpu *gpu = intel_gpu(gpu_);
465 XGL_RESULT ret = XGL_SUCCESS;
466
467 switch (infoType) {
468 case XGL_INFO_TYPE_PHYSICAL_GPU_PROPERTIES:
Chia-I Wubec90a02014-08-06 12:33:03 +0800469 *pDataSize = sizeof(XGL_PHYSICAL_GPU_PROPERTIES);
Jon Ashburn408daec2014-12-05 09:23:52 -0700470 if (pData == NULL) {
471 return ret;
472 }
Chia-I Wubec90a02014-08-06 12:33:03 +0800473 intel_gpu_get_props(gpu, pData);
474 break;
475
476 case XGL_INFO_TYPE_PHYSICAL_GPU_PERFORMANCE:
Chia-I Wubec90a02014-08-06 12:33:03 +0800477 *pDataSize = sizeof(XGL_PHYSICAL_GPU_PERFORMANCE);
Jon Ashburn408daec2014-12-05 09:23:52 -0700478 if (pData == NULL) {
479 return ret;
480 }
Chia-I Wubec90a02014-08-06 12:33:03 +0800481 intel_gpu_get_perf(gpu, pData);
482 break;
483
484 case XGL_INFO_TYPE_PHYSICAL_GPU_QUEUE_PROPERTIES:
485 /*
486 * XGL Programmers guide, page 33:
487 * to determine the data size an application calls
488 * xglGetGpuInfo() with a NULL data pointer. The
489 * expected data size for all queue property structures
490 * is returned in pDataSize
491 */
492 *pDataSize = sizeof(XGL_PHYSICAL_GPU_QUEUE_PROPERTIES) *
493 INTEL_GPU_ENGINE_COUNT;
494 if (pData != NULL) {
495 XGL_PHYSICAL_GPU_QUEUE_PROPERTIES *dst = pData;
496 int engine;
497
498 for (engine = 0; engine < INTEL_GPU_ENGINE_COUNT; engine++) {
499 intel_gpu_get_queue_props(gpu, engine, dst);
500 dst++;
501 }
502 }
503 break;
504
505 case XGL_INFO_TYPE_PHYSICAL_GPU_MEMORY_PROPERTIES:
Chia-I Wubec90a02014-08-06 12:33:03 +0800506 *pDataSize = sizeof(XGL_PHYSICAL_GPU_MEMORY_PROPERTIES);
Jon Ashburn408daec2014-12-05 09:23:52 -0700507 if (pData == NULL) {
508 return ret;
509 }
Chia-I Wubec90a02014-08-06 12:33:03 +0800510 intel_gpu_get_memory_props(gpu, pData);
511 break;
512
513 default:
514 ret = XGL_ERROR_INVALID_VALUE;
515 }
516
517 return ret;
518}
519
Chia-I Wu96177272015-01-03 15:27:41 +0800520ICD_EXPORT XGL_RESULT XGLAPI xglGetExtensionSupport(
Chia-I Wubec90a02014-08-06 12:33:03 +0800521 XGL_PHYSICAL_GPU gpu_,
522 const XGL_CHAR* pExtName)
523{
524 struct intel_gpu *gpu = intel_gpu(gpu_);
Chia-I Wu7461fcf2014-12-27 15:16:07 +0800525 const enum intel_ext_type ext = intel_gpu_lookup_extension(gpu, pExtName);
Chia-I Wubec90a02014-08-06 12:33:03 +0800526
Chia-I Wu1db76e02014-09-15 14:21:14 +0800527 return (ext != INTEL_EXT_INVALID) ?
Chia-I Wubec90a02014-08-06 12:33:03 +0800528 XGL_SUCCESS : XGL_ERROR_INVALID_EXTENSION;
529}
Chia-I Wu251e7d92014-08-19 13:35:42 +0800530
Chia-I Wu96177272015-01-03 15:27:41 +0800531ICD_EXPORT XGL_RESULT XGLAPI xglGetMultiGpuCompatibility(
Chia-I Wu452f5e82014-08-31 12:39:05 +0800532 XGL_PHYSICAL_GPU gpu0_,
533 XGL_PHYSICAL_GPU gpu1_,
Chia-I Wu251e7d92014-08-19 13:35:42 +0800534 XGL_GPU_COMPATIBILITY_INFO* pInfo)
535{
Chia-I Wu452f5e82014-08-31 12:39:05 +0800536 const struct intel_gpu *gpu0 = intel_gpu(gpu0_);
537 const struct intel_gpu *gpu1 = intel_gpu(gpu1_);
538 XGL_FLAGS compat = XGL_GPU_COMPAT_IQ_MATCH_BIT |
539 XGL_GPU_COMPAT_PEER_TRANSFER_BIT |
540 XGL_GPU_COMPAT_SHARED_MEMORY_BIT |
541 XGL_GPU_COMPAT_SHARED_GPU0_DISPLAY_BIT |
542 XGL_GPU_COMPAT_SHARED_GPU1_DISPLAY_BIT;
543
544 if (intel_gpu_gen(gpu0) == intel_gpu_gen(gpu1))
545 compat |= XGL_GPU_COMPAT_ASIC_FEATURES_BIT;
546
547 pInfo->compatibilityFlags = compat;
548
549 return XGL_SUCCESS;
Chia-I Wu251e7d92014-08-19 13:35:42 +0800550}