diff options
author | Mark Janes <[email protected]> | 2019-07-25 14:31:40 -0700 |
---|---|---|
committer | Mark Janes <[email protected]> | 2019-08-01 16:39:54 -0700 |
commit | d594d2a0524ff8d7c14b4842119936163bfa9318 (patch) | |
tree | d59452bf371a5a2527f072e85b1996599337221c | |
parent | e4a0070db4462d450ca89cf488de549cf6a3a885 (diff) |
intel/tools: use device info initializer
Reviewed-by: Kenneth Graunke <[email protected]>
Reviewed-by: Lionel Landwerlin <[email protected]>
-rw-r--r-- | src/intel/tools/intel_dump_gpu.c | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/src/intel/tools/intel_dump_gpu.c b/src/intel/tools/intel_dump_gpu.c index 09b8db39aa2..f9a5668be53 100644 --- a/src/intel/tools/intel_dump_gpu.c +++ b/src/intel/tools/intel_dump_gpu.c @@ -172,21 +172,6 @@ gem_mmap(int fd, uint32_t handle, uint64_t offset, uint64_t size) return (void *)(uintptr_t) mmap.addr_ptr; } -static int -gem_get_param(int fd, uint32_t param) -{ - int value; - drm_i915_getparam_t gp = { - .param = param, - .value = &value - }; - - if (gem_ioctl(fd, DRM_IOCTL_I915_GETPARAM, &gp) == -1) - return 0; - - return value; -} - static enum drm_i915_gem_engine_class engine_class_from_ring_flag(uint32_t ring_flag) { @@ -219,13 +204,9 @@ dump_execbuffer2(int fd, struct drm_i915_gem_execbuffer2 *execbuffer2) /* We can't do this at open time as we're not yet authenticated. */ if (device == 0) { - device = gem_get_param(fd, I915_PARAM_CHIPSET_ID); - fail_if(device == 0 || devinfo.gen == 0, "failed to identify chipset\n"); - } - if (devinfo.gen == 0) { - fail_if(!gen_get_device_info(device, &devinfo), - "failed to identify chipset=0x%x\n", device); - + fail_if(!gen_get_device_info_from_fd(fd, &devinfo), + "failed to identify chipset.\n"); + device = devinfo.chipset_id; aub_file_init(&aub_file, output_file, verbose == 2 ? stdout : NULL, device, program_invocation_short_name); |