diff options
Diffstat (limited to 'include/drm/drm_gem_cma_helper.h')
-rw-r--r-- | include/drm/drm_gem_cma_helper.h | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/include/drm/drm_gem_cma_helper.h b/include/drm/drm_gem_cma_helper.h index 2ff35f3de9c5..acd6af8a8e67 100644 --- a/include/drm/drm_gem_cma_helper.h +++ b/include/drm/drm_gem_cma_helper.h | |||
@@ -4,6 +4,13 @@ | |||
4 | #include <drm/drmP.h> | 4 | #include <drm/drmP.h> |
5 | #include <drm/drm_gem.h> | 5 | #include <drm/drm_gem.h> |
6 | 6 | ||
7 | /** | ||
8 | * struct drm_gem_cma_object - GEM object backed by CMA memory allocations | ||
9 | * @base: base GEM object | ||
10 | * @paddr: physical address of the backing memory | ||
11 | * @sgt: scatter/gather table for imported PRIME buffers | ||
12 | * @vaddr: kernel virtual address of the backing memory | ||
13 | */ | ||
7 | struct drm_gem_cma_object { | 14 | struct drm_gem_cma_object { |
8 | struct drm_gem_object base; | 15 | struct drm_gem_object base; |
9 | dma_addr_t paddr; | 16 | dma_addr_t paddr; |
@@ -19,23 +26,30 @@ to_drm_gem_cma_obj(struct drm_gem_object *gem_obj) | |||
19 | return container_of(gem_obj, struct drm_gem_cma_object, base); | 26 | return container_of(gem_obj, struct drm_gem_cma_object, base); |
20 | } | 27 | } |
21 | 28 | ||
22 | /* free gem object. */ | 29 | /* free GEM object */ |
23 | void drm_gem_cma_free_object(struct drm_gem_object *gem_obj); | 30 | void drm_gem_cma_free_object(struct drm_gem_object *gem_obj); |
24 | 31 | ||
25 | /* create memory region for drm framebuffer. */ | 32 | /* create memory region for DRM framebuffer */ |
33 | int drm_gem_cma_dumb_create_internal(struct drm_file *file_priv, | ||
34 | struct drm_device *drm, | ||
35 | struct drm_mode_create_dumb *args); | ||
36 | |||
37 | /* create memory region for DRM framebuffer */ | ||
26 | int drm_gem_cma_dumb_create(struct drm_file *file_priv, | 38 | int drm_gem_cma_dumb_create(struct drm_file *file_priv, |
27 | struct drm_device *drm, struct drm_mode_create_dumb *args); | 39 | struct drm_device *drm, |
40 | struct drm_mode_create_dumb *args); | ||
28 | 41 | ||
29 | /* map memory region for drm framebuffer to user space. */ | 42 | /* map memory region for DRM framebuffer to user space */ |
30 | int drm_gem_cma_dumb_map_offset(struct drm_file *file_priv, | 43 | int drm_gem_cma_dumb_map_offset(struct drm_file *file_priv, |
31 | struct drm_device *drm, uint32_t handle, uint64_t *offset); | 44 | struct drm_device *drm, u32 handle, |
45 | u64 *offset); | ||
32 | 46 | ||
33 | /* set vm_flags and we can change the vm attribute to other one at here. */ | 47 | /* set vm_flags and we can change the VM attribute to other one at here */ |
34 | int drm_gem_cma_mmap(struct file *filp, struct vm_area_struct *vma); | 48 | int drm_gem_cma_mmap(struct file *filp, struct vm_area_struct *vma); |
35 | 49 | ||
36 | /* allocate physical memory. */ | 50 | /* allocate physical memory */ |
37 | struct drm_gem_cma_object *drm_gem_cma_create(struct drm_device *drm, | 51 | struct drm_gem_cma_object *drm_gem_cma_create(struct drm_device *drm, |
38 | unsigned int size); | 52 | size_t size); |
39 | 53 | ||
40 | extern const struct vm_operations_struct drm_gem_cma_vm_ops; | 54 | extern const struct vm_operations_struct drm_gem_cma_vm_ops; |
41 | 55 | ||