[Intel-gfx] [PATCH 1/2] drm/mm: Add an iterator to optimally walk over holes for an allocation (v3)

Tvrtko Ursulin tvrtko.ursulin at linux.intel.com
Mon Feb 21 12:42:18 UTC 2022


On 16/02/2022 10:36, Christian König wrote:
> Am 15.02.22 um 23:23 schrieb Vivek Kasireddy:
>> This iterator relies on drm_mm_first_hole() and drm_mm_next_hole()
>> functions to identify suitable holes for an allocation of a given
>> size by efficiently traversing the rbtree associated with the given
>> allocator.
>>
>> It replaces the for loop in drm_mm_insert_node_in_range() and can
>> also be used by drm drivers to quickly identify holes of a certain
>> size within a given range.
>>
>> v2: (Tvrtko)
>> - Prepend a double underscore for the newly exported first/next_hole
>> - s/each_best_hole/each_suitable_hole/g
>> - Mask out DRM_MM_INSERT_ONCE from the mode before calling
>>    first/next_hole and elsewhere.
>>
>> v3: (Tvrtko)
>> - Reduce the number of hunks by retaining the "mode" variable name
>>
>> Cc: Christian König <christian.koenig at amd.com>
>> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
>> Suggested-by: Tvrtko Ursulin <tvrtko.ursulin at linux.intel.com>
>> Signed-off-by: Vivek Kasireddy <vivek.kasireddy at intel.com>
> 
> Of hand it looks like it does what the description says without any 
> functional change, but I don't know the internals of drm_mm so well either.
> 
> Feel free to add an Acked-by: Christian König <christian.koenig at amd.com>.

Thanks!

Can we merge this via the Intel tree as one series (one drm core plus 
one i915 patch)? Daniel?

Regards,

Tvrtko


More information about the Intel-gfx mailing list