@@ -90,6 +90,9 @@
#include "i915_drv.h"
#include "i915_trace.h"
+i915_ppgtt_validation_callback_t ppgtt_validation_callback = NULL;
+EXPORT_SYMBOL_GPL(ppgtt_validation_callback);
+
/* This is a HW constraint. The value below is the largest known requirement
* I've seen in a spec to date, and that was a workaround for a non-shipping
* part. It should be safe to decrease this, but it's more future proof as is.
@@ -33,6 +33,9 @@
#include "intel_drv.h"
#include <linux/dma_remapping.h>
+i915_gem_ring_dispatch_callback_t i915_gem_ring_dispatch_validation_callback = NULL;
+EXPORT_SYMBOL_GPL(i915_gem_ring_dispatch_validation_callback);
+
#define __EXEC_OBJECT_HAS_PIN (1<<31)
#define __EXEC_OBJECT_HAS_FENCE (1<<30)
#define __EXEC_OBJECT_NEEDS_BIAS (1<<28)
@@ -15,6 +15,18 @@
#define TRACE_SYSTEM_STRING __stringify(TRACE_SYSTEM)
#define TRACE_INCLUDE_FILE i915_trace
+/* validation callbacks */
+
+typedef void (*i915_ppgtt_validation_callback_t)(unsigned int action_code,
+ struct i915_hw_ppgtt *ppgtt);
+extern i915_ppgtt_validation_callback_t ppgtt_validation_callback;
+
+typedef void (*i915_gem_ring_dispatch_callback_t)(struct intel_engine_cs *ring,
+ u32 seqno,
+ u32 flags,
+ struct intel_context *ctx);
+extern i915_gem_ring_dispatch_callback_t i915_gem_ring_dispatch_validation_callback;
+
/* pipe updates */
TRACE_EVENT(i915_pipe_update_start,
@@ -394,6 +406,10 @@ TRACE_EVENT(i915_gem_ring_dispatch_validation,
__entry->flags = flags;
__entry->vm = ctx->vm;
i915_trace_irq_get(ring, seqno);
+
+ if (i915_gem_ring_dispatch_validation_callback)
+ i915_gem_ring_dispatch_validation_callback(ring,
+ seqno, flags, ctx);
),
TP_printk("dev=%u, ring=%u, seqno=%u, flags=%x, vm=%p",
@@ -630,6 +646,9 @@ TRACE_EVENT(create_vm_for_ctx,
__entry->vm = &ppgtt->base;
__entry->dev = ppgtt->base.dev->primary->index;
__entry->pid = (unsigned int)task_pid_nr(current);
+
+ if (ppgtt_validation_callback)
+ ppgtt_validation_callback(0, ppgtt);
),
TP_printk("dev=%u, task_pid=%u, vm=%p",
@@ -650,6 +669,9 @@ TRACE_EVENT(ppgtt_release,
TP_fast_assign(
__entry->vm = &ppgtt->base;
__entry->dev = ppgtt->base.dev->primary->index;
+
+ if (ppgtt_validation_callback)
+ ppgtt_validation_callback(1, ppgtt);
),
TP_printk("dev=%u, vm=%p", __entry->dev, __entry->vm)