aboutsummaryrefslogtreecommitdiff
path: root/linux-core
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2008-05-08 12:46:02 -0700
committerEric Anholt <eric@anholt.net>2008-05-08 12:46:02 -0700
commit2f573e6df4890784124eea24ce168702574f0152 (patch)
tree5686fc99cc949fe5c68d1706a8cb3903dae6b738 /linux-core
parent9af4c497433398fa4576a7c1c31036448cf4f24c (diff)
GEM: Fix oops on NULL dereference when we try clflushing when we don't need to.
Diffstat (limited to 'linux-core')
-rw-r--r--linux-core/i915_gem.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/linux-core/i915_gem.c b/linux-core/i915_gem.c
index 861e7bb7..5c58032b 100644
--- a/linux-core/i915_gem.c
+++ b/linux-core/i915_gem.c
@@ -415,6 +415,13 @@ i915_gem_clflush_object (struct drm_gem_object *obj)
{
struct drm_i915_gem_object *obj_priv = obj->driver_private;
+ /* If we don't have a page list set up, then we're not pinned
+ * to GPU, and we can ignore the cache flush because it'll happen
+ * again at bind time.
+ */
+ if (obj_priv->page_list == NULL)
+ return;
+
drm_ttm_cache_flush (obj_priv->page_list, obj->size / PAGE_SIZE);
}