diff mbox series

[02/49] drm/vram-helper: call the ttm manager debug function

Message ID 20200731040520.3701599-3-airlied@gmail.com (mailing list archive)
State New, archived
Headers show
Series ttm mem manager refactoring. | expand

Commit Message

Dave Airlie July 31, 2020, 4:04 a.m. UTC
From: Dave Airlie <airlied@redhat.com>

This code was assuming there was a drm_mm here, don't do
that call the correct API.

Signed-off-by: Dave Airlie <airlied@redhat.com>
---
 drivers/gpu/drm/drm_gem_vram_helper.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

Thomas Zimmermann July 31, 2020, 6:43 a.m. UTC | #1
Hi

Am 31.07.20 um 06:04 schrieb Dave Airlie:
> From: Dave Airlie <airlied@redhat.com>
> 
> This code was assuming there was a drm_mm here, don't do
> that call the correct API.

Maybe put a semicolon after 'that' for readability.

> 
> Signed-off-by: Dave Airlie <airlied@redhat.com>

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>

> ---
>  drivers/gpu/drm/drm_gem_vram_helper.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_gem_vram_helper.c b/drivers/gpu/drm/drm_gem_vram_helper.c
> index a93a00966f3a..b6f158ab0f5a 100644
> --- a/drivers/gpu/drm/drm_gem_vram_helper.c
> +++ b/drivers/gpu/drm/drm_gem_vram_helper.c
> @@ -1075,12 +1075,10 @@ static int drm_vram_mm_debugfs(struct seq_file *m, void *data)
>  {
>  	struct drm_info_node *node = (struct drm_info_node *) m->private;
>  	struct drm_vram_mm *vmm = node->minor->dev->vram_mm;
> -	struct drm_mm *mm = vmm->bdev.man[TTM_PL_VRAM].priv;
> +	struct ttm_mem_type_manager *man = &vmm->bdev.man[TTM_PL_VRAM];
>  	struct drm_printer p = drm_seq_file_printer(m);
>  
> -	spin_lock(&ttm_bo_glob.lru_lock);
> -	drm_mm_print(mm, &p);
> -	spin_unlock(&ttm_bo_glob.lru_lock);
> +	man->func->debug(man, &p);
>  	return 0;
>  }
>  
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/drm_gem_vram_helper.c b/drivers/gpu/drm/drm_gem_vram_helper.c
index a93a00966f3a..b6f158ab0f5a 100644
--- a/drivers/gpu/drm/drm_gem_vram_helper.c
+++ b/drivers/gpu/drm/drm_gem_vram_helper.c
@@ -1075,12 +1075,10 @@  static int drm_vram_mm_debugfs(struct seq_file *m, void *data)
 {
 	struct drm_info_node *node = (struct drm_info_node *) m->private;
 	struct drm_vram_mm *vmm = node->minor->dev->vram_mm;
-	struct drm_mm *mm = vmm->bdev.man[TTM_PL_VRAM].priv;
+	struct ttm_mem_type_manager *man = &vmm->bdev.man[TTM_PL_VRAM];
 	struct drm_printer p = drm_seq_file_printer(m);
 
-	spin_lock(&ttm_bo_glob.lru_lock);
-	drm_mm_print(mm, &p);
-	spin_unlock(&ttm_bo_glob.lru_lock);
+	man->func->debug(man, &p);
 	return 0;
 }