dri: remove ttm common code since superioctl is device specific
[mesa.git] / src / mesa / drivers / dri / common / dri_bufmgr.h
index 62ed9d38218a7331f5f9800f4a62cca4f108f41f..7dbb558949aff60136b51bcec4d343da842a504c 100644 (file)
@@ -81,25 +81,20 @@ struct _dri_bufmgr {
     * address space or graphics device aperture.  They must be mapped using
     * bo_map() to be used by the CPU, and validated for use using bo_validate()
     * to be used from the graphics device.
-    *
-    * XXX: flags/hint reason to live?
     */
    dri_bo *(*bo_alloc)(dri_bufmgr *bufmgr_ctx, const char *name,
                       unsigned long size, unsigned int alignment,
-                      unsigned int flags, unsigned int hint);
+                      unsigned int location_mask);
 
    /**
     * Allocates a buffer object for a static allocation.
     *
     * Static allocations are ones such as the front buffer that are offered by
     * the X Server, which are never evicted and never moved.
-    *
-    * XXX: flags/hint reason to live?
     */
    dri_bo *(*bo_alloc_static)(dri_bufmgr *bufmgr_ctx, const char *name,
                              unsigned long offset, unsigned long size,
-                             void *virtual, unsigned int flags,
-                             unsigned int hint);
+                             void *virtual, unsigned int location_mask);
 
    /** Takes a reference on a buffer object */
    void (*bo_reference)(dri_bo *bo);
@@ -121,30 +116,6 @@ struct _dri_bufmgr {
    /** Reduces the refcount on the userspace mapping of the buffer object. */
    int (*bo_unmap)(dri_bo *buf);
 
-   /**
-    * Makes the buffer accessible to the graphics chip.
-    *
-    * The resulting offset of the buffer within the graphics aperture is then
-    * available at buf->offset until the buffer is fenced.
-    *
-    * Flags should consist of the memory types that the buffer may be validated
-    * into and the read/write/exe flags appropriate to the use of the buffer.
-    */
-   int (*bo_validate)(dri_bo *buf, unsigned int flags);
-
-   /**
-    * Associates the current set of validated buffers with a fence.
-    *
-    * Once fenced, the buffer manager will allow the validated buffers to be
-    * evicted when the graphics device's execution has passed the fence
-    * command.
-    *
-    * The fence object will have flags for the sum of the read/write/exe flags
-    * of the validated buffers associated with it.
-    */
-   dri_fence * (*fence_validated)(dri_bufmgr *bufmgr, const char *name,
-                                 GLboolean flushed);
-
    /** Takes a reference on a fence object */
    void (*fence_reference)(dri_fence *fence);
 
@@ -160,24 +131,29 @@ struct _dri_bufmgr {
    void (*fence_wait)(dri_fence *fence);
 
    /**
-    * Checks and returns whether the given fence is signaled.
+    * Tears down the buffer manager instance.
+    */
+   void (*destroy)(dri_bufmgr *bufmgr);
+   
+   /**
+    * Add relocation
     */
+   void (*emit_reloc)(dri_bo *batch_buf, GLuint flags, GLuint delta, GLuint offset, dri_bo *relocatee);
+
+  void *(*process_relocs)(dri_bo *batch_buf, GLuint *count);
+
+   void (*post_submit)(dri_bo *batch_buf, dri_fence **fence);
 };
 
 dri_bo *dri_bo_alloc(dri_bufmgr *bufmgr, const char *name, unsigned long size,
-                    unsigned int alignment, unsigned int flags,
-                    unsigned int hint);
+                    unsigned int alignment, unsigned int location_mask);
 dri_bo *dri_bo_alloc_static(dri_bufmgr *bufmgr, const char *name,
                            unsigned long offset, unsigned long size,
-                           void *virtual, unsigned int flags,
-                           unsigned int hint);
+                           void *virtual, unsigned int location_mask);
 void dri_bo_reference(dri_bo *bo);
 void dri_bo_unreference(dri_bo *bo);
 int dri_bo_map(dri_bo *buf, GLboolean write_enable);
 int dri_bo_unmap(dri_bo *buf);
-int dri_bo_validate(dri_bo *buf, unsigned int flags);
-dri_fence *dri_fence_validated(dri_bufmgr *bufmgr, const char *name,
-                              GLboolean flushed);
 void dri_fence_wait(dri_fence *fence);
 void dri_fence_reference(dri_fence *fence);
 void dri_fence_unreference(dri_fence *fence);
@@ -197,6 +173,12 @@ dri_bufmgr *dri_bufmgr_fake_init(unsigned long low_offset, void *low_virtual,
                                 int (*fence_wait)(void *private,
                                                   unsigned int cookie),
                                 void *driver_priv);
-void dri_bufmgr_fake_contended_lock_take(dri_bufmgr *bufmgr);
-
+void dri_bufmgr_destroy(dri_bufmgr *bufmgr);
+dri_bo *dri_ttm_bo_create_from_handle(dri_bufmgr *bufmgr, const char *name,
+                                     unsigned int handle);
+
+void dri_emit_reloc(dri_bo *batch_buf, GLuint flags, GLuint delta, GLuint offset, dri_bo *relocatee);
+void *dri_process_relocs(dri_bo *batch_buf, uint32_t *count);
+void dri_post_process_relocs(dri_bo *batch_buf);
+void dri_post_submit(dri_bo *batch_buf, dri_fence **last_fence);
 #endif