Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1290890imm; Tue, 5 Jun 2018 12:03:54 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKBY7BH+XFNGM7IfdUZP4fOTdobrQVYoswWJECbvJCqcjkOj5LdXwEdqc1ehE6hieI2eoM0 X-Received: by 2002:a63:79c5:: with SMTP id u188-v6mr5481374pgc.111.1528225434827; Tue, 05 Jun 2018 12:03:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528225434; cv=none; d=google.com; s=arc-20160816; b=z7rfY5rq3EdSFH1LH8sXtAFUXI8NuDfKS6Kd+20XFXIBMNd3Gn4cTv/HQYWTYZcs8E RupKunbau8w7lt09s1zdjZP7motHtEl6X6BBz2SjgHxgBxzb92rgBi/URLTei1lwHBU+ rXVCO1WsnivHcBOGJ9vdBc0WIF9a6fl4iO15xmEQ8oVRPLiDhRvQ7vi5tIB+9AHS8BhN sVQWGLYZsfrOGgqg8NMcD6y0qncffOns1qYEKj8HadMdsb0J6F1VCrmFWxs4BVsZzMRQ 47P/I4prNE52LtADYyRdxJBxVH/PSErzkB65TCjX9SJKrEJuFXV/JIv4d46iZbXA1WlW AM4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=Vzf9O8+wAARFpX0mnSavPi15NfDV77m1i9aZ3WStBz4=; b=T5xUgEnyDuxca8z46MdqEodLypNaUprxQssDi7ZXBSz1AYtfCavFldCcJ3CfyS2pCo duiGKaXp0QxDMjmAKC+AfPLIRKGIq+Xfmgl33xMNNxuA6lG/popqfG9ECFdiIUHMAnl1 KWoaPCQRBh+nZKWQ/otp/jpnyJDjut8yynrkLE+uVqjG8WEjpf0S+IFqNODeCmEaQWtu TMKzJCbP+598mtwdiTz66KcqeJa/y4BBcVYcQ9p6g+MuVSFVE/mQ8LIyExYtRUcn6KL+ 4SFEAQzkuxZlEqGIU5umWh/+MbMjgoeX3f8DTyc2p4U/Om5vSlc5Xk3aD5ZOCNENmv+1 bWOw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c7-v6si18931225pgu.535.2018.06.05.12.03.40; Tue, 05 Jun 2018 12:03:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752196AbeFETDL (ORCPT + 99 others); Tue, 5 Jun 2018 15:03:11 -0400 Received: from anholt.net ([50.246.234.109]:40576 "EHLO anholt.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751823AbeFETDJ (ORCPT ); Tue, 5 Jun 2018 15:03:09 -0400 Received: from localhost (localhost [127.0.0.1]) by anholt.net (Postfix) with ESMTP id 30C4010A12B2; Tue, 5 Jun 2018 12:03:08 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at anholt.net Received: from anholt.net ([127.0.0.1]) by localhost (kingsolver.anholt.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id k5zFIGA07ZKk; Tue, 5 Jun 2018 12:03:04 -0700 (PDT) Received: from eliezer.anholt.net (localhost [127.0.0.1]) by anholt.net (Postfix) with ESMTP id BBE9D10A0F77; Tue, 5 Jun 2018 12:03:03 -0700 (PDT) Received: by eliezer.anholt.net (Postfix, from userid 1000) id 0885E2FE2D96; Tue, 5 Jun 2018 12:03:03 -0700 (PDT) From: Eric Anholt To: dri-devel@lists.freedesktop.org Cc: linux-kernel@vger.kernel.org, Lucas Stach , amd-gfx@lists.freedesktop.org, Eric Anholt Subject: [PATCH 2/3] drm/v3d: Remove the bad signaled() implementation. Date: Tue, 5 Jun 2018 12:03:01 -0700 Message-Id: <20180605190302.18279-2-eric@anholt.net> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180605190302.18279-1-eric@anholt.net> References: <20180605190302.18279-1-eric@anholt.net> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since our seqno value comes from a counter associated with the GPU ring, not the entity (aka client), they'll be completed out of order. There's actually no need for this code at all, since we don't have enable_signaling() and thus DMA_FENCE_SIGNALED_BIT will be set before we could be called. Signed-off-by: Eric Anholt --- drivers/gpu/drm/v3d/v3d_drv.h | 1 - drivers/gpu/drm/v3d/v3d_fence.c | 13 ++++--------- drivers/gpu/drm/v3d/v3d_gem.c | 7 ++----- drivers/gpu/drm/v3d/v3d_irq.c | 3 --- 4 files changed, 6 insertions(+), 18 deletions(-) diff --git a/drivers/gpu/drm/v3d/v3d_drv.h b/drivers/gpu/drm/v3d/v3d_drv.h index 26005abd9c5d..f32ac8c98f37 100644 --- a/drivers/gpu/drm/v3d/v3d_drv.h +++ b/drivers/gpu/drm/v3d/v3d_drv.h @@ -25,7 +25,6 @@ struct v3d_queue_state { u64 fence_context; u64 emit_seqno; - u64 finished_seqno; }; struct v3d_dev { diff --git a/drivers/gpu/drm/v3d/v3d_fence.c b/drivers/gpu/drm/v3d/v3d_fence.c index 087d49c8cb12..bfe31a89668b 100644 --- a/drivers/gpu/drm/v3d/v3d_fence.c +++ b/drivers/gpu/drm/v3d/v3d_fence.c @@ -40,19 +40,14 @@ static bool v3d_fence_enable_signaling(struct dma_fence *fence) return true; } -static bool v3d_fence_signaled(struct dma_fence *fence) -{ - struct v3d_fence *f = to_v3d_fence(fence); - struct v3d_dev *v3d = to_v3d_dev(f->dev); - - return v3d->queue[f->queue].finished_seqno >= f->seqno; -} - const struct dma_fence_ops v3d_fence_ops = { .get_driver_name = v3d_fence_get_driver_name, .get_timeline_name = v3d_fence_get_timeline_name, .enable_signaling = v3d_fence_enable_signaling, - .signaled = v3d_fence_signaled, + /* Each of our fences gets signaled as complete by the IRQ + * handler, so we rely on the core's tracking of signaling. + */ + .signaled = NULL, .wait = dma_fence_default_wait, .release = dma_fence_free, }; diff --git a/drivers/gpu/drm/v3d/v3d_gem.c b/drivers/gpu/drm/v3d/v3d_gem.c index 9ea83bdb9a30..d06d6697e089 100644 --- a/drivers/gpu/drm/v3d/v3d_gem.c +++ b/drivers/gpu/drm/v3d/v3d_gem.c @@ -657,17 +657,14 @@ void v3d_gem_destroy(struct drm_device *dev) { struct v3d_dev *v3d = to_v3d_dev(dev); - enum v3d_queue q; v3d_sched_fini(v3d); /* Waiting for exec to finish would need to be done before * unregistering V3D. */ - for (q = 0; q < V3D_MAX_QUEUES; q++) { - WARN_ON(v3d->queue[q].emit_seqno != - v3d->queue[q].finished_seqno); - } + WARN_ON(v3d->bin_job); + WARN_ON(v3d->render_job); drm_mm_takedown(&v3d->mm); diff --git a/drivers/gpu/drm/v3d/v3d_irq.c b/drivers/gpu/drm/v3d/v3d_irq.c index 77e1fa046c10..e07514eb11b5 100644 --- a/drivers/gpu/drm/v3d/v3d_irq.c +++ b/drivers/gpu/drm/v3d/v3d_irq.c @@ -87,15 +87,12 @@ v3d_irq(int irq, void *arg) } if (intsts & V3D_INT_FLDONE) { - v3d->queue[V3D_BIN].finished_seqno++; dma_fence_signal(v3d->bin_job->bin.done_fence); status = IRQ_HANDLED; } if (intsts & V3D_INT_FRDONE) { - v3d->queue[V3D_RENDER].finished_seqno++; dma_fence_signal(v3d->render_job->render.done_fence); - status = IRQ_HANDLED; } -- 2.17.0