mbox series

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

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

Message

Thomas Hellström Feb. 24, 2023, 9:51 a.m. UTC
This series (or at least the suballocator helper) is a prerequisite
for the new Xe driver.

There was an unresolved issue when the series was last up for review,
and that was the per allocation aligment. Last message was from
Maarten Lankhorst arguing that the larger per-driver alignment used
would only incur a small memory cost. This new variant resolves that.

The generic suballocator has been tested with the Xe driver, and a
kunit test is under development.
The amd- and radeon adaptations are only compile-tested.

v3:
- Remove stale author information (Christian König)
- Update Radeon Kconfig (Thomas Hellström)

v4:
- Avoid 64-bit integer divisions (kernel test robot <lkp@intel.com>)
- Use size_t rather than u64 for the managed range. (Thomas)


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

 drivers/gpu/drm/Kconfig                    |   4 +
 drivers/gpu/drm/Makefile                   |   3 +
 drivers/gpu/drm/amd/amdgpu/Kconfig         |   1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu.h        |  26 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c     |   5 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.h |  23 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h   |   3 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_sa.c     | 324 +--------------
 drivers/gpu/drm/drm_suballoc.c             | 457 +++++++++++++++++++++
 drivers/gpu/drm/radeon/Kconfig             |   1 +
 drivers/gpu/drm/radeon/radeon.h            |  55 +--
 drivers/gpu/drm/radeon/radeon_ib.c         |  12 +-
 drivers/gpu/drm/radeon/radeon_object.h     |  25 +-
 drivers/gpu/drm/radeon/radeon_sa.c         | 316 ++------------
 drivers/gpu/drm/radeon/radeon_semaphore.c  |   4 +-
 include/drm/drm_suballoc.h                 | 108 +++++
 16 files changed, 674 insertions(+), 693 deletions(-)
 create mode 100644 drivers/gpu/drm/drm_suballoc.c
 create mode 100644 include/drm/drm_suballoc.h

Comments

Thomas Hellström Feb. 27, 2023, 8:11 a.m. UTC | #1
Daniel, Dave

Ack to merge this to drm through drm-misc-next?

/Thomas


On 2/24/23 10:51, Thomas Hellström wrote:
> This series (or at least the suballocator helper) is a prerequisite
> for the new Xe driver.
>
> There was an unresolved issue when the series was last up for review,
> and that was the per allocation aligment. Last message was from
> Maarten Lankhorst arguing that the larger per-driver alignment used
> would only incur a small memory cost. This new variant resolves that.
>
> The generic suballocator has been tested with the Xe driver, and a
> kunit test is under development.
> The amd- and radeon adaptations are only compile-tested.
>
> v3:
> - Remove stale author information (Christian König)
> - Update Radeon Kconfig (Thomas Hellström)
>
> v4:
> - Avoid 64-bit integer divisions (kernel test robot <lkp@intel.com>)
> - Use size_t rather than u64 for the managed range. (Thomas)
>
>
> Maarten Lankhorst (3):
>    drm/suballoc: Extract amdgpu_sa.c as generic suballocation helper
>    drm/amd: Convert amdgpu to use suballocation helper.
>    drm/radeon: Use the drm suballocation manager implementation.
>
>   drivers/gpu/drm/Kconfig                    |   4 +
>   drivers/gpu/drm/Makefile                   |   3 +
>   drivers/gpu/drm/amd/amdgpu/Kconfig         |   1 +
>   drivers/gpu/drm/amd/amdgpu/amdgpu.h        |  26 +-
>   drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c     |   5 +-
>   drivers/gpu/drm/amd/amdgpu/amdgpu_object.h |  23 +-
>   drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h   |   3 +-
>   drivers/gpu/drm/amd/amdgpu/amdgpu_sa.c     | 324 +--------------
>   drivers/gpu/drm/drm_suballoc.c             | 457 +++++++++++++++++++++
>   drivers/gpu/drm/radeon/Kconfig             |   1 +
>   drivers/gpu/drm/radeon/radeon.h            |  55 +--
>   drivers/gpu/drm/radeon/radeon_ib.c         |  12 +-
>   drivers/gpu/drm/radeon/radeon_object.h     |  25 +-
>   drivers/gpu/drm/radeon/radeon_sa.c         | 316 ++------------
>   drivers/gpu/drm/radeon/radeon_semaphore.c  |   4 +-
>   include/drm/drm_suballoc.h                 | 108 +++++
>   16 files changed, 674 insertions(+), 693 deletions(-)
>   create mode 100644 drivers/gpu/drm/drm_suballoc.c
>   create mode 100644 include/drm/drm_suballoc.h
>
Maarten Lankhorst Feb. 27, 2023, 8:55 a.m. UTC | #2
Hey,

