• Arunpravin's avatar
    drm: implement top-down allocation method · 476e4063
    Arunpravin authored
    Implemented a function which walk through the order list,
    compares the offset and returns the maximum offset block,
    this method is unpredictable in obtaining the high range
    address blocks which depends on allocation and deallocation.
    for instance, if driver requests address at a low specific
    range, allocator traverses from the root block and splits
    the larger blocks until it reaches the specific block and
    in the process of splitting, lower orders in the freelist
    are occupied with low range address blocks and for the
    subsequent TOPDOWN memory request we may return the low
    range blocks.To overcome this issue, we may go with the
    below approach.
    
    The other approach, sorting each order list entries in
    ascending order and compares the last entry of each
    order list in the freelist and return the max block.
    This creates sorting overhead on every drm_buddy_free()
    request and split up of larger blocks for a single page
    request.
    
    v2:
      - Fix alignment issues(Matthew Auld)
      - Remove unnecessary list_empty check(Matthew Auld)
      - merged the below patch to see the feature in action
         - add top-down alloc support to i915 driver
    Signed-off-by: default avatarArunpravin <Arunpravin.PaneerSelvam@amd.com>
    Reviewed-by: default avatarMatthew Auld <matthew.auld@intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20220221164552.2434-2-Arunpravin.PaneerSelvam@amd.comSigned-off-by: default avatarChristian König <christian.koenig@amd.com>
    476e4063
drm_buddy.c 14.6 KB