drm/i915: Initialize obj->pages before use by i915_gem_object_do_bit17_swizzle()
authorChris Wilson <chris@chris-wilson.co.uk>
Fri, 19 Oct 2012 14:51:06 +0000 (15:51 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 19 Oct 2012 19:52:52 +0000 (21:52 +0200)
If we leave obj->pages set to NULL before attempting to deswizzle them,
then an OOPS is well deserved.

Fixes regression introduced in commit 9da3da660d8c19a54f6e93361d147509be3fff84
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Jun 1 15:20:22 2012 +0100

    drm/i915: Replace the array of pages with a scatterlist

Reported-and-tested-by: Krzysztof Kolasa
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_gem.c

index 45888d2ed534074b7563a7d25f193e26832acf0b..8bc7ba76ace167fe6bd039546c1d16c218aef7ba 100644 (file)
@@ -1825,10 +1825,11 @@ i915_gem_object_get_pages_gtt(struct drm_i915_gem_object *obj)
                sg_set_page(sg, page, PAGE_SIZE, 0);
        }
 
+       obj->pages = st;
+
        if (i915_gem_object_needs_bit17_swizzle(obj))
                i915_gem_object_do_bit_17_swizzle(obj);
 
-       obj->pages = st;
        return 0;
 
 err_pages: