From patchwork Fri Aug 12 01:18:33 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Widawsky X-Patchwork-Id: 1059292 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p7C1Ig8P028717 for ; Fri, 12 Aug 2011 01:19:05 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E34DC9EEFA for ; Thu, 11 Aug 2011 18:18:40 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from cloud01.chad-versace.us (184-106-247-128.static.cloud-ips.com [184.106.247.128]) by gabe.freedesktop.org (Postfix) with ESMTP id B81119E8B1 for ; Thu, 11 Aug 2011 18:18:21 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by cloud01.chad-versace.us (Postfix) with ESMTP id F2D801D408F; Fri, 12 Aug 2011 01:21:15 +0000 (UTC) X-Virus-Scanned: amavisd-new at static.cloud-ips.com X-Spam-Flag: NO X-Spam-Score: -1 X-Spam-Level: X-Spam-Status: No, score=-1 tagged_above=-100 required=3 tests=[ALL_TRUSTED=-1] autolearn=ham Received: from cloud01.chad-versace.us ([127.0.0.1]) by localhost (cloud01.static.cloud-ips.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gq0ifiIboR1l; Fri, 12 Aug 2011 01:21:10 +0000 (UTC) Received: from localhost.localdomain (unknown [64.114.255.126]) by cloud01.chad-versace.us (Postfix) with ESMTPSA id 220581D408E; Fri, 12 Aug 2011 01:21:10 +0000 (UTC) From: Ben Widawsky To: intel-gfx@lists.freedesktop.org Date: Thu, 11 Aug 2011 18:18:33 -0700 Message-Id: <1313111913-6458-1-git-send-email-ben@bwidawsk.net> X-Mailer: git-send-email 1.7.6 In-Reply-To: <1313110048-2971-2-git-send-email-ben@bwidawsk.net> References: <1313110048-2971-2-git-send-email-ben@bwidawsk.net> Cc: Ben Widawsky Subject: [Intel-gfx] [PATCH 1/2] drm/i915: add assumed cpu-dirtied flush 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: , MIME-Version: 1.0 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.6 (demeter1.kernel.org [140.211.167.41]); Fri, 12 Aug 2011 01:19:06 +0000 (UTC) Oops. The previous patch was the wrong one. Signed-off-by: Ben Widawsky --- drivers/gpu/drm/i915/i915_drv.h | 2 ++ drivers/gpu/drm/i915/i915_gem_execbuffer.c | 7 +++++++ 2 files changed, 9 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index feb4f16..2a61e63 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -879,6 +879,8 @@ struct drm_i915_gem_object { * reaches 0, dev_priv->pending_flip_queue will be woken up. */ atomic_t pending_flip; + + atomic_t always_cpu_dirty; }; #define to_intel_bo(x) container_of(x, struct drm_i915_gem_object, base) diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c index 4934cf8..b88febf 100644 --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c @@ -179,6 +179,12 @@ i915_gem_object_set_to_gpu_domain(struct drm_i915_gem_object *obj, invalidate_domains |= obj->base.pending_read_domains & ~obj->base.write_domain; } + + if (atomic_read(&obj->always_cpu_dirty)) { + flush_domains |= I915_GEM_DOMAIN_CPU; + cd->flush_domains |= I915_GEM_DOMAIN_CPU; + } + /* * Invalidate any read caches which may have * stale data. That is, any new read domains. @@ -201,6 +207,7 @@ i915_gem_object_set_to_gpu_domain(struct drm_i915_gem_object *obj, cd->invalidate_domains |= invalidate_domains; cd->flush_domains |= flush_domains; + if (flush_domains & I915_GEM_GPU_DOMAINS) cd->flush_rings |= obj->ring->id; if (invalidate_domains & I915_GEM_GPU_DOMAINS)