I can push this to drm-misc-next, I don't think a drm maintainer ack is 
needed, as long as we have the acks from the amd folk for merging 
through drm-misc-next.

~Maarten

On 2023-02-27 09:11, Thomas Hellström wrote:
> Daniel, Dave
>
> Ack to merge this to drm through drm-misc-next?
>
> /Thomas
>
>
> On 2/24/23 10:51, Thomas Hellström wrote:
>> This series (or at least the suballocator helper) is a prerequisite
>> for the new Xe driver.
>>
>> There was an unresolved issue when the series was last up for review,
>> and that was the per allocation aligment. Last message was from
>> Maarten Lankhorst arguing that the larger per-driver alignment used
>> would only incur a small memory cost. This new variant resolves that.
>>
>> The generic suballocator has been tested with the Xe driver, and a
>> kunit test is under development.
>> The amd- and radeon adaptations are only compile-tested.
>>
>> v3:
>> - Remove stale author information (Christian König)
>> - Update Radeon Kconfig (Thomas Hellström)
>>
>> v4:
>> - Avoid 64-bit integer divisions (kernel test robot <lkp@intel.com>)
>> - Use size_t rather than u64 for the managed range. (Thomas)
>>
>>
>> Maarten Lankhorst (3):
>>    drm/suballoc: Extract amdgpu_sa.c as generic suballocation helper
>>    drm/amd: Convert amdgpu to use suballocation helper.
>>    drm/radeon: Use the drm suballocation manager implementation.
>>
>>   drivers/gpu/drm/Kconfig                    |   4 +
>>   drivers/gpu/drm/Makefile                   |   3 +
>>   drivers/gpu/drm/amd/amdgpu/Kconfig         |   1 +
>>   drivers/gpu/drm/amd/amdgpu/amdgpu.h        |  26 +-
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c     |   5 +-
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_object.h |  23 +-
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h   |   3 +-
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_sa.c     | 324 +--------------
>>   drivers/gpu/drm/drm_suballoc.c             | 457 +++++++++++++++++++++
>>   drivers/gpu/drm/radeon/Kconfig             |   1 +
>>   drivers/gpu/drm/radeon/radeon.h            |  55 +--
>>   drivers/gpu/drm/radeon/radeon_ib.c         |  12 +-
>>   drivers/gpu/drm/radeon/radeon_object.h     |  25 +-
>>   drivers/gpu/drm/radeon/radeon_sa.c         | 316 ++------------
>>   drivers/gpu/drm/radeon/radeon_semaphore.c  |   4 +-
>>   include/drm/drm_suballoc.h                 | 108 +++++
>>   16 files changed, 674 insertions(+), 693 deletions(-)
>>   create mode 100644 drivers/gpu/drm/drm_suballoc.c
>>   create mode 100644 include/drm/drm_suballoc.h
>>
Thomas Hellström Feb. 27, 2023, 9 a.m. UTC | #3
Hi, Maarten,

On 2/27/23 09:55, Maarten Lankhorst wrote:
> Hey,
>
> I can push this to drm-misc-next, I don't think a drm maintainer ack 
> is needed, as long as we have the acks from the amd folk for merging 
> through drm-misc-next.
>
OK, sound good, we have that ack so please go ahead!

/Thomas


