@@ -1580,7 +1580,7 @@ i915_gem_object_move_to_active(struct drm_gem_object *obj,
/* Move from whatever list we were on to the tail of execution. */
list_move_tail(&obj_priv->mm_list, &dev_priv->mm.active_list);
- list_add_tail(&obj_priv->ring_list, &ring->active_list);
+ list_move_tail(&obj_priv->ring_list, &ring->active_list);
obj_priv->last_rendering_seqno = seqno;
}
@@ -1593,7 +1593,7 @@ i915_gem_object_move_to_flushing(struct drm_gem_object *obj)
BUG_ON(!obj_priv->active);
list_move_tail(&obj_priv->mm_list, &dev_priv->mm.flushing_list);
- list_del(&obj_priv->ring_list);
+ list_del_init(&obj_priv->ring_list);
obj_priv->last_rendering_seqno = 0;
}
@@ -1635,7 +1635,7 @@ i915_gem_object_move_to_inactive(struct drm_gem_object *obj)
list_move_tail(&obj_priv->mm_list, &dev_priv->mm.pinned_list);
else
list_move_tail(&obj_priv->mm_list, &dev_priv->mm.inactive_list);
- list_del(&obj_priv->ring_list);
+ list_del_init(&obj_priv->ring_list);
BUG_ON(!list_empty(&obj_priv->gpu_write_list));
@@ -1880,7 +1880,7 @@ i915_gem_retire_requests_ring(struct drm_device *dev,
obj_priv = list_first_entry(&ring->active_list,
struct drm_i915_gem_object,
- mm_list);
+ ring_list);
if (!i915_seqno_passed(seqno, obj_priv->last_rendering_seqno))
break;
@@ -3246,17 +3246,16 @@ i915_gem_execbuffer_relocate(struct drm_i915_gem_object *obj,
struct drm_i915_gem_relocation_entry __user *user_relocs;
struct drm_gem_object *target_obj = NULL;
uint32_t target_handle = 0;
- int i, ret;
+ int i, ret = 0;
user_relocs = (void __user *)(uintptr_t)entry->relocs_ptr;
for (i = 0; i < entry->relocation_count; i++) {
struct drm_i915_gem_relocation_entry reloc;
uint32_t target_offset;
- ret = __copy_from_user_inatomic(&reloc,
- user_relocs+i,
- sizeof(reloc));
- if (ret) {
+ if (__copy_from_user_inatomic(&reloc,
+ user_relocs+i,
+ sizeof(reloc))) {
ret = -EFAULT;
break;
}
@@ -4286,6 +4285,7 @@ struct drm_gem_object * i915_gem_alloc_object(struct drm_device *dev,
obj->base.driver_private = NULL;
obj->fence_reg = I915_FENCE_REG_NONE;
INIT_LIST_HEAD(&obj->mm_list);
+ INIT_LIST_HEAD(&obj->ring_list);
INIT_LIST_HEAD(&obj->gpu_write_list);
obj->madv = I915_MADV_WILLNEED;