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

Chris Wilson chris at chris-wilson.co.uk
Fri Mar 8 15:08:08 UTC 2019


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


More information about the igt-dev mailing list