From patchwork Fri Oct 22 22:48:01 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Clifton X-Patchwork-Id: 278241 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o9MMmENd015471 for ; Fri, 22 Oct 2010 22:48:36 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0684F9E9BF for ; Fri, 22 Oct 2010 15:48:13 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from ppsw-50.csi.cam.ac.uk (ppsw-50.csi.cam.ac.uk [131.111.8.150]) by gabe.freedesktop.org (Postfix) with ESMTP id C7D869E82D for ; Fri, 22 Oct 2010 15:48:02 -0700 (PDT) X-Cam-AntiVirus: no malware found X-Cam-SpamDetails: not scanned X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from cpc1-cmbg11-0-0-cust238.5-4.cable.virginmedia.com ([86.22.72.239]:49816 helo=[192.168.1.4]) by ppsw-50.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.157]:465) with esmtpsa (LOGIN:pcjc2) (SSLv3:DHE-RSA-CAMELLIA256-SHA:256) id 1P9QP3-0003kJ-sK (Exim 4.72) for intel-gfx@lists.freedesktop.org (return-path ); Fri, 22 Oct 2010 23:48:01 +0100 From: Peter Clifton To: intel-gfx@lists.freedesktop.org Date: Fri, 22 Oct 2010 23:48:01 +0100 Message-ID: <1287787681.16619.3.camel@pcjc2lap> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Subject: [Intel-gfx] Chris Wilson X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Fri, 22 Oct 2010 22:48:36 +0000 (UTC) diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 1ce109a..6e85496 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -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;