summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2008-05-21 00:32:02 -0700
committerEric Anholt <eric@anholt.net>2008-05-21 15:00:16 -0700
commitf8e38e49dd70bf4a5ef97c29f0c405a1fc5023f5 (patch)
treefe3b4a45c8098ab61a1f4f33236fbe0a0f5dc9ed
parentaf8e087157ef5034fa12d93202037f87da61355d (diff)
[intel-gem] invalidate ring locals for pin/unpin/set_domain/free functions
Ring locals must be reloaded from hardware in case the X server ran.
-rw-r--r--linux-core/i915_gem.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/linux-core/i915_gem.c b/linux-core/i915_gem.c
index 3535fae1..8e5539f5 100644
--- a/linux-core/i915_gem.c
+++ b/linux-core/i915_gem.c
@@ -1163,6 +1163,7 @@ i915_gem_pin_ioctl(struct drm_device *dev, void *data,
mutex_lock(&dev->struct_mutex);
+ i915_kernel_lost_context(dev);
obj = drm_gem_object_lookup(dev, file_priv, args->handle);
if (obj == NULL) {
DRM_ERROR("Bad handle in i915_gem_pin_ioctl(): %d\n",
@@ -1202,6 +1203,8 @@ i915_gem_unpin_ioctl(struct drm_device *dev, void *data,
struct drm_i915_gem_object *obj_priv;
mutex_lock(&dev->struct_mutex);
+
+ i915_kernel_lost_context(dev);
obj = drm_gem_object_lookup(dev, file_priv, args->handle);
if (obj == NULL) {
DRM_ERROR("Bad handle in i915_gem_unpin_ioctl(): %d\n",
@@ -1233,6 +1236,7 @@ int i915_gem_init_object(struct drm_gem_object *obj)
void i915_gem_free_object(struct drm_gem_object *obj)
{
+ i915_kernel_lost_context(obj->dev);
i915_gem_object_unbind(obj);
drm_free(obj->driver_private, 1, DRM_MEM_DRIVER);
@@ -1247,6 +1251,7 @@ i915_gem_set_domain(struct drm_gem_object *obj,
BUG_ON(!mutex_is_locked(&dev->struct_mutex));
+ i915_kernel_lost_context(dev);
i915_gem_object_set_domain(obj, read_domains, write_domain);
i915_gem_dev_set_domain(obj->dev);