Chia-I Wu | d4bae36 | 2014-07-29 11:15:00 +0800 | [diff] [blame] | 1 | #include <stdlib.h> |
| 2 | #include <stdio.h> |
| 3 | #include <stdbool.h> |
| 4 | #include <string.h> |
| 5 | |
| 6 | #include <xgl.h> |
Courtney Goeltzenleuchter | d183e71 | 2014-08-06 16:12:02 -0600 | [diff] [blame] | 7 | #include "common.h" |
Chia-I Wu | d4bae36 | 2014-07-29 11:15:00 +0800 | [diff] [blame] | 8 | |
| 9 | static const char *xgl_gpu_type_string(XGL_PHYSICAL_GPU_TYPE type) |
| 10 | { |
Chia-I Wu | 190ebdc | 2014-08-06 12:04:13 +0800 | [diff] [blame] | 11 | switch (type) { |
Chia-I Wu | d4bae36 | 2014-07-29 11:15:00 +0800 | [diff] [blame] | 12 | #define STR(r) case XGL_GPU_TYPE_ ##r: return #r |
Chia-I Wu | 190ebdc | 2014-08-06 12:04:13 +0800 | [diff] [blame] | 13 | STR(OTHER); |
| 14 | STR(INTEGRATED); |
| 15 | STR(DISCRETE); |
| 16 | STR(VIRTUAL); |
Chia-I Wu | d4bae36 | 2014-07-29 11:15:00 +0800 | [diff] [blame] | 17 | #undef STR |
Chia-I Wu | 190ebdc | 2014-08-06 12:04:13 +0800 | [diff] [blame] | 18 | default: return "UNKNOWN_GPU"; |
| 19 | } |
Chia-I Wu | d4bae36 | 2014-07-29 11:15:00 +0800 | [diff] [blame] | 20 | } |
| 21 | |
| 22 | static const char *xgl_heap_type_string(XGL_HEAP_MEMORY_TYPE type) |
| 23 | { |
Chia-I Wu | 190ebdc | 2014-08-06 12:04:13 +0800 | [diff] [blame] | 24 | switch (type) { |
Chia-I Wu | d4bae36 | 2014-07-29 11:15:00 +0800 | [diff] [blame] | 25 | #define STR(r) case XGL_HEAP_MEMORY_ ##r: return #r |
Chia-I Wu | 190ebdc | 2014-08-06 12:04:13 +0800 | [diff] [blame] | 26 | STR(OTHER); |
| 27 | STR(LOCAL); |
| 28 | STR(REMOTE); |
| 29 | STR(EMBEDDED); |
Chia-I Wu | d4bae36 | 2014-07-29 11:15:00 +0800 | [diff] [blame] | 30 | #undef STR |
Chia-I Wu | 190ebdc | 2014-08-06 12:04:13 +0800 | [diff] [blame] | 31 | default: return "UNKNOWN_HEAP"; |
| 32 | } |
Chia-I Wu | d4bae36 | 2014-07-29 11:15:00 +0800 | [diff] [blame] | 33 | } |
| 34 | |
| 35 | static const char *xgl_channel_format_string(XGL_CHANNEL_FORMAT ch) |
| 36 | { |
Chia-I Wu | 190ebdc | 2014-08-06 12:04:13 +0800 | [diff] [blame] | 37 | switch (ch) { |
Chia-I Wu | d4bae36 | 2014-07-29 11:15:00 +0800 | [diff] [blame] | 38 | #define STR(r) case XGL_CH_FMT_ ##r: return #r |
Chia-I Wu | 190ebdc | 2014-08-06 12:04:13 +0800 | [diff] [blame] | 39 | STR(UNDEFINED); |
| 40 | STR(R4G4); |
| 41 | STR(R4G4B4A4); |
| 42 | STR(R5G6B5); |
| 43 | STR(B5G6R5); |
| 44 | STR(R5G5B5A1); |
| 45 | STR(R8); |
| 46 | STR(R8G8); |
| 47 | STR(R8G8B8A8); |
| 48 | STR(B8G8R8A8); |
| 49 | STR(R10G11B11); |
| 50 | STR(R11G11B10); |
| 51 | STR(R10G10B10A2); |
| 52 | STR(R16); |
| 53 | STR(R16G16); |
| 54 | STR(R16G16B16A16); |
| 55 | STR(R32); |
| 56 | STR(R32G32); |
| 57 | STR(R32G32B32); |
| 58 | STR(R32G32B32A32); |
| 59 | STR(R16G8); |
| 60 | STR(R32G8); |
| 61 | STR(R9G9B9E5); |
| 62 | STR(BC1); |
| 63 | STR(BC2); |
| 64 | STR(BC3); |
| 65 | STR(BC4); |
| 66 | STR(BC5); |
| 67 | STR(BC6U); |
| 68 | STR(BC6S); |
| 69 | STR(BC7); |
Chia-I Wu | d4bae36 | 2014-07-29 11:15:00 +0800 | [diff] [blame] | 70 | #undef STR |
Chia-I Wu | 190ebdc | 2014-08-06 12:04:13 +0800 | [diff] [blame] | 71 | default: return "UNKNOWN_CH"; |
| 72 | } |
Chia-I Wu | d4bae36 | 2014-07-29 11:15:00 +0800 | [diff] [blame] | 73 | } |
| 74 | |
| 75 | static const char *xgl_numeric_format_string(XGL_NUM_FORMAT num) |
| 76 | { |
Chia-I Wu | 190ebdc | 2014-08-06 12:04:13 +0800 | [diff] [blame] | 77 | switch (num) { |
Chia-I Wu | d4bae36 | 2014-07-29 11:15:00 +0800 | [diff] [blame] | 78 | #define STR(r) case XGL_NUM_FMT_ ##r: return #r |
Chia-I Wu | 190ebdc | 2014-08-06 12:04:13 +0800 | [diff] [blame] | 79 | STR(UNDEFINED); |
| 80 | STR(UNORM); |
| 81 | STR(SNORM); |
| 82 | STR(UINT); |
| 83 | STR(SINT); |
| 84 | STR(FLOAT); |
| 85 | STR(SRGB); |
| 86 | STR(DS); |
Chia-I Wu | d4bae36 | 2014-07-29 11:15:00 +0800 | [diff] [blame] | 87 | #undef STR |
Chia-I Wu | 190ebdc | 2014-08-06 12:04:13 +0800 | [diff] [blame] | 88 | default: return "UNKNOWN_NUM"; |
| 89 | } |
Chia-I Wu | d4bae36 | 2014-07-29 11:15:00 +0800 | [diff] [blame] | 90 | } |
| 91 | |
| 92 | static void app_dev_dump_format_props(const struct app_dev *dev, XGL_CHANNEL_FORMAT ch, XGL_NUM_FORMAT num) |
| 93 | { |
Chia-I Wu | 190ebdc | 2014-08-06 12:04:13 +0800 | [diff] [blame] | 94 | const XGL_FORMAT_PROPERTIES *props = &dev->format_props[ch][num]; |
| 95 | struct { |
| 96 | const char *name; |
| 97 | XGL_FLAGS flags; |
| 98 | } tilings[2]; |
| 99 | XGL_UINT i; |
Chia-I Wu | d4bae36 | 2014-07-29 11:15:00 +0800 | [diff] [blame] | 100 | |
Chia-I Wu | 190ebdc | 2014-08-06 12:04:13 +0800 | [diff] [blame] | 101 | if (!props->linearTilingFeatures && !props->optimalTilingFeatures) |
| 102 | return; |
Chia-I Wu | d4bae36 | 2014-07-29 11:15:00 +0800 | [diff] [blame] | 103 | |
Chia-I Wu | 190ebdc | 2014-08-06 12:04:13 +0800 | [diff] [blame] | 104 | tilings[0].name = "linear"; |
| 105 | tilings[0].flags = props->linearTilingFeatures; |
| 106 | tilings[1].name = "optimal"; |
| 107 | tilings[1].flags = props->optimalTilingFeatures; |
Chia-I Wu | d4bae36 | 2014-07-29 11:15:00 +0800 | [diff] [blame] | 108 | |
Chia-I Wu | 190ebdc | 2014-08-06 12:04:13 +0800 | [diff] [blame] | 109 | printf("FORMAT_%s_%s\n", xgl_channel_format_string(ch), |
| 110 | xgl_numeric_format_string(num)); |
| 111 | for (i = 0; i < ARRAY_SIZE(tilings); i++) { |
| 112 | if (!tilings[i].flags) |
| 113 | continue; |
Chia-I Wu | d4bae36 | 2014-07-29 11:15:00 +0800 | [diff] [blame] | 114 | |
Chia-I Wu | 190ebdc | 2014-08-06 12:04:13 +0800 | [diff] [blame] | 115 | printf("\t%s tiling image =%s%s%s\n", tilings[i].name, |
| 116 | (tilings[i].flags & XGL_FORMAT_IMAGE_SHADER_READ_BIT) ? " read" : "", |
| 117 | (tilings[i].flags & XGL_FORMAT_IMAGE_SHADER_WRITE_BIT) ? " write" : "", |
| 118 | (tilings[i].flags & XGL_FORMAT_IMAGE_COPY_BIT) ? " copy" : ""); |
| 119 | printf("\t%s tiling memory =%s\n", tilings[i].name, |
| 120 | (tilings[i].flags & XGL_FORMAT_MEMORY_SHADER_ACCESS_BIT) ? " access" : ""); |
| 121 | printf("\t%s tiling attachment =%s%s%s%s%s\n", tilings[i].name, |
| 122 | (tilings[i].flags & XGL_FORMAT_COLOR_ATTACHMENT_WRITE_BIT) ? " color" : "", |
| 123 | (tilings[i].flags & XGL_FORMAT_COLOR_ATTACHMENT_BLEND_BIT) ? " blend" : "", |
| 124 | (tilings[i].flags & XGL_FORMAT_DEPTH_ATTACHMENT_BIT) ? " depth" : "", |
| 125 | (tilings[i].flags & XGL_FORMAT_STENCIL_ATTACHMENT_BIT) ? " stencil" : "", |
| 126 | (tilings[i].flags & XGL_FORMAT_MSAA_ATTACHMENT_BIT) ? " msaa" : ""); |
| 127 | printf("\t%s tiling conversion = %u\n", tilings[i].name, |
| 128 | (bool) (tilings[i].flags & XGL_FORMAT_CONVERSION_BIT)); |
| 129 | } |
Chia-I Wu | d4bae36 | 2014-07-29 11:15:00 +0800 | [diff] [blame] | 130 | } |
| 131 | |
| 132 | static void app_dev_dump_heap_props(const struct app_dev *dev, XGL_UINT id) |
| 133 | { |
Chia-I Wu | 190ebdc | 2014-08-06 12:04:13 +0800 | [diff] [blame] | 134 | const XGL_MEMORY_HEAP_PROPERTIES *props = &dev->heap_props[id]; |
Chia-I Wu | d4bae36 | 2014-07-29 11:15:00 +0800 | [diff] [blame] | 135 | |
Chia-I Wu | 190ebdc | 2014-08-06 12:04:13 +0800 | [diff] [blame] | 136 | printf("XGL_MEMORY_HEAP_PROPERTIES[%u]\n", id); |
| 137 | printf("\tstructSize = %u\n", props->structSize); |
| 138 | printf("\theapMemoryType = %s\n", xgl_heap_type_string(props->heapMemoryType)); |
| 139 | printf("\theapSize = %u\n", props->heapSize); |
| 140 | printf("\tpagesSize = %u\n", props->pageSize); |
Chia-I Wu | d4bae36 | 2014-07-29 11:15:00 +0800 | [diff] [blame] | 141 | |
Chia-I Wu | 190ebdc | 2014-08-06 12:04:13 +0800 | [diff] [blame] | 142 | printf("\tflags =%s%s%s%s%s%s\n", |
| 143 | (props->flags & XGL_MEMORY_HEAP_CPU_VISIBLE_BIT) ? " visible" : "", |
| 144 | (props->flags & XGL_MEMORY_HEAP_CPU_GPU_COHERENT_BIT) ? " coherent" : "", |
| 145 | (props->flags & XGL_MEMORY_HEAP_CPU_UNCACHED_BIT) ? " uc" : "", |
| 146 | (props->flags & XGL_MEMORY_HEAP_CPU_WRITE_COMBINED_BIT) ? " wc" : "", |
| 147 | (props->flags & XGL_MEMORY_HEAP_HOLDS_PINNED_BIT) ? " pinnable" : "", |
| 148 | (props->flags & XGL_MEMORY_HEAP_SHAREABLE_BIT) ? " shareable" : ""); |
Chia-I Wu | d4bae36 | 2014-07-29 11:15:00 +0800 | [diff] [blame] | 149 | |
Chia-I Wu | 190ebdc | 2014-08-06 12:04:13 +0800 | [diff] [blame] | 150 | printf("\tgpuReadPerfRating = %f\n", props->gpuReadPerfRating); |
| 151 | printf("\tgpuWritePerfRating = %f\n", props->gpuWritePerfRating); |
| 152 | printf("\tcpuReadPerfRating = %f\n", props->cpuReadPerfRating); |
| 153 | printf("\tcpuWritePerfRating = %f\n", props->cpuWritePerfRating); |
Chia-I Wu | d4bae36 | 2014-07-29 11:15:00 +0800 | [diff] [blame] | 154 | } |
| 155 | |
| 156 | static void |
| 157 | app_dev_dump(const struct app_dev *dev) |
| 158 | { |
Chia-I Wu | 190ebdc | 2014-08-06 12:04:13 +0800 | [diff] [blame] | 159 | XGL_CHANNEL_FORMAT ch; |
| 160 | XGL_NUM_FORMAT num; |
| 161 | XGL_UINT i; |
Chia-I Wu | d4bae36 | 2014-07-29 11:15:00 +0800 | [diff] [blame] | 162 | |
Chia-I Wu | 190ebdc | 2014-08-06 12:04:13 +0800 | [diff] [blame] | 163 | for (i = 0; i < dev->heap_count; i++) { |
| 164 | app_dev_dump_heap_props(dev, i); |
| 165 | printf("\n"); |
| 166 | } |
Chia-I Wu | d4bae36 | 2014-07-29 11:15:00 +0800 | [diff] [blame] | 167 | |
Chia-I Wu | 190ebdc | 2014-08-06 12:04:13 +0800 | [diff] [blame] | 168 | for (ch = 0; ch < XGL_MAX_CH_FMT; ch++) { |
| 169 | for (num = 0; num < XGL_MAX_NUM_FMT; num++) |
| 170 | app_dev_dump_format_props(dev, ch, num); |
| 171 | } |
Chia-I Wu | d4bae36 | 2014-07-29 11:15:00 +0800 | [diff] [blame] | 172 | } |
| 173 | |
| 174 | static void app_gpu_dump_multi_compat(const struct app_gpu *gpu, const struct app_gpu *other, |
Chia-I Wu | 190ebdc | 2014-08-06 12:04:13 +0800 | [diff] [blame] | 175 | const XGL_GPU_COMPATIBILITY_INFO *info) |
Chia-I Wu | d4bae36 | 2014-07-29 11:15:00 +0800 | [diff] [blame] | 176 | { |
Chia-I Wu | 190ebdc | 2014-08-06 12:04:13 +0800 | [diff] [blame] | 177 | printf("XGL_GPU_COMPATIBILITY_INFO[GPU%d]\n", other->id); |
Chia-I Wu | d4bae36 | 2014-07-29 11:15:00 +0800 | [diff] [blame] | 178 | |
| 179 | #define TEST(info, b) printf(#b " = %u\n", (bool) (info->compatibilityFlags & XGL_GPU_COMPAT_ ##b## _BIT)) |
Chia-I Wu | 190ebdc | 2014-08-06 12:04:13 +0800 | [diff] [blame] | 180 | TEST(info, ASIC_FEATURES); |
| 181 | TEST(info, IQ_MATCH); |
| 182 | TEST(info, PEER_TRANSFER); |
| 183 | TEST(info, SHARED_MEMORY); |
| 184 | TEST(info, SHARED_SYNC); |
| 185 | TEST(info, SHARED_GPU0_DISPLAY); |
| 186 | TEST(info, SHARED_GPU1_DISPLAY); |
Chia-I Wu | d4bae36 | 2014-07-29 11:15:00 +0800 | [diff] [blame] | 187 | #undef TEST |
| 188 | } |
| 189 | |
Courtney Goeltzenleuchter | d183e71 | 2014-08-06 16:12:02 -0600 | [diff] [blame] | 190 | static void app_gpu_multi_compat(struct app_gpu *gpus, XGL_UINT gpu_count) |
| 191 | { |
| 192 | XGL_RESULT err; |
| 193 | XGL_UINT i, j; |
| 194 | |
| 195 | for (i = 0; i < gpu_count; i++) { |
| 196 | for (j = 0; j < gpu_count; j++) { |
| 197 | XGL_GPU_COMPATIBILITY_INFO info; |
| 198 | |
| 199 | if (i == j) |
| 200 | continue; |
| 201 | |
| 202 | err = xglGetMultiGpuCompatibility(gpus[i].obj, |
| 203 | gpus[j].obj, &info); |
| 204 | if (err) |
| 205 | ERR_EXIT(err); |
| 206 | |
| 207 | app_gpu_dump_multi_compat(&gpus[i], &gpus[j], &info); |
| 208 | } |
| 209 | } |
| 210 | } |
| 211 | |
Chia-I Wu | d4bae36 | 2014-07-29 11:15:00 +0800 | [diff] [blame] | 212 | static void app_gpu_dump_props(const struct app_gpu *gpu) |
| 213 | { |
Chia-I Wu | 190ebdc | 2014-08-06 12:04:13 +0800 | [diff] [blame] | 214 | const XGL_PHYSICAL_GPU_PROPERTIES *props = &gpu->props; |
Chia-I Wu | d4bae36 | 2014-07-29 11:15:00 +0800 | [diff] [blame] | 215 | |
Chia-I Wu | 190ebdc | 2014-08-06 12:04:13 +0800 | [diff] [blame] | 216 | printf("XGL_PHYSICAL_GPU_PROPERTIES\n"); |
| 217 | printf("\tstructSize = %u\n", props->structSize); |
| 218 | printf("\tapiVersion = %u\n", props->apiVersion); |
| 219 | printf("\tdriverVersion = %u\n", props->driverVersion); |
| 220 | printf("\tvendorId = 0x%04x\n", props->vendorId); |
| 221 | printf("\tdeviceId = 0x%04x\n", props->deviceId); |
| 222 | printf("\tgpuType = %s\n", xgl_gpu_type_string(props->gpuType)); |
| 223 | printf("\tgpuName = %s\n", props->gpuName); |
| 224 | printf("\tmaxMemRefsPerSubmission = %u\n", props->maxMemRefsPerSubmission); |
| 225 | printf("\tvirtualMemPageSize = %u\n", props->virtualMemPageSize); |
| 226 | printf("\tmaxInlineMemoryUpdateSize = %u\n", props->maxInlineMemoryUpdateSize); |
| 227 | printf("\tmaxBoundDescriptorSets = %u\n", props->maxBoundDescriptorSets); |
| 228 | printf("\tmaxThreadGroupSize = %u\n", props->maxThreadGroupSize); |
| 229 | printf("\ttimestampFrequency = %lu\n", props->timestampFrequency); |
| 230 | printf("\tmultiColorAttachmentClears = %u\n", props->multiColorAttachmentClears); |
Chia-I Wu | d4bae36 | 2014-07-29 11:15:00 +0800 | [diff] [blame] | 231 | } |
| 232 | |
| 233 | static void app_gpu_dump_perf(const struct app_gpu *gpu) |
| 234 | { |
Chia-I Wu | 190ebdc | 2014-08-06 12:04:13 +0800 | [diff] [blame] | 235 | const XGL_PHYSICAL_GPU_PERFORMANCE *perf = &gpu->perf; |
Chia-I Wu | d4bae36 | 2014-07-29 11:15:00 +0800 | [diff] [blame] | 236 | |
Chia-I Wu | 190ebdc | 2014-08-06 12:04:13 +0800 | [diff] [blame] | 237 | printf("XGL_PHYSICAL_GPU_PERFORMANCE\n"); |
| 238 | printf("\tmaxGpuClock = %f\n", perf->maxGpuClock); |
| 239 | printf("\taluPerClock = %f\n", perf->aluPerClock); |
| 240 | printf("\ttexPerClock = %f\n", perf->texPerClock); |
| 241 | printf("\tprimsPerClock = %f\n", perf->primsPerClock); |
| 242 | printf("\tpixelsPerClock = %f\n", perf->pixelsPerClock); |
Chia-I Wu | d4bae36 | 2014-07-29 11:15:00 +0800 | [diff] [blame] | 243 | } |
| 244 | |
Chia-I Wu | f5c46f4 | 2014-08-05 15:33:40 +0800 | [diff] [blame] | 245 | static void app_gpu_dump_queue_props(const struct app_gpu *gpu, XGL_UINT id) |
Chia-I Wu | d4bae36 | 2014-07-29 11:15:00 +0800 | [diff] [blame] | 246 | { |
Chia-I Wu | 190ebdc | 2014-08-06 12:04:13 +0800 | [diff] [blame] | 247 | const XGL_PHYSICAL_GPU_QUEUE_PROPERTIES *props = &gpu->queue_props[id]; |
Chia-I Wu | d4bae36 | 2014-07-29 11:15:00 +0800 | [diff] [blame] | 248 | |
Chia-I Wu | 190ebdc | 2014-08-06 12:04:13 +0800 | [diff] [blame] | 249 | printf("XGL_PHYSICAL_GPU_QUEUE_PROPERTIES[%d]\n", id); |
| 250 | printf("\tstructSize = %u\n", props->structSize); |
| 251 | printf("\tqueueFlags = %c%c%c%c\n", |
| 252 | (props->queueFlags & XGL_QUEUE_GRAPHICS_BIT) ? 'G' : '.', |
| 253 | (props->queueFlags & XGL_QUEUE_COMPUTE_BIT) ? 'C' : '.', |
| 254 | (props->queueFlags & XGL_QUEUE_DMA_BIT) ? 'D' : '.', |
| 255 | (props->queueFlags & XGL_QUEUE_EXTENDED_BIT) ? 'X' : '.'); |
| 256 | printf("\tqueueCount = %u\n", props->queueCount); |
| 257 | printf("\tmaxAtomicCounters = %u\n", props->maxAtomicCounters); |
| 258 | printf("\tsupportsTimestamps = %u\n", props->supportsTimestamps); |
Chia-I Wu | d4bae36 | 2014-07-29 11:15:00 +0800 | [diff] [blame] | 259 | } |
| 260 | |
| 261 | static void app_gpu_dump_memory_props(const struct app_gpu *gpu) |
| 262 | { |
Chia-I Wu | 190ebdc | 2014-08-06 12:04:13 +0800 | [diff] [blame] | 263 | const XGL_PHYSICAL_GPU_MEMORY_PROPERTIES *props = &gpu->memory_props; |
Chia-I Wu | d4bae36 | 2014-07-29 11:15:00 +0800 | [diff] [blame] | 264 | |
Chia-I Wu | 190ebdc | 2014-08-06 12:04:13 +0800 | [diff] [blame] | 265 | printf("XGL_PHYSICAL_GPU_MEMORY_PROPERTIES\n"); |
| 266 | printf("\tstructSize = %u\n", props->structSize); |
| 267 | printf("\tsupportsMigration = %u\n", props->supportsMigration); |
| 268 | printf("\tsupportsVirtualMemoryRemapping = %u\n", props->supportsVirtualMemoryRemapping); |
| 269 | printf("\tsupportsPinning = %u\n", props->supportsPinning); |
Chia-I Wu | d4bae36 | 2014-07-29 11:15:00 +0800 | [diff] [blame] | 270 | } |
| 271 | |
| 272 | static void app_gpu_dump(const struct app_gpu *gpu) |
| 273 | { |
Chia-I Wu | 190ebdc | 2014-08-06 12:04:13 +0800 | [diff] [blame] | 274 | XGL_UINT i; |
Chia-I Wu | f5c46f4 | 2014-08-05 15:33:40 +0800 | [diff] [blame] | 275 | |
Chia-I Wu | 190ebdc | 2014-08-06 12:04:13 +0800 | [diff] [blame] | 276 | printf("GPU%u\n", gpu->id); |
| 277 | app_gpu_dump_props(gpu); |
| 278 | printf("\n"); |
| 279 | app_gpu_dump_perf(gpu); |
| 280 | printf("\n"); |
| 281 | for (i = 0; i < gpu->queue_count; i++) { |
| 282 | app_gpu_dump_queue_props(gpu, i); |
| 283 | printf("\n"); |
| 284 | } |
| 285 | app_gpu_dump_memory_props(gpu); |
| 286 | printf("\n"); |
| 287 | app_dev_dump(&gpu->dev); |
Chia-I Wu | d4bae36 | 2014-07-29 11:15:00 +0800 | [diff] [blame] | 288 | } |
| 289 | |
Chia-I Wu | d4bae36 | 2014-07-29 11:15:00 +0800 | [diff] [blame] | 290 | int main(int argc, char **argv) |
| 291 | { |
Chia-I Wu | 190ebdc | 2014-08-06 12:04:13 +0800 | [diff] [blame] | 292 | static const XGL_APPLICATION_INFO app_info = { |
| 293 | .sType = XGL_STRUCTURE_TYPE_APPLICATION_INFO, |
| 294 | .pNext = NULL, |
| 295 | .pAppName = (const XGL_CHAR *) "xglinfo", |
| 296 | .appVersion = 1, |
| 297 | .pEngineName = (const XGL_CHAR *) "xglinfo", |
| 298 | .engineVersion = 1, |
| 299 | .apiVersion = XGL_MAKE_VERSION(0, 22, 0), |
| 300 | }; |
| 301 | struct app_gpu gpus[MAX_GPUS]; |
| 302 | XGL_PHYSICAL_GPU objs[MAX_GPUS]; |
| 303 | XGL_UINT gpu_count, i; |
| 304 | XGL_RESULT err; |
Chia-I Wu | d4bae36 | 2014-07-29 11:15:00 +0800 | [diff] [blame] | 305 | |
Chia-I Wu | 190ebdc | 2014-08-06 12:04:13 +0800 | [diff] [blame] | 306 | err = xglInitAndEnumerateGpus(&app_info, NULL, |
| 307 | MAX_GPUS, &gpu_count, objs); |
| 308 | if (err) |
| 309 | ERR_EXIT(err); |
Chia-I Wu | d4bae36 | 2014-07-29 11:15:00 +0800 | [diff] [blame] | 310 | |
Chia-I Wu | 190ebdc | 2014-08-06 12:04:13 +0800 | [diff] [blame] | 311 | for (i = 0; i < gpu_count; i++) { |
| 312 | app_gpu_init(&gpus[i], i, objs[i]); |
| 313 | app_gpu_dump(&gpus[i]); |
| 314 | printf("\n\n"); |
| 315 | } |
Chia-I Wu | d4bae36 | 2014-07-29 11:15:00 +0800 | [diff] [blame] | 316 | |
Chia-I Wu | 190ebdc | 2014-08-06 12:04:13 +0800 | [diff] [blame] | 317 | app_gpu_multi_compat(gpus, gpu_count); |
Chia-I Wu | d4bae36 | 2014-07-29 11:15:00 +0800 | [diff] [blame] | 318 | |
Chia-I Wu | 190ebdc | 2014-08-06 12:04:13 +0800 | [diff] [blame] | 319 | for (i = 0; i < gpu_count; i++) |
| 320 | app_gpu_destroy(&gpus[i]); |
Chia-I Wu | d4bae36 | 2014-07-29 11:15:00 +0800 | [diff] [blame] | 321 | |
Chia-I Wu | 0b9a737 | 2014-08-06 12:09:19 +0800 | [diff] [blame] | 322 | xglInitAndEnumerateGpus(&app_info, NULL, 0, &gpu_count, NULL); |
| 323 | |
Chia-I Wu | 190ebdc | 2014-08-06 12:04:13 +0800 | [diff] [blame] | 324 | return 0; |
Chia-I Wu | d4bae36 | 2014-07-29 11:15:00 +0800 | [diff] [blame] | 325 | } |