diff options
author | Christian König <christian.koenig@amd.com> | 2023-04-19 12:51:41 +0200 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2023-06-15 11:37:54 -0400 |
commit | b13eb02ba8ba7617d41212121891756da31f1d8b (patch) | |
tree | e68abdafcc425f0eaefe9e3ff85de0ad478426fa /drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | |
parent | 2eb841bdbca819017e7483cdfbb3d401751848a5 (diff) |
drm/amdgpu: add amdgpu_error_* debugfs file
This allows us to insert some error codes into the bottom of the pipeline
on an engine.
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Luben Tuikov <luben.tuikov@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c index da26c555af24..9fd55a10da19 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c @@ -561,6 +561,17 @@ static const struct file_operations amdgpu_debugfs_mqd_fops = { .llseek = default_llseek }; +static int amdgpu_debugfs_ring_error(void *data, u64 val) +{ + struct amdgpu_ring *ring = data; + + amdgpu_fence_driver_set_error(ring, val); + return 0; +} + +DEFINE_DEBUGFS_ATTRIBUTE_SIGNED(amdgpu_debugfs_error_fops, NULL, + amdgpu_debugfs_ring_error, "%lld\n"); + #endif void amdgpu_debugfs_ring_init(struct amdgpu_device *adev, @@ -582,6 +593,11 @@ void amdgpu_debugfs_ring_init(struct amdgpu_device *adev, &amdgpu_debugfs_mqd_fops, ring->mqd_size); } + + sprintf(name, "amdgpu_error_%s", ring->name); + debugfs_create_file(name, 0200, root, ring, + &amdgpu_debugfs_error_fops); + #endif } |