From patchwork Wed Apr 27 20:46:04 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 737601 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 p3RKcxZu011438 for ; Wed, 27 Apr 2011 20:39:19 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F16F79F03A for ; Wed, 27 Apr 2011 13:38:58 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-ww0-f43.google.com (mail-ww0-f43.google.com [74.125.82.43]) by gabe.freedesktop.org (Postfix) with ESMTP id 6AD1B9E775 for ; Wed, 27 Apr 2011 13:38:12 -0700 (PDT) Received: by wwb17 with SMTP id 17so1885695wwb.12 for ; Wed, 27 Apr 2011 13:38:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=iVdlxBR2TiDrTrx2o+mFUL2nCQt660Z7WRjqRx3AQJc=; b=aBiLcrUgiOb2GwG/cAGnQ0a+62i6qu6KetXCvKUr2t/oErWKPdYoz1ABdUSu/B7GVw bIgs0I0c18B/bUWejuQI/eivB3ZeYGTMAN6hmFTunKomVwyC+R1WlTDTrv7jMz6SAsEq PJlgRb8VNlci8VuTZQuKnJHooQTuJUof/XiOg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=d0pNr3bBmguKcsSpVZK7sdDyJf8Gj96PJ0EsH57Kd8mKGYgC5Q2R8XKxJAW9fuRZ6W NVULIbQRDW69ELdKqRu+EwrpTmToBpUDK4D6oaadEyYSpIcXInX/Et8uCSOhGetm6qPZ jBD5eyDwvTuxeEPcYVGPwjx6lfBMOe1tL3WYA= Received: by 10.216.79.1 with SMTP id h1mr796969wee.103.1303936691249; Wed, 27 Apr 2011 13:38:11 -0700 (PDT) Received: from localhost.localdomain (cable-static-216-166.intergga.ch [87.102.216.166]) by mx.google.com with ESMTPS id l5sm553743wej.32.2011.04.27.13.38.10 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 27 Apr 2011 13:38:10 -0700 (PDT) From: Daniel Vetter To: intel-gfx@lists.freedesktop.org Date: Wed, 27 Apr 2011 22:46:04 +0200 Message-Id: <1303937166-1756-2-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.7.4.2 In-Reply-To: <1303937166-1756-1-git-send-email-daniel.vetter@ffwll.ch> References: <1303937166-1756-1-git-send-email-daniel.vetter@ffwll.ch> Cc: Daniel Vetter Subject: [Intel-gfx] [PATCH 1/3] drm/i915/ringbuffer: kill snb blt workaround 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]); Wed, 27 Apr 2011 20:39:34 +0000 (UTC) This was just to facilitate product enablement with pre-production hw. Allows us to kill quite a bit of cruft. Cc: Eric Anholt Signed-off-by: Daniel Vetter Reviewed-by: Eric Anholt --- drivers/gpu/drm/i915/intel_ringbuffer.c | 83 +------------------------------ 1 files changed, 2 insertions(+), 81 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c index f15d80f..afb2a34 100644 --- a/drivers/gpu/drm/i915/intel_ringbuffer.c +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c @@ -887,9 +887,6 @@ void intel_cleanup_ring_buffer(struct intel_ring_buffer *ring) drm_gem_object_unreference(&ring->obj->base); ring->obj = NULL; - if (ring->cleanup) - ring->cleanup(ring); - cleanup_status_page(ring); } @@ -1153,78 +1150,13 @@ blt_ring_put_irq(struct intel_ring_buffer *ring) } -/* Workaround for some stepping of SNB, - * each time when BLT engine ring tail moved, - * the first command in the ring to be parsed - * should be MI_BATCH_BUFFER_START - */ -#define NEED_BLT_WORKAROUND(dev) \ - (IS_GEN6(dev) && (dev->pdev->revision < 8)) - -static inline struct drm_i915_gem_object * -to_blt_workaround(struct intel_ring_buffer *ring) -{ - return ring->private; -} - -static int blt_ring_init(struct intel_ring_buffer *ring) -{ - if (NEED_BLT_WORKAROUND(ring->dev)) { - struct drm_i915_gem_object *obj; - u32 *ptr; - int ret; - - obj = i915_gem_alloc_object(ring->dev, 4096); - if (obj == NULL) - return -ENOMEM; - - ret = i915_gem_object_pin(obj, 4096, true); - if (ret) { - drm_gem_object_unreference(&obj->base); - return ret; - } - - ptr = kmap(obj->pages[0]); - *ptr++ = MI_BATCH_BUFFER_END; - *ptr++ = MI_NOOP; - kunmap(obj->pages[0]); - - ret = i915_gem_object_set_to_gtt_domain(obj, false); - if (ret) { - i915_gem_object_unpin(obj); - drm_gem_object_unreference(&obj->base); - return ret; - } - - ring->private = obj; - } - - return init_ring_common(ring); -} - -static int blt_ring_begin(struct intel_ring_buffer *ring, - int num_dwords) -{ - if (ring->private) { - int ret = intel_ring_begin(ring, num_dwords+2); - if (ret) - return ret; - - intel_ring_emit(ring, MI_BATCH_BUFFER_START); - intel_ring_emit(ring, to_blt_workaround(ring)->gtt_offset); - - return 0; - } else - return intel_ring_begin(ring, 4); -} - static int blt_ring_flush(struct intel_ring_buffer *ring, u32 invalidate, u32 flush) { uint32_t cmd; int ret; - ret = blt_ring_begin(ring, 4); + ret = intel_ring_begin(ring, 4); if (ret) return ret; @@ -1239,22 +1171,12 @@ static int blt_ring_flush(struct intel_ring_buffer *ring, return 0; } -static void blt_ring_cleanup(struct intel_ring_buffer *ring) -{ - if (!ring->private) - return; - - i915_gem_object_unpin(ring->private); - drm_gem_object_unreference(ring->private); - ring->private = NULL; -} - static const struct intel_ring_buffer gen6_blt_ring = { .name = "blt ring", .id = RING_BLT, .mmio_base = BLT_RING_BASE, .size = 32 * PAGE_SIZE, - .init = blt_ring_init, + .init = init_ring_common, .write_tail = ring_write_tail, .flush = blt_ring_flush, .add_request = gen6_add_request, @@ -1262,7 +1184,6 @@ static const struct intel_ring_buffer gen6_blt_ring = { .irq_get = blt_ring_get_irq, .irq_put = blt_ring_put_irq, .dispatch_execbuffer = gen6_ring_dispatch_execbuffer, - .cleanup = blt_ring_cleanup, }; int intel_init_render_ring_buffer(struct drm_device *dev)