From 6ccab620a0e7364ab6c0d902b3ddf58ee988f7fa Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Thu, 23 Dec 2010 19:40:54 +1000 Subject: r300g: import the last bits of libdrm and cleanup the whole thing Based on Dave's branch. The majority of this commit is a cleanup, mainly renaming things. There wasn't much code to import, just ioctl calls. Also done: - implemented unsynchronized bo_map (important optimization!) - radeon_bo_is_referenced_by_cs is no longer a refcount hack - dropped the libdrm_radeon dependency I'm surprised that this has resulted in less code in the end. --- src/gallium/winsys/radeon/drm/radeon_drm_cs.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/gallium/winsys/radeon/drm/radeon_drm_cs.h') diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_cs.h b/src/gallium/winsys/radeon/drm/radeon_drm_cs.h index 76046534b6..3913c4e79a 100644 --- a/src/gallium/winsys/radeon/drm/radeon_drm_cs.h +++ b/src/gallium/winsys/radeon/drm/radeon_drm_cs.h @@ -1,7 +1,7 @@ #ifndef RADEON_DRM_CS_H #define RADEON_DRM_CS_H -#include "radeon_winsys.h" +#include "radeon_drm_bo.h" #include struct radeon_drm_cs { @@ -31,12 +31,25 @@ struct radeon_drm_cs { unsigned reloc_indices_hashlist[256]; }; +int radeon_get_reloc(struct radeon_drm_cs *cs, struct radeon_bo *bo); + static INLINE struct radeon_drm_cs * radeon_drm_cs(struct r300_winsys_cs *base) { return (struct radeon_drm_cs*)base; } +static INLINE int radeon_bo_is_referenced_by_cs(struct radeon_drm_cs *cs, + struct radeon_bo *bo) +{ + return radeon_get_reloc(cs, bo) != -1; +} + +static INLINE int radeon_bo_is_referenced_by_any_cs(struct radeon_bo *bo) +{ + return bo->cref > 1; +} + void radeon_drm_cs_init_functions(struct radeon_drm_winsys *ws); #endif -- cgit v1.2.3