drm/i915: Support readback of stolen objects upon error
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 15 Nov 2012 11:32:23 +0000 (11:32 +0000)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 30 Nov 2012 22:32:22 +0000 (23:32 +0100)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_irq.c

index 26753ee6571dbba663353956e2488b19a9f688b4..7a0ddee9751a238fc0b2fe0739edb28a48fd9011 100644 (file)
@@ -929,6 +929,14 @@ i915_error_object_create(struct drm_i915_private *dev_priv,
                                                     reloc_offset);
                        memcpy_fromio(d, s, PAGE_SIZE);
                        io_mapping_unmap_atomic(s);
+               } else if (src->stolen) {
+                       unsigned long offset;
+
+                       offset = dev_priv->mm.stolen_base;
+                       offset += src->stolen->start;
+                       offset += i << PAGE_SHIFT;
+
+                       memcpy_fromio(d, (void *)offset, PAGE_SIZE);
                } else {
                        struct page *page;
                        void *s;