xref: /aosp_15_r20/external/libdrm/radeon/radeon_bo_int.h (revision 7688df22e49036ff52a766b7101da3a49edadb8c)
1*7688df22SAndroid Build Coastguard Worker #ifndef RADEON_BO_INT
2*7688df22SAndroid Build Coastguard Worker #define RADEON_BO_INT
3*7688df22SAndroid Build Coastguard Worker 
4*7688df22SAndroid Build Coastguard Worker struct radeon_bo_manager {
5*7688df22SAndroid Build Coastguard Worker     const struct radeon_bo_funcs *funcs;
6*7688df22SAndroid Build Coastguard Worker     int                     fd;
7*7688df22SAndroid Build Coastguard Worker };
8*7688df22SAndroid Build Coastguard Worker 
9*7688df22SAndroid Build Coastguard Worker struct radeon_bo_int {
10*7688df22SAndroid Build Coastguard Worker     void                        *ptr;
11*7688df22SAndroid Build Coastguard Worker     uint32_t                    flags;
12*7688df22SAndroid Build Coastguard Worker     uint32_t                    handle;
13*7688df22SAndroid Build Coastguard Worker     uint32_t                    size;
14*7688df22SAndroid Build Coastguard Worker     /* private members */
15*7688df22SAndroid Build Coastguard Worker     uint32_t                    alignment;
16*7688df22SAndroid Build Coastguard Worker     uint32_t                    domains;
17*7688df22SAndroid Build Coastguard Worker     unsigned                    cref;
18*7688df22SAndroid Build Coastguard Worker     struct radeon_bo_manager    *bom;
19*7688df22SAndroid Build Coastguard Worker     uint32_t                    space_accounted;
20*7688df22SAndroid Build Coastguard Worker     uint32_t                    referenced_in_cs;
21*7688df22SAndroid Build Coastguard Worker };
22*7688df22SAndroid Build Coastguard Worker 
23*7688df22SAndroid Build Coastguard Worker /* bo functions */
24*7688df22SAndroid Build Coastguard Worker struct radeon_bo_funcs {
25*7688df22SAndroid Build Coastguard Worker     struct radeon_bo *(*bo_open)(struct radeon_bo_manager *bom,
26*7688df22SAndroid Build Coastguard Worker                                  uint32_t handle,
27*7688df22SAndroid Build Coastguard Worker                                  uint32_t size,
28*7688df22SAndroid Build Coastguard Worker                                  uint32_t alignment,
29*7688df22SAndroid Build Coastguard Worker                                  uint32_t domains,
30*7688df22SAndroid Build Coastguard Worker                                  uint32_t flags);
31*7688df22SAndroid Build Coastguard Worker     void (*bo_ref)(struct radeon_bo_int *bo);
32*7688df22SAndroid Build Coastguard Worker     struct radeon_bo *(*bo_unref)(struct radeon_bo_int *bo);
33*7688df22SAndroid Build Coastguard Worker     int (*bo_map)(struct radeon_bo_int *bo, int write);
34*7688df22SAndroid Build Coastguard Worker     int (*bo_unmap)(struct radeon_bo_int *bo);
35*7688df22SAndroid Build Coastguard Worker     int (*bo_wait)(struct radeon_bo_int *bo);
36*7688df22SAndroid Build Coastguard Worker     int (*bo_is_static)(struct radeon_bo_int *bo);
37*7688df22SAndroid Build Coastguard Worker     int (*bo_set_tiling)(struct radeon_bo_int *bo, uint32_t tiling_flags,
38*7688df22SAndroid Build Coastguard Worker                          uint32_t pitch);
39*7688df22SAndroid Build Coastguard Worker     int (*bo_get_tiling)(struct radeon_bo_int *bo, uint32_t *tiling_flags,
40*7688df22SAndroid Build Coastguard Worker                          uint32_t *pitch);
41*7688df22SAndroid Build Coastguard Worker     int (*bo_is_busy)(struct radeon_bo_int *bo, uint32_t *domain);
42*7688df22SAndroid Build Coastguard Worker     int (*bo_is_referenced_by_cs)(struct radeon_bo_int *bo, struct radeon_cs *cs);
43*7688df22SAndroid Build Coastguard Worker };
44*7688df22SAndroid Build Coastguard Worker 
45*7688df22SAndroid Build Coastguard Worker #endif
46