summaryrefslogtreecommitdiff
path: root/include/drm/drm_device.h
diff options
context:
space:
mode:
authorAndré Almeida <andrealmeid@igalia.com>2025-06-17 09:49:46 -0300
committerAndré Almeida <andrealmeid@igalia.com>2025-06-17 11:32:47 -0300
commit183bccafa176f4519a15ec5c35a47495cbea658c (patch)
tree666dc741ae1fad888314a4c2200b55da6a63fb5b /include/drm/drm_device.h
parent3bfd1af74a7fc239ab05bc780e2f455c37fe6219 (diff)
drm: Create a task info option for wedge events
When a device get wedged, it might be caused by a guilty application. For userspace, knowing which task was involved can be useful for some situations, like for implementing a policy, logs or for giving a chance for the compositor to let the user know what task was involved in the problem. This is an optional argument, when the task info is not available, the PID and TASK string won't appear in the event string. Sometimes just the PID isn't enough giving that the task might be already dead by the time userspace will try to check what was this PID's name, so to make the life easier also notify what's the task's name in the user event. Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com> Reviewed-by: Raag Jadav <raag.jadav@intel.com> Acked-by: Christian König <christian.koenig@amd.com> Link: https://lore.kernel.org/r/20250617124949.2151549-4-andrealmeid@igalia.com Signed-off-by: André Almeida <andrealmeid@igalia.com>
Diffstat (limited to 'include/drm/drm_device.h')
-rw-r--r--include/drm/drm_device.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/drm/drm_device.h b/include/drm/drm_device.h
index e2f894f1b90a..08b3b2467c4c 100644
--- a/include/drm/drm_device.h
+++ b/include/drm/drm_device.h
@@ -5,6 +5,7 @@
#include <linux/kref.h>
#include <linux/mutex.h>
#include <linux/idr.h>
+#include <linux/sched.h>
#include <drm/drm_mode_config.h>
@@ -31,6 +32,14 @@ struct pci_controller;
#define DRM_WEDGE_RECOVERY_BUS_RESET BIT(2) /* unbind + reset bus device + bind */
/**
+ * struct drm_wedge_task_info - information about the guilty task of a wedge dev
+ */
+struct drm_wedge_task_info {
+ pid_t pid;
+ char comm[TASK_COMM_LEN];
+};
+
+/**
* enum switch_power_state - power state of drm device
*/