Skip to content

Commit

Permalink
drm/gpuvm: rename struct drm_gpuva_manager to struct drm_gpuvm
Browse files Browse the repository at this point in the history
Rename struct drm_gpuva_manager to struct drm_gpuvm including
corresponding functions. This way the GPUVA manager's structures align
very well with the documentation of VM_BIND [1] and VM_BIND locking [2].

It also provides a better foundation for the naming of data structures
and functions introduced for implementing a common dma-resv per GPU-VM
including tracking of external and evicted objects in subsequent
patches.

[1] Documentation/gpu/drm-vm-bind-async.rst
[2] Documentation/gpu/drm-vm-bind-locking.rst

Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Danilo Krummrich <dakr@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230920144343.64830-2-dakr@redhat.com
  • Loading branch information
Danilo Krummrich committed Sep 25, 2023
1 parent 89755ee commit f72c2db
Show file tree
Hide file tree
Showing 8 changed files with 309 additions and 310 deletions.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ drm-y := \
drm_vblank.o \
drm_vblank_work.o \
drm_vma_manager.o \
drm_gpuva_mgr.o \
drm_gpuvm.o \
drm_writeback.o
drm-$(CONFIG_DRM_LEGACY) += \
drm_agpsupport.o \
Expand Down
16 changes: 8 additions & 8 deletions drivers/gpu/drm/drm_debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#include <drm/drm_file.h>
#include <drm/drm_gem.h>
#include <drm/drm_managed.h>
#include <drm/drm_gpuva_mgr.h>
#include <drm/drm_gpuvm.h>

#include "drm_crtc_internal.h"
#include "drm_internal.h"
Expand Down Expand Up @@ -189,31 +189,31 @@ static const struct file_operations drm_debugfs_fops = {
/**
* drm_debugfs_gpuva_info - dump the given DRM GPU VA space
* @m: pointer to the &seq_file to write
* @mgr: the &drm_gpuva_manager representing the GPU VA space
* @gpuvm: the &drm_gpuvm representing the GPU VA space
*
* Dumps the GPU VA mappings of a given DRM GPU VA manager.
*
* For each DRM GPU VA space drivers should call this function from their
* &drm_info_list's show callback.
*
* Returns: 0 on success, -ENODEV if the &mgr is not initialized
* Returns: 0 on success, -ENODEV if the &gpuvm is not initialized
*/
int drm_debugfs_gpuva_info(struct seq_file *m,
struct drm_gpuva_manager *mgr)
struct drm_gpuvm *gpuvm)
{
struct drm_gpuva *va, *kva = &mgr->kernel_alloc_node;
struct drm_gpuva *va, *kva = &gpuvm->kernel_alloc_node;

if (!mgr->name)
if (!gpuvm->name)
return -ENODEV;

seq_printf(m, "DRM GPU VA space (%s) [0x%016llx;0x%016llx]\n",
mgr->name, mgr->mm_start, mgr->mm_start + mgr->mm_range);
gpuvm->name, gpuvm->mm_start, gpuvm->mm_start + gpuvm->mm_range);
seq_printf(m, "Kernel reserved node [0x%016llx;0x%016llx]\n",
kva->va.addr, kva->va.addr + kva->va.range);
seq_puts(m, "\n");
seq_puts(m, " VAs | start | range | end | object | object offset\n");
seq_puts(m, "-------------------------------------------------------------------------------------------------------------\n");
drm_gpuva_for_each_va(va, mgr) {
drm_gpuvm_for_each_va(va, gpuvm) {
if (unlikely(va == kva))
continue;

Expand Down
Loading

0 comments on commit f72c2db

Please sign in to comment.