From patchwork Sat Apr 8 16:26:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 9671119 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id F1885601EB for ; Sat, 8 Apr 2017 16:26:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E42DF28489 for ; Sat, 8 Apr 2017 16:26:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D9066284F4; Sat, 8 Apr 2017 16:26:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9A4C428489 for ; Sat, 8 Apr 2017 16:26:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B82C5895C8; Sat, 8 Apr 2017 16:26:13 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 85D626E16F; Sat, 8 Apr 2017 16:26:08 +0000 (UTC) Received: by mail-wm0-x242.google.com with SMTP id q125so2907164wmd.3; Sat, 08 Apr 2017 09:26:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=lSoz+GGmbNirVncl//wyQTtyzvbfl/gSKb71MReadFQ=; b=N2vLAeYyzt5FlPj8P6zvaZEWkrDexKnMlv4o7Z4oMLappdFUIjxj3vI8Ytv8Sl3zyW Yy0SMwHQHb9mJRyRwJVx0E6GqJ6BY5eAVGKuupuhyDEA45CgQp89djQz/Idek1mRQJ6F pN2R6tdfa7CoKW8JFpSW0l74/14GcXoQNGctR7bdXZkoip0EKL3El3FtJkiV+UXzNS9N RlX/e07nTZrvAOl078v3iJ/t8C4L5rLPeacbzCsj9WHw6+xehQkrneJdHA5zexWaEVFD JXLWTcDoh/xHXcTku1VtcrFuUgkQaFaElZisSY7drpyuvo95jNW/JwE+6X2lzpf6o7hv Dqug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=lSoz+GGmbNirVncl//wyQTtyzvbfl/gSKb71MReadFQ=; b=D9igH/3lee3zNSX7/9nrxn4cVl4/g4JYqaJLYn1gMy27WGYCyrE39RdUiWamxP07n7 DxRt5dQ0+Bx+olON4wEmWofbLR4eydurBFmAkkub/xEDnnAEFuicpjKu4HhBZxCi6gGh G2RGsqgiqzD+vBe2mjhthdH0HAZpteqYUiV5KdBYM8o7pVA8OCOTR6+p+rLxcOFTc4Yc urwRMQ/Kw+6pXWJgX9WEF0Vx3IOgPmgbhTN0POSvG4XJevoV9l4pUo3F45OLq8CDxp58 hx3Qw2FyV0ADu6gtBPfbmXAwmNafZM6Xn8bW3ghTrQlW7y/BeQQlug5vK0bdz+CZjxYa rYfQ== X-Gm-Message-State: AN3rC/4YjuQk/j5SGKPftRXeKPUK9cnepZFEWxJEeugyqAuZIDwgGqEt9feByapQzQEroA== X-Received: by 10.28.86.68 with SMTP id k65mr3738882wmb.112.1491668767216; Sat, 08 Apr 2017 09:26:07 -0700 (PDT) Received: from haswell.alporthouse.com ([78.156.65.138]) by smtp.gmail.com with ESMTPSA id 191sm3256856wmv.25.2017.04.08.09.26.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 08 Apr 2017 09:26:06 -0700 (PDT) From: Chris Wilson To: dri-devel@lists.freedesktop.org Subject: [PATCH 2/3] drm/i915: Mark up clflushes as belonging to an unordered timeline (NO_CONTEXT) Date: Sat, 8 Apr 2017 17:26:02 +0100 Message-Id: <20170408162603.28305-2-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170408162603.28305-1-chris@chris-wilson.co.uk> References: <20170408162603.28305-1-chris@chris-wilson.co.uk> Cc: Daniel Vetter , intel-gfx@lists.freedesktop.org, Joonas Lahtinen X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 2 clflushes on two different objects are not ordered, and so do not belong to the same timeline (context). Either we use a unique context for each, or we reserve a special context (0 / DMA_FENCE_NO_CONTEXT) to mean unordered. Signed-off-by: Chris Wilson Cc: Sumit Semwal Cc: Gustavo Padovan Cc: Daniel Vetter Cc: Joonas Lahtinen --- drivers/gpu/drm/i915/i915_gem.c | 2 -- drivers/gpu/drm/i915/i915_gem_clflush.c | 8 +------- drivers/gpu/drm/i915/i915_gem_clflush.h | 1 - 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index b210acc3d0b4..6dacc5c21889 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -4681,8 +4681,6 @@ int i915_gem_init(struct drm_i915_private *dev_priv) mutex_lock(&dev_priv->drm.struct_mutex); - i915_gem_clflush_init(dev_priv); - if (!i915.enable_execlists) { dev_priv->gt.resume = intel_legacy_submission_resume; dev_priv->gt.cleanup_engine = intel_engine_cleanup; diff --git a/drivers/gpu/drm/i915/i915_gem_clflush.c b/drivers/gpu/drm/i915/i915_gem_clflush.c index ffd01e02fe94..57ee389c665f 100644 --- a/drivers/gpu/drm/i915/i915_gem_clflush.c +++ b/drivers/gpu/drm/i915/i915_gem_clflush.c @@ -27,7 +27,6 @@ #include "i915_gem_clflush.h" static DEFINE_SPINLOCK(clflush_lock); -static u64 clflush_context; struct clflush { struct dma_fence dma; /* Must be first for dma_fence_free() */ @@ -157,7 +156,7 @@ void i915_gem_clflush_object(struct drm_i915_gem_object *obj, dma_fence_init(&clflush->dma, &i915_clflush_ops, &clflush_lock, - clflush_context, + DMA_FENCE_NO_CONTEXT, 0); i915_sw_fence_init(&clflush->wait, i915_clflush_notify); @@ -182,8 +181,3 @@ void i915_gem_clflush_object(struct drm_i915_gem_object *obj, GEM_BUG_ON(obj->base.write_domain != I915_GEM_DOMAIN_CPU); } } - -void i915_gem_clflush_init(struct drm_i915_private *i915) -{ - clflush_context = dma_fence_context_alloc(1); -} diff --git a/drivers/gpu/drm/i915/i915_gem_clflush.h b/drivers/gpu/drm/i915/i915_gem_clflush.h index b62d61a2d15f..2455a7820937 100644 --- a/drivers/gpu/drm/i915/i915_gem_clflush.h +++ b/drivers/gpu/drm/i915/i915_gem_clflush.h @@ -28,7 +28,6 @@ struct drm_i915_private; struct drm_i915_gem_object; -void i915_gem_clflush_init(struct drm_i915_private *i915); void i915_gem_clflush_object(struct drm_i915_gem_object *obj, unsigned int flags); #define I915_CLFLUSH_FORCE BIT(0)