diff options
author | Lionel Landwerlin <[email protected]> | 2016-09-07 17:19:35 +0100 |
---|---|---|
committer | Lionel Landwerlin <[email protected]> | 2016-09-21 12:01:06 +0300 |
commit | 09394ee6cfe9df2c99373963794c60678da08b39 (patch) | |
tree | 01a4ff0b5a7a8c92fd949af3255c73240f888250 /src/intel/vulkan/anv_device.c | |
parent | 1f291369e430922821c6f9fe5d73998c0eb09501 (diff) |
anv: device: calculate compute thread numbers using subslices numbers
Signed-off-by: Lionel Landwerlin <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_device.c')
-rw-r--r-- | src/intel/vulkan/anv_device.c | 43 |
1 files changed, 39 insertions, 4 deletions
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index e66f81252d1..fecb8505b89 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -136,6 +136,41 @@ anv_physical_device_init(struct anv_physical_device *device, bool swizzled = anv_gem_get_bit6_swizzle(fd, I915_TILING_X); + device->max_vs_threads = device->info->max_vs_threads; + device->max_hs_threads = device->info->max_hs_threads; + device->max_ds_threads = device->info->max_ds_threads; + device->max_gs_threads = device->info->max_gs_threads; + device->max_wm_threads = device->info->max_wm_threads; + + /* GENs prior to 8 do not support EU/Subslice info */ + if (device->info->gen >= 8) { + device->subslice_total = anv_gem_get_param(fd, I915_PARAM_SUBSLICE_TOTAL); + device->eu_total = anv_gem_get_param(fd, I915_PARAM_EU_TOTAL); + + /* Without this information, we cannot get the right Braswell + * brandstrings, and we have to use conservative numbers for GPGPU on + * many platforms, but otherwise, things will just work. + */ + if (device->subslice_total < 1 || device->eu_total < 1) { + fprintf(stderr, "WARNING: Kernel 4.1 required to properly" + " query GPU properties.\n"); + } + } else if (device->info->gen == 7) { + device->subslice_total = 1 << (device->info->gt - 1); + } + + if (device->info->is_cherryview && + device->subslice_total > 0 && device->eu_total > 0) { + /* Logical CS threads = EUs per subslice * 7 threads per EU */ + device->max_cs_threads = device->eu_total / device->subslice_total * 7; + + /* Fuse configurations may give more threads than expected, never less. */ + if (device->max_cs_threads < device->info->max_cs_threads) + device->max_cs_threads = device->info->max_cs_threads; + } else { + device->max_cs_threads = device->info->max_cs_threads; + } + close(fd); brw_process_intel_debug_variable(); @@ -503,11 +538,11 @@ void anv_GetPhysicalDeviceProperties( .maxFragmentCombinedOutputResources = 8, .maxComputeSharedMemorySize = 32768, .maxComputeWorkGroupCount = { 65535, 65535, 65535 }, - .maxComputeWorkGroupInvocations = 16 * devinfo->max_cs_threads, + .maxComputeWorkGroupInvocations = 16 * pdevice->max_cs_threads, .maxComputeWorkGroupSize = { - 16 * devinfo->max_cs_threads, - 16 * devinfo->max_cs_threads, - 16 * devinfo->max_cs_threads, + 16 * pdevice->max_cs_threads, + 16 * pdevice->max_cs_threads, + 16 * pdevice->max_cs_threads, }, .subPixelPrecisionBits = 4 /* FIXME */, .subTexelPrecisionBits = 4 /* FIXME */, |