diff mbox series

[2/5] drm/vram: use drm_gem_ttm_print_info

Message ID 20190902124126.7700-3-kraxel@redhat.com (mailing list archive)
State New, archived
Headers show
Series drm: add some ttm/vram info to debugfs | expand

Commit Message

Gerd Hoffmann Sept. 2, 2019, 12:41 p.m. UTC
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 include/drm/drm_gem_vram_helper.h     | 1 +
 drivers/gpu/drm/drm_gem_vram_helper.c | 3 ++-
 drivers/gpu/drm/Kconfig               | 1 +
 3 files changed, 4 insertions(+), 1 deletion(-)

Comments

Thomas Zimmermann Sept. 2, 2019, 2:24 p.m. UTC | #1
Hi

Am 02.09.19 um 14:41 schrieb Gerd Hoffmann:
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
>  include/drm/drm_gem_vram_helper.h     | 1 +
>  drivers/gpu/drm/drm_gem_vram_helper.c | 3 ++-
>  drivers/gpu/drm/Kconfig               | 1 +
>  3 files changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/include/drm/drm_gem_vram_helper.h b/include/drm/drm_gem_vram_helper.h
> index ac217d768456..17f160dd6e7d 100644
> --- a/include/drm/drm_gem_vram_helper.h
> +++ b/include/drm/drm_gem_vram_helper.h
> @@ -4,6 +4,7 @@
>  #define DRM_GEM_VRAM_HELPER_H
>  
>  #include <drm/drm_gem.h>
> +#include <drm/drm_gem_ttm_helper.h>

Why is this include statement in the header file instead of the source file?

>  #include <drm/ttm/ttm_bo_api.h>
>  #include <drm/ttm/ttm_placement.h>
>  #include <linux/kernel.h> /* for container_of() */
> diff --git a/drivers/gpu/drm/drm_gem_vram_helper.c b/drivers/gpu/drm/drm_gem_vram_helper.c
> index fd751078bae1..b4929e1fb190 100644
> --- a/drivers/gpu/drm/drm_gem_vram_helper.c
> +++ b/drivers/gpu/drm/drm_gem_vram_helper.c
> @@ -633,5 +633,6 @@ static const struct drm_gem_object_funcs drm_gem_vram_object_funcs = {
>  	.pin	= drm_gem_vram_object_pin,
>  	.unpin	= drm_gem_vram_object_unpin,
>  	.vmap	= drm_gem_vram_object_vmap,
> -	.vunmap	= drm_gem_vram_object_vunmap
> +	.vunmap	= drm_gem_vram_object_vunmap,
> +	.print_info = drm_gem_ttm_print_info,
>  };
> diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
> index f7b25519f95c..1be8ad30d8fe 100644
> --- a/drivers/gpu/drm/Kconfig
> +++ b/drivers/gpu/drm/Kconfig
> @@ -169,6 +169,7 @@ config DRM_VRAM_HELPER
>  	tristate
>  	depends on DRM
>  	select DRM_TTM
> +	select DRM_TTM_HELPER

I thought that VRAM helpers already depend on TTM helpers. If so, this
line should rather be a separate patch with a Fixes tag to the patch
that introduced the dependency.

With these points addressed:

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

Best regards
Thomas

>  	help
>  	  Helpers for VRAM memory management
>  
>
Gerd Hoffmann Sept. 3, 2019, 6:17 a.m. UTC | #2
Hi,

> > @@ -169,6 +169,7 @@ config DRM_VRAM_HELPER
> >  	tristate
> >  	depends on DRM
> >  	select DRM_TTM
> > +	select DRM_TTM_HELPER
> 
> I thought that VRAM helpers already depend on TTM helpers.

No, they don't.  Patch #1 adds them ;)

cheers,
  Gerd
diff mbox series

Patch

diff --git a/include/drm/drm_gem_vram_helper.h b/include/drm/drm_gem_vram_helper.h
index ac217d768456..17f160dd6e7d 100644
--- a/include/drm/drm_gem_vram_helper.h
+++ b/include/drm/drm_gem_vram_helper.h
@@ -4,6 +4,7 @@ 
 #define DRM_GEM_VRAM_HELPER_H
 
 #include <drm/drm_gem.h>
+#include <drm/drm_gem_ttm_helper.h>
 #include <drm/ttm/ttm_bo_api.h>
 #include <drm/ttm/ttm_placement.h>
 #include <linux/kernel.h> /* for container_of() */
diff --git a/drivers/gpu/drm/drm_gem_vram_helper.c b/drivers/gpu/drm/drm_gem_vram_helper.c
index fd751078bae1..b4929e1fb190 100644
--- a/drivers/gpu/drm/drm_gem_vram_helper.c
+++ b/drivers/gpu/drm/drm_gem_vram_helper.c
@@ -633,5 +633,6 @@  static const struct drm_gem_object_funcs drm_gem_vram_object_funcs = {
 	.pin	= drm_gem_vram_object_pin,
 	.unpin	= drm_gem_vram_object_unpin,
 	.vmap	= drm_gem_vram_object_vmap,
-	.vunmap	= drm_gem_vram_object_vunmap
+	.vunmap	= drm_gem_vram_object_vunmap,
+	.print_info = drm_gem_ttm_print_info,
 };
diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index f7b25519f95c..1be8ad30d8fe 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -169,6 +169,7 @@  config DRM_VRAM_HELPER
 	tristate
 	depends on DRM
 	select DRM_TTM
+	select DRM_TTM_HELPER
 	help
 	  Helpers for VRAM memory management