aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys/radeon/drm/radeon_drm_cs.h
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2010-12-23 19:40:54 +1000
committerMarek Olšák <[email protected]>2011-02-11 01:07:25 +0100
commit6ccab620a0e7364ab6c0d902b3ddf58ee988f7fa (patch)
tree6228427e261efd6187915ab651b78f99d3ff7dd1 /src/gallium/winsys/radeon/drm/radeon_drm_cs.h
parentc0beaf6e6d5764531a4cb21d0d0a9a1fd09affee (diff)
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.
Diffstat (limited to 'src/gallium/winsys/radeon/drm/radeon_drm_cs.h')
-rw-r--r--src/gallium/winsys/radeon/drm/radeon_drm_cs.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_cs.h b/src/gallium/winsys/radeon/drm/radeon_drm_cs.h
index 76046534b65..3913c4e79a3 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 <radeon_drm.h>
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