diff options
author | Jakob Bornecrantz <wallbraker@gmail.com> | 2009-01-05 11:44:56 +0100 |
---|---|---|
committer | Jakob Bornecrantz <wallbraker@gmail.com> | 2009-01-14 12:28:31 +0100 |
commit | 529f86fb113529d1ecf113dc45efade7fe185f94 (patch) | |
tree | b17f5bd7519c7e1d861023ca65b7df4d1ab43899 /src/gallium/winsys/drm/intel/gem/intel_be_fence.h | |
parent | f6d09531ff1588ea18048a842ab24338ae4bc5a7 (diff) |
intel: Add a none working GEM backend for intel
Diffstat (limited to 'src/gallium/winsys/drm/intel/gem/intel_be_fence.h')
-rw-r--r-- | src/gallium/winsys/drm/intel/gem/intel_be_fence.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/gallium/winsys/drm/intel/gem/intel_be_fence.h b/src/gallium/winsys/drm/intel/gem/intel_be_fence.h new file mode 100644 index 0000000000..0fe18f66f8 --- /dev/null +++ b/src/gallium/winsys/drm/intel/gem/intel_be_fence.h @@ -0,0 +1,38 @@ + +#ifndef INTEL_BE_FENCE_H +#define INTEL_BE_FENCE_H + +#include "pipe/p_defines.h" + +#include "drm.h" +#include "intel_bufmgr.h" + +/** + * Because gem does not have fence's we have to create our own fences. + * + * They work by keeping the batchbuffer around and checking if that has + * been idled. If bo is NULL fence has expired. + */ +struct intel_be_fence +{ + uint32_t refcount; + drm_intel_bo *bo; +}; + +static INLINE void +intel_be_fence_reference(struct intel_be_fence *f) +{ + f->refcount++; +} + +static INLINE void +intel_be_fence_unreference(struct intel_be_fence *f) +{ + if (!--f->refcount) { + if (f->bo) + drm_intel_bo_unreference(f->bo); + free(f); + } +} + +#endif |