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
This commit is contained in:
19
include/drm/drm_gem_ttm_helper.h
Normal file
19
include/drm/drm_gem_ttm_helper.h
Normal file
@@ -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
|
Reference in New Issue
Block a user