[igt-dev] [PATCH i-g-t 3/3] lib/fb: Clear framebuffer on amdgpu

Kazlauskas, Nicholas Nicholas.Kazlauskas at amd.com
Fri Mar 8 15:10:42 UTC 2019


On 3/8/19 10:08 AM, Chris Wilson wrote:
> Quoting Kazlauskas, Nicholas (2019-03-08 15:00:46)
>> On 3/8/19 9:40 AM, Chris Wilson wrote:
>>> Quoting Nicholas Kazlauskas (2019-03-08 14:36:03)
>>>> IGT expects buffers returned from DRM_IOCTL_MODE_MAP_DUMB to be
>>>> cleared, but amdgpu retains the contents previously in memory
>>>> in the buffer - clear it on amdgpu by with a memset to 0.
>>>
>>> How is this not a kernel information leak?
>>> -Chris
>>>
>>
>> I actually meant to write DRM_IOCTL_MODE_CREATE_DUMB, but it is an
>> information leak for whatever was previously in VRAM anyway.
>>
>> With AMDGPU you have to explicitly ask for the memory to be cleared when
>> creating the BO with AMDGPU_GEM_CREATE_VRAM_CLEARED, but that flag isn't
>> one of the flags used when creating buffers for amdgpu_mode_dumb_create.
>>
>> Maybe it should be, but I'd be considered with any potential performance
>> impact in doing so at least. I haven't done much driver benchmarking
>> myself to know if it's a good idea or not.
> 
> It's a dumb buffer who's only purpose is to create splash framebuffer,
> and is explicitly not meant to be used for rendering (which of course
> means that userspace does...). I would strongly suggest it is cleared on
> creation and anyone who complains be redirected to use the proper
> interface for amdgpu.
> -Chris
> 

Considering that most userspace probably goes through mesa which 
obviously doesn't use this API I would be inclined to agree with that 
perspective at least.

It probably doesn't hurt to post the patch to clear it on the kernel 
side and see what feedback shows up.

Thanks.

Nicholas Kazlauskas


More information about the igt-dev mailing list