diff options
author | Kristian Høgsberg <krh@bitplanet.net> | 2009-11-20 17:09:03 -0500 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2009-11-20 17:09:03 -0500 |
commit | 10ce0ec18806ae32a5d615c693626a085b0dd7b8 (patch) | |
tree | 0511e492b1235ef8d45cb7997035421c409a26b5 /radeon/radeon_bo.h | |
parent | 1b064cc428f03f753699d4d9fbe60453891a8529 (diff) | |
parent | b4312b639d56a6cad78953af0fd4f863182007e3 (diff) |
Merge remote branch 'origin/master' into libdrm
Diffstat (limited to 'radeon/radeon_bo.h')
-rw-r--r-- | radeon/radeon_bo.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/radeon/radeon_bo.h b/radeon/radeon_bo.h index 1e2e6c20..72d35200 100644 --- a/radeon/radeon_bo.h +++ b/radeon/radeon_bo.h @@ -39,6 +39,7 @@ #define RADEON_BO_FLAGS_MICRO_TILE 2 struct radeon_bo_manager; +struct radeon_cs; struct radeon_bo { uint32_t alignment; @@ -53,6 +54,7 @@ struct radeon_bo { void *ptr; struct radeon_bo_manager *bom; uint32_t space_accounted; + uint32_t referenced_in_cs; }; /* bo functions */ @@ -74,6 +76,7 @@ struct radeon_bo_funcs { int (*bo_get_tiling)(struct radeon_bo *bo, uint32_t *tiling_flags, uint32_t *pitch); int (*bo_is_busy)(struct radeon_bo *bo, uint32_t *domain); + int (*bo_is_referenced_by_cs)(struct radeon_bo *bo, struct radeon_cs *cs); }; struct radeon_bo_manager { @@ -195,6 +198,15 @@ static inline int radeon_bo_is_static(struct radeon_bo *bo) return 0; } +static inline int _radeon_bo_is_referenced_by_cs(struct radeon_bo *bo, + struct radeon_cs *cs, + const char *file, + const char *func, + unsigned line) +{ + return bo->cref > 1; +} + #define radeon_bo_open(bom, h, s, a, d, f)\ _radeon_bo_open(bom, h, s, a, d, f, __FILE__, __FUNCTION__, __LINE__) #define radeon_bo_ref(bo)\ @@ -211,5 +223,7 @@ static inline int radeon_bo_is_static(struct radeon_bo *bo) _radeon_bo_wait(bo, __FILE__, __func__, __LINE__) #define radeon_bo_is_busy(bo, domain) \ _radeon_bo_is_busy(bo, domain, __FILE__, __func__, __LINE__) +#define radeon_bo_is_referenced_by_cs(bo, cs) \ + _radeon_bo_is_referenced_by_cs(bo, cs, __FILE__, __FUNCTION__, __LINE__) #endif |