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
479479 return total_length;
480480 }
481481
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 = &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+
482504 static int (* const i915_query_funcs[])(struct drm_i915_private *dev_priv,
483505 struct drm_i915_query_item *query_item) = {
484506 query_topology_info,
485507 query_engine_info,
486508 query_perf_config,
487509 query_memregion_info,
510+ query_hwconfig_blob,
488511 };
489512
490513 int 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
26912691 #define DRM_I915_QUERY_ENGINE_INFO 2
26922692 #define DRM_I915_QUERY_PERF_CONFIG 3
26932693 #define DRM_I915_QUERY_MEMORY_REGIONS 4
2694+#define DRM_I915_QUERY_HWCONFIG_BLOB 5
26942695 /* Must be kept compact -- no holes and well documented */
26952696
26962697 /**

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