History

drm/i915/uapi: Add query for hwconfig blob

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.

Rodrigo Vivi committed 4 years ago

Commit 78e1fb31 parent 8781f052 files · +24 −0Browse files

Unified · Split

2 files
  1. drivers/gpu/drm/i915/i915_query.c +23 −0
  2. include/uapi/drm/i915_drm.h +1 −0
drivers/gpu/drm/i915/i915_query.c+23−0
@@ -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
482static 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 = &gt->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
482static int (* const i915_query_funcs[])(struct drm_i915_private *dev_priv,504static 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
490int i915_query_ioctl(struct drm_device *dev, void *data, struct drm_file *file)513int i915_query_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
include/uapi/drm/i915_drm.h+1−0
@@ -2691,6 +2691,7 @@ struct drm_i915_query_item { · 2690 unmodified lines
2691#define DRM_I915_QUERY_ENGINE_INFO 22691#define DRM_I915_QUERY_ENGINE_INFO 2
2692#define DRM_I915_QUERY_PERF_CONFIG 32692#define DRM_I915_QUERY_PERF_CONFIG 3
2693#define DRM_I915_QUERY_MEMORY_REGIONS 42693#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 /**

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t