diff options
| -rw-r--r-- | libdrm/radeon/radeon_bo.h | 14 | 
1 files changed, 14 insertions, 0 deletions
| diff --git a/libdrm/radeon/radeon_bo.h b/libdrm/radeon/radeon_bo.h index 1e2e6c20..72d35200 100644 --- a/libdrm/radeon/radeon_bo.h +++ b/libdrm/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 | 
