aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_gem.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem.c')
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c22
1 files changed, 5 insertions, 17 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 769f75262feb..4200c32407ec 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2247,25 +2247,15 @@ static void i915_gem_reset_ring_lists(struct drm_i915_private *dev_priv,
2247 } 2247 }
2248} 2248}
2249 2249
2250static void i915_gem_reset_fences(struct drm_device *dev) 2250void i915_gem_restore_fences(struct drm_device *dev)
2251{ 2251{
2252 struct drm_i915_private *dev_priv = dev->dev_private; 2252 struct drm_i915_private *dev_priv = dev->dev_private;
2253 int i; 2253 int i;
2254 2254
2255 for (i = 0; i < dev_priv->num_fence_regs; i++) { 2255 for (i = 0; i < dev_priv->num_fence_regs; i++) {
2256 struct drm_i915_fence_reg *reg = &dev_priv->fence_regs[i]; 2256 struct drm_i915_fence_reg *reg = &dev_priv->fence_regs[i];
2257 2257 i915_gem_write_fence(dev, i, reg->obj);
2258 if (reg->obj)
2259 i915_gem_object_fence_lost(reg->obj);
2260
2261 i915_gem_write_fence(dev, i, NULL);
2262
2263 reg->pin_count = 0;
2264 reg->obj = NULL;
2265 INIT_LIST_HEAD(&reg->lru_list);
2266 } 2258 }
2267
2268 INIT_LIST_HEAD(&dev_priv->mm.fence_list);
2269} 2259}
2270 2260
2271void i915_gem_reset(struct drm_device *dev) 2261void i915_gem_reset(struct drm_device *dev)
@@ -2288,8 +2278,7 @@ void i915_gem_reset(struct drm_device *dev)
2288 obj->base.read_domains &= ~I915_GEM_GPU_DOMAINS; 2278 obj->base.read_domains &= ~I915_GEM_GPU_DOMAINS;
2289 } 2279 }
2290 2280
2291 /* The fence registers are invalidated so clear them out */ 2281 i915_gem_restore_fences(dev);
2292 i915_gem_reset_fences(dev);
2293} 2282}
2294 2283
2295/** 2284/**
@@ -4020,8 +4009,6 @@ i915_gem_idle(struct drm_device *dev)
4020 if (!drm_core_check_feature(dev, DRIVER_MODESET)) 4009 if (!drm_core_check_feature(dev, DRIVER_MODESET))
4021 i915_gem_evict_everything(dev); 4010 i915_gem_evict_everything(dev);
4022 4011
4023 i915_gem_reset_fences(dev);
4024
4025 /* Hack! Don't let anybody do execbuf while we don't control the chip. 4012 /* Hack! Don't let anybody do execbuf while we don't control the chip.
4026 * We need to replace this with a semaphore, or something. 4013 * We need to replace this with a semaphore, or something.
4027 * And not confound mm.suspended! 4014 * And not confound mm.suspended!
@@ -4357,7 +4344,8 @@ i915_gem_load(struct drm_device *dev)
4357 dev_priv->num_fence_regs = 8; 4344 dev_priv->num_fence_regs = 8;
4358 4345
4359 /* Initialize fence registers to zero */ 4346 /* Initialize fence registers to zero */
4360 i915_gem_reset_fences(dev); 4347 INIT_LIST_HEAD(&dev_priv->mm.fence_list);
4348 i915_gem_restore_fences(dev);
4361 4349
4362 i915_gem_detect_bit_6_swizzle(dev); 4350 i915_gem_detect_bit_6_swizzle(dev);
4363 init_waitqueue_head(&dev_priv->pending_flip_queue); 4351 init_waitqueue_head(&dev_priv->pending_flip_queue);