build: Update to latest eudebug xe uapi

Remove implementation of some unused and removed
uapis

Signed-off-by: Brandon Yates <brandon.yates@intel.com>
This commit is contained in:
Brandon Yates
2024-07-12 18:11:41 +00:00
committed by Compute-Runtime-Automation
parent 8b99cbe48b
commit 4513e42ddb
11 changed files with 443 additions and 406 deletions

View File

@@ -7,5 +7,4 @@
#pragma once
#include "third_party/uapi-eudebug/drm/xe_drm.h"
#include "third_party/uapi-eudebug/drm/xe_drm_tmp.h"
#include "third_party/uapi-eudebug/drm/xe_drm.h"

View File

@@ -1074,15 +1074,7 @@ int IoctlHelperXe::ioctl(DrmIoctl request, void *arg) {
GemVmControl *vmControl = static_cast<GemVmControl *>(arg);
struct drm_xe_vm_create args = {};
args.flags = vmControl->flags;
if (drm.getRootDeviceEnvironment().executionEnvironment.getDebuggingMode() != DebuggingMode::disabled) {
args.extensions = reinterpret_cast<unsigned long long>(allocateDebugMetadata());
}
ret = IoctlHelper::ioctl(request, &args);
if (drm.getRootDeviceEnvironment().executionEnvironment.getDebuggingMode() != DebuggingMode::disabled) {
args.extensions = reinterpret_cast<unsigned long long>(freeDebugMetadata(reinterpret_cast<void *>(args.extensions)));
}
vmControl->vmId = args.vm_id;
xeLog(" -> IoctlHelperXe::ioctl gemVmCreate f=0x%x vmid=0x%x r=%d\n", vmControl->flags, vmControl->vmId, ret);

View File

@@ -124,7 +124,6 @@ class IoctlHelperXe : public IoctlHelper {
bool setDomainCpu(uint32_t handle, bool writeEnable) override;
uint16_t getCpuCachingMode(std::optional<bool> isCoherent, bool allocationInSystemMemory) const;
void addDebugMetadata(DrmResourceClass type, uint64_t *offset, uint64_t size);
void addDebugMetadataCookie(uint64_t cookie);
uint32_t registerResource(DrmResourceClass classType, const void *data, size_t size) override;
void unregisterResource(uint32_t handle) override;
void insertEngineToContextParams(ContextParamEngines<> &contextParamEngines, uint32_t engineId, const EngineClassInstance *engineClassInstance, uint32_t tileId, bool hasVirtualEngines) override;
@@ -147,11 +146,9 @@ class IoctlHelperXe : public IoctlHelper {
int xeVmBind(const VmBindParams &vmBindParams, bool bindOp);
void xeShowBindTable();
void updateBindInfo(uint32_t handle, uint64_t userPtr, uint64_t size);
void *allocateDebugMetadata();
int debuggerOpenIoctl(DrmIoctl request, void *arg);
int debuggerMetadataCreateIoctl(DrmIoctl request, void *arg);
int debuggerMetadataDestroyIoctl(DrmIoctl request, void *arg);
void *freeDebugMetadata(void *metadata);
int getRunaloneExtProperty();
virtual bool isExtraEngineClassAllowed(uint16_t engineClass) const { return false; }
virtual uint32_t getCxlType(struct drm_xe_query_config *config) { return 0u; }
@@ -194,7 +191,6 @@ class IoctlHelperXe : public IoctlHelper {
uint64_t size;
bool isCookie;
};
std::vector<DebugMetadata> debugMetadata;
template <typename... XeLogArgs>
void xeLog(XeLogArgs &&...args) const;

View File

@@ -57,84 +57,6 @@ int IoctlHelperXe::debuggerMetadataDestroyIoctl(DrmIoctl request, void *arg) {
return ret;
}
void *IoctlHelperXe::allocateDebugMetadata() {
drm_xe_ext_vm_set_debug_metadata *prev = nullptr;
drm_xe_ext_vm_set_debug_metadata *xeMetadataRoot = nullptr;
for (auto &metadata : debugMetadata) {
auto *xeMetadata = new drm_xe_ext_vm_set_debug_metadata();
if (!xeMetadataRoot) {
xeMetadataRoot = xeMetadata;
}
xeMetadata->base.name = DRM_XE_VM_EXTENSION_SET_DEBUG_METADATA;
xeMetadata->offset = metadata.offset;
xeMetadata->len = metadata.size;
if (metadata.isCookie) {
xeMetadata->type = DRM_XE_VM_DEBUG_METADATA_COOKIE;
} else {
switch (metadata.type) {
case DrmResourceClass::contextSaveArea:
xeMetadata->type = DRM_XE_VM_DEBUG_METADATA_SIP_AREA;
break;
case DrmResourceClass::sbaTrackingBuffer:
xeMetadata->type = DRM_XE_VM_DEBUG_METADATA_SBA_AREA;
break;
case DrmResourceClass::moduleHeapDebugArea:
xeMetadata->type = DRM_XE_VM_DEBUG_METADATA_MODULE_AREA;
break;
default:
UNRECOVERABLE_IF(true);
}
}
PRINT_DEBUGGER_INFO_LOG("drm_xe_ext_vm_set_debug_metadata: type = %ul, offset = %ul, len = %ul\n", xeMetadata->type, xeMetadata->offset, xeMetadata->len);
if (prev) {
prev->base.next_extension = reinterpret_cast<unsigned long long>(xeMetadata);
}
prev = xeMetadata;
}
return xeMetadataRoot;
}
void *IoctlHelperXe::freeDebugMetadata(void *metadata) {
drm_xe_user_extension *ext = static_cast<drm_xe_user_extension *>(metadata);
drm_xe_user_extension *prev = nullptr;
drm_xe_user_extension *newRoot = nullptr;
while (ext) {
drm_xe_user_extension *temp = reinterpret_cast<drm_xe_user_extension *>(ext->next_extension);
if (ext->name == DRM_XE_VM_EXTENSION_SET_DEBUG_METADATA) {
if (prev) {
prev->next_extension = ext->next_extension;
}
delete ext;
} else {
if (!newRoot) {
newRoot = ext;
}
prev = ext;
}
ext = temp;
}
return newRoot;
}
void IoctlHelperXe::addDebugMetadataCookie(uint64_t cookie) {
DebugMetadata metadata = {DrmResourceClass::cookie, cookie, 0, true};
debugMetadata.push_back(metadata);
return;
}
void IoctlHelperXe::addDebugMetadata(DrmResourceClass type, uint64_t *offset, uint64_t size) {
if (type != DrmResourceClass::moduleHeapDebugArea && type != DrmResourceClass::contextSaveArea && type != DrmResourceClass::sbaTrackingBuffer) {
return;
}
DebugMetadata metadata = {type, reinterpret_cast<unsigned long long>(offset), size, false};
debugMetadata.push_back(metadata);
return;
}
int IoctlHelperXe::getRunaloneExtProperty() {
return DRM_XE_EXEC_QUEUE_SET_PROPERTY_EUDEBUG;
}

View File

@@ -29,22 +29,6 @@ int IoctlHelperXe::debuggerMetadataDestroyIoctl(DrmIoctl request, void *arg) {
return 0;
}
void *IoctlHelperXe::allocateDebugMetadata() {
UNRECOVERABLE_IF(true);
return nullptr;
}
void *IoctlHelperXe::freeDebugMetadata(void *metadata) {
UNRECOVERABLE_IF(true);
return nullptr;
}
void IoctlHelperXe::addDebugMetadataCookie(uint64_t cookie) {
}
void IoctlHelperXe::addDebugMetadata(DrmResourceClass type, uint64_t *offset, uint64_t size) {
}
int IoctlHelperXe::getRunaloneExtProperty() {
UNRECOVERABLE_IF(true);
return 0;

View File

@@ -29,8 +29,6 @@ using namespace NEO;
struct MockIoctlHelperXeDebug : IoctlHelperXe {
using IoctlHelperXe::bindInfo;
using IoctlHelperXe::debugMetadata;
using IoctlHelperXe::freeDebugMetadata;
using IoctlHelperXe::getRunaloneExtProperty;
using IoctlHelperXe::IoctlHelperXe;
using IoctlHelperXe::tileIdToGtId;
@@ -121,12 +119,6 @@ struct DrmMockXeDebug : public DrmMockCustom {
ret = 0;
} break;
case DrmIoctl::gemVmCreate: {
struct drm_xe_vm_create *v = static_cast<struct drm_xe_vm_create *>(arg);
drm_xe_ext_vm_set_debug_metadata *metadata = reinterpret_cast<drm_xe_ext_vm_set_debug_metadata *>(v->extensions);
while (metadata) {
vmCreateMetadata.push_back(*metadata);
metadata = reinterpret_cast<drm_xe_ext_vm_set_debug_metadata *>(metadata->base.next_extension);
}
ret = 0;
} break;
case DrmIoctl::debuggerOpen: {
@@ -209,7 +201,6 @@ struct DrmMockXeDebug : public DrmMockCustom {
uint64_t metadataType = 9999;
alignas(64) std::vector<uint8_t> queryTopology;
std::vector<drm_xe_ext_vm_set_debug_metadata> vmCreateMetadata;
std::vector<drm_xe_engine_class_instance> execQueueEngineInstances;
drm_xe_exec_queue_create execQueueCreateParams = {};
StackVec<drm_xe_wait_user_fence, 1> waitUserFenceInputs;

View File

@@ -58,119 +58,6 @@ TEST(IoctlHelperXeTest, givenIoctlHelperXeWhenCallingGetIoctForDebuggerThenCorre
verifyIoctlRequestValue(DRM_IOCTL_XE_EUDEBUG_CONNECT, DrmIoctl::debuggerOpen);
}
TEST(IoctlHelperXeTest, givenIoctlHelperXeWhenCallingaddDebugMetadataThenDataIsAdded) {
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
auto drm = DrmMockXeDebug::create(*executionEnvironment->rootDeviceEnvironments[0]);
auto xeIoctlHelper = static_cast<MockIoctlHelperXeDebug *>(drm->ioctlHelper.get());
uint64_t temp = 0;
xeIoctlHelper->addDebugMetadata(DrmResourceClass::moduleHeapDebugArea, &temp, 8000u);
ASSERT_EQ(1u, xeIoctlHelper->debugMetadata.size());
xeIoctlHelper->addDebugMetadata(DrmResourceClass::contextSaveArea, &temp, 8000u);
ASSERT_EQ(2u, xeIoctlHelper->debugMetadata.size());
xeIoctlHelper->addDebugMetadata(DrmResourceClass::sbaTrackingBuffer, &temp, 8000u);
ASSERT_EQ(3u, xeIoctlHelper->debugMetadata.size());
xeIoctlHelper->addDebugMetadata(DrmResourceClass::isa, &temp, 8000u); // ISA should be ignored
ASSERT_EQ(3u, xeIoctlHelper->debugMetadata.size());
}
TEST(IoctlHelperXeTest, givenIoctlHelperXeWhenCallingVmCreateThenDebugMetadadaIsAttached) {
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
executionEnvironment->setDebuggingMode(DebuggingMode::offline);
auto drm = DrmMockXeDebug::create(*executionEnvironment->rootDeviceEnvironments[0]);
auto xeIoctlHelper = static_cast<MockIoctlHelperXeDebug *>(drm->ioctlHelper.get());
uint64_t temp = 0;
xeIoctlHelper->addDebugMetadata(DrmResourceClass::moduleHeapDebugArea, &temp, 8000u);
xeIoctlHelper->addDebugMetadata(DrmResourceClass::contextSaveArea, &temp, 8000u);
xeIoctlHelper->addDebugMetadata(DrmResourceClass::sbaTrackingBuffer, &temp, 8000u);
xeIoctlHelper->addDebugMetadata(DrmResourceClass::isa, &temp, 8000u); // ISA should be ignored
xeIoctlHelper->addDebugMetadataCookie(123u);
GemVmControl test = {};
xeIoctlHelper->ioctl(DrmIoctl::gemVmCreate, &test);
ASSERT_EQ(4u, drm->vmCreateMetadata.size());
ASSERT_EQ(drm->vmCreateMetadata[0].type, static_cast<unsigned long long>(DRM_XE_VM_DEBUG_METADATA_MODULE_AREA));
ASSERT_EQ(drm->vmCreateMetadata[0].offset, reinterpret_cast<unsigned long long>(&temp));
ASSERT_EQ(drm->vmCreateMetadata[0].len, 8000ul);
ASSERT_EQ(drm->vmCreateMetadata[1].type, static_cast<unsigned long long>(DRM_XE_VM_DEBUG_METADATA_SIP_AREA));
ASSERT_EQ(drm->vmCreateMetadata[1].offset, reinterpret_cast<unsigned long long>(&temp));
ASSERT_EQ(drm->vmCreateMetadata[1].len, 8000ul);
ASSERT_EQ(drm->vmCreateMetadata[2].type, static_cast<unsigned long long>(DRM_XE_VM_DEBUG_METADATA_SBA_AREA));
ASSERT_EQ(drm->vmCreateMetadata[2].offset, reinterpret_cast<unsigned long long>(&temp));
ASSERT_EQ(drm->vmCreateMetadata[2].len, 8000ul);
ASSERT_EQ(drm->vmCreateMetadata[3].type, static_cast<unsigned long long>(DRM_XE_VM_DEBUG_METADATA_COOKIE));
ASSERT_EQ(drm->vmCreateMetadata[3].offset, 123ul);
ASSERT_EQ(drm->vmCreateMetadata[3].len, 0ul);
ASSERT_EQ(drm->vmCreateMetadata[3].base.next_extension, 0ul);
}
TEST(IoctlHelperXeTest, givenFreeDebugMetadataWhenVmCreateHasMultipleExtTypesThenOnlyDebugMetadataIsDeleted) {
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
executionEnvironment->setDebuggingMode(DebuggingMode::offline);
auto drm = DrmMockXeDebug::create(*executionEnvironment->rootDeviceEnvironments[0]);
auto xeIoctlHelper = static_cast<MockIoctlHelperXeDebug *>(drm->ioctlHelper.get());
drm_xe_ext_vm_set_debug_metadata *node1 = new drm_xe_ext_vm_set_debug_metadata();
drm_xe_ext_vm_set_debug_metadata *node2 = new drm_xe_ext_vm_set_debug_metadata();
drm_xe_ext_vm_set_debug_metadata *node3 = new drm_xe_ext_vm_set_debug_metadata();
node1->base.name = DRM_XE_VM_EXTENSION_SET_DEBUG_METADATA;
node2->base.name = 0x1234ul;
node3->base.name = DRM_XE_VM_EXTENSION_SET_DEBUG_METADATA;
node1->base.next_extension = reinterpret_cast<unsigned long long>(node2);
node2->base.next_extension = reinterpret_cast<unsigned long long>(node3);
drm_xe_ext_vm_set_debug_metadata *newRoot = static_cast<drm_xe_ext_vm_set_debug_metadata *>(xeIoctlHelper->freeDebugMetadata(node1));
ASSERT_EQ(newRoot, node2);
ASSERT_EQ(newRoot->base.next_extension, 0ul);
delete node2;
node1 = new drm_xe_ext_vm_set_debug_metadata();
node2 = new drm_xe_ext_vm_set_debug_metadata();
node3 = new drm_xe_ext_vm_set_debug_metadata();
node1->base.name = DRM_XE_VM_EXTENSION_SET_DEBUG_METADATA;
node2->base.name = DRM_XE_VM_EXTENSION_SET_DEBUG_METADATA;
node3->base.name = DRM_XE_VM_EXTENSION_SET_DEBUG_METADATA;
node1->base.next_extension = reinterpret_cast<unsigned long long>(node2);
node2->base.next_extension = reinterpret_cast<unsigned long long>(node3);
newRoot = static_cast<drm_xe_ext_vm_set_debug_metadata *>(xeIoctlHelper->freeDebugMetadata(node1));
ASSERT_EQ(newRoot, nullptr);
node1 = new drm_xe_ext_vm_set_debug_metadata();
node2 = new drm_xe_ext_vm_set_debug_metadata();
node3 = new drm_xe_ext_vm_set_debug_metadata();
node1->base.name = 0x1234;
node2->base.name = DRM_XE_VM_EXTENSION_SET_DEBUG_METADATA;
node3->base.name = DRM_XE_VM_EXTENSION_SET_DEBUG_METADATA;
node1->base.next_extension = reinterpret_cast<unsigned long long>(node2);
node2->base.next_extension = reinterpret_cast<unsigned long long>(node3);
newRoot = static_cast<drm_xe_ext_vm_set_debug_metadata *>(xeIoctlHelper->freeDebugMetadata(node1));
ASSERT_EQ(newRoot, node1);
ASSERT_EQ(newRoot->base.next_extension, 0ul);
delete node1;
node1 = new drm_xe_ext_vm_set_debug_metadata();
node2 = new drm_xe_ext_vm_set_debug_metadata();
node3 = new drm_xe_ext_vm_set_debug_metadata();
node1->base.name = 0x1234;
node2->base.name = 0x1234;
node3->base.name = 0x1234;
node1->base.next_extension = reinterpret_cast<unsigned long long>(node2);
node2->base.next_extension = reinterpret_cast<unsigned long long>(node3);
newRoot = static_cast<drm_xe_ext_vm_set_debug_metadata *>(xeIoctlHelper->freeDebugMetadata(node1));
ASSERT_EQ(newRoot, node1);
ASSERT_EQ(newRoot->base.next_extension, reinterpret_cast<unsigned long long>(node2));
delete node1;
delete node2;
delete node3;
}
TEST(IoctlHelperXeTest, givenIoctlHelperXeWhenCallingGetRunaloneExtPropertyThenCorrectValueReturned) {
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
executionEnvironment->setDebuggingMode(DebuggingMode::offline);

View File

@@ -29,7 +29,6 @@ using namespace NEO;
struct MockIoctlHelperXe : IoctlHelperXe {
using IoctlHelperXe::bindInfo;
using IoctlHelperXe::contextParamEngine;
using IoctlHelperXe::debugMetadata;
using IoctlHelperXe::defaultEngine;
using IoctlHelperXe::getDefaultEngineClass;
using IoctlHelperXe::getFdFromVmExport;

View File

@@ -1,3 +1,3 @@
git_url: https://gitlab.freedesktop.org/miku/kernel/-/tree/eudebug-dev
git_revision: 48236857dc7f41e5d28c25651428c4394a58966a
git_revision: 7e0438726de3a0175f8a51b029917726cad62868

View File

@@ -80,6 +80,7 @@ extern "C" {
* - &DRM_IOCTL_XE_EXEC_QUEUE_GET_PROPERTY
* - &DRM_IOCTL_XE_EXEC
* - &DRM_IOCTL_XE_WAIT_USER_FENCE
* - &DRM_IOCTL_XE_OBSERVATION
*/
/*
@@ -100,8 +101,10 @@ extern "C" {
#define DRM_XE_EXEC_QUEUE_GET_PROPERTY 0x08
#define DRM_XE_EXEC 0x09
#define DRM_XE_WAIT_USER_FENCE 0x0a
#define DRM_XE_DEBUG_METADATA_CREATE 0x0b
#define DRM_XE_DEBUG_METADATA_DESTROY 0x0c
#define DRM_XE_OBSERVATION 0x0b
#define DRM_XE_EUDEBUG_CONNECT 0x0c
#define DRM_XE_DEBUG_METADATA_CREATE 0x0d
#define DRM_XE_DEBUG_METADATA_DESTROY 0x0e
/* Must be kept compact -- no holes */
#define DRM_IOCTL_XE_DEVICE_QUERY DRM_IOWR(DRM_COMMAND_BASE + DRM_XE_DEVICE_QUERY, struct drm_xe_device_query)
@@ -115,6 +118,8 @@ extern "C" {
#define DRM_IOCTL_XE_EXEC_QUEUE_GET_PROPERTY DRM_IOWR(DRM_COMMAND_BASE + DRM_XE_EXEC_QUEUE_GET_PROPERTY, struct drm_xe_exec_queue_get_property)
#define DRM_IOCTL_XE_EXEC DRM_IOW(DRM_COMMAND_BASE + DRM_XE_EXEC, struct drm_xe_exec)
#define DRM_IOCTL_XE_WAIT_USER_FENCE DRM_IOWR(DRM_COMMAND_BASE + DRM_XE_WAIT_USER_FENCE, struct drm_xe_wait_user_fence)
#define DRM_IOCTL_XE_OBSERVATION DRM_IOW(DRM_COMMAND_BASE + DRM_XE_OBSERVATION, struct drm_xe_observation_param)
#define DRM_IOCTL_XE_EUDEBUG_CONNECT DRM_IOWR(DRM_COMMAND_BASE + DRM_XE_EUDEBUG_CONNECT, struct drm_xe_eudebug_connect)
#define DRM_IOCTL_XE_DEBUG_METADATA_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_XE_DEBUG_METADATA_CREATE, struct drm_xe_debug_metadata_create)
#define DRM_IOCTL_XE_DEBUG_METADATA_DESTROY DRM_IOW(DRM_COMMAND_BASE + DRM_XE_DEBUG_METADATA_DESTROY, struct drm_xe_debug_metadata_destroy)
@@ -463,8 +468,16 @@ struct drm_xe_gt {
* by struct drm_xe_query_mem_regions' mem_class.
*/
__u64 far_mem_regions;
/** @ip_ver_major: Graphics/media IP major version on GMD_ID platforms */
__u16 ip_ver_major;
/** @ip_ver_minor: Graphics/media IP minor version on GMD_ID platforms */
__u16 ip_ver_minor;
/** @ip_ver_rev: Graphics/media IP revision version on GMD_ID platforms */
__u16 ip_ver_rev;
/** @pad2: MBZ */
__u16 pad2;
/** @reserved: Reserved */
__u64 reserved[8];
__u64 reserved[7];
};
/**
@@ -504,6 +517,7 @@ struct drm_xe_query_gt_list {
* containing the following in mask:
* ``DSS_COMPUTE ff ff ff ff 00 00 00 00``
* means 32 DSS are available for compute.
* - %DRM_XE_TOPO_L3_BANK - To query the mask of enabled L3 banks
* - %DRM_XE_TOPO_EU_PER_DSS - To query the mask of Execution Units (EU)
* available per Dual Sub Slices (DSS). For example a query response
* containing the following in mask:
@@ -514,9 +528,10 @@ struct drm_xe_query_topology_mask {
/** @gt_id: GT ID the mask is associated with */
__u16 gt_id;
#define DRM_XE_TOPO_DSS_GEOMETRY (1 << 0)
#define DRM_XE_TOPO_DSS_COMPUTE (1 << 1)
#define DRM_XE_TOPO_EU_PER_DSS (1 << 2)
#define DRM_XE_TOPO_DSS_GEOMETRY 1
#define DRM_XE_TOPO_DSS_COMPUTE 2
#define DRM_XE_TOPO_L3_BANK 3
#define DRM_XE_TOPO_EU_PER_DSS 4
/** @type: type of mask */
__u16 type;
@@ -578,6 +593,37 @@ struct drm_xe_query_engine_cycles {
__u64 cpu_delta;
};
/**
* struct drm_xe_query_uc_fw_version - query a micro-controller firmware version
*
* Given a uc_type this will return the branch, major, minor and patch version
* of the micro-controller firmware.
*/
struct drm_xe_query_uc_fw_version {
/** @uc_type: The micro-controller type to query firmware version */
#define XE_QUERY_UC_TYPE_GUC_SUBMISSION 0
#define XE_QUERY_UC_TYPE_HUC 1
__u16 uc_type;
/** @pad: MBZ */
__u16 pad;
/** @branch_ver: branch uc fw version */
__u32 branch_ver;
/** @major_ver: major uc fw version */
__u32 major_ver;
/** @minor_ver: minor uc fw version */
__u32 minor_ver;
/** @patch_ver: patch uc fw version */
__u32 patch_ver;
/** @pad2: MBZ */
__u32 pad2;
/** @reserved: Reserved */
__u64 reserved;
};
/**
* struct drm_xe_device_query - Input of &DRM_IOCTL_XE_DEVICE_QUERY - main
* structure to query device information
@@ -647,6 +693,8 @@ struct drm_xe_device_query {
#define DRM_XE_DEVICE_QUERY_HWCONFIG 4
#define DRM_XE_DEVICE_QUERY_GT_TOPOLOGY 5
#define DRM_XE_DEVICE_QUERY_ENGINE_CYCLES 6
#define DRM_XE_DEVICE_QUERY_UC_FW_VERSION 7
#define DRM_XE_DEVICE_QUERY_OA_UNITS 8
/** @query: The type of data to query */
__u32 query;
@@ -794,7 +842,6 @@ struct drm_xe_gem_mmap_offset {
* this.
*/
struct drm_xe_vm_create {
#define DRM_XE_VM_EXTENSION_SET_DEBUG_METADATA 0
/** @extensions: Pointer to the first extension struct, if any */
__u64 extensions;
@@ -829,8 +876,8 @@ struct drm_xe_vm_bind_op_ext_attach_debug {
/** @base: base user extension */
struct drm_xe_user_extension base;
/** @metadata_id: Debug object id from create metadata */
__u32 metadata_id;
/** @id: Debug object id from create metadata */
__u64 metadata_id;
/** @flags: Flags */
__u64 flags;
@@ -1071,11 +1118,8 @@ struct drm_xe_exec_queue_create {
#define DRM_XE_EXEC_QUEUE_EXTENSION_SET_PROPERTY 0
#define DRM_XE_EXEC_QUEUE_SET_PROPERTY_PRIORITY 0
#define DRM_XE_EXEC_QUEUE_SET_PROPERTY_TIMESLICE 1
/* Set eu debug specific flags */
#define DRM_XE_EXEC_QUEUE_SET_PROPERTY_EUDEBUG 2
#define DRM_XE_EXEC_QUEUE_EUDEBUG_FLAG_ENABLE (1 << 0)
#define DRM_XE_EXEC_QUEUE_EUDEBUG_FLAG_PAGEFAULT_ENABLE (1 << 1)
/** @extensions: Pointer to the first extension struct, if any */
__u64 extensions;
@@ -1356,6 +1400,328 @@ struct drm_xe_wait_user_fence {
__u64 reserved[2];
};
/**
* enum drm_xe_observation_type - Observation stream types
*/
enum drm_xe_observation_type {
/** @DRM_XE_OBSERVATION_TYPE_OA: OA observation stream type */
DRM_XE_OBSERVATION_TYPE_OA,
};
/**
* enum drm_xe_observation_op - Observation stream ops
*/
enum drm_xe_observation_op {
/** @DRM_XE_OBSERVATION_OP_STREAM_OPEN: Open an observation stream */
DRM_XE_OBSERVATION_OP_STREAM_OPEN,
/** @DRM_XE_OBSERVATION_OP_ADD_CONFIG: Add observation stream config */
DRM_XE_OBSERVATION_OP_ADD_CONFIG,
/** @DRM_XE_OBSERVATION_OP_REMOVE_CONFIG: Remove observation stream config */
DRM_XE_OBSERVATION_OP_REMOVE_CONFIG,
};
/**
* struct drm_xe_observation_param - Input of &DRM_XE_OBSERVATION
*
* The observation layer enables multiplexing observation streams of
* multiple types. The actual params for a particular stream operation are
* supplied via the @param pointer (use __copy_from_user to get these
* params).
*/
struct drm_xe_observation_param {
/** @extensions: Pointer to the first extension struct, if any */
__u64 extensions;
/** @observation_type: observation stream type, of enum @drm_xe_observation_type */
__u64 observation_type;
/** @observation_op: observation stream op, of enum @drm_xe_observation_op */
__u64 observation_op;
/** @param: Pointer to actual stream params */
__u64 param;
};
/**
* enum drm_xe_observation_ioctls - Observation stream fd ioctl's
*
* Information exchanged between userspace and kernel for observation fd
* ioctl's is stream type specific
*/
enum drm_xe_observation_ioctls {
/** @DRM_XE_OBSERVATION_IOCTL_ENABLE: Enable data capture for an observation stream */
DRM_XE_OBSERVATION_IOCTL_ENABLE = _IO('i', 0x0),
/** @DRM_XE_OBSERVATION_IOCTL_DISABLE: Disable data capture for a observation stream */
DRM_XE_OBSERVATION_IOCTL_DISABLE = _IO('i', 0x1),
/** @DRM_XE_OBSERVATION_IOCTL_CONFIG: Change observation stream configuration */
DRM_XE_OBSERVATION_IOCTL_CONFIG = _IO('i', 0x2),
/** @DRM_XE_OBSERVATION_IOCTL_STATUS: Return observation stream status */
DRM_XE_OBSERVATION_IOCTL_STATUS = _IO('i', 0x3),
/** @DRM_XE_OBSERVATION_IOCTL_INFO: Return observation stream info */
DRM_XE_OBSERVATION_IOCTL_INFO = _IO('i', 0x4),
};
/**
* enum drm_xe_oa_unit_type - OA unit types
*/
enum drm_xe_oa_unit_type {
/**
* @DRM_XE_OA_UNIT_TYPE_OAG: OAG OA unit. OAR/OAC are considered
* sub-types of OAG. For OAR/OAC, use OAG.
*/
DRM_XE_OA_UNIT_TYPE_OAG,
/** @DRM_XE_OA_UNIT_TYPE_OAM: OAM OA unit */
DRM_XE_OA_UNIT_TYPE_OAM,
};
/**
* struct drm_xe_oa_unit - describe OA unit
*/
struct drm_xe_oa_unit {
/** @extensions: Pointer to the first extension struct, if any */
__u64 extensions;
/** @oa_unit_id: OA unit ID */
__u32 oa_unit_id;
/** @oa_unit_type: OA unit type of @drm_xe_oa_unit_type */
__u32 oa_unit_type;
/** @capabilities: OA capabilities bit-mask */
__u64 capabilities;
#define DRM_XE_OA_CAPS_BASE (1 << 0)
/** @oa_timestamp_freq: OA timestamp freq */
__u64 oa_timestamp_freq;
/** @reserved: MBZ */
__u64 reserved[4];
/** @num_engines: number of engines in @eci array */
__u64 num_engines;
/** @eci: engines attached to this OA unit */
struct drm_xe_engine_class_instance eci[];
};
/**
* struct drm_xe_query_oa_units - describe OA units
*
* If a query is made with a struct drm_xe_device_query where .query
* is equal to DRM_XE_DEVICE_QUERY_OA_UNITS, then the reply uses struct
* drm_xe_query_oa_units in .data.
*
* OA unit properties for all OA units can be accessed using a code block
* such as the one below:
*
* .. code-block:: C
*
* struct drm_xe_query_oa_units *qoa;
* struct drm_xe_oa_unit *oau;
* u8 *poau;
*
* // malloc qoa and issue DRM_XE_DEVICE_QUERY_OA_UNITS. Then:
* poau = (u8 *)&qoa->oa_units[0];
* for (int i = 0; i < qoa->num_oa_units; i++) {
* oau = (struct drm_xe_oa_unit *)poau;
* // Access 'struct drm_xe_oa_unit' fields here
* poau += sizeof(*oau) + oau->num_engines * sizeof(oau->eci[0]);
* }
*/
struct drm_xe_query_oa_units {
/** @extensions: Pointer to the first extension struct, if any */
__u64 extensions;
/** @num_oa_units: number of OA units returned in oau[] */
__u32 num_oa_units;
/** @pad: MBZ */
__u32 pad;
/**
* @oa_units: struct @drm_xe_oa_unit array returned for this device.
* Written below as a u64 array to avoid problems with nested flexible
* arrays with some compilers
*/
__u64 oa_units[];
};
/**
* enum drm_xe_oa_format_type - OA format types as specified in PRM/Bspec
* 52198/60942
*/
enum drm_xe_oa_format_type {
/** @DRM_XE_OA_FMT_TYPE_OAG: OAG report format */
DRM_XE_OA_FMT_TYPE_OAG,
/** @DRM_XE_OA_FMT_TYPE_OAR: OAR report format */
DRM_XE_OA_FMT_TYPE_OAR,
/** @DRM_XE_OA_FMT_TYPE_OAM: OAM report format */
DRM_XE_OA_FMT_TYPE_OAM,
/** @DRM_XE_OA_FMT_TYPE_OAC: OAC report format */
DRM_XE_OA_FMT_TYPE_OAC,
/** @DRM_XE_OA_FMT_TYPE_OAM_MPEC: OAM SAMEDIA or OAM MPEC report format */
DRM_XE_OA_FMT_TYPE_OAM_MPEC,
/** @DRM_XE_OA_FMT_TYPE_PEC: PEC report format */
DRM_XE_OA_FMT_TYPE_PEC,
};
/**
* enum drm_xe_oa_property_id - OA stream property id's
*
* Stream params are specified as a chain of @drm_xe_ext_set_property
* struct's, with @property values from enum @drm_xe_oa_property_id and
* @drm_xe_user_extension base.name set to @DRM_XE_OA_EXTENSION_SET_PROPERTY.
* @param field in struct @drm_xe_observation_param points to the first
* @drm_xe_ext_set_property struct.
*
* Exactly the same mechanism is also used for stream reconfiguration using the
* @DRM_XE_OBSERVATION_IOCTL_CONFIG observation stream fd ioctl, though only a
* subset of properties below can be specified for stream reconfiguration.
*/
enum drm_xe_oa_property_id {
#define DRM_XE_OA_EXTENSION_SET_PROPERTY 0
/**
* @DRM_XE_OA_PROPERTY_OA_UNIT_ID: ID of the OA unit on which to open
* the OA stream, see @oa_unit_id in 'struct
* drm_xe_query_oa_units'. Defaults to 0 if not provided.
*/
DRM_XE_OA_PROPERTY_OA_UNIT_ID = 1,
/**
* @DRM_XE_OA_PROPERTY_SAMPLE_OA: A value of 1 requests inclusion of raw
* OA unit reports or stream samples in a global buffer attached to an
* OA unit.
*/
DRM_XE_OA_PROPERTY_SAMPLE_OA,
/**
* @DRM_XE_OA_PROPERTY_OA_METRIC_SET: OA metrics defining contents of OA
* reports, previously added via @DRM_XE_OBSERVATION_OP_ADD_CONFIG.
*/
DRM_XE_OA_PROPERTY_OA_METRIC_SET,
/** @DRM_XE_OA_PROPERTY_OA_FORMAT: OA counter report format */
DRM_XE_OA_PROPERTY_OA_FORMAT,
/*
* OA_FORMAT's are specified the same way as in PRM/Bspec 52198/60942,
* in terms of the following quantities: a. enum @drm_xe_oa_format_type
* b. Counter select c. Counter size and d. BC report. Also refer to the
* oa_formats array in drivers/gpu/drm/xe/xe_oa.c.
*/
#define DRM_XE_OA_FORMAT_MASK_FMT_TYPE (0xff << 0)
#define DRM_XE_OA_FORMAT_MASK_COUNTER_SEL (0xff << 8)
#define DRM_XE_OA_FORMAT_MASK_COUNTER_SIZE (0xff << 16)
#define DRM_XE_OA_FORMAT_MASK_BC_REPORT (0xff << 24)
/**
* @DRM_XE_OA_PROPERTY_OA_PERIOD_EXPONENT: Requests periodic OA unit
* sampling with sampling frequency proportional to 2^(period_exponent + 1)
*/
DRM_XE_OA_PROPERTY_OA_PERIOD_EXPONENT,
/**
* @DRM_XE_OA_PROPERTY_OA_DISABLED: A value of 1 will open the OA
* stream in a DISABLED state (see @DRM_XE_OBSERVATION_IOCTL_ENABLE).
*/
DRM_XE_OA_PROPERTY_OA_DISABLED,
/**
* @DRM_XE_OA_PROPERTY_EXEC_QUEUE_ID: Open the stream for a specific
* @exec_queue_id. OA queries can be executed on this exec queue.
*/
DRM_XE_OA_PROPERTY_EXEC_QUEUE_ID,
/**
* @DRM_XE_OA_PROPERTY_OA_ENGINE_INSTANCE: Optional engine instance to
* pass along with @DRM_XE_OA_PROPERTY_EXEC_QUEUE_ID or will default to 0.
*/
DRM_XE_OA_PROPERTY_OA_ENGINE_INSTANCE,
/**
* @DRM_XE_OA_PROPERTY_NO_PREEMPT: Allow preemption and timeslicing
* to be disabled for the stream exec queue.
*/
DRM_XE_OA_PROPERTY_NO_PREEMPT,
};
/**
* struct drm_xe_oa_config - OA metric configuration
*
* Multiple OA configs can be added using @DRM_XE_OBSERVATION_OP_ADD_CONFIG. A
* particular config can be specified when opening an OA stream using
* @DRM_XE_OA_PROPERTY_OA_METRIC_SET property.
*/
struct drm_xe_oa_config {
/** @extensions: Pointer to the first extension struct, if any */
__u64 extensions;
/** @uuid: String formatted like "%\08x-%\04x-%\04x-%\04x-%\012x" */
char uuid[36];
/** @n_regs: Number of regs in @regs_ptr */
__u32 n_regs;
/**
* @regs_ptr: Pointer to (register address, value) pairs for OA config
* registers. Expected length of buffer is: (2 * sizeof(u32) * @n_regs).
*/
__u64 regs_ptr;
};
/**
* struct drm_xe_oa_stream_status - OA stream status returned from
* @DRM_XE_OBSERVATION_IOCTL_STATUS observation stream fd ioctl. Userspace can
* call the ioctl to query stream status in response to EIO errno from
* observation fd read().
*/
struct drm_xe_oa_stream_status {
/** @extensions: Pointer to the first extension struct, if any */
__u64 extensions;
/** @oa_status: OA stream status (see Bspec 46717/61226) */
__u64 oa_status;
#define DRM_XE_OASTATUS_MMIO_TRG_Q_FULL (1 << 3)
#define DRM_XE_OASTATUS_COUNTER_OVERFLOW (1 << 2)
#define DRM_XE_OASTATUS_BUFFER_OVERFLOW (1 << 1)
#define DRM_XE_OASTATUS_REPORT_LOST (1 << 0)
/** @reserved: reserved for future use */
__u64 reserved[3];
};
/**
* struct drm_xe_oa_stream_info - OA stream info returned from
* @DRM_XE_OBSERVATION_IOCTL_INFO observation stream fd ioctl
*/
struct drm_xe_oa_stream_info {
/** @extensions: Pointer to the first extension struct, if any */
__u64 extensions;
/** @oa_buf_size: OA buffer size */
__u64 oa_buf_size;
/** @reserved: reserved for future use */
__u64 reserved[3];
};
/*
* Debugger ABI (ioctl and events) Version History:
* 0 - No debugger available
* 1 - Initial version
*/
#define DRM_XE_EUDEBUG_VERSION 1
struct drm_xe_eudebug_connect {
/** @extensions: Pointer to the first extension struct, if any */
__u64 extensions;
__u64 pid; /* input: Target process ID */
__u32 flags; /* MBZ */
__u32 version; /* output: current ABI (ioctl / events) version */
};
/*
* struct drm_xe_debug_metadata_create - Create debug metadata
*
@@ -1404,37 +1770,7 @@ struct drm_xe_debug_metadata_destroy {
__u32 metadata_id;
};
/**
* struct drm_xe_ext_vm_set_debug_metadata - Annotate metadata in vm
*
* Annotate static regions of vm to be noted as debug metadata.
* These will be communicated to a debugger and (XXX: selectively?)
* included in gpu error state.
*
*/
struct drm_xe_ext_vm_set_debug_metadata {
/** @base: base user extension */
struct drm_xe_user_extension base;
#define DRM_XE_VM_DEBUG_METADATA_COOKIE 0
#define DRM_XE_VM_DEBUG_METADATA_MODULE_AREA 1
#define DRM_XE_VM_DEBUG_METADATA_SBA_AREA 2
#define DRM_XE_VM_DEBUG_METADATA_SIP_AREA 3
#define DRM_XE_VM_DEBUG_METADATA_NUM (1 + DRM_XE_VM_DEBUG_METADATA_SIP_AREA)
/** @type: Type of metadata at offset if not cookie */
__u64 type;
union {
/**@cookie: Cookie value to attach if type is METADATA_COOKIE */
__u64 cookie;
/**@offset: Offset into vm where metadata starts */
__u64 offset;
};
/** @len: Length of metadata in bytes or zero for cookie */
__u64 len;
};
#include "xe_drm_eudebug.h"
#if defined(__cplusplus)
}

View File

@@ -2,19 +2,11 @@
/*
* Copyright © 2023 Intel Corporation
*/
#ifndef _UAPI_XE_DRM_TMP_H_
#define _UAPI_XE_DRM_TMP_H_
#include "xe_drm.h"
#if defined(__cplusplus)
extern "C" {
#if !defined(_UAPI_XE_DRM_H_)
error "Do not include this directly"
#endif
#define DRM_XE_EUDEBUG_CONNECT 0x5f
#define DRM_IOCTL_XE_EUDEBUG_CONNECT DRM_IOWR(DRM_COMMAND_BASE + DRM_XE_EUDEBUG_CONNECT, struct drm_xe_eudebug_connect)
/**
* Do a eudebug event read for a debugger connection.
*
@@ -22,30 +14,27 @@ extern "C" {
*/
#define DRM_XE_EUDEBUG_IOCTL_READ_EVENT _IO('j', 0x0)
#define DRM_XE_EUDEBUG_IOCTL_EU_CONTROL _IOWR('j', 0x2, struct drm_xe_eudebug_eu_control)
#define DRM_XE_EUDEBUG_IOCTL_ACK_EVENT _IOW('j', 0x4, struct drm_xe_eudebug_ack_event)
#define DRM_XE_EUDEBUG_IOCTL_VM_OPEN _IOW('j', 0x1, struct drm_xe_eudebug_vm_open)
#define DRM_XE_EUDEBUG_IOCTL_READ_METADATA _IOWR('j', 0x3, struct drm_xe_eudebug_read_metadata)
#define DRM_XE_EUDEBUG_IOCTL_ACK_EVENT _IOW('j', 0x4, struct drm_xe_eudebug_ack_event)
/* XXX: Document events to match their internal counterparts when moved to xe_drm.h */
struct drm_xe_eudebug_event {
__u32 len;
__u16 type;
#define DRM_XE_EUDEBUG_EVENT_NONE 0
#define DRM_XE_EUDEBUG_EVENT_READ 1
#define DRM_XE_EUDEBUG_EVENT_OPEN 2
#define DRM_XE_EUDEBUG_EVENT_VM 3
#define DRM_XE_EUDEBUG_EVENT_EXEC_QUEUE 4
#define DRM_XE_EUDEBUG_EVENT_EU_ATTENTION 5
#define DRM_XE_EUDEBUG_EVENT_VM_BIND 6
#define DRM_XE_EUDEBUG_EVENT_VM_BIND_OP 7
#define DRM_XE_EUDEBUG_EVENT_VM_BIND_UFENCE 8
#define DRM_XE_EUDEBUG_EVENT_METADATA 9
#define DRM_XE_EUDEBUG_EVENT_NONE 0
#define DRM_XE_EUDEBUG_EVENT_READ 1
#define DRM_XE_EUDEBUG_EVENT_OPEN 2
#define DRM_XE_EUDEBUG_EVENT_VM 3
#define DRM_XE_EUDEBUG_EVENT_EXEC_QUEUE 4
#define DRM_XE_EUDEBUG_EVENT_EU_ATTENTION 5
#define DRM_XE_EUDEBUG_EVENT_VM_BIND 6
#define DRM_XE_EUDEBUG_EVENT_VM_BIND_OP 7
#define DRM_XE_EUDEBUG_EVENT_VM_BIND_UFENCE 8
#define DRM_XE_EUDEBUG_EVENT_METADATA 9
#define DRM_XE_EUDEBUG_EVENT_VM_BIND_OP_METADATA 10
#define DRM_XE_EUDEBUG_EVENT_VM_SET_METADATA 11
#define DRM_XE_EUDEBUG_EVENT_PAGEFAULT 12
#define DRM_XE_EUDEBUG_EVENT_SYNC_HOST 13
#define DRM_XE_EUDEBUG_EVENT_MAX_EVENT DRM_XE_EUDEBUG_EVENT_SYNC_HOST
#define DRM_XE_EUDEBUG_EVENT_MAX_EVENT DRM_XE_EUDEBUG_EVENT_VM_BIND_OP_METADATA
__u16 flags;
#define DRM_XE_EUDEBUG_EVENT_CREATE (1 << 0)
@@ -55,20 +44,20 @@ struct drm_xe_eudebug_event {
__u64 seqno;
__u64 reserved;
} __attribute__((packed));
};
struct drm_xe_eudebug_event_client {
struct drm_xe_eudebug_event base;
__u64 client_handle; /* This is unique per debug connection */
} __attribute__((packed));
};
struct drm_xe_eudebug_event_vm {
struct drm_xe_eudebug_event base;
__u64 client_handle;
__u64 vm_handle;
} __attribute__((packed));
};
struct drm_xe_eudebug_event_exec_queue {
struct drm_xe_eudebug_event base;
@@ -78,8 +67,8 @@ struct drm_xe_eudebug_event_exec_queue {
__u64 exec_queue_handle;
__u32 engine_class;
__u32 width;
__u64 lrc_handle[0];
} __attribute__((packed));
__u64 lrc_handle[];
};
struct drm_xe_eudebug_event_eu_attention {
struct drm_xe_eudebug_event base;
@@ -89,8 +78,26 @@ struct drm_xe_eudebug_event_eu_attention {
__u64 lrc_handle;
__u32 flags;
__u32 bitmask_size;
__u8 bitmask[0];
} __attribute__((packed));
__u8 bitmask[];
};
struct drm_xe_eudebug_eu_control {
__u64 client_handle;
#define DRM_XE_EUDEBUG_EU_CONTROL_CMD_INTERRUPT_ALL 0
#define DRM_XE_EUDEBUG_EU_CONTROL_CMD_STOPPED 1
#define DRM_XE_EUDEBUG_EU_CONTROL_CMD_RESUME 2
__u32 cmd;
__u32 flags;
__u64 seqno;
__u64 exec_queue_handle;
__u64 lrc_handle;
__u32 reserved;
__u32 bitmask_size;
__u64 bitmask_ptr;
};
/*
* When client (debuggee) does vm_bind_ioctl() following event
@@ -126,7 +133,7 @@ struct drm_xe_eudebug_event_eu_attention {
*
* Client's UFENCE sync will be held by the driver: client's
* drm_xe_wait_ufence will not complete and the value of the ufence
* wont appear until ufence is acked by the debugger process calling
* won't appear until ufence is acked by the debugger process calling
* DRM_XE_EUDEBUG_IOCTL_ACK_EVENT with the event_ufence.base.seqno.
* This will signal the fence, .value will update and the wait will
* complete allowing the client to continue.
@@ -138,11 +145,12 @@ struct drm_xe_eudebug_event_vm_bind {
__u64 client_handle;
__u64 vm_handle;
__u32 flags;
#define DRM_XE_EUDEBUG_EVENT_VM_BIND_FLAG_UFENCE (1 << 0)
__u32 num_binds;
} __attribute__((packed));
};
struct drm_xe_eudebug_event_vm_bind_op {
struct drm_xe_eudebug_event base;
@@ -151,102 +159,19 @@ struct drm_xe_eudebug_event_vm_bind_op {
__u64 addr; /* XXX: Zero for unmap all? */
__u64 range; /* XXX: Zero for unmap all? */
} __attribute__((packed));
};
struct drm_xe_eudebug_event_vm_bind_ufence {
struct drm_xe_eudebug_event base;
__u64 vm_bind_ref_seqno; /* *_event_vm_bind.base.seqno */
} __attribute__((packed));
};
struct drm_xe_eudebug_event_metadata {
struct drm_xe_eudebug_event base;
__u64 client_handle;
__u64 metadata_handle;
/* XXX: Refer to xe_drm.h for fields */
__u64 type;
__u64 len;
} __attribute__((packed));
struct drm_xe_eudebug_event_vm_bind_op_metadata {
struct drm_xe_eudebug_event base;
__u64 vm_bind_op_ref_seqno; /* *_event_vm_bind_op.base.seqno */
__u64 metadata_handle;
__u64 metadata_cookie;
} __attribute__((packed));
struct drm_xe_eudebug_event_vm_set_metadata {
struct drm_xe_eudebug_event base;
__u64 client_handle;
__u64 vm_handle;
/* XXX: Refer to xe_drm.h for fields */
__u64 type;
union {
__u64 cookie;
__u64 offset;
};
__u64 len;
} __attribute__((packed));
struct drm_xe_eudebug_event_pagefault {
struct drm_xe_eudebug_event base;
__u64 client_handle;
__u64 exec_queue_handle;
__u64 lrc_handle;
__u64 pagefault_address;
__u32 fault_flags;
__u32 bitmask_size;
__u8 bitmask[0];
} __attribute__((packed));
struct drm_xe_eudebug_event_sync_host {
struct drm_xe_eudebug_event base;
__u64 client_handle;
__u64 exec_queue_handle;
__u64 lrc_handle;
} __attribute__((packed));
/*
* Debugger ABI (ioctl and events) Version History:
* 0 - No debugger available
* 1 - Initial version
*/
#define DRM_XE_EUDEBUG_VERSION 1
struct drm_xe_eudebug_connect {
/** @extensions: Pointer to the first extension struct, if any */
__u64 extensions;
__u64 pid; /* input: Target process ID */
struct drm_xe_eudebug_ack_event {
__u32 type;
__u32 flags; /* MBZ */
__u32 version; /* output: current ABI (ioctl / events) version */
};
struct drm_xe_eudebug_eu_control {
__u64 client_handle;
#define DRM_XE_EUDEBUG_EU_CONTROL_CMD_INTERRUPT_ALL 0
#define DRM_XE_EUDEBUG_EU_CONTROL_CMD_STOPPED 1
#define DRM_XE_EUDEBUG_EU_CONTROL_CMD_RESUME 2
#define DRM_XE_EUDEBUG_EU_CONTROL_CMD_UNLOCK 3
__u32 cmd;
__u32 flags;
__u64 seqno;
__u64 exec_queue_handle;
__u64 lrc_handle;
__u32 bitmask_size;
__u64 bitmask_ptr;
};
struct drm_xe_eudebug_vm_open {
/** @extensions: Pointer to the first extension struct, if any */
__u64 extensions;
@@ -268,19 +193,25 @@ struct drm_xe_eudebug_read_metadata {
__u64 client_handle;
__u64 metadata_handle;
__u32 flags;
__u32 reserved;
__u64 ptr;
__u64 size;
};
struct drm_xe_eudebug_ack_event {
__u32 type;
__u32 flags; /* MBZ */
__u64 seqno;
struct drm_xe_eudebug_event_metadata {
struct drm_xe_eudebug_event base;
__u64 client_handle;
__u64 metadata_handle;
/* XXX: Refer to xe_drm.h for fields */
__u64 type;
__u64 len;
};
#if defined(__cplusplus)
}
#endif
struct drm_xe_eudebug_event_vm_bind_op_metadata {
struct drm_xe_eudebug_event base;
__u64 vm_bind_op_ref_seqno; /* *_event_vm_bind_op.base.seqno */
#endif /* _UAPI_XE_DRM_TMP_H_ */
__u64 metadata_handle;
__u64 metadata_cookie;
};