mbox series

[0/3] drm/helpers: Make the suballocation manager drm generic.

Message ID 20220223135112.655569-1-maarten.lankhorst@linux.intel.com (mailing list archive)
Headers show
Series drm/helpers: Make the suballocation manager drm generic. | expand

Message

Maarten Lankhorst Feb. 23, 2022, 1:51 p.m. UTC
Second version of the patch. I didn't fix the copyright (which ame up
in the previous version), as I feel the original author should send a
patch for that.

I've made the suballocator into its own module, and did a cleanup pass on it.
The suballocator is generic enough to be useful for any resource that can be
subdivided and is guarded by a completion fence.

Maarten Lankhorst (3):
  drm: Extract amdgpu_sa.c as a generic suballocation helper
  drm/amd: Convert amdgpu to use suballocation helper.
  drm/radeon: Use the drm suballocation manager implementation.

 drivers/gpu/drm/Kconfig                    |   6 +
 drivers/gpu/drm/Makefile                   |   3 +
 drivers/gpu/drm/amd/amdgpu/amdgpu.h        |  29 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c     |   5 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.h |  21 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_sa.c     | 320 +---------------
 drivers/gpu/drm/drm_suballoc.c             | 426 +++++++++++++++++++++
 drivers/gpu/drm/radeon/radeon.h            |  55 +--
 drivers/gpu/drm/radeon/radeon_ib.c         |  10 +-
 drivers/gpu/drm/radeon/radeon_object.h     |  23 +-
 drivers/gpu/drm/radeon/radeon_sa.c         | 314 ++-------------
 drivers/gpu/drm/radeon/radeon_semaphore.c  |   6 +-
 include/drm/drm_suballoc.h                 |  78 ++++
 13 files changed, 603 insertions(+), 693 deletions(-)
 create mode 100644 drivers/gpu/drm/drm_suballoc.c
 create mode 100644 include/drm/drm_suballoc.h

Comments

Christian König Feb. 23, 2022, 3:11 p.m. UTC | #1
Am 23.02.22 um 14:51 schrieb Maarten Lankhorst:
> Second version of the patch. I didn't fix the copyright (which ame up
> in the previous version), as I feel the original author should send a
> patch for that.
>
> I've made the suballocator into its own module, and did a cleanup pass on it.
> The suballocator is generic enough to be useful for any resource that can be
> subdivided and is guarded by a completion fence.

Well the main issue is still that you removed the per allocation alignment.

For amdgpu that is not much of a problem, but for radeon that could 
cause massive issues with UVD semaphore synchronization.

Christian.

>
> Maarten Lankhorst (3):
>    drm: Extract amdgpu_sa.c as a generic suballocation helper
>    drm/amd: Convert amdgpu to use suballocation helper.
>    drm/radeon: Use the drm suballocation manager implementation.
>
>   drivers/gpu/drm/Kconfig                    |   6 +
>   drivers/gpu/drm/Makefile                   |   3 +
>   drivers/gpu/drm/amd/amdgpu/amdgpu.h        |  29 +-
>   drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c     |   5 +-
>   drivers/gpu/drm/amd/amdgpu/amdgpu_object.h |  21 +-
>   drivers/gpu/drm/amd/amdgpu/amdgpu_sa.c     | 320 +---------------
>   drivers/gpu/drm/drm_suballoc.c             | 426 +++++++++++++++++++++
>   drivers/gpu/drm/radeon/radeon.h            |  55 +--
>   drivers/gpu/drm/radeon/radeon_ib.c         |  10 +-
>   drivers/gpu/drm/radeon/radeon_object.h     |  23 +-
>   drivers/gpu/drm/radeon/radeon_sa.c         | 314 ++-------------
>   drivers/gpu/drm/radeon/radeon_semaphore.c  |   6 +-
>   include/drm/drm_suballoc.h                 |  78 ++++
>   13 files changed, 603 insertions(+), 693 deletions(-)
>   create mode 100644 drivers/gpu/drm/drm_suballoc.c
>   create mode 100644 include/drm/drm_suballoc.h
>
Maarten Lankhorst Feb. 24, 2022, 8:39 p.m. UTC | #2
Op 23-02-2022 om 16:11 schreef Christian König:
> Am 23.02.22 um 14:51 schrieb Maarten Lankhorst:
>> Second version of the patch. I didn't fix the copyright (which ame up
>> in the previous version), as I feel the original author should send a
>> patch for that.
>>
>> I've made the suballocator into its own module, and did a cleanup pass on it.
>> The suballocator is generic enough to be useful for any resource that can be
>> subdivided and is guarded by a completion fence.
>
> Well the main issue is still that you removed the per allocation alignment.
>
> For amdgpu that is not much of a problem, but for radeon that could cause massive issues with UVD semaphore synchronization. 

Hey,

Is this really a problem? I made the per allocation alignment fixed and set it to the higher of the 2 places it's used in by radeon. This just means that slightly more memory might be allocated to each suballocation. This shouldn't cause any problem. It would reserve 256 bytes for a semaphore allocation, instead of 8.

~Maarten