summaryrefslogtreecommitdiff
path: root/include/drm/drm_gem_ttm_helper.h
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2019-09-04 07:47:35 +0200
committerGerd Hoffmann <kraxel@redhat.com>2019-09-10 08:53:08 +0200
commitff540b76f14ac9922eb91894ebc1fab335e8be7e (patch)
treeb6c7eb4101338baef157384b990f9c0199f16219 /include/drm/drm_gem_ttm_helper.h
parent2dc5d44ccc5e7f032dbea2735b243f7f50ff863e (diff)
drm/ttm: add drm gem ttm helpers, starting with drm_gem_ttm_print_info()
Now with ttm_buffer_object being a subclass of drm_gem_object we can easily lookup ttm_buffer_object for a given drm_gem_object, which in turn allows to create common helper functions. This patch starts off with a drm_gem_ttm_print_info() helper function which adds some ttm specific lines to the debug output. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/20190904054740.20817-3-kraxel@redhat.com
Diffstat (limited to 'include/drm/drm_gem_ttm_helper.h')
-rw-r--r--include/drm/drm_gem_ttm_helper.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/drm/drm_gem_ttm_helper.h b/include/drm/drm_gem_ttm_helper.h
new file mode 100644
index 000000000000..6268f89c5a48
--- /dev/null
+++ b/include/drm/drm_gem_ttm_helper.h
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#ifndef DRM_GEM_TTM_HELPER_H
+#define DRM_GEM_TTM_HELPER_H
+
+#include <linux/kernel.h>
+
+#include <drm/drm_gem.h>
+#include <drm/drm_device.h>
+#include <drm/ttm/ttm_bo_api.h>
+#include <drm/ttm/ttm_bo_driver.h>
+
+#define drm_gem_ttm_of_gem(gem_obj) \
+ container_of(gem_obj, struct ttm_buffer_object, base)
+
+void drm_gem_ttm_print_info(struct drm_printer *p, unsigned int indent,
+ const struct drm_gem_object *gem);
+
+#endif