|
XenevaOS
|
#include <xe_drm.h>
Public Attributes | |
| __u64 | extensions |
| __u32 | query |
| __u32 | size |
| __u64 | data |
| __u64 | reserved [2] |
struct drm_xe_device_query - Input of &DRM_IOCTL_XE_DEVICE_QUERY - main structure to query device information
The user selects the type of data to query among DRM_XE_DEVICE_QUERY_* and sets the value in the query member. This determines the type of the structure provided by the driver in data, among struct drm_xe_query_*.
The @query can be:
If size is set to 0, the driver fills it with the required size for the requested type of data to query. If size is equal to the required size, the queried information is copied into data. If size is set to a value different from 0 and different from the required size, the IOCTL call returns -EINVAL.
For example the following code snippet allows retrieving and printing information about the device engines with DRM_XE_DEVICE_QUERY_ENGINES:
.. code-block:: C
struct drm_xe_query_engines *engines;
struct drm_xe_device_query query = {
.extensions = 0,
.query = DRM_XE_DEVICE_QUERY_ENGINES,
.size = 0,
.data = 0,
};
ioctl(fd, DRM_IOCTL_XE_DEVICE_QUERY, &query);
engines = malloc(query.size);
query.data = (uintptr_t)engines;
ioctl(fd, DRM_IOCTL_XE_DEVICE_QUERY, &query);
for (int i = 0; i < engines->num_engines; i++) {
printf("Engine %d: %s\n", i,
engines->engines[i].instance.engine_class ==
DRM_XE_ENGINE_CLASS_RENDER ? "RENDER":
engines->engines[i].instance.engine_class ==
DRM_XE_ENGINE_CLASS_COPY ? "COPY":
engines->engines[i].instance.engine_class ==
DRM_XE_ENGINE_CLASS_VIDEO_DECODE ? "VIDEO_DECODE":
engines->engines[i].instance.engine_class ==
DRM_XE_ENGINE_CLASS_VIDEO_ENHANCE ? "VIDEO_ENHANCE":
engines->engines[i].instance.engine_class ==
DRM_XE_ENGINE_CLASS_COMPUTE ? "COMPUTE":
"UNKNOWN");
}
free(engines);
| __u64 drm_xe_device_query::data |
@data: Queried data is placed here
| __u64 drm_xe_device_query::extensions |
@extensions: Pointer to the first extension struct, if any
| __u32 drm_xe_device_query::query |
@query: The type of data to query
| __u64 drm_xe_device_query::reserved[2] |
@reserved: Reserved
| __u32 drm_xe_device_query::size |
@size: Size of the queried data