[PATCH 1/2] drm/amdgpu: return bo itself if userptr is cpu addr of bo (v3)

Christian König christian.koenig at amd.com
Wed Aug 1 17:52:05 UTC 2018


Am 01.08.2018 um 19:39 schrieb Marek Olšák:
> On Wed, Aug 1, 2018 at 2:32 AM, Christian König
> <christian.koenig at amd.com> wrote:
>> Am 01.08.2018 um 00:07 schrieb Marek Olšák:
>>> Can this be implemented as a wrapper on top of libdrm? So that the
>>> tree (or hash table) isn't created for UMDs that don't need it.
>>
>> No, the problem is that an application gets a CPU pointer from one API and
>> tries to import that pointer into another one.
>>
>> In other words we need to implement this independent of the UMD who mapped
>> the BO.
> Yeah, it could be an optional feature of libdrm, and other components
> should be able to disable it to remove the overhead.

The overhead is negligible, the real problem is the memory footprint.

A brief look at the hash implementation in libdrm showed that this is 
actually really inefficient.

I think we have the choice of implementing a r/b tree to map the CPU 
pointer addresses or implement a quadratic tree to map the handles.

The later is easy to do and would also allow to get rid of the hash 
table as well.

Christian.

>
> Marek



More information about the amd-gfx mailing list