diff options
author | Dave Airlie <airlied@redhat.com> | 2009-12-17 14:11:55 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-12-21 08:05:16 +1000 |
commit | 125994ab30d4f0f126c62fa741ec62a52d69d7a8 (patch) | |
tree | e641a13ec8e32c2322ebe1f1480581d58ad815e8 /radeon/radeon_bo_int.h | |
parent | f1660c249198b5cc14ebbb75107da7bcb6972033 (diff) |
radeon: straighten out the API insanity.
as Michel pointed out we are exposing too much info for these object
for this to be maintainable going forward.
This patch set minimises the exposed parts of the radeon_bo and
radeon_cs objects to the piece necessary for ddx/mesa to operate
at a decent speed.
The major problem is mesa contains a legacy BO/CS managers which we still
need to expose functionality to, and we really cannot change the API
until we can drop the non-KMS codepaths.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'radeon/radeon_bo_int.h')
-rw-r--r-- | radeon/radeon_bo_int.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/radeon/radeon_bo_int.h b/radeon/radeon_bo_int.h new file mode 100644 index 00000000..190c3324 --- /dev/null +++ b/radeon/radeon_bo_int.h @@ -0,0 +1,45 @@ +#ifndef RADEON_BO_INT +#define RADEON_BO_INT + +struct radeon_bo_manager { + struct radeon_bo_funcs *funcs; + int fd; +}; + +struct radeon_bo_int { + void *ptr; + uint32_t flags; + uint32_t handle; + uint32_t size; + /* private members */ + uint32_t alignment; + uint32_t domains; + unsigned cref; + struct radeon_bo_manager *bom; + uint32_t space_accounted; + uint32_t referenced_in_cs; +}; + +/* bo functions */ +struct radeon_bo_funcs { + struct radeon_bo *(*bo_open)(struct radeon_bo_manager *bom, + uint32_t handle, + uint32_t size, + uint32_t alignment, + uint32_t domains, + uint32_t flags); + void (*bo_ref)(struct radeon_bo_int *bo); + struct radeon_bo *(*bo_unref)(struct radeon_bo_int *bo); + int (*bo_map)(struct radeon_bo_int *bo, int write); + int (*bo_unmap)(struct radeon_bo_int *bo); + int (*bo_wait)(struct radeon_bo_int *bo); + int (*bo_is_static)(struct radeon_bo_int *bo); + int (*bo_set_tiling)(struct radeon_bo_int *bo, uint32_t tiling_flags, + uint32_t pitch); + int (*bo_get_tiling)(struct radeon_bo_int *bo, uint32_t *tiling_flags, + uint32_t *pitch); + int (*bo_is_busy)(struct radeon_bo_int *bo, uint32_t *domain); + int (*bo_is_referenced_by_cs)(struct radeon_bo_int *bo, struct radeon_cs *cs); +}; + +#endif |