diff options
Diffstat (limited to 'dove_bufmgr.h')
-rw-r--r-- | dove_bufmgr.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/dove_bufmgr.h b/dove_bufmgr.h new file mode 100644 index 0000000..701e128 --- /dev/null +++ b/dove_bufmgr.h @@ -0,0 +1,31 @@ +#ifndef DRM_DOVE_GEM_H +#define DRM_DOVE_GEM_H + +enum drm_dove_bo_type { + DRM_DOVE_BO_DUMB, + DRM_DOVE_BO_LINEAR, + DRM_DOVE_BO_SHMEM +}; + +struct drm_dove_bo { + uint32_t ref; + uint32_t handle; + uint32_t size; + uint32_t pitch; + uint32_t phys; + void *ptr; + enum drm_dove_bo_type type; +}; + +struct drm_dove_bo *drm_dove_bo_create(int fd, unsigned w, unsigned h, unsigned bpp); +struct drm_dove_bo *drm_dove_bo_create_phys(int fd, uint32_t phys, size_t size); +struct drm_dove_bo *drm_dove_bo_dumb_create(int fd, unsigned w, unsigned h, + unsigned bpp); +int drm_dove_bo_map(int fd, struct drm_dove_bo *bo); +uint32_t drm_dove_bo_phys(int fd, struct drm_dove_bo *bo); +void drm_dove_bo_get(int fd, struct drm_dove_bo *bo); +void drm_dove_bo_put(int fd, struct drm_dove_bo *bo); +int drm_dove_bo_subdata(int fd, struct drm_dove_bo *bo, unsigned long offset, + unsigned long size, const void *data); + +#endif |