blob: 7c6d874910b89b358d953d17987430baa7770132 [file] [log] [blame]
Gerd Hoffmannff540b72019-09-04 07:47:35 +02001/* SPDX-License-Identifier: GPL-2.0-or-later */
2
3#ifndef DRM_GEM_TTM_HELPER_H
4#define DRM_GEM_TTM_HELPER_H
5
6#include <linux/kernel.h>
7
8#include <drm/drm_gem.h>
9#include <drm/drm_device.h>
10#include <drm/ttm/ttm_bo_api.h>
11#include <drm/ttm/ttm_bo_driver.h>
12
Thomas Zimmermann43676602020-11-03 10:30:10 +010013struct dma_buf_map;
14
Gerd Hoffmannff540b72019-09-04 07:47:35 +020015#define drm_gem_ttm_of_gem(gem_obj) \
16 container_of(gem_obj, struct ttm_buffer_object, base)
17
18void drm_gem_ttm_print_info(struct drm_printer *p, unsigned int indent,
19 const struct drm_gem_object *gem);
Thomas Zimmermann43676602020-11-03 10:30:10 +010020int drm_gem_ttm_vmap(struct drm_gem_object *gem,
21 struct dma_buf_map *map);
22void drm_gem_ttm_vunmap(struct drm_gem_object *gem,
23 struct dma_buf_map *map);
Gerd Hoffmann231927d2019-10-16 13:52:00 +020024int drm_gem_ttm_mmap(struct drm_gem_object *gem,
25 struct vm_area_struct *vma);
Gerd Hoffmannff540b72019-09-04 07:47:35 +020026
27#endif