Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp5424354pxv; Wed, 28 Jul 2021 10:22:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwG2ipkTB0QJF8inKybuNcinHui9Dem23vQGLdyCdwui2ie5oQuKi2iOvzBk/6AH5vWpRUt X-Received: by 2002:a05:6e02:54c:: with SMTP id i12mr576882ils.103.1627492932676; Wed, 28 Jul 2021 10:22:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1627492932; cv=pass; d=google.com; s=arc-20160816; b=lGeMCT+EHF1jJFPNxkNRgyusKsslJakrhXodtiSaL3Y/gLFo4/pAypSKbZGE61I2Vs KpZkhhi1wCmQszUqvREW9khGzfpd6MNA+kyDJHfHlgU+WHrtliVxgk8/J5XgwySQCMm5 1mbxiPF2a2AtcADUqASF4GD/lExine6NKgpUfHOm8UFnGA+9Yq5W9oij0hrZYWq3+WLu MeHL1dwY9kPkMGAOiWNNP3pt5xybIZyp3bYGUuIWAf+EuKJXH5TkvB81TgNuWulOTZPW 6JOIwlrPdjXgk/PrcBGM6tahNZfrd7BYvmbtu+pzvyZouTm9IRVgiu8FZ4WHE386f/gY wKvg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-language :content-transfer-encoding:in-reply-to:user-agent:date:message-id :from:references:cc:to:subject:dkim-signature; bh=EeeehMC3HZ9EeMrGd+cPmxu4wzBus/t16PBo+eBHhqs=; b=Iwq5nsfTXeFAZwiOH+FBVMNHUuxmBaeKA0A0AHUdLP4fuZ6ojCmHFF48n7VrBD3QtD hdtkg42wrX4xOKfKdMWsxrUtCEYVxVFUAC1akM20aWdKtnzbaKuLhHgCVZIEKwwM4NpP 4M3R8udA4J2S8vHFQLKWj8Nx3qzUV/lQBpC0jLxYQ7jsQVQ3PGIw2+Y/HMrzStcFTmPA z6o/EBm9BX93w1fZJRR3rvuO5ME/NTDpNaT58V+XP6ViQoGWFCMQOWYWijdubn+9yWUk Fc9Pw5HgdVq9UPvCB+MBT0VJt0d3aaR2tWyb5aH5J0Jgn3+Vj+kZj+I4nwq/26KSxG1j dvOQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=AtLpkF32; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x14si415817jab.2.2021.07.28.10.22.00; Wed, 28 Jul 2021 10:22:12 -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=@amd.com header.s=selector1 header.b=AtLpkF32; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230054AbhG1RVG (ORCPT + 99 others); Wed, 28 Jul 2021 13:21:06 -0400 Received: from mail-bn8nam11on2055.outbound.protection.outlook.com ([40.107.236.55]:60896 "EHLO NAM11-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229515AbhG1RVF (ORCPT ); Wed, 28 Jul 2021 13:21:05 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eP6IMxtqsLEoojlRvnL+Ji8slHGaNgdp9nuv1c+CbatRv4ZI8w9pgVEQLqgFD07QC0bEsst9wWaL4ngqnsxsiTSAq+TKW9xwn+TpAvtfC5XOdngiiPvIxgnTFIc3uUElnnCePBqmBLgUhu4t1y7G2ymyitf41VgjmwOgHgpvEwY+wi032vs9YEd9zwL6AYZi58RHHQG2N+QWqIQuFZhf1wF9nXVYcfrpQoX7DyEMzfG0B2iZJMfy9YC7e2cQn1IyjAslRi906HKTRz2omX0PMD8K7PEpr4S8S4pQlVG78Pvhm1qg/zylXDchPiUv51Vn8yNkrJcoFSyO8Vlk0s90cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EeeehMC3HZ9EeMrGd+cPmxu4wzBus/t16PBo+eBHhqs=; b=M3iMBXYTdn/Pg5BRUGZ9j2KAiWGiXH6YcOQP9vaCodLrhINHrgTc7elM9WofJyo3ULJdEuS5hCbTVopTq32SpIptAbLyHGB9fJCENPVs6QoN9pOtn3XWZ7CGZ/KI6HYRlarVlf9WipPHePn4TpP61KvXiN8Q2k9WEiqxjXcYFC2X+R2dW9SneBRwA+4YJfZC+Ap/tjG3hTZYuXAOkyrlC36ckWY1BC68iKt/dcg3k68fA5pzQ/DFre9Y2xOvCP3n1l4uWz8MYLPeEY4Q9Eoysu7LPCRZq9PPtuYS58euGl6kJcw9/VbJbKcfBUyMbJHin0s3wrdgjP+fppJwggG53g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EeeehMC3HZ9EeMrGd+cPmxu4wzBus/t16PBo+eBHhqs=; b=AtLpkF32gROCbL9Wq9ZOl6a4pve24129+4uCpT4Y1ExQ9J3rO3j7ktfvf6IxRNHxVp+qDcyjb0kwy6l8Sd52zfmX9414gDOEZyNYIWzUzzB57038775Tz4nk3vvcTovo70liVwkVjO/JSw7QvuEPAw3sTvax0+ecyU/EkN3yuEo= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=amd.com; Received: from MN2PR12MB3775.namprd12.prod.outlook.com (2603:10b6:208:159::19) by MN2PR12MB3968.namprd12.prod.outlook.com (2603:10b6:208:16f::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.29; Wed, 28 Jul 2021 17:21:00 +0000 Received: from MN2PR12MB3775.namprd12.prod.outlook.com ([fe80::6c9e:1e08:7617:f756]) by MN2PR12MB3775.namprd12.prod.outlook.com ([fe80::6c9e:1e08:7617:f756%5]) with mapi id 15.20.4352.031; Wed, 28 Jul 2021 17:21:00 +0000 Subject: Re: [RFC 0/4] dma-fence: Deadline awareness To: Rob Clark , Pekka Paalanen Cc: 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" 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> From: =?UTF-8?Q?Christian_K=c3=b6nig?= Message-ID: Date: Wed, 28 Jul 2021 19:20:53 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-ClientProxiedBy: FR3P281CA0052.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:4a::23) To MN2PR12MB3775.namprd12.prod.outlook.com (2603:10b6:208:159::19) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [IPv6:2a02:908:1252:fb60:f1e3:17b4:fe37:19a9] (2a02:908:1252:fb60:f1e3:17b4:fe37:19a9) by FR3P281CA0052.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:4a::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.7 via Frontend Transport; Wed, 28 Jul 2021 17:20:58 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: da9090a7-fd73-405f-d3ac-08d951ec11bc X-MS-TrafficTypeDiagnostic: MN2PR12MB3968: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VgQ7cEu9LpKvcyJVLT/jcYRvtEp8ZK7aOJ6fjNLF+7USVU5i6/xXSeoJ65KQSZMs3dT0Z/P+xS/hcDWBM1l9ab8i2H01+1xXwqzDQ6RWr+URVLKgReg14c1w1u8xstm8ucxyYtS/XiTxtcUnoiZPNb3UVv/sXB5T3HGubkCjMCC4I9EVXBwSukRQhv1L74chC+IBdfc/aQTFD7x5N/Z3dHV2DWEoxeIzgWP/typd4byrLKB1M/VfgE+k/1PLDhxvvUw+lGlxrXUUshF1GEVDoPbPHolymQUoZx2ycdGsMsihbTRWg5UMw1hQxa0oWe014xjCYaLUovRta8K5p+2Ew/9hBUyTdMbDquDdiecuXlAoWNYl7BrGY5U7QOcMneLx4yMHO9etciH+DFsdkf+DRod+0cCwm5oadN5dPjonKW3YKvBvZvmowBOnRdJRYh/7uFqcmAY76cp2sbi0Q5TTFlPMZ7SJoTOqeidGurr3wEZSXmOv4R+McNV+xoaAdP7cL74fZrqhnggktR00BuuHUhPqLn8dBQ/Yj7uhmtG7uzXLYuSj75G7XyBu1bpfQXD712tTRFzRO0JIcubZc23JrVHKgjSZUcKvKGkX3fEW2q1jZ8Am/c5vSgVQ3ksQS3r2emuuj/NNeXZxOTdxf9lysCQ7/KMskIT24sxfRq+PrUa34fdrjj8hpQ3st2ytL4z6zqezKWqwVPz4IR5XFr4s/PjQ/t/XoXcJex4uIPojWqw= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN2PR12MB3775.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(136003)(396003)(39860400002)(346002)(376002)(8676002)(53546011)(54906003)(316002)(31686004)(6486002)(4326008)(110136005)(8936002)(36756003)(478600001)(6666004)(5660300002)(7416002)(186003)(66574015)(2906002)(66556008)(66946007)(66476007)(31696002)(38100700002)(2616005)(86362001)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?c3BKQ1hCQ2I0UTE1d1paTnhacHhSdkJxWnBQRkpWaTd1Q2p3b3B0WHR3MHJP?= =?utf-8?B?ZnVCdHlETEhuaXpTMGx2YWUyRkpkVDRTcTkxOC9tYVBmc0pHVkxTcXg0SFEx?= =?utf-8?B?RStkRk1tOEtBQmRBRTZWRWhtR2FuYk82QlA1amVHY2YzaDZJQkpQS25RN2dN?= =?utf-8?B?akZhZWttYWZaejhBTlJ2MFFJbWdyejhWaVJRUjZ2WjM4RkRVTGVJNm9qYzBj?= =?utf-8?B?ajdWd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VVBK1BvVFB5MlNj?= =?utf-8?B?Wmp5TkxnODFBVDVoR2NNS3Z4NHllak1ueG5QOUxXSGRwQWVteUpQM1I4Z0Zz?= =?utf-8?B?b2pLSHdWMFdmLzhkcEJYUkRXcnRjYlNldEpuelhaK0FHQWQ5TDNTbHhEVklp?= =?utf-8?B?M3ZGSW5aUVEwc1VRTW5Ob25QWEtGL011NDdRdmE5MVIvRmJrditBa3BDM1I0?= =?utf-8?B?VlRhMjB5VXpiTUNYM0E3Z21ibHQwR0l1ekhUZUpZRUNucmVlWlVVYTNnQ3U3?= =?utf-8?B?Z1VQOUMwUGlzRGpUUlpVRk00WlVwNFF1MXV5ejZGWlgxNEFzUFNZZXlDcHlo?= =?utf-8?B?c0NndGxQb3IyN29JL2x2Q1cxUFFiRlBlNXRCZG5pN1QxOVN2enUvQjRIa1lW?= =?utf-8?B?YnZpbnA3a0wzUkgwUFloY2hRSmxRako5dnlCNk1UREplZHJEa2VvUHBsWkVI?= =?utf-8?B?UEdwc2FtWkQwVVB0MUswNkczT1pnK3dKOHMwMUoybk4vQmQyZW5TZ3hYWUhq?= =?utf-8?B?RWlVL01FZ0t3MkdVMWtrejJ0b2lXOUZ6MVY5RzdaOXd1SmpleHNTVlhHU0FE?= =?utf-8?B?cUxEd2JDTm9CTHNRbjNzOHNiclMxTm5reE9DQ1dENENRWEFzRUY3QnVKUVZy?= =?utf-8?B?S3R6TThIU2pNT3JsSUhaS0VaSnR5YXI5N3FwVEx6eXluVG04Z202czI4YVZv?= =?utf-8?B?M3VScGFyeU84TzdySlFmUjJ0VTEyRGtSSnd4TGZRV1BMMktrZU9SNVoxU2hz?= =?utf-8?Q?2PFiJXHriC6UO?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: da9090a7-fd73-405f-d3ac-08d951ec11bc X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB3775.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2021 17:21:00.4793 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: gLUtZm6AP4Y+W7F7mB3dNsBEEes80sX8KZNd8qrBkE7t49uTXo0wUkJTz0vZXYrv X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB3968 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 28.07.21 um 17:27 schrieb Rob Clark: > On Wed, Jul 28, 2021 at 6:57 AM Pekka Paalanen wrote: >> 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. >> > 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? Yeah, exactly that's my thinking as well. Christian. > > BR, > -R