aboutsummaryrefslogtreecommitdiff
path: root/libdrm/intel/intel_bufmgr.h
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2008-09-05 10:35:32 +0100
committerEric Anholt <eric@anholt.net>2008-09-10 14:07:18 -0700
commit738e36acbce24df0ccadb499c5cf62ccb74f56df (patch)
tree271da736d94c1ec99cdf7ae1428aa5d804ddce7c /libdrm/intel/intel_bufmgr.h
parent09cf0f0213652609d09154ce2859c03cf97ab11e (diff)
Move intel libdrm stuff to libdrm_intel.so
dri_bufmgr.h is replaced by intel_bufmgr.h, and several functions are renamed, though the structures and many functions remain dri_bufmgr_* and dri_bo_*
Diffstat (limited to 'libdrm/intel/intel_bufmgr.h')
-rw-r--r--libdrm/intel/intel_bufmgr.h114
1 files changed, 51 insertions, 63 deletions
diff --git a/libdrm/intel/intel_bufmgr.h b/libdrm/intel/intel_bufmgr.h
index 4d335210..0b473f3b 100644
--- a/libdrm/intel/intel_bufmgr.h
+++ b/libdrm/intel/intel_bufmgr.h
@@ -31,65 +31,65 @@
* Public definitions of Intel-specific bufmgr functions.
*/
-#ifndef INTEL_BUFMGR_GEM_H
-#define INTEL_BUFMGR_GEM_H
+#ifndef INTEL_BUFMGR_H
+#define INTEL_BUFMGR_H
-#include "dri_bufmgr.h"
+#include <stdint.h>
-/**
- * Intel-specific bufmgr bits that follow immediately after the
- * generic bufmgr structure.
- */
-struct intel_bufmgr {
- /**
- * Add relocation entry in reloc_buf, which will be updated with the
- * target buffer's real offset on on command submission.
- *
- * Relocations remain in place for the lifetime of the buffer object.
- *
- * \param reloc_buf Buffer to write the relocation into.
- * \param read_domains GEM read domains which the buffer will be read into
- * by the command that this relocation is part of.
- * \param write_domains GEM read domains which the buffer will be dirtied
- * in by the command that this relocation is part of.
- * \param delta Constant value to be added to the relocation target's
- * offset.
- * \param offset Byte offset within batch_buf of the relocated pointer.
- * \param target Buffer whose offset should be written into the relocation
- * entry.
- */
- int (*emit_reloc)(dri_bo *reloc_buf,
- uint32_t read_domains, uint32_t write_domain,
- uint32_t delta, uint32_t offset, dri_bo *target);
- /**
- * Pin a buffer to the aperture and fix the offset until unpinned
- *
- * \param buf Buffer to pin
- * \param alignment Required alignment for aperture, in bytes
- */
- int (*pin) (dri_bo *buf, uint32_t alignment);
+typedef struct _dri_bufmgr dri_bufmgr;
+typedef struct _dri_bo dri_bo;
+
+struct _dri_bo {
/**
- * Unpin a buffer from the aperture, allowing it to be removed
+ * Size in bytes of the buffer object.
*
- * \param buf Buffer to unpin
+ * The size may be larger than the size originally requested for the
+ * allocation, such as being aligned to page size.
*/
- int (*unpin) (dri_bo *buf);
+ unsigned long size;
/**
- * Ask that the buffer be placed in tiling mode
- *
- * \param buf Buffer to set tiling mode for
- * \param tiling_mode desired, and returned tiling mode
+ * Card virtual address (offset from the beginning of the aperture) for the
+ * object. Only valid while validated.
*/
- int (*set_tiling) (dri_bo *bo, uint32_t *tiling_mode);
+ unsigned long offset;
/**
- * Create a visible name for a buffer which can be used by other apps
- *
- * \param buf Buffer to create a name for
- * \param name Returned name
+ * Virtual address for accessing the buffer data. Only valid while mapped.
*/
- int (*flink) (dri_bo *buf, uint32_t *name);
+ void *virtual;
+
+ /** Buffer manager context associated with this buffer object */
+ dri_bufmgr *bufmgr;
};
+dri_bo *dri_bo_alloc(dri_bufmgr *bufmgr, const char *name, unsigned long size,
+ unsigned int alignment);
+void dri_bo_reference(dri_bo *bo);
+void dri_bo_unreference(dri_bo *bo);
+int dri_bo_map(dri_bo *buf, int write_enable);
+int dri_bo_unmap(dri_bo *buf);
+
+int dri_bo_subdata(dri_bo *bo, unsigned long offset,
+ unsigned long size, const void *data);
+int dri_bo_get_subdata(dri_bo *bo, unsigned long offset,
+ unsigned long size, void *data);
+void dri_bo_wait_rendering(dri_bo *bo);
+
+void dri_bufmgr_set_debug(dri_bufmgr *bufmgr, int enable_debug);
+void dri_bufmgr_destroy(dri_bufmgr *bufmgr);
+
+void *dri_process_relocs(dri_bo *batch_buf);
+void dri_post_process_relocs(dri_bo *batch_buf);
+void dri_post_submit(dri_bo *batch_buf);
+int dri_bufmgr_check_aperture_space(dri_bo **bo_array, int count);
+
+int dri_bo_emit_reloc(dri_bo *reloc_buf,
+ uint32_t read_domains, uint32_t write_domain,
+ uint32_t delta, uint32_t offset, dri_bo *target_buf);
+int dri_bo_pin(dri_bo *buf, uint32_t alignment);
+int dri_bo_unpin(dri_bo *buf);
+int dri_bo_set_tiling(dri_bo *buf, uint32_t *tiling_mode);
+int dri_bo_flink(dri_bo *buf, uint32_t *name);
+
/* intel_bufmgr_gem.c */
dri_bufmgr *intel_bufmgr_gem_init(int fd, int batch_size);
dri_bo *intel_bo_gem_create_from_name(dri_bufmgr *bufmgr, const char *name,
@@ -106,25 +106,13 @@ dri_bufmgr *intel_bufmgr_fake_init(unsigned long low_offset, void *low_virtual,
dri_bo *intel_bo_fake_alloc_static(dri_bufmgr *bufmgr, const char *name,
unsigned long offset, unsigned long size,
void *virtual);
-
-void intel_bufmgr_fake_contended_lock_take(dri_bufmgr *bufmgr);
void intel_bo_fake_disable_backing_store(dri_bo *bo,
void (*invalidate_cb)(dri_bo *bo,
void *ptr),
void *ptr);
-void intel_bufmgr_fake_evict_all(dri_bufmgr *bufmgr);
-
-int intel_bo_emit_reloc(dri_bo *reloc_buf,
- uint32_t read_domains, uint32_t write_domain,
- uint32_t delta, uint32_t offset, dri_bo *target_buf);
-
-int intel_bo_pin(dri_bo *buf, uint32_t alignment);
-
-int intel_bo_unpin(dri_bo *buf);
-int intel_bo_set_tiling(dri_bo *buf, uint32_t *tiling_mode);
-
-int intel_bo_flink(dri_bo *buf, uint32_t *name);
+void intel_bufmgr_fake_contended_lock_take(dri_bufmgr *bufmgr);
+void intel_bufmgr_fake_evict_all(dri_bufmgr *bufmgr);
-#endif /* INTEL_BUFMGR_GEM_H */
+#endif /* INTEL_BUFMGR_H */