summaryrefslogtreecommitdiff
path: root/linux-core
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2008-05-05 17:17:19 -0700
committerKeith Packard <keithp@keithp.com>2008-05-05 17:17:19 -0700
commit2c8f970baaba9c72c882677f40ce8271bff03bac (patch)
tree8a772483344e9ddc55f94d98da57eb00e911f5f3 /linux-core
parent5b0d0fa7f81fb297778af97124a2273b2af317bb (diff)
Unlock pages right after getting them.
pages come back from find_or_create_page locked, but must not stay locked for long. Unlock them immediately instead of waiting until we're done with them to avoid deadlock when applications try to touch them.
Diffstat (limited to 'linux-core')
-rw-r--r--linux-core/i915_gem.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/linux-core/i915_gem.c b/linux-core/i915_gem.c
index fabbaf9b..e3864612 100644
--- a/linux-core/i915_gem.c
+++ b/linux-core/i915_gem.c
@@ -61,7 +61,6 @@ i915_gem_object_free_page_list(struct drm_gem_object *obj)
for (i = 0; i < page_count; i++) {
if (obj_priv->page_list[i] != NULL) {
- unlock_page (obj_priv->page_list[i]);
page_cache_release (obj_priv->page_list[i]);
}
}
@@ -109,7 +108,7 @@ i915_gem_dump_object (struct drm_gem_object *obj, int len, const char *where)
DRM_INFO ("%s: object at offset %08x\n", where, obj_priv->gtt_offset);
for (i = 0; i < len/4; i++)
- DRM_INFO ("%3d: mem %08x gtt %08x\n", i, mem[i], readl(gtt + i));
+ DRM_INFO ("%04x: mem %08x gtt %08x\n", i * 4, mem[i], readl(gtt + i));
iounmap (gtt);
kunmap_atomic (mem, KM_USER0);
}
@@ -173,6 +172,7 @@ i915_gem_object_bind_to_gtt(struct drm_gem_object *obj, unsigned alignment)
obj_priv->gtt_space = NULL;
return -ENOMEM;
}
+ unlock_page (obj_priv->page_list[i]);
}
drm_ttm_cache_flush (obj_priv->page_list, page_count);