[PATCH 1/3] drm/amdgpu: Refuse to create a KMS FB for non-P2P exported dma-bufs

Michel Dänzer michel at daenzer.net
Mon Feb 26 16:46:24 UTC 2024


On 2024-02-26 17:34, Christian König wrote:
> 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 at 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.

It's the only known sane approach at this point. There's no other proposal which allows using both BO sharing and scanout without pessimizing or hitting seemingly random CS ioctl failures.


>>> 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.

"Very high chance" sounds like you still don't know of any actual real-world use case relying on it though?


> 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?

Yes, Wayland compositors are only starting to try and make use of this now.


-- 
Earthling Michel Dänzer            |                  https://redhat.com
Libre software enthusiast          |         Mesa and Xwayland developer



More information about the amd-gfx mailing list