> ~Maarten
>
> On 2023-02-27 09:11, Thomas Hellström wrote:
>> Daniel, Dave
>>
>> Ack to merge this to drm through drm-misc-next?
>>
>> /Thomas
>>
>>
>> On 2/24/23 10:51, Thomas Hellström wrote:
>>> This series (or at least the suballocator helper) is a prerequisite
>>> for the new Xe driver.
>>>
>>> There was an unresolved issue when the series was last up for review,
>>> and that was the per allocation aligment. Last message was from
>>> Maarten Lankhorst arguing that the larger per-driver alignment used
>>> would only incur a small memory cost. This new variant resolves that.
>>>
>>> The generic suballocator has been tested with the Xe driver, and a
>>> kunit test is under development.
>>> The amd- and radeon adaptations are only compile-tested.
>>>
>>> v3:
>>> - Remove stale author information (Christian König)
>>> - Update Radeon Kconfig (Thomas Hellström)
>>>
>>> v4:
>>> - Avoid 64-bit integer divisions (kernel test robot <lkp@intel.com>)
>>> - Use size_t rather than u64 for the managed range. (Thomas)
>>>
>>>
>>> Maarten Lankhorst (3):
>>>    drm/suballoc: Extract amdgpu_sa.c as generic suballocation helper
>>>    drm/amd: Convert amdgpu to use suballocation helper.
>>>    drm/radeon: Use the drm suballocation manager implementation.
>>>
>>>   drivers/gpu/drm/Kconfig                    |   4 +
>>>   drivers/gpu/drm/Makefile                   |   3 +
>>>   drivers/gpu/drm/amd/amdgpu/Kconfig         |   1 +
>>>   drivers/gpu/drm/amd/amdgpu/amdgpu.h        |  26 +-
>>>   drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c     |   5 +-
>>>   drivers/gpu/drm/amd/amdgpu/amdgpu_object.h |  23 +-
>>>   drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h   |   3 +-
>>>   drivers/gpu/drm/amd/amdgpu/amdgpu_sa.c     | 324 +--------------
>>>   drivers/gpu/drm/drm_suballoc.c             | 457 
>>> +++++++++++++++++++++
>>>   drivers/gpu/drm/radeon/Kconfig             |   1 +
>>>   drivers/gpu/drm/radeon/radeon.h            |  55 +--
>>>   drivers/gpu/drm/radeon/radeon_ib.c         |  12 +-
>>>   drivers/gpu/drm/radeon/radeon_object.h     |  25 +-
>>>   drivers/gpu/drm/radeon/radeon_sa.c         | 316 ++------------
>>>   drivers/gpu/drm/radeon/radeon_semaphore.c  |   4 +-
>>>   include/drm/drm_suballoc.h                 | 108 +++++
>>>   16 files changed, 674 insertions(+), 693 deletions(-)
>>>   create mode 100644 drivers/gpu/drm/drm_suballoc.c
>>>   create mode 100644 include/drm/drm_suballoc.h
>>>
Christian König Feb. 27, 2023, 1:03 p.m. UTC | #4
Am 27.02.23 um 10:00 schrieb Thomas Hellström:
> Hi, Maarten,
>
> On 2/27/23 09:55, Maarten Lankhorst wrote:
>> Hey,
>>
>> I can push this to drm-misc-next, I don't think a drm maintainer ack 
>> is needed, as long as we have the acks from the amd folk for merging 
>> through drm-misc-next.
>>
> OK, sound good, we have that ack so please go ahead!

Works for me and I don't think Alex would object either.

Regards,
Christian.

>
> /Thomas
>
>
>> ~Maarten
>>
>> On 2023-02-27 09:11, Thomas Hellström wrote:
>>> Daniel, Dave
>>>
>>> Ack to merge this to drm through drm-misc-next?
>>>
>>> /Thomas
>>>
>>>
>>> On 2/24/23 10:51, Thomas Hellström wrote:
>>>> This series (or at least the suballocator helper) is a prerequisite
>>>> for the new Xe driver.
>>>>
>>>> There was an unresolved issue when the series was last up for review,
>>>> and that was the per allocation aligment. Last message was from
>>>> Maarten Lankhorst arguing that the larger per-driver alignment used
>>>> would only incur a small memory cost. This new variant resolves that.
>>>>
>>>> The generic suballocator has been tested with the Xe driver, and a
>>>> kunit test is under development.
>>>> The amd- and radeon adaptations are only compile-tested.
>>>>
>>>> v3:
>>>> - Remove stale author information (Christian König)
>>>> - Update Radeon Kconfig (Thomas Hellström)
>>>>
>>>> v4:
>>>> - Avoid 64-bit integer divisions (kernel test robot <lkp@intel.com>)
>>>> - Use size_t rather than u64 for the managed range. (Thomas)
>>>>
>>>>
>>>> Maarten Lankhorst (3):
>>>>    drm/suballoc: Extract amdgpu_sa.c as generic suballocation helper
>>>>    drm/amd: Convert amdgpu to use suballocation helper.
>>>>    drm/radeon: Use the drm suballocation manager implementation.
>>>>
>>>>   drivers/gpu/drm/Kconfig                    |   4 +
>>>>   drivers/gpu/drm/Makefile                   |   3 +
>>>>   drivers/gpu/drm/amd/amdgpu/Kconfig         |   1 +
>>>>   drivers/gpu/drm/amd/amdgpu/amdgpu.h        |  26 +-
>>>>   drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c     |   5 +-
>>>>   drivers/gpu/drm/amd/amdgpu/amdgpu_object.h |  23 +-
>>>>   drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h   |   3 +-
>>>>   drivers/gpu/drm/amd/amdgpu/amdgpu_sa.c     | 324 +--------------
>>>>   drivers/gpu/drm/drm_suballoc.c             | 457 
>>>> +++++++++++++++++++++
>>>>   drivers/gpu/drm/radeon/Kconfig             |   1 +
>>>>   drivers/gpu/drm/radeon/radeon.h            |  55 +--
>>>>   drivers/gpu/drm/radeon/radeon_ib.c         |  12 +-
>>>>   drivers/gpu/drm/radeon/radeon_object.h     |  25 +-
>>>>   drivers/gpu/drm/radeon/radeon_sa.c         | 316 ++------------
>>>>   drivers/gpu/drm/radeon/radeon_semaphore.c  |   4 +-
>>>>   include/drm/drm_suballoc.h                 | 108 +++++
>>>>   16 files changed, 674 insertions(+), 693 deletions(-)
>>>>   create mode 100644 drivers/gpu/drm/drm_suballoc.c
>>>>   create mode 100644 include/drm/drm_suballoc.h
>>>>
Alex Deucher Feb. 27, 2023, 3 p.m. UTC | #5
On Mon, Feb 27, 2023 at 8:04 AM Christian König
<christian.koenig@amd.com> wrote:
>
> Am 27.02.23 um 10:00 schrieb Thomas Hellström:
> > Hi, Maarten,
> >
> > On 2/27/23 09:55, Maarten Lankhorst wrote:
> >> Hey,
> >>
> >> I can push this to drm-misc-next, I don't think a drm maintainer ack
> >> is needed, as long as we have the acks from the amd folk for merging
> >> through drm-misc-next.
> >>
> > OK, sound good, we have that ack so please go ahead!
>
> Works for me and I don't think Alex would object either.

