2019-09-04 13:47:35 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
|
|
|
|
#ifndef DRM_GEM_TTM_HELPER_H
|
|
|
|
#define DRM_GEM_TTM_HELPER_H
|
|
|
|
|
2021-11-10 18:24:23 +08:00
|
|
|
#include <linux/container_of.h>
|
2019-09-04 13:47:35 +08:00
|
|
|
|
|
|
|
#include <drm/drm_device.h>
|
2021-04-08 22:01:36 +08:00
|
|
|
#include <drm/drm_gem.h>
|
2022-05-10 03:13:35 +08:00
|
|
|
#include <drm/ttm/ttm_bo.h>
|
2019-09-04 13:47:35 +08:00
|
|
|
|
2022-02-05 01:05:41 +08:00
|
|
|
struct iosys_map;
|
2020-11-03 17:30:10 +08:00
|
|
|
|
2019-09-04 13:47:35 +08:00
|
|
|
#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);
|
2020-11-03 17:30:10 +08:00
|
|
|
int drm_gem_ttm_vmap(struct drm_gem_object *gem,
|
2022-02-05 01:05:41 +08:00
|
|
|
struct iosys_map *map);
|
2020-11-03 17:30:10 +08:00
|
|
|
void drm_gem_ttm_vunmap(struct drm_gem_object *gem,
|
2022-02-05 01:05:41 +08:00
|
|
|
struct iosys_map *map);
|
2019-10-16 19:52:00 +08:00
|
|
|
int drm_gem_ttm_mmap(struct drm_gem_object *gem,
|
|
|
|
struct vm_area_struct *vma);
|
2019-09-04 13:47:35 +08:00
|
|
|
|
2021-04-08 22:01:36 +08:00
|
|
|
int drm_gem_ttm_dumb_map_offset(struct drm_file *file, struct drm_device *dev,
|
|
|
|
uint32_t handle, uint64_t *offset);
|
|
|
|
|
2019-09-04 13:47:35 +08:00
|
|
|
#endif
|