From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 74AB5C38A2A for ; Fri, 8 May 2020 10:27:27 +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 5116E20A8B for ; Fri, 8 May 2020 10:27:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5116E20A8B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=chris-wilson.co.uk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E15216EAD6; Fri, 8 May 2020 10:27:26 +0000 (UTC) Received: from fireflyinternet.com (mail.fireflyinternet.com [109.228.58.192]) by gabe.freedesktop.org (Postfix) with ESMTPS id 805816EAD6 for ; Fri, 8 May 2020 10:27:25 +0000 (UTC) X-Default-Received-SPF: pass (skip=forwardok (res=PASS)) x-ip-name=78.156.65.138; Received: from localhost (unverified [78.156.65.138]) by fireflyinternet.com (Firefly Internet (M1)) with ESMTP (TLS) id 21149155-1500050 for multiple; Fri, 08 May 2020 11:27:24 +0100 MIME-Version: 1.0 In-Reply-To: <87imh6ybiq.fsf@gaia.fi.intel.com> References: <20200508092933.738-1-chris@chris-wilson.co.uk> <20200508092933.738-2-chris@chris-wilson.co.uk> <87imh6ybiq.fsf@gaia.fi.intel.com> From: Chris Wilson To: Mika Kuoppala , intel-gfx@lists.freedesktop.org Message-ID: <158893364177.11903.12713400644286649178@build.alporthouse.com> User-Agent: alot/0.8.1 Date: Fri, 08 May 2020 11:27:21 +0100 Subject: Re: [Intel-gfx] [PATCH 2/9] drm/i915: Pull waiting on an external dma-fence into its routine X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Quoting Mika Kuoppala (2020-05-08 11:19:25) > Chris Wilson writes: > > > As a means for a small code consolidation, but primarily to start > > thinking more carefully about internal-vs-external linkage, pull the > > pair of i915_sw_fence_await_dma_fence() calls into a common routine. > > > > Signed-off-by: Chris Wilson > > --- > > drivers/gpu/drm/i915/i915_request.c | 16 ++++++++++------ > > 1 file changed, 10 insertions(+), 6 deletions(-) > > > > diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c > > index be2ce9065a29..94189c7d43cd 100644 > > --- a/drivers/gpu/drm/i915/i915_request.c > > +++ b/drivers/gpu/drm/i915/i915_request.c > > @@ -1067,6 +1067,14 @@ i915_request_await_request(struct i915_request *to, struct i915_request *from) > > return 0; > > } > > > > +static int > > +i915_request_await_external(struct i915_request *rq, struct dma_fence *fence) > > +{ > > + return i915_sw_fence_await_dma_fence(&rq->submit, fence, > > + fence->context ? I915_FENCE_TIMEOUT : 0, > > + I915_FENCE_GFP); > > +} > > + > > int > > i915_request_await_dma_fence(struct i915_request *rq, struct dma_fence *fence) > > { > > @@ -1114,9 +1122,7 @@ i915_request_await_dma_fence(struct i915_request *rq, struct dma_fence *fence) > > if (dma_fence_is_i915(fence)) > > ret = i915_request_await_request(rq, to_request(fence)); > > else > > - ret = i915_sw_fence_await_dma_fence(&rq->submit, fence, > > - fence->context ? I915_FENCE_TIMEOUT : 0, > > - I915_FENCE_GFP); > > + ret = i915_request_await_external(rq, fence); > > For us (rq, rq), for external (rq, fence). > > It looks neat for a reader. But then, how can external fence have > a context? How about s/fence/dma/? -Chris _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx