1
2
3
4
5
6
7
8
9
10
11
12
13
14
15#ifndef _ROCKCHIP_DRM_GEM_H
16#define _ROCKCHIP_DRM_GEM_H
17
18#define to_rockchip_obj(x) container_of(x, struct rockchip_gem_object, base)
19
20struct rockchip_gem_object {
21 struct drm_gem_object base;
22 unsigned int flags;
23
24 void *kvaddr;
25 dma_addr_t dma_addr;
26
27 unsigned long dma_attrs;
28
29
30 struct drm_mm_node mm;
31 unsigned long num_pages;
32 struct page **pages;
33 struct sg_table *sgt;
34 size_t size;
35};
36
37struct sg_table *rockchip_gem_prime_get_sg_table(struct drm_gem_object *obj);
38struct drm_gem_object *
39rockchip_gem_prime_import_sg_table(struct drm_device *dev,
40 struct dma_buf_attachment *attach,
41 struct sg_table *sg);
42void *rockchip_gem_prime_vmap(struct drm_gem_object *obj);
43void rockchip_gem_prime_vunmap(struct drm_gem_object *obj, void *vaddr);
44
45
46int rockchip_gem_mmap(struct file *filp, struct vm_area_struct *vma);
47
48
49int rockchip_gem_mmap_buf(struct drm_gem_object *obj,
50 struct vm_area_struct *vma);
51
52struct rockchip_gem_object *
53 rockchip_gem_create_object(struct drm_device *drm, unsigned int size,
54 bool alloc_kmap);
55
56void rockchip_gem_free_object(struct drm_gem_object *obj);
57
58int rockchip_gem_dumb_create(struct drm_file *file_priv,
59 struct drm_device *dev,
60 struct drm_mode_create_dumb *args);
61#endif
62