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=-3.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 71608C2D0A8 for ; Wed, 23 Sep 2020 10:58:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 26D32235FD for ; Wed, 23 Sep 2020 10:58:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="Qdl9ZA+Z" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726476AbgIWK6l (ORCPT ); Wed, 23 Sep 2020 06:58:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726332AbgIWK6l (ORCPT ); Wed, 23 Sep 2020 06:58:41 -0400 Received: from mail-oi1-x243.google.com (mail-oi1-x243.google.com [IPv6:2607:f8b0:4864:20::243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 697E8C0613CE for ; Wed, 23 Sep 2020 03:58:41 -0700 (PDT) Received: by mail-oi1-x243.google.com with SMTP id x69so24520635oia.8 for ; Wed, 23 Sep 2020 03:58:41 -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=wDiVGOW2BwVoj+byF8GmVc4hZoZxCN4FNEDgvLDpQ1k=; b=Qdl9ZA+ZTkR35bC8SLkZu9gmZz0yIkZzf7fKlMtexw60Ein4nPVkpSZdq9H4b/uQNE ym/7FKqm2OjdqPm5ssrHThHs7fQORtaSTkbYAoMJcXd6zsMkSRPtq+uCBJ7yDajwu2T7 3POcxNH9Erym7dLnHVvozChqgrTpMfAQqddds= 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=wDiVGOW2BwVoj+byF8GmVc4hZoZxCN4FNEDgvLDpQ1k=; b=q8d9BdBPaiRwQNzPgMk9Eiav5Dt+Qh4dtbYblHcoquix+V8yBE9BTyiXd/iyRvHs2s icL41WX/M3xgQwJDPV+OjxL1OPfCmQFtUR1TmzQ9jpyHlGDDiTYiQefHCN11fUn276wC WKqhQMDgf/7l9KsOMX4UMgfmUM2d1nDMxPWUiO0wbpgr2lroVKWXwriF81ze3pbnctdu 9QJaEZzrpFbSMKeD+Xu3kuXwNHd3k7kDkem9mo7s0/5f0PQcros+A6/Fl0FVcMY/A5BS aS7bES0eArUy9n8nq6Sg1aTbRi5kGZZxKJQ95LCQdzCqPTVntNFRXO0Mw3xD3RhO0LLg t25w== X-Gm-Message-State: AOAM530DAiq7hZBjMnfyM+lUoavaSZJm/EEtRD6IRMgLM7uwe4Obf1+h NZFAMFLD6i94XzZGM5T94TIMo51Qhm93D9sudP0HcQ== X-Google-Smtp-Source: ABdhPJxfxLPKhyX0sj8rLdjW3NuP47epv2iLZ1JCv3JNotaYE+HIg78XpuC6HN1WlipJCa2mmIVWRxwkFtnAzZPhCt0= X-Received: by 2002:aca:49c2:: with SMTP id w185mr4818246oia.101.1600858720790; Wed, 23 Sep 2020 03:58:40 -0700 (PDT) MIME-Version: 1.0 References: <20180705101043.4883-1-daniel.vetter@ffwll.ch> <20180705102121.5091-1-daniel.vetter@ffwll.ch> <20200922133636.GA2369@xpredator> In-Reply-To: <20200922133636.GA2369@xpredator> From: Daniel Vetter Date: Wed, 23 Sep 2020 12:58:30 +0200 Message-ID: Subject: Re: [PATCH] drm: avoid spurious EBUSY due to nonblocking atomic modesets To: Marius Vlad Cc: Daniel Stone , Pekka Paalanen , Intel Graphics Development , stable , DRI Development , Daniel Vetter Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org On Tue, Sep 22, 2020 at 3:36 PM Marius Vlad wrote: > > On Fri, Jan 31, 2020 at 07:34:00AM +0000, Daniel Stone wrote: > > On Thu, 5 Jul 2018 at 11:21, Daniel Vetter wrote: > > > When doing an atomic modeset with ALLOW_MODESET drivers are allowed to > > > pull in arbitrary other resources, including CRTCs (e.g. when > > > reconfiguring global resources). > > > > > > But in nonblocking mode userspace has then no idea this happened, > > > which can lead to spurious EBUSY calls, both: > > > - when that other CRTC is currently busy doing a page_flip the > > > ALLOW_MODESET commit can fail with an EBUSY > > > - on the other CRTC a normal atomic flip can fail with EBUSY because > > > of the additional commit inserted by the kernel without userspace's > > > knowledge > > > > > > For blocking commits this isn't a problem, because everyone else will > > > just block until all the CRTC are reconfigured. Only thing userspace > > > can notice is the dropped frames without any reason for why frames got > > > dropped. > > > > > > Consensus is that we need new uapi to handle this properly, but no one > > > has any idea what exactly the new uapi should look like. As a stop-gap > > > plug this problem by demoting nonblocking commits which might cause > > > issues by including CRTCs not in the original request to blocking > > > commits. > Gentle ping. I've tried out Linus's master tree and, and like Pekka, > I've noticed this isn't integrated/added. > > Noticed this is fixing (also) DPMS when multiple outputs are in use. > Wondering if we can just use a _ONCE() variant instead of WARN_ON(). I'm seeing > the warning quite often. On which driver/chip does this happen? -Daniel > > > > > Thanks for writing this up Daniel, and for reminding me about it some > > time later as well ... > > > > Reviewed-by: Daniel Stone > > > > Cheers, > > Daniel > > _______________________________________________ > > 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 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=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no 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 4AA90C4727F for ; Wed, 23 Sep 2020 10:58:44 +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 F18B923787 for ; Wed, 23 Sep 2020 10:58:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="Qdl9ZA+Z" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F18B923787 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E53196E959; Wed, 23 Sep 2020 10:58:42 +0000 (UTC) Received: from mail-oi1-x242.google.com (mail-oi1-x242.google.com [IPv6:2607:f8b0:4864:20::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 76C486E959 for ; Wed, 23 Sep 2020 10:58:41 +0000 (UTC) Received: by mail-oi1-x242.google.com with SMTP id a3so24597656oib.4 for ; Wed, 23 Sep 2020 03:58:41 -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=wDiVGOW2BwVoj+byF8GmVc4hZoZxCN4FNEDgvLDpQ1k=; b=Qdl9ZA+ZTkR35bC8SLkZu9gmZz0yIkZzf7fKlMtexw60Ein4nPVkpSZdq9H4b/uQNE ym/7FKqm2OjdqPm5ssrHThHs7fQORtaSTkbYAoMJcXd6zsMkSRPtq+uCBJ7yDajwu2T7 3POcxNH9Erym7dLnHVvozChqgrTpMfAQqddds= 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=wDiVGOW2BwVoj+byF8GmVc4hZoZxCN4FNEDgvLDpQ1k=; b=Ki0+Axga+NwIbjkUyT/6kfz47oSz41bbyJYQg17rY1wSiBqAW4texk/Gv93Zd1MhsX igj0wl0qk4va7ck8PvmpudUeUKyD06OD3zRENpMwU+MUBxIudR39qOn3Da0rNuBmrz/V vZf9WmGiYggdtQUW/9DRT3l0uRQc2oiVmispSPIIFFdD8tC8qtrqCb2qQLsoxWeWgSnL RLbDdYbCJLSAd3+UWsiCiY7UK4KJqXJSCHQ+KotQaCGGl/nmIxFVI8ZnJoo14MUEjzoj 9POyBkB2Iobj/pmJ7+vTEmIqSAF4U6O2ZzdgV0CBDi4T+HDxpfkDCIJ6tqifjZp9rJYn DQ5w== X-Gm-Message-State: AOAM531sW6RRckQV10EBJheHRCcfY2ZmX66ij8T/VH+lbZ1+0eDOjZkr VBagancZc8tTYx/4D5qLiK1TENfCfCyCo83zelkXYg== X-Google-Smtp-Source: ABdhPJxfxLPKhyX0sj8rLdjW3NuP47epv2iLZ1JCv3JNotaYE+HIg78XpuC6HN1WlipJCa2mmIVWRxwkFtnAzZPhCt0= X-Received: by 2002:aca:49c2:: with SMTP id w185mr4818246oia.101.1600858720790; Wed, 23 Sep 2020 03:58:40 -0700 (PDT) MIME-Version: 1.0 References: <20180705101043.4883-1-daniel.vetter@ffwll.ch> <20180705102121.5091-1-daniel.vetter@ffwll.ch> <20200922133636.GA2369@xpredator> In-Reply-To: <20200922133636.GA2369@xpredator> From: Daniel Vetter Date: Wed, 23 Sep 2020 12:58:30 +0200 Message-ID: Subject: Re: [PATCH] drm: avoid spurious EBUSY due to nonblocking atomic modesets To: Marius Vlad X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Intel Graphics Development , DRI Development , stable , Daniel Vetter , Pekka Paalanen Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Tue, Sep 22, 2020 at 3:36 PM Marius Vlad wrote: > > On Fri, Jan 31, 2020 at 07:34:00AM +0000, Daniel Stone wrote: > > On Thu, 5 Jul 2018 at 11:21, Daniel Vetter wrote: > > > When doing an atomic modeset with ALLOW_MODESET drivers are allowed to > > > pull in arbitrary other resources, including CRTCs (e.g. when > > > reconfiguring global resources). > > > > > > But in nonblocking mode userspace has then no idea this happened, > > > which can lead to spurious EBUSY calls, both: > > > - when that other CRTC is currently busy doing a page_flip the > > > ALLOW_MODESET commit can fail with an EBUSY > > > - on the other CRTC a normal atomic flip can fail with EBUSY because > > > of the additional commit inserted by the kernel without userspace's > > > knowledge > > > > > > For blocking commits this isn't a problem, because everyone else will > > > just block until all the CRTC are reconfigured. Only thing userspace > > > can notice is the dropped frames without any reason for why frames got > > > dropped. > > > > > > Consensus is that we need new uapi to handle this properly, but no one > > > has any idea what exactly the new uapi should look like. As a stop-gap > > > plug this problem by demoting nonblocking commits which might cause > > > issues by including CRTCs not in the original request to blocking > > > commits. > Gentle ping. I've tried out Linus's master tree and, and like Pekka, > I've noticed this isn't integrated/added. > > Noticed this is fixing (also) DPMS when multiple outputs are in use. > Wondering if we can just use a _ONCE() variant instead of WARN_ON(). I'm seeing > the warning quite often. On which driver/chip does this happen? -Daniel > > > > > Thanks for writing this up Daniel, and for reminding me about it some > > time later as well ... > > > > Reviewed-by: Daniel Stone > > > > Cheers, > > Daniel > > _______________________________________________ > > 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 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel 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=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no 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 19C11C4727E for ; Wed, 23 Sep 2020 10:58:44 +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 799AC235FC for ; Wed, 23 Sep 2020 10:58:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="Qdl9ZA+Z" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 799AC235FC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch 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 D6D8E6E954; Wed, 23 Sep 2020 10:58:42 +0000 (UTC) Received: from mail-oi1-x241.google.com (mail-oi1-x241.google.com [IPv6:2607:f8b0:4864:20::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 74DC76E954 for ; Wed, 23 Sep 2020 10:58:41 +0000 (UTC) Received: by mail-oi1-x241.google.com with SMTP id v20so24577649oiv.3 for ; Wed, 23 Sep 2020 03:58:41 -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=wDiVGOW2BwVoj+byF8GmVc4hZoZxCN4FNEDgvLDpQ1k=; b=Qdl9ZA+ZTkR35bC8SLkZu9gmZz0yIkZzf7fKlMtexw60Ein4nPVkpSZdq9H4b/uQNE ym/7FKqm2OjdqPm5ssrHThHs7fQORtaSTkbYAoMJcXd6zsMkSRPtq+uCBJ7yDajwu2T7 3POcxNH9Erym7dLnHVvozChqgrTpMfAQqddds= 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=wDiVGOW2BwVoj+byF8GmVc4hZoZxCN4FNEDgvLDpQ1k=; b=VqIeIV+wlk/HXMuXaGw4hXpYLbPPCqKhJSN5hwrmmtMnwg4nSG1ApoBPXSpc12z3vQ eMUSmqeYUX4gz3FcHkfVOU5XVPFXddl/kpHhZBafx3T2OntNLudrVJLXk0zQVdc8BBAs PwCpqeIYHLANavTIEmbTP8RYKdOeW9gAW/tSKhvIQWxEVSXdCYLZIQ+ceVsa7DxUt/G7 2/OiEtoqaPCVGewmFqBzTpt1mBKe/730Tij2/GQ2IO8wKGvZCVZMomQXTVFBLwOorY6A Mt5OKm1tRA6no26KeiPoq3Y7rr8Ul5UDICUz1qUb9ixNqs01vNnjBwWOTZw3NFAHvBZX z2qQ== X-Gm-Message-State: AOAM533sf9zoK7kj4+Fvj5exCeGr/16XeK9ZLD1OyDJrhN0Z+WlIltMT cvRckesO054uxvpWvcLJ2taEaHccD/2BqOxvTi8HQzbGJou4wQ== X-Google-Smtp-Source: ABdhPJxfxLPKhyX0sj8rLdjW3NuP47epv2iLZ1JCv3JNotaYE+HIg78XpuC6HN1WlipJCa2mmIVWRxwkFtnAzZPhCt0= X-Received: by 2002:aca:49c2:: with SMTP id w185mr4818246oia.101.1600858720790; Wed, 23 Sep 2020 03:58:40 -0700 (PDT) MIME-Version: 1.0 References: <20180705101043.4883-1-daniel.vetter@ffwll.ch> <20180705102121.5091-1-daniel.vetter@ffwll.ch> <20200922133636.GA2369@xpredator> In-Reply-To: <20200922133636.GA2369@xpredator> From: Daniel Vetter Date: Wed, 23 Sep 2020 12:58:30 +0200 Message-ID: To: Marius Vlad Subject: Re: [Intel-gfx] [PATCH] drm: avoid spurious EBUSY due to nonblocking atomic modesets 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 Graphics Development , DRI Development , stable , Daniel Vetter , Pekka Paalanen Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Tue, Sep 22, 2020 at 3:36 PM Marius Vlad wrote: > > On Fri, Jan 31, 2020 at 07:34:00AM +0000, Daniel Stone wrote: > > On Thu, 5 Jul 2018 at 11:21, Daniel Vetter wrote: > > > When doing an atomic modeset with ALLOW_MODESET drivers are allowed to > > > pull in arbitrary other resources, including CRTCs (e.g. when > > > reconfiguring global resources). > > > > > > But in nonblocking mode userspace has then no idea this happened, > > > which can lead to spurious EBUSY calls, both: > > > - when that other CRTC is currently busy doing a page_flip the > > > ALLOW_MODESET commit can fail with an EBUSY > > > - on the other CRTC a normal atomic flip can fail with EBUSY because > > > of the additional commit inserted by the kernel without userspace's > > > knowledge > > > > > > For blocking commits this isn't a problem, because everyone else will > > > just block until all the CRTC are reconfigured. Only thing userspace > > > can notice is the dropped frames without any reason for why frames got > > > dropped. > > > > > > Consensus is that we need new uapi to handle this properly, but no one > > > has any idea what exactly the new uapi should look like. As a stop-gap > > > plug this problem by demoting nonblocking commits which might cause > > > issues by including CRTCs not in the original request to blocking > > > commits. > Gentle ping. I've tried out Linus's master tree and, and like Pekka, > I've noticed this isn't integrated/added. > > Noticed this is fixing (also) DPMS when multiple outputs are in use. > Wondering if we can just use a _ONCE() variant instead of WARN_ON(). I'm seeing > the warning quite often. On which driver/chip does this happen? -Daniel > > > > > Thanks for writing this up Daniel, and for reminding me about it some > > time later as well ... > > > > Reviewed-by: Daniel Stone > > > > Cheers, > > Daniel > > _______________________________________________ > > 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 _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx