From patchwork Mon Nov 25 09:43:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 11260059 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DD23213A4 for ; Mon, 25 Nov 2019 09:44:15 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C644120409 for ; Mon, 25 Nov 2019 09:44:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C644120409 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D47F76E0FA; Mon, 25 Nov 2019 09:44:08 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by gabe.freedesktop.org (Postfix) with ESMTPS id D750F6E0DC for ; Mon, 25 Nov 2019 09:44:06 +0000 (UTC) Received: by mail-wr1-x444.google.com with SMTP id t2so17092451wrr.1 for ; Mon, 25 Nov 2019 01:44:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8hpBAi/pZFlll+DPJCdIzsjixXdb4nKfYkOd8MlOFBA=; b=jSeK1ccDBDR7sZgPKkCz8Zcy19crIWjnYpTcI8/KZfftJOkhLsI1C38jvmIyMoII7P qKXWVTRLHlaSuyaRw8xLBRwBziDcRDVuEuSENzXfvmxKcRk+GdzkiYFMegotv9xrWOfC yskDIhfvcQngOJENMueOgMf5gOv5gLIrhHivwBgOeS8eB0n9EsMfKeBWOz6yYyk8KybO 9fxKrwJjLQ6Et3Ul75k1r0tdWd/0jkD5VF16zoloaqUY6VwAXmDm8aIY8mlIHlQp3lPR hC+TomF49EHkX8UCE9w9LYe9T9IaK2+Zl6lQbWH7qBouDylXsJ+SRWFRtqb/6nrzrt7A e4YA== X-Gm-Message-State: APjAAAVxuJS/1Oe4nDDSt+sc9rOL5XmeeOx/N4zJlpo8dEn7gJDun7/o 54dPDCU7L3GZqMD+j1SLRX3tRngRLqg= X-Google-Smtp-Source: APXvYqwgiLAplJg5Yh+JXV/ILpyKDrtCFstj+m4TmjF69SZbLZrUV+E0/HOtNdZWE6C7IMPJkt9q1A== X-Received: by 2002:adf:f010:: with SMTP id j16mr31434843wro.206.1574675045183; Mon, 25 Nov 2019 01:44:05 -0800 (PST) Received: from phenom.ffwll.local (212-51-149-96.fiber7.init7.net. [212.51.149.96]) by smtp.gmail.com with ESMTPSA id x2sm7598233wmc.3.2019.11.25.01.44.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Nov 2019 01:44:04 -0800 (PST) From: Daniel Vetter To: DRI Development Subject: [PATCH 2/4] drm/i915: Use dma_resv locking wrappers Date: Mon, 25 Nov 2019 10:43:54 +0100 Message-Id: <20191125094356.161941-3-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191125094356.161941-1-daniel.vetter@ffwll.ch> References: <20191125094356.161941-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8hpBAi/pZFlll+DPJCdIzsjixXdb4nKfYkOd8MlOFBA=; b=ZIKz9bxLfotsLoAB2e4VeRO+CsM/sKapVeODn24UtPjlRFVp/CYfWouHtuEk/nEdhp IMqMBOo2nW38o9v3DR+HdLrbnX/tjaFvSiIXKzkvClSbrBcqQLg52bhKfhYdOdziTEQd OSmNCzd2FO958TzAMrulD37aZlu4fey3iXKQ0= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tvrtko Ursulin , Jani Nikula , Daniel Vetter , Intel Graphics Development , Matthew Auld , Daniel Vetter Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" I'll add more fancy logic to them soon, so everyone really has to use them. Plus they already provide some nice additional debug infrastructure on top of direct ww_mutex usage for the fences tracked by dma_resv. Aside: We might want to create wrappers for i915_vma locking of the ->resv like we have for the i915_gem_bo itself already. Signed-off-by: Daniel Vetter Cc: Chris Wilson Cc: Tvrtko Ursulin Cc: Matthew Auld Cc: Joonas Lahtinen Cc: Jani Nikula --- drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c index 7a87e8270460..7b8f4ebd9986 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c @@ -1848,7 +1848,7 @@ static int eb_move_to_gpu(struct i915_execbuffer *eb) for (i = 0; i < count; i++) { struct i915_vma *vma = eb->vma[i]; - err = ww_mutex_lock_interruptible(&vma->resv->lock, &acquire); + err = dma_resv_lock_interruptible(vma->resv, &acquire); if (!err) continue; @@ -1859,7 +1859,7 @@ static int eb_move_to_gpu(struct i915_execbuffer *eb) do { int j = i - 1; - ww_mutex_unlock(&eb->vma[j]->resv->lock); + dma_resv_unlock(eb->vma[j]->resv); swap(eb->flags[i], eb->flags[j]); swap(eb->vma[i], eb->vma[j]); @@ -1868,7 +1868,7 @@ static int eb_move_to_gpu(struct i915_execbuffer *eb) GEM_BUG_ON(vma != eb->vma[0]); vma->exec_flags = &eb->flags[0]; - err = ww_mutex_lock_slow_interruptible(&vma->resv->lock, + err = dma_resv_lock_slow_interruptible(vma->resv, &acquire); } if (err)