diff options
author | Ben Widawsky <ben@bwidawsk.net> | 2017-07-06 14:21:13 -0700 |
---|---|---|
committer | Ben Widawsky <ben@bwidawsk.net> | 2017-07-06 14:33:34 -0700 |
commit | 6d02d6942c9a4a56163a6f882b3d2f29ce09c0fb (patch) | |
tree | b273e80cd2215334c21fb62fe7de3018ffb86f01 | |
parent | 3e986137888541853478b76f280ffa1fd816f445 (diff) |
intel: Make driver aware of MOCS table versionfast_jenkins
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
-rw-r--r-- | src/intel/vulkan/anv_device.c | 8 | ||||
-rw-r--r-- | src/intel/vulkan/anv_private.h | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i915/intel_context.c | 5 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/intel_screen.c | 4 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/intel_screen.h | 2 |
5 files changed, 20 insertions, 1 deletions
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index 3dc55dbb8d..a1a61a81f8 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -368,6 +368,14 @@ anv_physical_device_init(struct anv_physical_device *device, device->info.max_cs_threads = max_cs_threads; } + if (device->info.gen >= 9) { + device->mocs_version = anv_gem_get_param(fd, + I915_PARAM_MOCS_TABLE_VERSION); + if (device->mocs_version > 1) { + anv_perf_warn("Kernel exposes newer MOCS table\n"); + } + } + brw_process_intel_debug_variable(); device->compiler = brw_compiler_create(NULL, &device->info); diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index 573778dad5..b8241a9b22 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -684,6 +684,8 @@ struct anv_physical_device { uint32_t eu_total; uint32_t subslice_total; + uint8_t mocs_version; + struct { uint32_t type_count; struct anv_memory_type types[VK_MAX_MEMORY_TYPES]; diff --git a/src/mesa/drivers/dri/i915/intel_context.c b/src/mesa/drivers/dri/i915/intel_context.c index e0766a0e3f..f76250f549 100644 --- a/src/mesa/drivers/dri/i915/intel_context.c +++ b/src/mesa/drivers/dri/i915/intel_context.c @@ -521,8 +521,11 @@ intelInitContext(struct intel_context *intel, INTEL_DEBUG = parse_debug_string(getenv("INTEL_DEBUG"), debug_control); if (INTEL_DEBUG & DEBUG_BUFMGR) dri_bufmgr_set_debug(intel->bufmgr, true); - if (INTEL_DEBUG & DEBUG_PERF) + if (INTEL_DEBUG & DEBUG_PERF) { intel->perf_debug = true; + if (screen->mocs_version > 1) + fprintf(stderr, "Kernel exposes newer MOCS table\n"); + } if (INTEL_DEBUG & DEBUG_AUB) drm_intel_bufmgr_gem_set_aub_dump(intel->bufmgr, true); diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c index c75f2125d4..9299467e75 100644 --- a/src/mesa/drivers/dri/i965/intel_screen.c +++ b/src/mesa/drivers/dri/i965/intel_screen.c @@ -2301,6 +2301,10 @@ __DRIconfig **intelInitScreen2(__DRIscreen *dri_screen) (ret != -1 || errno != EINVAL); } + if (devinfo->gen >= 9) + screen->mocs_version = intel_get_integer(screen, + I915_PARAM_MOCS_TABLE_VERSION); + dri_screen->extensions = !screen->has_context_reset_notification ? screenExtensions : intelRobustScreenExtensions; diff --git a/src/mesa/drivers/dri/i965/intel_screen.h b/src/mesa/drivers/dri/i965/intel_screen.h index f78b3e8f74..eb801f8155 100644 --- a/src/mesa/drivers/dri/i965/intel_screen.h +++ b/src/mesa/drivers/dri/i965/intel_screen.h @@ -112,6 +112,8 @@ struct intel_screen bool mesa_format_supports_texture[MESA_FORMAT_COUNT]; bool mesa_format_supports_render[MESA_FORMAT_COUNT]; enum isl_format mesa_to_isl_render_format[MESA_FORMAT_COUNT]; + + unsigned mocs_version; }; extern void intelDestroyContext(__DRIcontext * driContextPriv); |