i965/drm: Merge drm_bacon_bo_gem into drm_bacon_bo.
[mesa.git] / src / mesa / drivers / dri / i965 / brw_bufmgr.h
index d3db6a3967b62906286b672380732610c47e7c49..87e67602bd9dd3c282f9da38d39d585af97c6749 100644 (file)
@@ -37,6 +37,7 @@
 #include <stdbool.h>
 #include <stdint.h>
 #include <stdio.h>
+#include "util/list.h"
 
 #if defined(__cplusplus)
 extern "C" {
@@ -77,10 +78,8 @@ struct _drm_bacon_bo {
        /** Buffer manager context associated with this buffer object */
        drm_bacon_bufmgr *bufmgr;
 
-       /**
-        * MM-specific handle for accessing object
-        */
-       int handle;
+       /** The GEM handle for this buffer object. */
+       uint32_t gem_handle;
 
        /**
         * Last seen card virtual address (offset from the beginning of the
@@ -97,6 +96,42 @@ struct _drm_bacon_bo {
         * processes, so we don't know their state.
         */
        bool idle;
+
+       int refcount;
+       const char *name;
+
+       /**
+        * Kenel-assigned global name for this object
+         *
+         * List contains both flink named and prime fd'd objects
+        */
+       unsigned int global_name;
+
+       /**
+        * Current tiling mode
+        */
+       uint32_t tiling_mode;
+       uint32_t swizzle_mode;
+       unsigned long stride;
+
+       time_t free_time;
+
+       /** Mapped address for the buffer, saved across map/unmap cycles */
+       void *mem_virtual;
+       /** GTT virtual address for the buffer, saved across map/unmap cycles */
+       void *gtt_virtual;
+       /** WC CPU address for the buffer, saved across map/unmap cycles */
+       void *wc_virtual;
+       int map_count;
+       struct list_head vma_list;
+
+       /** BO cache list */
+       struct list_head head;
+
+       /**
+        * Boolean of whether this buffer can be re-used
+        */
+       bool reusable;
 };
 
 #define BO_ALLOC_FOR_RENDER (1<<0)