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);
}