diff options
author | Ben Widawsky <ben@bwidawsk.net> | 2013-07-19 12:16:42 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-07-19 12:26:57 -0400 |
commit | cce723ed091ac304d48386bcc3524994c345123e (patch) | |
tree | 2d2db05b37cad6ae79950aa0f9767215171bc518 | |
parent | 8e76f8dc49f180b0e9d750426c99e37a7d6162ae (diff) |
drm/i915: Make i915 events part of uapi
Make the uevent strings part of the user API for people who wish to
write their own listeners.
v2: Make a space in the string concatenation. (Chad)
Use the "UEVENT" suffix intead of "EVENT" (Chad)
Make kernel-doc parseable Docbook comments (Daniel)
v3: Undid reset change introduced in last submission (Daniel)
Fixed up comments to address removal changes.
Thanks to Daniel Vetter for a majority of the parity error comments.
CC: Chad Versace <chad.versace@linux.intel.com>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r-- | drivers/gpu/drm/i915/i915_irq.c | 8 | ||||
-rw-r--r-- | include/uapi/drm/i915_drm.h | 24 |
2 files changed, 28 insertions, 4 deletions
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index 1fffb4b10a05..58ee8269471f 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c | |||
@@ -812,7 +812,7 @@ static void ivybridge_parity_work(struct work_struct *work) | |||
812 | 812 | ||
813 | mutex_unlock(&dev_priv->dev->struct_mutex); | 813 | mutex_unlock(&dev_priv->dev->struct_mutex); |
814 | 814 | ||
815 | parity_event[0] = "L3_PARITY_ERROR=1"; | 815 | parity_event[0] = I915_L3_PARITY_UEVENT "=1"; |
816 | parity_event[1] = kasprintf(GFP_KERNEL, "ROW=%d", row); | 816 | parity_event[1] = kasprintf(GFP_KERNEL, "ROW=%d", row); |
817 | parity_event[2] = kasprintf(GFP_KERNEL, "BANK=%d", bank); | 817 | parity_event[2] = kasprintf(GFP_KERNEL, "BANK=%d", bank); |
818 | parity_event[3] = kasprintf(GFP_KERNEL, "SUBBANK=%d", subbank); | 818 | parity_event[3] = kasprintf(GFP_KERNEL, "SUBBANK=%d", subbank); |
@@ -1402,9 +1402,9 @@ static void i915_error_work_func(struct work_struct *work) | |||
1402 | gpu_error); | 1402 | gpu_error); |
1403 | struct drm_device *dev = dev_priv->dev; | 1403 | struct drm_device *dev = dev_priv->dev; |
1404 | struct intel_ring_buffer *ring; | 1404 | struct intel_ring_buffer *ring; |
1405 | char *error_event[] = { "ERROR=1", NULL }; | 1405 | char *error_event[] = { I915_ERROR_UEVENT "=1", NULL }; |
1406 | char *reset_event[] = { "RESET=1", NULL }; | 1406 | char *reset_event[] = { I915_RESET_UEVENT "=1", NULL }; |
1407 | char *reset_done_event[] = { "ERROR=0", NULL }; | 1407 | char *reset_done_event[] = { I915_ERROR_UEVENT "=0", NULL }; |
1408 | int i, ret; | 1408 | int i, ret; |
1409 | 1409 | ||
1410 | kobject_uevent_env(&dev->primary->kdev.kobj, KOBJ_CHANGE, error_event); | 1410 | kobject_uevent_env(&dev->primary->kdev.kobj, KOBJ_CHANGE, error_event); |
diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h index 923ed7fe5775..a1a7b6bd60d8 100644 --- a/include/uapi/drm/i915_drm.h +++ b/include/uapi/drm/i915_drm.h | |||
@@ -33,6 +33,30 @@ | |||
33 | * subject to backwards-compatibility constraints. | 33 | * subject to backwards-compatibility constraints. |
34 | */ | 34 | */ |
35 | 35 | ||
36 | /** | ||
37 | * DOC: uevents generated by i915 on it's device node | ||
38 | * | ||
39 | * I915_L3_PARITY_UEVENT - Generated when the driver receives a parity mismatch | ||
40 | * event from the gpu l3 cache. Additional information supplied is ROW, | ||
41 | * BANK, SUBBANK of the affected cacheline. Userspace should keep track of | ||
42 | * these events and if a specific cache-line seems to have a persistent | ||
43 | * error remap it with the l3 remapping tool supplied in intel-gpu-tools. | ||
44 | * The value supplied with the event is always 1. | ||
45 | * | ||
46 | * I915_ERROR_UEVENT - Generated upon error detection, currently only via | ||
47 | * hangcheck. The error detection event is a good indicator of when things | ||
48 | * began to go badly. The value supplied with the event is a 1 upon error | ||
49 | * detection, and a 0 upon reset completion, signifying no more error | ||
50 | * exists. NOTE: Disabling hangcheck or reset via module parameter will | ||
51 | * cause the related events to not be seen. | ||
52 | * | ||
53 | * I915_RESET_UEVENT - Event is generated just before an attempt to reset the | ||
54 | * the GPU. The value supplied with the event is always 1. NOTE: Disable | ||
55 | * reset via module parameter will cause this event to not be seen. | ||
56 | */ | ||
57 | #define I915_L3_PARITY_UEVENT "L3_PARITY_ERROR" | ||
58 | #define I915_ERROR_UEVENT "ERROR" | ||
59 | #define I915_RESET_UEVENT "RESET" | ||
36 | 60 | ||
37 | /* Each region is a minimum of 16k, and there are at most 255 of them. | 61 | /* Each region is a minimum of 16k, and there are at most 255 of them. |
38 | */ | 62 | */ |