Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp5335504pxv; Wed, 28 Jul 2021 08:25:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw001sV9wROiwxcua2JOUxFuPJ8nYSYkxxMHHKfrlvZdxRBN7ZIH167BgpRGd8lSeEm4pit X-Received: by 2002:a17:906:3948:: with SMTP id g8mr52083eje.282.1627485916956; Wed, 28 Jul 2021 08:25:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627485916; cv=none; d=google.com; s=arc-20160816; b=rz+Qs5xL6foXcRMtcTxlo39SrPdD9Obadf1kVLuUSDTcIvXjxjbIUazqDev1j3Pq8Y 0BpmwBAm0XYe1PMbzD9TogW6noLdHhw139Pk9baTuFCNYgm8SBfVzrcTUEDRtzJ6/43y Hfh9zSDaY8HhuqvkSYkgwecyzXlkevkX2zQJNrgw2X6CejyGCVzrXCRXAJFG9rTSk/sc If7UYAnnlI48ALUHlPEY6gphdBqEJW5QOrNtmX4zlpjZlif1RLAd2P1EjRIBrtF4M8PU Ka17Xix+J0giwJZVTSgrStizX+b49+LYZCVYbWIw2KUXRWXODPjOntBYczjlakCSSBhK 6a9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=gIJl6heK4Wu8LD+136XTBtnsYW2mvJjQU/D8Ms2H3as=; b=AdK//ykpjDiOn02BkaxgObRREDGRil0uLXxff8dqzaqJFwEmu6DCOU2Zdf7vHe2J8e 4BSl4ji7sG1c3MvVbJO+8x1GuWYBMIjc6AY42pq/Epsc4f3ZSyUEJcBzYJAGv11MDQjR tPID4Z5IeymV3qc0pSOHBDYL6CNAGftL1QHhjOGTOFghYMhDF/x9CpGAAuBgbyNXkFiV YYmladQXt512grIfd1hwXKHEtULkGDfOQPLtAnX/D5kkm40Hx6Fd36FdgAc8nwXzO14P zGPr/zR6bvTRjF60zGOB1pyclJc0/jNktyHqcUVVGjeeHmOBxBwm2Wsvc0ava2/6dPRd 0upQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jmPs1tCU; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gt14si14207ejb.752.2021.07.28.08.24.53; Wed, 28 Jul 2021 08:25:16 -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=@gmail.com header.s=20161025 header.b=jmPs1tCU; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236711AbhG1PX3 (ORCPT + 99 others); Wed, 28 Jul 2021 11:23:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235457AbhG1PX2 (ORCPT ); Wed, 28 Jul 2021 11:23:28 -0400 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4B4FC061757; Wed, 28 Jul 2021 08:23:23 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id l18so3042329wrv.5; Wed, 28 Jul 2021 08:23:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=gIJl6heK4Wu8LD+136XTBtnsYW2mvJjQU/D8Ms2H3as=; b=jmPs1tCUkBSl0nSXYR6gPia9DTZUsUuK6WuNawtSRaBMCEBxyDs7+QabJIoXdqZq/U ipyFUCHAbYE4ejN18peJE6bLtQ2Bi5RNYl8nKS6Tjj97CkA062FBKEmfWjDqKQgYK9EN 3fZGAPjbfgcEnTQ2Ujrt4z3pi69aXGmnmeFMWo2wJdXup9LLrxLbA9G20eikcAjxV+Zm av3H6Os8s+gr10pPR3+ISY5lhp9rY5uSyGZCWkWk9iyUoOQiaflz7mC6JcfImucPIXmd fuYSCACdcYk3G4rFYcy0vppFGoGuG7uFFuQT+OruTr/oXEunbEXPHUXYUFT6vnnfcMUG HPQw== 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:content-transfer-encoding; bh=gIJl6heK4Wu8LD+136XTBtnsYW2mvJjQU/D8Ms2H3as=; b=aeeiTmMqV6bUPP2Tdmxz/hMEuNLcz4Lx6cKnMdEnt489DLc87dmGYpabRcoQONnP1j XEMGwxEgntQWDH9Nz+M8VmjlddJglzwVCiXBtjzLudv3y8NjEveKNbZCgcGopzWIeNMt VXW7YwSH+36BGn45ehhPJhZEDs1Sv3kueP3wc9X5QUFlpWhuUytwLwrex4dLeDNsbTfk 501UwBgYH+4qm7GoWqKG0apeIaU3UEYqAmqVyQOQwxyUlKentwmf6s4YvV642Q0S95cs X0yxIKlCoJSmq83KH2gSmaYM3KGXMyC8cQ0avHweniuDg0QGq2O1bNDeXDtsg0E+g5cy y/EA== X-Gm-Message-State: AOAM530EhmvNv8ec+HDZUF1Xuz7wojJfspYsRYGvlDwEYWnJjgli3H+r ndOCL008qGlyIsOzWrZkx2w7NZghFjeGeU3jpYg= X-Received: by 2002:adf:ea41:: with SMTP id j1mr17628736wrn.147.1627485802309; Wed, 28 Jul 2021 08:23:22 -0700 (PDT) MIME-Version: 1.0 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> In-Reply-To: <20210728165700.38c39cf8@eldfell> From: Rob Clark Date: Wed, 28 Jul 2021 08:27:31 -0700 Message-ID: Subject: Re: [RFC 0/4] dma-fence: Deadline awareness To: Pekka Paalanen Cc: =?UTF-8?Q?Christian_K=C3=B6nig?= , Rob Clark , Matthew Brost , Jack Zhang , =?UTF-8?Q?Christian_K=C3=B6nig?= , =?UTF-8?Q?Michel_D=C3=A4nzer?= , 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" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 28, 2021 at 6:57 AM Pekka Paalanen wrote: > > On Wed, 28 Jul 2021 15:31:41 +0200 > Christian K=C3=B6nig wrote: > > > Am 28.07.21 um 15:24 schrieb Michel D=C3=A4nzer: > > > On 2021-07-28 3:13 p.m., Christian K=C3=B6nig wrote: > > >> Am 28.07.21 um 15:08 schrieb Michel D=C3=A4nzer: > > >>> On 2021-07-28 1:36 p.m., Christian K=C3=B6nig 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 ha= rdware you are completely killing of such features. > > >>>> > > >>>> For composing use cases that makes sense, but certainly not for fu= ll screen applications as far as I can see. > > >>> Even for fullscreen, the current KMS API only allows queuing a sing= le page flip per CRTC, with no way to cancel or otherwise modify it. Theref= ore, 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 f= or the fullscreen surface. To make sure the flip will not miss the next ref= resh cycle, the compositor has to pick an idle buffer. If it picks a non-id= le buffer, and the pending rendering does not finish in time for vertical b= lank, 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 re= fresh cycle) > > >> Well then let's extend the KMS API instead of hacking together worka= rounds 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. > Hmm, seems like we could come up with a way for a shader to figure out if a fence has signaled or not on the GPU, and then either sample from the current or previous window surface? BR, -R