Fine with me as well.

Alex

>
> Regards,
> Christian.
>
> >
> > /Thomas
> >
> >
> >> ~Maarten
> >>
> >> On 2023-02-27 09:11, Thomas Hellström wrote:
> >>> Daniel, Dave
> >>>
> >>> Ack to merge this to drm through drm-misc-next?
> >>>
> >>> /Thomas
> >>>
> >>>
> >>> On 2/24/23 10:51, Thomas Hellström wrote:
> >>>> This series (or at least the suballocator helper) is a prerequisite
> >>>> for the new Xe driver.
> >>>>
> >>>> There was an unresolved issue when the series was last up for review,
> >>>> and that was the per allocation aligment. Last message was from
> >>>> Maarten Lankhorst arguing that the larger per-driver alignment used
> >>>> would only incur a small memory cost. This new variant resolves that.
> >>>>
> >>>> The generic suballocator has been tested with the Xe driver, and a
> >>>> kunit test is under development.
> >>>> The amd- and radeon adaptations are only compile-tested.
> >>>>
> >>>> v3:
> >>>> - Remove stale author information (Christian König)
> >>>> - Update Radeon Kconfig (Thomas Hellström)
> >>>>
> >>>> v4:
> >>>> - Avoid 64-bit integer divisions (kernel test robot <lkp@intel.com>)
> >>>> - Use size_t rather than u64 for the managed range. (Thomas)
> >>>>
> >>>>
> >>>> Maarten Lankhorst (3):
> >>>>    drm/suballoc: Extract amdgpu_sa.c as generic suballocation helper
> >>>>    drm/amd: Convert amdgpu to use suballocation helper.
> >>>>    drm/radeon: Use the drm suballocation manager implementation.
> >>>>
> >>>>   drivers/gpu/drm/Kconfig                    |   4 +
> >>>>   drivers/gpu/drm/Makefile                   |   3 +
> >>>>   drivers/gpu/drm/amd/amdgpu/Kconfig         |   1 +
> >>>>   drivers/gpu/drm/amd/amdgpu/amdgpu.h        |  26 +-
> >>>>   drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c     |   5 +-
> >>>>   drivers/gpu/drm/amd/amdgpu/amdgpu_object.h |  23 +-
> >>>>   drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h   |   3 +-
> >>>>   drivers/gpu/drm/amd/amdgpu/amdgpu_sa.c     | 324 +--------------
> >>>>   drivers/gpu/drm/drm_suballoc.c             | 457
> >>>> +++++++++++++++++++++
> >>>>   drivers/gpu/drm/radeon/Kconfig             |   1 +
> >>>>   drivers/gpu/drm/radeon/radeon.h            |  55 +--
> >>>>   drivers/gpu/drm/radeon/radeon_ib.c         |  12 +-
> >>>>   drivers/gpu/drm/radeon/radeon_object.h     |  25 +-
> >>>>   drivers/gpu/drm/radeon/radeon_sa.c         | 316 ++------------
> >>>>   drivers/gpu/drm/radeon/radeon_semaphore.c  |   4 +-
> >>>>   include/drm/drm_suballoc.h                 | 108 +++++
> >>>>   16 files changed, 674 insertions(+), 693 deletions(-)
> >>>>   create mode 100644 drivers/gpu/drm/drm_suballoc.c
> >>>>   create mode 100644 include/drm/drm_suballoc.h
> >>>>
>