On Thu, May 04, 2017 at 09:26:35PM +0000, Srivatsa, Anusha wrote:
> >+void i915_guc_load_error_log_capture(struct drm_i915_private *i915) {
> >+    void *log, *buf;
> >+    struct i915_vma *vma = i915->guc.log.vma;
> >+
> >+    if (i915->gpu_error.guc_load_fail_log || !vma)
> >+            return;
> >+
> >+    /*
> >+     * the vma should be already pinned and mapped for log runtime
> >+     * management but let's play safe
> >+     */
> >+    log = i915_gem_object_pin_map(vma->obj, I915_MAP_WC);
> >+    if (IS_ERR(log)) {
> >+            DRM_ERROR("Failed to pin guc_log vma\n");
> >+            return;
> >+    }
> >+
> >+    buf = kzalloc(GUC_LOG_SIZE, GFP_KERNEL);
> >+    if (buf) {
> >+            memcpy(buf, log, GUC_LOG_SIZE);
> >+            i915->gpu_error.guc_load_fail_log = buf;
> >+    } else {
> >+            DRM_ERROR("Failed to copy guc log\n");
> >+    }
> >+
> >+    i915_gem_object_unpin_map(vma->obj);

You are trading a swappable object for unswappable kernel memory. If you
want to have the guc log after guc is disabled, just keep the log object
around.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to