1
2
3
4
5
6
7
8
9
10
11
12
13
14#ifndef _MTK_DRM_GEM_H_
15#define _MTK_DRM_GEM_H_
16
17#include <drm/drm_gem.h>
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33struct mtk_drm_gem_obj {
34 struct drm_gem_object base;
35 void *cookie;
36 void *kvaddr;
37 dma_addr_t dma_addr;
38 unsigned long dma_attrs;
39 struct sg_table *sg;
40};
41
42#define to_mtk_gem_obj(x) container_of(x, struct mtk_drm_gem_obj, base)
43
44void mtk_drm_gem_free_object(struct drm_gem_object *gem);
45struct mtk_drm_gem_obj *mtk_drm_gem_create(struct drm_device *dev, size_t size,
46 bool alloc_kmap);
47int mtk_drm_gem_dumb_create(struct drm_file *file_priv, struct drm_device *dev,
48 struct drm_mode_create_dumb *args);
49int mtk_drm_gem_mmap(struct file *filp, struct vm_area_struct *vma);
50int mtk_drm_gem_mmap_buf(struct drm_gem_object *obj,
51 struct vm_area_struct *vma);
52struct sg_table *mtk_gem_prime_get_sg_table(struct drm_gem_object *obj);
53struct drm_gem_object *mtk_gem_prime_import_sg_table(struct drm_device *dev,
54 struct dma_buf_attachment *attach, struct sg_table *sg);
55
56#endif
57