mm: fix calculation of dirtyable memory
[linux/fpc-iii.git] / include / drm / drm_gem_cma_helper.h
blobf0f6b1af25adf7b108e89160d9eb651c2b777ff9
1 #ifndef __DRM_GEM_CMA_HELPER_H__
2 #define __DRM_GEM_CMA_HELPER_H__
4 struct drm_gem_cma_object {
5 struct drm_gem_object base;
6 dma_addr_t paddr;
7 void *vaddr;
8 };
10 static inline struct drm_gem_cma_object *
11 to_drm_gem_cma_obj(struct drm_gem_object *gem_obj)
13 return container_of(gem_obj, struct drm_gem_cma_object, base);
16 /* free gem object. */
17 void drm_gem_cma_free_object(struct drm_gem_object *gem_obj);
19 /* create memory region for drm framebuffer. */
20 int drm_gem_cma_dumb_create(struct drm_file *file_priv,
21 struct drm_device *drm, struct drm_mode_create_dumb *args);
23 /* map memory region for drm framebuffer to user space. */
24 int drm_gem_cma_dumb_map_offset(struct drm_file *file_priv,
25 struct drm_device *drm, uint32_t handle, uint64_t *offset);
27 /* set vm_flags and we can change the vm attribute to other one at here. */
28 int drm_gem_cma_mmap(struct file *filp, struct vm_area_struct *vma);
31 * destroy memory region allocated.
32 * - a gem handle and physical memory region pointed by a gem object
33 * would be released by drm_gem_handle_delete().
35 int drm_gem_cma_dumb_destroy(struct drm_file *file_priv,
36 struct drm_device *drm, unsigned int handle);
38 /* allocate physical memory. */
39 struct drm_gem_cma_object *drm_gem_cma_create(struct drm_device *drm,
40 unsigned int size);
42 extern const struct vm_operations_struct drm_gem_cma_vm_ops;
44 #endif /* __DRM_GEM_CMA_HELPER_H__ */