drm/i915: Avoid oops when capturing NULL ring for inactive pinned buffers
authorChris Wilson <chris@chris-wilson.co.uk>
Tue, 23 Nov 2010 08:49:38 +0000 (08:49 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Tue, 23 Nov 2010 08:49:38 +0000 (08:49 +0000)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
drivers/gpu/drm/i915/i915_debugfs.c
drivers/gpu/drm/i915/i915_irq.c

index 421b8414b577e78d12d0b3a7689c1ba5890760cc..4fe49e0228ef10a946497c1e1b346925e007f835 100644 (file)
@@ -572,9 +572,9 @@ static int i915_ringbuffer_info(struct seq_file *m, void *data)
 static const char *ring_str(int ring)
 {
        switch (ring) {
-       case RING_RENDER: return "render";
-       case RING_BSD: return "bsd";
-       case RING_BLT: return "blt";
+       case RING_RENDER: return " render";
+       case RING_BSD: return " bsd";
+       case RING_BLT: return " blt";
        default: return "";
        }
 }
index 0b6052abedd1c9fd010cec91be5827ad72975f3e..a8f55f061f6d0ab51dac5009003a566acbc4ce61 100644 (file)
@@ -575,7 +575,7 @@ static u32 capture_bo_list(struct drm_i915_error_buffer *err,
                err->tiling = obj->tiling_mode;
                err->dirty = obj->dirty;
                err->purgeable = obj->madv != I915_MADV_WILLNEED;
-               err->ring = obj->ring->id;
+               err->ring = obj->ring ? obj->ring->id : 0;
 
                if (++i == count)
                        break;