From 67a10ea21596b2dff3ea2dc40713e59784e02ef2 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Thu, 19 Mar 2020 16:45:19 -0500 Subject: [PATCH] intel/dump_gpu: Handle a bunch of getparam in the no-HW case Reviewed-by: Lionel Landwerlin Tested-by: Marge Bot Part-of: --- src/intel/tools/intel_dump_gpu.c | 49 ++++++++++++++++++++++++++++++-- 1 file changed, 47 insertions(+), 2 deletions(-) diff --git a/src/intel/tools/intel_dump_gpu.c b/src/intel/tools/intel_dump_gpu.c index fabbf4f73d8..24dd1dffcaa 100644 --- a/src/intel/tools/intel_dump_gpu.c +++ b/src/intel/tools/intel_dump_gpu.c @@ -481,8 +481,53 @@ ioctl(int fd, unsigned long request, ...) if (getparam->param == I915_PARAM_CHIPSET_ID) return get_pci_id(fd, getparam->value); - if (device_override) - return -1; + if (device_override) { + switch (getparam->param) { + case I915_PARAM_CS_TIMESTAMP_FREQUENCY: + *getparam->value = devinfo.timestamp_frequency; + return 0; + + case I915_PARAM_HAS_WAIT_TIMEOUT: + case I915_PARAM_HAS_EXECBUF2: + case I915_PARAM_MMAP_VERSION: + case I915_PARAM_HAS_EXEC_ASYNC: + case I915_PARAM_HAS_EXEC_FENCE: + case I915_PARAM_HAS_EXEC_FENCE_ARRAY: + *getparam->value = 1; + return 0; + + case I915_PARAM_HAS_EXEC_SOFTPIN: + *getparam->value = devinfo.gen >= 8 && !devinfo.is_cherryview; + return 0; + + default: + return -1; + } + } + + return libc_ioctl(fd, request, argp); + } + + case DRM_IOCTL_I915_GEM_CONTEXT_GETPARAM: { + struct drm_i915_gem_context_param *getparam = argp; + + ensure_device_info(fd); + + if (device_override) { + switch (getparam->param) { + case I915_CONTEXT_PARAM_GTT_SIZE: + if (devinfo.is_elkhartlake) + getparam->value = 1ull << 36; + else if (devinfo.gen >= 8 && !devinfo.is_cherryview) + getparam->value = 1ull << 48; + else + getparam->value = 1ull << 31; + return 0; + + default: + return -1; + } + } return libc_ioctl(fd, request, argp); } -- 2.30.2