Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id AB4A6C48BF6 for ; Mon, 26 Feb 2024 16:34:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E5FA410E1C9; Mon, 26 Feb 2024 16:34:49 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=amd.com header.i=@amd.com header.b="jV6HSpak"; dkim-atps=neutral Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2043.outbound.protection.outlook.com [40.107.93.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id 669EE10E1C9; Mon, 26 Feb 2024 16:34:48 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MV7TFewuauzArDi4lepbuxsN3WtJmrRCa/KynIwbbeq4itfeAL55NiZoZs5QoUKgrZti1jGhATUHe6cN4R6wEGkR720gksjvVtg6wcp2zinN4PToQ42Q4EU8/jZnvpuWdtJlojhGIrx0bwkd9gyQR3EU+TLIN/UmZnASbtlca6/IS6Bgu53bs75/TPXM8hW4/xIjcHpCfuar8uppg4xwj6GvRV1WcSRHYF7vuEqjssQ2otqmH0OhvLEvKb0oBF/2+3CiOzMxGu/j5rKkKUoFmxUx6LnNyRDkpPJUYeYIRMeC0Z2Rndl6pu9QHEMS/r8See5j08co0kEyMdFyxc8apw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=HpZK4fjkpAKtGSxAZ0MZN9rnfTvq2vMVy+NW3cfW88Q=; b=KIc+LOYHhU7Hj9dNIml7yyIY2j4OwxUwZOmMDb379xnysrkpP2CCfYusZfL8lpvIQcSoGxvWPDRkBTzn+o/A8VEX8lHnoSyI8ODXBH3x+0dsVqRLUZ49x8Pv+A2sO0O7P90ACIZKWT9/WtvImAXw8XmqZ52qxU3JwRVD8MV7mTiGhNjW/M+yXHkNF7o9b6duEvSOeskicM2sWLUeKr14457GB2INTyb4mhTn0bTrudOb6fzsKlPGHOR10zC+iANesFGYkX8jGvLD5NRH2GRnE4k1RrhsfxqrVjuoPFnDbeR5lmneDp1pr0OD/jdludQIfmG8c2M8HmxiDMx06w5azA== 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=HpZK4fjkpAKtGSxAZ0MZN9rnfTvq2vMVy+NW3cfW88Q=; b=jV6HSpakdd61p8ZC+3a2uJpG8Iq+WIprvmdHMcr1UYnCNO1wxi11gbGj74Hrh1QySKeT+SjBQy66/N1wGwOm63vbmEyvmJtZ7zHFiiWxq1cqGemIn+zdAROAwxghpJpocdV81McqcqAr8GDMJ9vUtfWeF1YZOr8Kd4oBLNWPctc= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from PH7PR12MB5685.namprd12.prod.outlook.com (2603:10b6:510:13c::22) by MW4PR12MB5625.namprd12.prod.outlook.com (2603:10b6:303:168::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.36; Mon, 26 Feb 2024 16:34:46 +0000 Received: from PH7PR12MB5685.namprd12.prod.outlook.com ([fe80::f2b6:1034:76e8:f15a]) by PH7PR12MB5685.namprd12.prod.outlook.com ([fe80::f2b6:1034:76e8:f15a%6]) with mapi id 15.20.7316.031; Mon, 26 Feb 2024 16:34:45 +0000 Content-Type: multipart/alternative; boundary="------------snwJIIzvCdr3uyXN8fXRVOhP" Message-ID: <4253f207-23af-4510-aa0c-a7509546917a@amd.com> Date: Mon, 26 Feb 2024 17:34:41 +0100 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/3] drm/amdgpu: Refuse to create a KMS FB for non-P2P exported dma-bufs Content-Language: en-US To: =?UTF-8?Q?Michel_D=C3=A4nzer?= , Alex Deucher , Xinhui Pan Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org References: <20240222172821.16901-1-michel@daenzer.net> <3156ea34-0655-4b0f-9438-9113fb714373@amd.com> <2d7632f0-0783-4d82-9d81-dd6bd52d5db6@daenzer.net> <84fa5bc1-6b4d-4d82-844a-8070d4bd78eb@amd.com> <7dd49c00-8d5e-4492-801c-f1b6db5e1737@daenzer.net> <298c5ccd-d39c-4036-8ad6-624f635bc08c@daenzer.net> From: =?UTF-8?Q?Christian_K=C3=B6nig?= In-Reply-To: <298c5ccd-d39c-4036-8ad6-624f635bc08c@daenzer.net> X-ClientProxiedBy: FR4P281CA0067.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:ce::18) To PH7PR12MB5685.namprd12.prod.outlook.com (2603:10b6:510:13c::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH7PR12MB5685:EE_|MW4PR12MB5625:EE_ X-MS-Office365-Filtering-Correlation-Id: 3d609766-2895-46c3-195e-08dc36e8d78d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rCbYwvQoDAHb2nE2CyU4Oyw6Ye0y5i6gm+476uAWTz4mr7hmSCiVD5eQy1soRKdQA5Xq4UNO87t17xN6hwAJiEH1IdMPaYxtUOEeRq8CEC4gPpqeFqG7Ryuj6b0EObRFz7zLmHUazznBH7K1Fd8jxy0PupBnoiYGhqZ9ri0nDbeaGadSLE9CdWSzyQxUCgUClDeA987bZRPgVNdJVkJB/Wk2sLpNg900Jrficj3mtda2TinTPMA/rkeaXYjl6l2KjwCD7BPzPO5yRlHkuLBCBu2Vz6+EIyUpuEXJQ4zPdbLSOfcIavHeVIcENtYWMNjTa/BLlTKm65TAb3W48iUMvpblLG2rjdzROZdlaXCoU2sE7U+OHKMYZh8Jlu83XTtrFS7PQMvpUC1WR4uLfnBVcpaj9fQuxGoCdp4QRw3D4yYLg41Ebov9fMb0bfYXmA0hN7i3lLop28s4qyMls5VrSS9Ljm4XpAsmoYw2A9URKPsnKFFwHRbeHXINbFtNj9pcNtHIDFwoANhRMOha8OX3qvIbuWjSUUL3YNldKmES0r/jonFI0tsEdG/MQUVLrpSuVh8Bb+Qj3pabZ1wthw039oSjXKPQh5/7V6XMZJZRfblt2l85UMVsOBNXVLK+tIvE3n1RTvpQ/jalEePChgvXDA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH7PR12MB5685.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?MWNwTjhvUWNxMDNEQXZkdmJjcHRkOCtUUVMwc05pREFWR3FNajd6Tk9sQVd6?= =?utf-8?B?NFd6MVZwdGpPS09DdjhGcXVQMzJQa21PZGF5UU5lSzkzWVhiZW5SYjJuazhx?= =?utf-8?B?UXk5ZWV4ZW5SemM4UWZJa3J2enY4dll0YVBQUzVUcHE3dFFCVlozZG5EWS9D?= =?utf-8?B?eHM2UFVPUXZXdXk4UFVpai9yUUFHNGFLa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OEM0cHhhbk0vL0JDdUdPNE90WUVZR2NkZEVjWVM1S2Z6OWlpTVlkc3NH?= =?utf-8?B?K3cxWFQ1bGZWKzkvWWRpMEhZTjhiZkllcnMrYzl2MEVaSUZyT3padzlyZWJU?= =?utf-8?Q?0bW6lkQ45MzDF9JgA7JNLtCvd?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3d609766-2895-46c3-195e-08dc36e8d78d X-MS-Exchange-CrossTenant-AuthSource: PH7PR12MB5685.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Feb 2024 16:34:45.8847 (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: uzwN/caj/Ynu47FtAga5r4Y84i4Lso3KbMPPVitihLQNr2efY9lcq7DVzucYvrEL X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB5625 X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" --------------snwJIIzvCdr3uyXN8fXRVOhP Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Am 26.02.24 um 17:27 schrieb Michel Dänzer: > On 2024-02-26 16:58, Christian König wrote: >> Am 23.02.24 um 17:43 schrieb Michel Dänzer: >>> On 2024-02-23 11:04, Michel Dänzer wrote: >>>> On 2024-02-23 10:34, Christian König wrote: >>>>> Am 23.02.24 um 09:11 schrieb Michel Dänzer: >>>>>> On 2024-02-23 08:06, Christian König wrote: >>>>>>> Am 22.02.24 um 18:28 schrieb Michel Dänzer: >>>>>>>> From: Michel Dänzer >>>>>>>> >>>>>>>> Pinning the BO storage to VRAM for scanout would make it inaccessible >>>>>>>> to non-P2P dma-buf importers. >>>>>>> Thinking more about it I don't think we can do this. >>>>>>> >>>>>>> Using the BO in a ping/pong fashion for scanout and DMA-buf is actually valid, you just can't do both at the same time. >>>>>>> >>>>>>> And if I'm not completely mistaken we actually have use cases for this at the moment, >>>>>> Those use cases don't have P2P & CONFIG_DMABUF_MOVE_NOTIFY? >>>>> Nope, we are basically talking about unit tests and examples for inter device operations. >>>> Sounds like the "no user-space regressions" rule might not apply then. >>> To clarify what I mean by that: >>> >>> "We can't fix this issue, because it would break some unit tests and examples" is similar to saying "We can't fix this KMS bug, because there are IGT tests expecting the buggy behaviour". In practice, the latter do get fixed, along with the IGT tests. >> The problem here is that this is not a bug, but intentional behavior. Exporting BOs and using them in scanout in a ping/pong fashion is perfectly valid. > The problem with the status quo is that it requires amdgpu-specific knowledge and worst-case pessimization in user space. Yeah, I'm perfectly aware of that. But that approach here really doesn't seems to be valid. >> We have use cases which depend on this behavior and I'm not going to break those to fix your use case. > It's not "my" use case, it's a Wayland compositor trying to make use of BO sharing and scanout without always pessimizing for the worst case. > > That's surely more of a real-world use case than unit tests and examples. I've looked a bit deeper into this and we have told customers for the last ~10 years or so that this is how it is supposed to work and that they can use this approach. So this is much more than unit tests and examples, we are changing existing behavior which is clearly not a bug but intentional and have a very high chance to break valid use cases. My question is why has it worked so far? I mean we are not doing this since yesterday and the problem only shows up now? While I see the use case something is still missing in that picture. Christian. --------------snwJIIzvCdr3uyXN8fXRVOhP Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit Am 26.02.24 um 17:27 schrieb Michel Dänzer:
On 2024-02-26 16:58, Christian König wrote:
Am 23.02.24 um 17:43 schrieb Michel Dänzer:
On 2024-02-23 11:04, Michel Dänzer wrote:
On 2024-02-23 10:34, Christian König wrote:
Am 23.02.24 um 09:11 schrieb Michel Dänzer:
On 2024-02-23 08:06, Christian König wrote:
Am 22.02.24 um 18:28 schrieb Michel Dänzer:
From: Michel Dänzer <mdaenzer@redhat.com>

Pinning the BO storage to VRAM for scanout would make it inaccessible
to non-P2P dma-buf importers.
Thinking more about it I don't think we can do this.

Using the BO in a ping/pong fashion for scanout and DMA-buf is actually valid, you just can't do both at the same time.

And if I'm not completely mistaken we actually have use cases for this at the moment,
Those use cases don't have P2P & CONFIG_DMABUF_MOVE_NOTIFY?
Nope, we are basically talking about unit tests and examples for inter device operations.
Sounds like the "no user-space regressions" rule might not apply then.
To clarify what I mean by that:

"We can't fix this issue, because it would break some unit tests and examples" is similar to saying "We can't fix this KMS bug, because there are IGT tests expecting the buggy behaviour". In practice, the latter do get fixed, along with the IGT tests.
The problem here is that this is not a bug, but intentional behavior. Exporting BOs and using them in scanout in a ping/pong fashion is perfectly valid.
The problem with the status quo is that it requires amdgpu-specific knowledge and worst-case pessimization in user space.

Yeah, I'm perfectly aware of that. But that approach here really doesn't seems to be valid.

We have use cases which depend on this behavior and I'm not going to break those to fix your use case.
It's not "my" use case, it's a Wayland compositor trying to make use of BO sharing and scanout without always pessimizing for the worst case.

That's surely more of a real-world use case than unit tests and examples.

I've looked a bit deeper into this and we have told customers for the last ~10 years or so that this is how it is supposed to work and that they can use this approach.

So this is much more than unit tests and examples, we are changing existing behavior which is clearly not a bug but intentional and have a very high chance to break valid use cases.

My question is why has it worked so far? I mean we are not doing this since yesterday and the problem only shows up now?

While I see the use case something is still missing in that picture.

Christian.
--------------snwJIIzvCdr3uyXN8fXRVOhP--