i915g: implement unfenced color&depth buffer using tiling bits
[mesa.git] / src / gallium / drivers / i915 / i915_winsys.h
index 8a6f579ad97249566081ba083541388ad07df4e4..24ea416f015469b84215dba63bd9f2ca1b19e624 100644 (file)
@@ -53,6 +53,7 @@ enum i915_winsys_buffer_type
    I915_NEW_VERTEX
 };
 
+/* These need to be in sync with the definitions of libdrm-intel! */
 enum i915_winsys_buffer_tile
 {
    I915_TILE_NONE,
@@ -81,6 +82,8 @@ struct i915_winsys_batchbuffer {
 
 struct i915_winsys {
 
+   unsigned pci_id; /**< PCI ID for the device */
+
    /**
     * Batchbuffer functions.
     */
@@ -104,7 +107,7 @@ struct i915_winsys {
    int (*batchbuffer_reloc)(struct i915_winsys_batchbuffer *batch,
                             struct i915_winsys_buffer *reloc,
                             enum i915_winsys_buffer_usage usage,
-                            unsigned offset);
+                            unsigned offset, bool fenced);
 
    /**
     * Flush a bufferbatch.
@@ -128,9 +131,23 @@ struct i915_winsys {
     */
    struct i915_winsys_buffer *
       (*buffer_create)(struct i915_winsys *iws,
-                       unsigned size, unsigned alignment,
+                       unsigned size,
                        enum i915_winsys_buffer_type type);
 
+   /**
+    * Create a tiled buffer.
+    *
+    * *stride, height are in bytes. The winsys tries to allocate the buffer with
+    * the tiling mode provide in *tiling. If tiling is no possible, *tiling will
+    * be set to I915_TILE_NONE. The calculated stride (incorporateing hw/kernel
+    * requirements) is always returned in *stride.
+    */
+   struct i915_winsys_buffer *
+      (*buffer_create_tiled)(struct i915_winsys *iws,
+                             unsigned *stride, unsigned height,
+                             enum i915_winsys_buffer_tile *tiling,
+                             enum i915_winsys_buffer_type type);
+
    /**
     * Creates a buffer from a handle.
     * Used to implement pipe_screen::resource_from_handle.
@@ -140,6 +157,7 @@ struct i915_winsys {
    struct i915_winsys_buffer *
       (*buffer_from_handle)(struct i915_winsys *iws,
                             struct winsys_handle *whandle,
+                            enum i915_winsys_buffer_tile *tiling,
                             unsigned *stride);
 
    /**
@@ -151,15 +169,6 @@ struct i915_winsys {
                                 struct winsys_handle *whandle,
                                 unsigned stride);
 
-   /**
-    * Fence a buffer with a fence reg.
-    * Not to be confused with pipe_fence_handle.
-    */
-   int (*buffer_set_fence_reg)(struct i915_winsys *iws,
-                               struct i915_winsys_buffer *buffer,
-                               unsigned stride,
-                               enum i915_winsys_buffer_tile tile);
-
    /**
     * Map a buffer.
     */
@@ -220,11 +229,4 @@ struct i915_winsys {
    void (*destroy)(struct i915_winsys *iws);
 };
 
-
-/**
- * Create i915 pipe_screen.
- */
-struct pipe_screen *i915_create_screen(struct i915_winsys *iws, unsigned pci_id);
-
-
 #endif