In this interface i915 is returning a blob of data which it receives from the guc software. This blob provides some useful data about the hardware for drivers. The format of this blob will be documented in the Programmer Reference Manuals when released.
Unified · Split
| @@ -479,12 +479,35 @@ static int query_memregion_info(struct drm_i915_private *i915, · 478 unmodified lines | |||
| 479 | return total_length; | 479 | return total_length; |
| 480 | } | 480 | } |
| 481 | 481 | ||
| 482 | static int query_hwconfig_blob(struct drm_i915_private *i915, | ||
| 483 | struct drm_i915_query_item *query_item) | ||
| 484 | { | ||
| 485 | struct intel_gt *gt = to_gt(i915); | ||
| 486 | struct intel_hwconfig *hwconfig = >->info.hwconfig; | ||
| 487 | |||
| 488 | if (!hwconfig->size || !hwconfig->ptr) | ||
| 489 | return -ENODEV; | ||
| 490 | |||
| 491 | if (query_item->length == 0) | ||
| 492 | return hwconfig->size; | ||
| 493 | |||
| 494 | if (query_item->length < hwconfig->size) | ||
| 495 | return -EINVAL; | ||
| 496 | |||
| 497 | if (copy_to_user(u64_to_user_ptr(query_item->data_ptr), | ||
| 498 | hwconfig->ptr, hwconfig->size)) | ||
| 499 | return -EFAULT; | ||
| 500 | |||
| 501 | return hwconfig->size; | ||
| 502 | } | ||
| 503 | |||
| 482 | static int (* const i915_query_funcs[])(struct drm_i915_private *dev_priv, | 504 | static int (* const i915_query_funcs[])(struct drm_i915_private *dev_priv, |
| 483 | struct drm_i915_query_item *query_item) = { | 505 | struct drm_i915_query_item *query_item) = { |
| 484 | query_topology_info, | 506 | query_topology_info, |
| 485 | query_engine_info, | 507 | query_engine_info, |
| 486 | query_perf_config, | 508 | query_perf_config, |
| 487 | query_memregion_info, | 509 | query_memregion_info, |
| 510 | query_hwconfig_blob, | ||
| 488 | }; | 511 | }; |
| 489 | 512 | ||
| 490 | int i915_query_ioctl(struct drm_device *dev, void *data, struct drm_file *file) | 513 | int i915_query_ioctl(struct drm_device *dev, void *data, struct drm_file *file) |
| @@ -2691,6 +2691,7 @@ struct drm_i915_query_item { · 2690 unmodified lines | |||
| 2691 | #define DRM_I915_QUERY_ENGINE_INFO 2 | 2691 | #define DRM_I915_QUERY_ENGINE_INFO 2 |
| 2692 | #define DRM_I915_QUERY_PERF_CONFIG 3 | 2692 | #define DRM_I915_QUERY_PERF_CONFIG 3 |
| 2693 | #define DRM_I915_QUERY_MEMORY_REGIONS 4 | 2693 | #define DRM_I915_QUERY_MEMORY_REGIONS 4 |
| 2694 | #define DRM_I915_QUERY_HWCONFIG_BLOB 5 | ||
| 2694 | /* Must be kept compact -- no holes and well documented */ | 2695 | /* Must be kept compact -- no holes and well documented */ |
| 2695 | 2696 | ||
| 2696 | /** | 2697 | /** |