Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp5908035pxv; Thu, 29 Jul 2021 01:11:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMfp8xMrR8eAz7ob3ZQy1lJfmCu16Te6I+l9+4cLyPpt8xV9mwZaEB+Z2vRk9+MvWijvd1 X-Received: by 2002:a05:6e02:1154:: with SMTP id o20mr2846832ill.168.1627546277107; Thu, 29 Jul 2021 01:11:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627546277; cv=none; d=google.com; s=arc-20160816; b=QohF5KwveHF5mTToYWxJEiVa1xL60LPxzlb97Q3LPfqjW0hOE5Xf8sd8Gx65gGhXxf IXLe9JyB+z4YJD14UovtlfpFi1u5gB1Mj84vAZVF1QcYU6IujfTaShm0CYDCLWqSz+J9 1m5B6bHROLLIMP2lRhXoERffQX3/JdkarhkZpFzjr1jCsBe9rAsxfe/7VatihMBfCSQb jCFLtmpkL17HvUyoWfuMg69M8+2XU3P/B3CN9OYDU4LD5uytQr1c9RdEub/fZHo9I3mP UjYFGhv8oD07aajM/F/MEH+aJQH2m3odr0zWCnUhRij1Y03Zjgn2dWRjpzEc+Cb6Mhe7 J4XA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:subject:from :references:cc:to; bh=lNvTGZ6oCELTkUFAxaWYAHIst3b65kuMAVTSroLH820=; b=Pc1IgQWvAdAR/0LHzi5rTTR1U58iNDAkQ8qzJQDOP6SJQGzLawuUafkKjkAsrIjWAI z3yKtkx8HisW/0P+ZInlYip7nsHwwOGbYr01dP1QumIhC8D1exrIMdv57fIcRfOlfq6K 9lHV04On/kdc7BqMvzV9UurVHxyLCwP4sJGPxXKcuTsceTRD9BRbWJmmUDE+xd0toLtY h2Ne68gAYlSh3vQ3jTpFCd63kCa40b+IpsJbi/1uGvpu0gMtV5Mti03RqIDiv8uuWNRa hXDrbK6n53bCscGqNoU3x/L/dmC0QoOdOA5DRhfbqk4Gt4x5ZEF/RjItDYn82jLAOc8R 0yRA== ARC-Authentication-Results: i=1; mx.google.com; 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 u11si2576922jak.14.2021.07.29.01.11.06; Thu, 29 Jul 2021 01:11:17 -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; 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 S235077AbhG2IJL (ORCPT + 99 others); Thu, 29 Jul 2021 04:09:11 -0400 Received: from mail.netline.ch ([148.251.143.180]:56476 "EHLO netline-mail3.netline.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235054AbhG2IJK (ORCPT ); Thu, 29 Jul 2021 04:09:10 -0400 Received: from localhost (localhost [127.0.0.1]) by netline-mail3.netline.ch (Postfix) with ESMTP id 9624E20201B; Thu, 29 Jul 2021 10:09:05 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at netline-mail3.netline.ch Received: from netline-mail3.netline.ch ([127.0.0.1]) by localhost (netline-mail3.netline.ch [127.0.0.1]) (amavisd-new, port 10024) with LMTP id qMf5KNcZpsS5; Thu, 29 Jul 2021 10:09:05 +0200 (CEST) Received: from thor (24.99.2.85.dynamic.wline.res.cust.swisscom.ch [85.2.99.24]) by netline-mail3.netline.ch (Postfix) with ESMTPA id 525BC20201A; Thu, 29 Jul 2021 10:09:04 +0200 (CEST) Received: from [::1] by thor with esmtp (Exim 4.94.2) (envelope-from ) id 1m916A-00140j-Bn; Thu, 29 Jul 2021 10:08:58 +0200 To: =?UTF-8?Q?Christian_K=c3=b6nig?= , Pekka Paalanen Cc: Rob Clark , Matthew Brost , Jack Zhang , =?UTF-8?Q?Christian_K=c3=b6nig?= , open list , dri-devel , "moderated list:DMA BUFFER SHARING FRAMEWORK" , Luben Tuikov , Roy Sun , Gustavo Padovan , Alex Deucher , Tian Tao , Lee Jones , "open list:DMA BUFFER SHARING FRAMEWORK" References: <20210726233854.2453899-1-robdclark@gmail.com> <28ca4167-4a65-0ccc-36be-5fb017f6f49d@daenzer.net> <99984703-c3ca-6aae-5888-5997d7046112@daenzer.net> <04d44873-d8e6-6ae7-f0f9-17bcb484d697@amd.com> <9d5f4415-d470-3bc1-7d52-61ba739706ae@daenzer.net> <20210728165700.38c39cf8@eldfell> <74e310fa-e544-889f-2389-5abe06f80eb8@amd.com> From: =?UTF-8?Q?Michel_D=c3=a4nzer?= Subject: Re: [RFC 0/4] dma-fence: Deadline awareness Message-ID: Date: Thu, 29 Jul 2021 10:08:58 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <74e310fa-e544-889f-2389-5abe06f80eb8@amd.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-CA Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021-07-28 4:30 p.m., Christian König wrote: > Am 28.07.21 um 15:57 schrieb Pekka Paalanen: >> On Wed, 28 Jul 2021 15:31:41 +0200 >> Christian König wrote: >> >>> Am 28.07.21 um 15:24 schrieb Michel Dänzer: >>>> On 2021-07-28 3:13 p.m., Christian König wrote: >>>>> Am 28.07.21 um 15:08 schrieb Michel Dänzer: >>>>>> On 2021-07-28 1:36 p.m., Christian König wrote: >>>>>>> At least AMD hardware is already capable of flipping frames on GPU events like finishing rendering (or uploading etc). >>>>>>> >>>>>>> By waiting in userspace on the CPU before send the frame to the hardware you are completely killing of such features. >>>>>>> >>>>>>> For composing use cases that makes sense, but certainly not for full screen applications as far as I can see. >>>>>> Even for fullscreen, the current KMS API only allows queuing a single page flip per CRTC, with no way to cancel or otherwise modify it. Therefore, a Wayland compositor has to set a deadline for the next refresh cycle, and when the deadline passes, it has to select the best buffer available for the fullscreen surface. To make sure the flip will not miss the next refresh cycle, the compositor has to pick an idle buffer. If it picks a non-idle buffer, and the pending rendering does not finish in time for vertical blank, the flip will be delayed by at least one refresh cycle, which results in visible stuttering. >>>>>> >>>>>> (Until the deadline passes, the Wayland compositor can't even know if a previously fullscreen surface will still be fullscreen for the next refresh cycle) >>>>> Well then let's extend the KMS API instead of hacking together workarounds in userspace. >>>> That's indeed a possible solution for the fullscreen / direct scanout case. >>>> >>>> Not for the general compositing case though, since a compositor does not want to composite multiple output frames per display refresh cycle, so it has to make sure the one frame hits the target. >>> Yeah, that's true as well. >>> >>> At least as long as nobody invents a mechanism to do this decision on >>> the GPU instead. >> That would mean putting the whole window manager into the GPU. > > Not really. You only need to decide if you want to use the new backing store or the old one based on if the new surface is ready or not. While something like that might be a possible optimization for (probably common) cases where the new buffer does not come with other state changes which affect the output frame beyond the buffer contents, there will always be cases (at least until a Wayland compositor can fully run on the GPU, as Pekka noted somewhat jokingly :) where this needs to be handled on the CPU. I'm currently focusing on that general case. Optimizations for special cases may follow later. -- Earthling Michel Dänzer | https://redhat.com Libre software enthusiast | Mesa and X developer