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