Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp575728pxx; Thu, 29 Oct 2020 09:17:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+b2UX8WN5zfUvXiv9yeHCIr/02HFndoQgR9bwhjI4KK3ar5DMrDO+s3M1cooZV/zwcBMN X-Received: by 2002:a05:6402:142c:: with SMTP id c12mr5000243edx.41.1603988247903; Thu, 29 Oct 2020 09:17:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603988247; cv=none; d=google.com; s=arc-20160816; b=K4ZmSBkn9NDS5WDkJfzVecRT9sZZrdQLNTDVJdBJljHVp4fFfKcjFl1WWQLkDyV6Ua 7+gVk7cbuYwK1AoQqI+RmgT8RVFQ1M94Xan0G5Rqh7olN3g9so8g6aJGCogPFx+J2oUv DCjROSI7rnkMlhj8osSkBJgI+jbcU7KkZdjbbNlbM6SdcSYeZC87Tvz3SG5oHNI2Ppmf PyNat+O2FBfYYor/LRMnmMjoDLAXqjdTawfgg54RPlko99bRjLr11hDygNZzBakT6fYN IcWHbhoOZP5FLharschiY9DVexFx7n9PbrUigBJ6FT7z6WTII8D2wiG303pq99sPDxOD jA8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=i6etDFeKtUj+RtB8Hig0oByEs1X05vnGUjehBWAxKJ0=; b=AmIyI1RIPijw7OAkXOrBCrXSqLb7RlfO6gIdCC45dqA3ZIOS6iQHNyS/xJAjJXdchQ xhIdB7nzD1JIDbVm/2UNUL6W7GYRi2pDQ8nLovS+bUUX0Q/jujlNSK1xhi2R/SDIPwzI vybnHpDmIoU63o/13yEBqyhlgXJyQlhhlBy7+LOHCGpu7oZENN88v2y+ouVUxyztdcPT 8AXIBU9sKLporM7WOFu8LTC9gSkyBb/WW8xAxW1VDl9j8P6RYwMuRXK17FiVesX2brEZ kCLWNkqdMbXDPblkjSXFfQXSKIVxjS7Wb5DVFID0L62T4QUJFJc4Lk5a8X7Cx4z7TK0s 7RUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=JM8mmzrw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j15si2108122ejy.366.2020.10.29.09.17.04; Thu, 29 Oct 2020 09:17:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=JM8mmzrw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725855AbgJ2QOk (ORCPT + 99 others); Thu, 29 Oct 2020 12:14:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725764AbgJ2QOk (ORCPT ); Thu, 29 Oct 2020 12:14:40 -0400 Received: from mail-ot1-x342.google.com (mail-ot1-x342.google.com [IPv6:2607:f8b0:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2920BC0613CF for ; Thu, 29 Oct 2020 09:14:40 -0700 (PDT) Received: by mail-ot1-x342.google.com with SMTP id h62so2800292oth.9 for ; Thu, 29 Oct 2020 09:14:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=i6etDFeKtUj+RtB8Hig0oByEs1X05vnGUjehBWAxKJ0=; b=JM8mmzrw2EIMWTSgXhoxYpNCZD/kbBIkLatmDmz6EvmNi2aHE4F5HWIEBMT2e9rVtj vee/pN885rxskj/y1aYzLuGj96hMCkTeA2H/K/mcI8cd1j3f4cM0kyZJoUbF43HcTN45 RnviYKwKrR5iq9ojbuj7d/uUu290M4d1GlwPM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=i6etDFeKtUj+RtB8Hig0oByEs1X05vnGUjehBWAxKJ0=; b=kUpTe+x6E6xeGjvgIQyH9uErWpDn4I7g1uPmvQVTA0oe3S7KxuetnttnCx0b3npvyS w0WJHVGFxH153KQyO2Xfv/kwyS3uIVjoFETIl7WaI3hKoMDY+fFoP/BdO3Z/xj2JkjVR bnHnzkhDovVkg0wF1HkWXPwiAi5NcuAfjPDkP7RZoAoUaNvIjPlxYWKlGLf7arZF3yIW 0diYIejNnSbo9N4+OWqRIcEqQ5VHnWE8/FTzW3EolPHxKO9P10Svi8R4mF+WLo8ZqK8/ ySbwDEddvOcL2Qz46NclAG+TAk6NSGYKxwSLUb4jzceLnQfWMmTyF8ogvxC3E46LCN2/ pW8Q== X-Gm-Message-State: AOAM532cSbJe+F+gkcDQT39iwFTDBxMYapeLjcqiu9OsK3Ls7Fk5wKLp ukXHHBSX5PCwqs2YlVZrYZTHH1T0F2123xpo8gS04Q== X-Received: by 2002:a9d:6e81:: with SMTP id a1mr3667472otr.303.1603988079536; Thu, 29 Oct 2020 09:14:39 -0700 (PDT) MIME-Version: 1.0 References: <20201023165136.561680-1-robdclark@gmail.com> <20201023165136.561680-24-robdclark@gmail.com> <20201026093405.GG401619@phenom.ffwll.local> In-Reply-To: <20201026093405.GG401619@phenom.ffwll.local> From: Daniel Vetter Date: Thu, 29 Oct 2020 17:14:28 +0100 Message-ID: Subject: Re: [PATCH v4 23/23] drm/msm: Don't implicit-sync if only a single ring To: Rob Clark Cc: Lucas Stach , Rob Clark , freedreno , David Airlie , linux-arm-msm , open list , dri-devel , "Kristian H . Kristensen" , Sean Paul Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 26, 2020 at 10:34 AM Daniel Vetter wrote: > > On Fri, Oct 23, 2020 at 08:49:14PM -0700, Rob Clark wrote: > > On Fri, Oct 23, 2020 at 11:20 AM Lucas Stach wrote: > > > > > > On Fr, 2020-10-23 at 09:51 -0700, Rob Clark wrote: > > > > From: Rob Clark > > > > > > > > If there is only a single ring (no-preemption), everything is FIFO order > > > > and there is no need to implicit-sync. > > > > > > > > Mesa should probably just always use MSM_SUBMIT_NO_IMPLICIT, as behavior > > > > is undefined when fences are not used to synchronize buffer usage across > > > > contexts (which is the only case where multiple different priority rings > > > > could come into play). > > > > > > Really, doesn't this break cross-device implicit sync? Okay, you may > > > not have many peripherals that rely on implicit sync on devices where > > > Adreno is usually found, but it seems rather heavy-handed. > > > > > > Wouldn't it be better to only ignore fences from your own ring context > > > in the implicit sync, like we do in the common DRM scheduler > > > (drm_sched_dependency_optimized)? > > > > we already do this.. as was discussed on an earlier iteration of this patchset > > > > But I'm not aware of any other non-gpu related implicit sync use-case > > (even on imx devices where display is decoupled from gpu).. I'll > > revert the patch if someone comes up with one, but otherwise lets let > > the implicit sync baggage die > > The thing is, dma_resv won't die, even if implicit sync is dead. We're > using internally for activity tracking and memory management. If you don't > set these, then we can't share generic code with msm, and I think everyone > inventing their own memory management is a bit a mistake. > > Now you only kill the implicit write sync stuff here, but I'm not sure > that's worth much since you still install all the read fences for > consistency. And if userspace doesn't want to be synced, they can set the > flag and do this on their own: I think you should be able to achieve > exactly the same thing in mesa. > > Aside: If you're worried about overhead, you can do O(1) submit if you > manage your ppgtt like amdgpu does. So just remember a use-case which is maybe a bit yucky, but it is actually possible to implement race-free. If you have implicit sync. There's screen-capture tool in mplayer and obs which capture your compositor by running getfb2 in a loop. It works, and after some initial screaming I realized it does actually work race-free. If you have implicit sync. I really don't think you can sunset this, as much as you want to. And sunsetting it inconsistently is probably the worst. -Daniel > -Daniel > > > > > BR, > > -R > > > > > > > > > > > > Regards, > > > Lucas > > > > > > > Signed-off-by: Rob Clark > > > > Reviewed-by: Kristian H. Kristensen > > > > --- > > > > drivers/gpu/drm/msm/msm_gem_submit.c | 7 ++++--- > > > > 1 file changed, 4 insertions(+), 3 deletions(-) > > > > > > > > diff --git a/drivers/gpu/drm/msm/msm_gem_submit.c b/drivers/gpu/drm/msm/msm_gem_submit.c > > > > index d04c349d8112..b6babc7f9bb8 100644 > > > > --- a/drivers/gpu/drm/msm/msm_gem_submit.c > > > > +++ b/drivers/gpu/drm/msm/msm_gem_submit.c > > > > @@ -283,7 +283,7 @@ static int submit_lock_objects(struct msm_gem_submit *submit) > > > > return ret; > > > > } > > > > > > > > -static int submit_fence_sync(struct msm_gem_submit *submit, bool no_implicit) > > > > +static int submit_fence_sync(struct msm_gem_submit *submit, bool implicit_sync) > > > > { > > > > int i, ret = 0; > > > > > > > > @@ -303,7 +303,7 @@ static int submit_fence_sync(struct msm_gem_submit *submit, bool no_implicit) > > > > return ret; > > > > } > > > > > > > > - if (no_implicit) > > > > + if (!implicit_sync) > > > > continue; > > > > > > > > ret = msm_gem_sync_object(&msm_obj->base, submit->ring->fctx, > > > > @@ -774,7 +774,8 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data, > > > > if (ret) > > > > goto out; > > > > > > > > - ret = submit_fence_sync(submit, !!(args->flags & MSM_SUBMIT_NO_IMPLICIT)); > > > > + ret = submit_fence_sync(submit, (gpu->nr_rings > 1) && > > > > + !(args->flags & MSM_SUBMIT_NO_IMPLICIT)); > > > > if (ret) > > > > goto out; > > > > > > > > > _______________________________________________ > > dri-devel mailing list > > dri-devel@lists.freedesktop.org > > https://lists.freedesktop.org/mailman/listinfo/dri-devel > > -- > Daniel Vetter > Software Engineer, Intel Corporation > http://blog.ffwll.ch -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch