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.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 8998CC47247 for ; Fri, 8 May 2020 11:10:18 +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 6A44A208CA for ; Fri, 8 May 2020 11:10:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6A44A208CA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com 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 072736EB04; Fri, 8 May 2020 11:10:18 +0000 (UTC) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 85E4E6EB04 for ; Fri, 8 May 2020 11:10:16 +0000 (UTC) IronPort-SDR: YTewEIrqXYOMzBFKt8BPfvgV9ROR0Hspqzg2J5Sl/suEhctS3C0S2YsdyG0CmK8Q5rV1hREOru Ji+uB5b7HWJg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 May 2020 04:10:15 -0700 IronPort-SDR: tTM77yia2ur9gkUF+4jqIkemXEygJMJTG0FZZ34SY1622PWraQ3OyTYczLWsgAeOMHkJl+Sr9x QWWcOgvD9SMw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,367,1583222400"; d="scan'208";a="305410692" Received: from gaia.fi.intel.com ([10.237.72.192]) by FMSMGA003.fm.intel.com with ESMTP; 08 May 2020 04:10:14 -0700 Received: by gaia.fi.intel.com (Postfix, from userid 1000) id B46EF5C1DC1; Fri, 8 May 2020 14:08:06 +0300 (EEST) From: Mika Kuoppala To: Chris Wilson , intel-gfx@lists.freedesktop.org In-Reply-To: <158893364177.11903.12713400644286649178@build.alporthouse.com> References: <20200508092933.738-1-chris@chris-wilson.co.uk> <20200508092933.738-2-chris@chris-wilson.co.uk> <87imh6ybiq.fsf@gaia.fi.intel.com> <158893364177.11903.12713400644286649178@build.alporthouse.com> Date: Fri, 08 May 2020 14:08:06 +0300 Message-ID: <87ftcay99l.fsf@gaia.fi.intel.com> MIME-Version: 1.0 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" Chris Wilson writes: > 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/? It is fine like it is. I was just so confused that we piggyback our context along the fence. But yeah this is the fence->context and zero is a special. (thanks for explaining in irc) Reviewed-by: Mika Kuoppala > -Chris _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx