]> git.dujemihanovic.xyz Git - linux.git/commit
drm/buddy: Add start address support to trim function
authorArunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
Fri, 2 Aug 2024 05:43:19 +0000 (11:13 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 7 Aug 2024 22:19:00 +0000 (18:19 -0400)
commitd507ae0dc83b7f43cdf6760b8f1a30aac4fc405a
tree5e8c9337fc9cd0b2e1e8a5df9816c8317f712968
parente8097cf1ce9e7ad8516ee95f06f7baaa31506035
drm/buddy: Add start address support to trim function

- Add a new start parameter in trim function to specify exact
  address from where to start the trimming. This would help us
  in situations like if drivers would like to do address alignment
  for specific requirements.

- Add a new flag DRM_BUDDY_TRIM_DISABLE. Drivers can use this
  flag to disable the allocator trimming part. This patch enables
  the drivers control trimming and they can do it themselves
  based on the application requirements.

v1:(Matthew)
  - check new_start alignment with min chunk_size
  - use range_overflows()

Signed-off-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit db65eb46de135338d6177f8853e0fd208f19d63e)
drivers/gpu/drm/drm_buddy.c
drivers/gpu/drm/xe/xe_ttm_vram_mgr.c
include/drm/drm_buddy.h