Displaying 20 results from an estimated 23 matches for "drm_gpuva".
2023 Jun 29
3
[PATCH drm-next v6 02/13] drm: manager to keep track of GPUs VA mappings
...;boris.brezillon at collabora.com>
Suggested-by: Dave Airlie <airlied at redhat.com>
Signed-off-by: Danilo Krummrich <dakr at redhat.com>
---
Documentation/gpu/drm-mm.rst | 36 +
drivers/gpu/drm/Makefile | 1 +
drivers/gpu/drm/drm_gem.c | 3 +
drivers/gpu/drm/drm_gpuva_mgr.c | 1743 +++++++++++++++++++++++++++++++
include/drm/drm_drv.h | 6 +
include/drm/drm_gem.h | 52 +
include/drm/drm_gpuva_mgr.h | 756 ++++++++++++++
7 files changed, 2597 insertions(+)
create mode 100644 drivers/gpu/drm/drm_gpuva_mgr.c
create mode 100644 includ...
2023 Jul 13
1
[PATCH drm-next v7 02/13] drm: manager to keep track of GPUs VA mappings
...n <donald.robson at imgtec.com>
Suggested-by: Dave Airlie <airlied at redhat.com>
Signed-off-by: Danilo Krummrich <dakr at redhat.com>
---
Documentation/gpu/drm-mm.rst | 36 +
drivers/gpu/drm/Makefile | 1 +
drivers/gpu/drm/drm_gem.c | 3 +
drivers/gpu/drm/drm_gpuva_mgr.c | 1730 +++++++++++++++++++++++++++++++
include/drm/drm_drv.h | 6 +
include/drm/drm_gem.h | 79 ++
include/drm/drm_gpuva_mgr.h | 706 +++++++++++++
7 files changed, 2561 insertions(+)
create mode 100644 drivers/gpu/drm/drm_gpuva_mgr.c
create mode 100644 includ...
2023 Jul 20
2
[PATCH drm-misc-next v8 01/12] drm: manager to keep track of GPUs VA mappings
...n <donald.robson at imgtec.com>
Suggested-by: Dave Airlie <airlied at redhat.com>
Signed-off-by: Danilo Krummrich <dakr at redhat.com>
---
Documentation/gpu/drm-mm.rst | 36 +
drivers/gpu/drm/Makefile | 1 +
drivers/gpu/drm/drm_gem.c | 3 +
drivers/gpu/drm/drm_gpuva_mgr.c | 1728 +++++++++++++++++++++++++++++++
include/drm/drm_drv.h | 6 +
include/drm/drm_gem.h | 79 ++
include/drm/drm_gpuva_mgr.h | 706 +++++++++++++
7 files changed, 2559 insertions(+)
create mode 100644 drivers/gpu/drm/drm_gpuva_mgr.c
create mode 100644 includ...
2023 Aug 20
3
[PATCH drm-misc-next 0/3] [RFC] DRM GPUVA Manager GPU-VM features
...eatures appear as a collection of optional helper functions, such that
drivers are free to make use of the DRM GPUVA managers basic
functionality and opt-in for other features without setting any feature
flags, just by making use of the corresponding functions.
The implementation introduces struct drm_gpuva_gem, which serves as abstraction
combining a struct drm_gpuva_manager and struct drm_gem_object, similar to what
amdgpu does with struct amdgpu_bo_vm. While this adds a bit of complexity it
improves the efficiency of tracking evicted GEM objects. [1] provides an
alternative implementation using a m...
2023 Feb 27
2
[PATCH drm-next v2 05/16] drm: manager to keep track of GPUs VA mappings
...Signed-off-by: Danilo Krummrich <dakr at redhat.com>
>>>> ---
>>>> Documentation/gpu/drm-mm.rst | 31 +
>>>> drivers/gpu/drm/Makefile | 1 +
>>>> drivers/gpu/drm/drm_gem.c | 3 +
>>>> drivers/gpu/drm/drm_gpuva_mgr.c | 1704 +++++++++++++++++++++++++++++++
>>>> include/drm/drm_drv.h | 6 +
>>>> include/drm/drm_gem.h | 75 ++
>>>> include/drm/drm_gpuva_mgr.h | 714 +++++++++++++
>>>> 7 files changed, 2534 insertions(+)
&g...
2023 Jul 07
0
[PATCH drm-next v6 02/13] drm: manager to keep track of GPUs VA mappings
On 7/7/23 13:00, Boris Brezillon wrote:
> On Fri, 30 Jun 2023 00:25:18 +0200
> Danilo Krummrich <dakr at redhat.com> wrote:
>
>> +/**
>> + * drm_gpuva_for_each_va_range - iternator to walk over a range of &drm_gpuvas
>> + * @va__: &drm_gpuva structure to assign to in each iteration step
>> + * @mgr__: &drm_gpuva_manager to walk over
>> + * @start__: starting offset, the first gpuva will overlap this
>> + * @end...
2023 Mar 06
2
[PATCH drm-next v2 05/16] drm: manager to keep track of GPUs VA mappings
...d
>>> try to write to the tree then things will go poorly.. In this scenario,
>>> we are very much walking the tree and writing to it in two steps.
>>>
>>>>
>>>> To remove an entry while walking the tree I have a separate function
>>>> drm_gpuva_iter_remove(). Would I need something similar for inserting
>>>> entries?
>>>
>>> I saw that. Your remove function uses the erase operation which is
>>> implemented as a walk to that location and a store of a null over the
>>> range that is returned....
2023 Aug 31
3
[PATCH drm-misc-next 2/3] drm/gpuva_mgr: generalize dma_resv/extobj handling and GEM validation
...> Some quick comments since I'm doing some Xe work in this area. Will probably
>>>>>> get back with more.
>>>>>>
>>>>>> On 8/20/23 23:53, Danilo Krummrich wrote:
> <snip>
>
>>>>>>> diff --git a/include/drm/drm_gpuva_mgr.h b/include/drm/drm_gpuva_mgr.h
>>>>>>> index ed8d50200cc3..693e2da3f425 100644
>>>>>>> --- a/include/drm/drm_gpuva_mgr.h
>>>>>>> +++ b/include/drm/drm_gpuva_mgr.h
>>>>>>> @@ -26,12 +26,16 @@
>>>>>...
2023 Jul 07
0
[PATCH drm-next v6 02/13] drm: manager to keep track of GPUs VA mappings
...; Boris Brezillon <boris.brezillon at collabora.com> wrote:
>
>> On Fri, 30 Jun 2023 00:25:18 +0200
>> Danilo Krummrich <dakr at redhat.com> wrote:
>>
>>> +#ifdef CONFIG_LOCKDEP
>>> +typedef struct lockdep_map *lockdep_map_p;
>>> +#define drm_gpuva_manager_ext_assert_held(mgr) \
>>> + lockdep_assert(lock_is_held((mgr)->ext_lock) != LOCK_STATE_NOT_HELD)
>>> +/**
>>> + * drm_gpuva_manager_set_ext_lock - set the external lock according to
>>> + * @DRM_GPUVA_MANAGER_LOCK_EXTERN
>>> + * @mgr: the &a...
2023 Mar 06
0
[PATCH drm-next v2 05/16] drm: manager to keep track of GPUs VA mappings
...> Signed-off-by: Danilo Krummrich <dakr at redhat.com>
>>>> ---
>>>> Documentation/gpu/drm-mm.rst | 31 +
>>>> drivers/gpu/drm/Makefile | 1 +
>>>> drivers/gpu/drm/drm_gem.c | 3 +
>>>> drivers/gpu/drm/drm_gpuva_mgr.c | 1704 +++++++++++++++++++++++++++++++
>>>> include/drm/drm_drv.h | 6 +
>>>> include/drm/drm_gem.h | 75 ++
>>>> include/drm/drm_gpuva_mgr.h | 714 +++++++++++++
>>>> 7 files changed, 2534 insertions(+)
>&g...
2023 Nov 08
1
[PATCH drm-misc-next v9 09/12] drm/gpuvm: reference count drm_gpuvm structures
...release the reference of
+ *
+ * This releases a reference to @gpuvm.
+ *
+ * This function may be called from atomic context.
+ */
+void
+drm_gpuvm_put(struct drm_gpuvm *gpuvm)
+{
+ if (gpuvm)
+ kref_put(&gpuvm->kref, drm_gpuvm_free);
+}
+EXPORT_SYMBOL_GPL(drm_gpuvm_put);
static int
__drm_gpuva_insert(struct drm_gpuvm *gpuvm,
@@ -839,11 +862,21 @@ drm_gpuva_insert(struct drm_gpuvm *gpuvm,
{
u64 addr = va->va.addr;
u64 range = va->va.range;
+ int ret;
if (unlikely(!drm_gpuvm_range_valid(gpuvm, addr, range)))
return -EINVAL;
- return __drm_gpuva_insert(gpuvm, va);
+ ret...
2023 Feb 22
1
[PATCH drm-next v2 05/16] drm: manager to keep track of GPUs VA mappings
On 2/22/23 11:25, Christian K?nig wrote:
> Am 17.02.23 um 14:44 schrieb Danilo Krummrich:
<snip>
>> +/**
>> + * DOC: Overview
>> + *
>> + * The DRM GPU VA Manager, represented by struct drm_gpuva_manager
>> keeps track
>> + * of a GPU's virtual address (VA) space and manages the
>> corresponding virtual
>> + * mappings represented by &drm_gpuva objects. It also keeps track of
>> the
>> + * mapping's backing &drm_gem_object buffers.
>...
2023 Jun 22
2
[PATCH drm-next v5 03/14] drm: manager to keep track of GPUs VA mappings
...t) the same relationship I introduce with the GPUVA
>>> manager?
>>>
>>> If you would switch over to the GPUVA manager right now, it would be
>>> that every GEM has a list of it's mappings (the gpuva list). The
>>> mapping is represented by struct drm_gpuva (of course embedded in
>>> driver specific structure(s)) which has a pointer to the VM address
>>> space it is part of, namely the GPUVA manager instance. And the GPUVA
>>> manager keeps a maple tree of it's mappings as well.
>>>
>>> If you still...
2023 Jul 17
1
[PATCH drm-next v7 02/13] drm: manager to keep track of GPUs VA mappings
...gt; +/**
> + * DOC: Locking
> + *
> + * Generally, the GPU VA manager does not take care of locking itself, it is
> + * the drivers responsibility to take care about locking. Drivers might want to
> + * protect the following operations: inserting, removing and iterating
> + * &drm_gpuva objects as well as generating all kinds of operations, such as
> + * split / merge or prefetch.
> + *
> + * The GPU VA manager also does not take care of the locking of the backing
> + * &drm_gem_object buffers GPU VA lists by itself; drivers are responsible to
> + * enforce mutu...
2023 Feb 23
1
[PATCH drm-next v2 05/16] drm: manager to keep track of GPUs VA mappings
...>>>> Am 17.02.23 um 14:44 schrieb Danilo Krummrich:
>>>
>>> <snip>
>>>
>>>>> +/**
>>>>> + * DOC: Overview
>>>>> + *
>>>>> + * The DRM GPU VA Manager, represented by struct
>>>>> drm_gpuva_manager keeps track
>>>>> + * of a GPU's virtual address (VA) space and manages the
>>>>> corresponding virtual
>>>>> + * mappings represented by &drm_gpuva objects. It also keeps
>>>>> track of the
>>>>> + * mappi...
2023 Jul 20
1
[PATCH drm-misc-next v8 02/12] drm: debugfs: provide infrastructure to dump a DRM GPU VA space
.../drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c
index 4855230ba2c6..c90dbcffa0dc 100644
--- a/drivers/gpu/drm/drm_debugfs.c
+++ b/drivers/gpu/drm/drm_debugfs.c
@@ -39,6 +39,7 @@
#include <drm/drm_file.h>
#include <drm/drm_gem.h>
#include <drm/drm_managed.h>
+#include <drm/drm_gpuva_mgr.h>
#include "drm_crtc_internal.h"
#include "drm_internal.h"
@@ -175,6 +176,45 @@ static const struct file_operations drm_debugfs_fops = {
.release = single_release,
};
+/**
+ * drm_debugfs_gpuva_info - dump the given DRM GPU VA space
+ * @m: pointer to the &s...
2023 Jun 23
1
[PATCH drm-next v5 03/14] drm: manager to keep track of GPUs VA mappings
...ship I introduce with the
>>>> GPUVA manager?
>>>>
>>>> If you would switch over to the GPUVA manager right now, it would
>>>> be that every GEM has a list of it's mappings (the gpuva list). The
>>>> mapping is represented by struct drm_gpuva (of course embedded in
>>>> driver specific structure(s)) which has a pointer to the VM address
>>>> space it is part of, namely the GPUVA manager instance. And the
>>>> GPUVA manager keeps a maple tree of it's mappings as well.
>>>>
>>&g...
2023 Jul 06
0
[PATCH drm-next v6 02/13] drm: manager to keep track of GPUs VA mappings
Hi Donald,
On 7/6/23 17:45, Donald Robson wrote:
> On Fri, 2023-06-30 at 00:25 +0200, Danilo Krummrich wrote:
>>
>> +#ifdef CONFIG_LOCKDEP
>> +typedef struct lockdep_map *lockdep_map_p;
>> +#define drm_gpuva_manager_ext_assert_held(mgr) \
>> + lockdep_assert(lock_is_held((mgr)->ext_lock) != LOCK_STATE_NOT_HELD)
>> +/**
>> + * drm_gpuva_manager_set_ext_lock - set the external lock according to
>> + * @DRM_GPUVA_MANAGER_LOCK_EXTERN
>> + * @mgr: the &drm_gpuva_manager...
2023 Nov 09
1
[PATCH drm-misc-next v8 09/12] drm/gpuvm: reference count drm_gpuvm structures
...'t a good idea. What we should rather really have is a BO -> VM or BO_VM ->VM reference. In other words that each BO which is part of the VM keeps a reference to the VM.
We have both. Please see the subsequent patch introducing VM_BO structures for that.
As I explained, mappings (struct drm_gpuva) keep a pointer to their VM they're mapped
in and besides that it doesn't make sense to free a VM that still contains mappings,
the reference count ensures that. This simply ensures memory safety.
>
> BTW: At least in amdgpu we can have BOs which (temporary) doesn't have any map...
2023 Nov 10
2
[PATCH drm-misc-next v8 09/12] drm/gpuvm: reference count drm_gpuvm structures
...ally
>> have is a BO -> VM or BO_VM ->VM reference. In other words that each
>> BO which is part of the VM keeps a reference to the VM.
>
> We have both. Please see the subsequent patch introducing VM_BO
> structures for that.
>
> As I explained, mappings (struct drm_gpuva) keep a pointer to their VM
> they're mapped
> in and besides that it doesn't make sense to free a VM that still
> contains mappings,
> the reference count ensures that. This simply ensures memory safety.
>
>>
>> BTW: At least in amdgpu we can have BOs which (te...