-
Notifications
You must be signed in to change notification settings - Fork 0
/
armada_bufmgr.h
52 lines (41 loc) · 1.5 KB
/
armada_bufmgr.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef DRM_ARMADA_GEM_H
#define DRM_ARMADA_GEM_H
#include <stdint.h>
enum drm_armada_bo_type {
DRM_ARMADA_BO_DUMB,
DRM_ARMADA_BO_LINEAR,
DRM_ARMADA_BO_SHMEM
};
struct drm_armada_bufmgr;
struct drm_armada_bo {
uint32_t ref;
uint32_t handle;
uint32_t size;
uint32_t pitch;
void *ptr;
enum drm_armada_bo_type type;
};
int drm_armada_cache_reap(struct drm_armada_bufmgr *mgr);
int drm_armada_init(int fd, struct drm_armada_bufmgr **mgr);
void drm_armada_fini(struct drm_armada_bufmgr *);
struct drm_armada_bo *drm_armada_bo_create(struct drm_armada_bufmgr *,
unsigned w, unsigned h, unsigned bpp);
struct drm_armada_bo *drm_armada_bo_create_size(struct drm_armada_bufmgr *,
size_t);
struct drm_armada_bo *drm_armada_bo_dumb_create(struct drm_armada_bufmgr *,
unsigned w, unsigned h, unsigned bpp);
/* Create a BO from a global name */
struct drm_armada_bo *drm_armada_bo_create_from_name(struct drm_armada_bufmgr *,
uint32_t name);
/* Create a global name from a BO */
int drm_armada_bo_flink(struct drm_armada_bo *bo, uint32_t *name);
/* Create a dmabuf fd for the BO */
int drm_armada_bo_to_fd(struct drm_armada_bo *bo, int *fd);
struct drm_armada_bo *drm_armada_bo_from_fd(struct drm_armada_bufmgr *mgr,
int prime_fd);
int drm_armada_bo_map(struct drm_armada_bo *bo);
void drm_armada_bo_get(struct drm_armada_bo *bo);
void drm_armada_bo_put(struct drm_armada_bo *bo);
int drm_armada_bo_subdata(struct drm_armada_bo *bo, unsigned long offset,
unsigned long size, const void *data);
#endif