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=-9.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,HK_RANDOM_FROM,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable 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 E05D3C433C1 for ; Tue, 23 Mar 2021 09:35:41 +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 A1AC261984 for ; Tue, 23 Mar 2021 09:35:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A1AC261984 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 92A496E873; Tue, 23 Mar 2021 09:35:40 +0000 (UTC) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id 961C16E29D; Tue, 23 Mar 2021 09:35:38 +0000 (UTC) IronPort-SDR: AoXK3TfFqr5muGFvDSzWwfATiKTFC9TAEAOdnCsXU0nee35ta2v3KwJlEZYA/z+Uxsm4fk9U3T zYBz5/EV8nlw== X-IronPort-AV: E=McAfee;i="6000,8403,9931"; a="190537369" X-IronPort-AV: E=Sophos;i="5.81,271,1610438400"; d="scan'208";a="190537369" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Mar 2021 02:35:37 -0700 IronPort-SDR: v5eOijKw1td8m8aT4eR99p8DYFKLyQWpA1iom0snynDvPd+ScTa0R3a075Ed2U4Z29jQToERPJ +WKtbID0ibVw== X-IronPort-AV: E=Sophos;i="5.81,271,1610438400"; d="scan'208";a="452073477" Received: from fbogue-mobl1.ger.corp.intel.com (HELO [10.213.247.160]) ([10.213.247.160]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Mar 2021 02:35:36 -0700 To: Jason Ekstrand References: <20210319223856.2983244-1-jason@jlekstrand.net> <20210319223856.2983244-5-jason@jlekstrand.net> From: Tvrtko Ursulin Organization: Intel Corporation UK Plc Message-ID: <963d089f-a08a-c3e7-4497-6f7d27b18520@linux.intel.com> Date: Tue, 23 Mar 2021 09:35:34 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US Subject: Re: [Intel-gfx] [PATCH 4/4] drm/i915: Implement SINGLE_TIMELINE with a syncobj 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: , Cc: Intel GFX , Maling list - DRI developers Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On 22/03/2021 16:10, Jason Ekstrand wrote: > On Mon, Mar 22, 2021 at 7:28 AM Tvrtko Ursulin [snip] >>> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c >>> index 96403130a373d..2c56796f6a71b 100644 >>> --- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c >>> +++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c >>> @@ -3295,6 +3295,15 @@ i915_gem_do_execbuffer(struct drm_device *dev, >>> goto err_vma; >>> } >>> >>> + if (eb.gem_context->syncobj) { >>> + struct dma_fence *fence; >>> + >>> + fence = drm_syncobj_fence_get(eb.gem_context->syncobj); >> >> Who drops this reference? > > i915_request_await_dma_fence() below consumes a reference. Not sure, please check on difference wrt input fence handling. >>> + err = i915_request_await_dma_fence(eb.request, fence); >>> + if (err) >>> + goto err_ext; >>> + } >>> + >>> if (in_fence) { >>> if (args->flags & I915_EXEC_FENCE_SUBMIT) >>> err = i915_request_await_execution(eb.request, >>> @@ -3351,6 +3360,12 @@ i915_gem_do_execbuffer(struct drm_device *dev, >>> fput(out_fence->file); >>> } >>> } >>> + >>> + if (eb.gem_context->syncobj) { >>> + drm_syncobj_replace_fence(eb.gem_context->syncobj, >>> + &eb.request->fence); >>> + } >>> + >>> i915_request_put(eb.request); >>> >>> err_vma: >>> >> >> So essentially moving the synchronisation to top level which is extra >> work, but given limited and questionable usage of the uapi may be >> acceptable. Need full picture on motivation to understand. > > For one thing, the GuC scheduler doesn't natively have a concept of > "timelines" which can be shared like this. To work with the GuC Confused - neither does execlists. It is handled in common layer in i915. GuC scheduler has the same concept of one hw context is one timeline because that is the hw concept and not backend specific. > scheduler as currently proposed in DII, they've asked the media driver > to stop using this flag in favor of passing a sync file from batch to > batch. If we want to slide GuC scheduling in smoothly, we've got to > keep it working. This means either making timelines a concept there > or doing an emulation like this. Hm not aware and don't see that GuC backend can't or doesn't implement this. Perhaps this would be best discussed once GuC patches are posted. >> Semantics are also not 1:1 since dma fence context will be different. > > Could you elaborate? Exported dma fence context as an "timeline" id will be single with the current patch and multiple contexts with this implementation. Daniel also raised another difference caused by lack of serialisation due multiple tl->mutex here. I don't think this is important, it was never part of a contract what happens with racing execbufs, but it is definitely required covering both topics in the commit message. Regards, Tvrtko _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx