Merge remote-tracking branch 'origin/master' into pipe-video
[mesa.git] / src / gallium / drivers / i915 / i915_resource.h
index 1093e8f41f90319170829a38803a6a7b78ecb45c..86620e6a123e5926b1fca4867bc36a154258d85b 100644 (file)
@@ -32,6 +32,7 @@ struct i915_screen;
 
 #include "util/u_transfer.h"
 #include "util/u_debug.h"
+#include "i915_winsys.h"
 
 
 struct i915_context;
@@ -48,29 +49,36 @@ struct i915_buffer {
 #define I915_MAX_TEXTURE_3D_LEVELS  8  /* max 128x128x128 */
 
 
+struct offset_pair {
+       unsigned short nblocksx;
+       unsigned short nblocksy;
+};
 
 struct i915_texture {
    struct u_resource b;
 
+   /* tiling flags */
+   enum i915_winsys_buffer_tile tiling;
    unsigned stride;
    unsigned depth_stride;          /* per-image on i945? */
    unsigned total_nblocksy;
 
-   unsigned sw_tiled; /**< tiled with software flags */
-   unsigned hw_tiled; /**< tiled with hardware fences */
-
    unsigned nr_images[I915_MAX_TEXTURE_2D_LEVELS];
 
    /* Explicitly store the offset of each image for each cube face or
     * depth value.
+    *
+    * Array [depth] off offsets.
     */
-   unsigned *image_offset[I915_MAX_TEXTURE_2D_LEVELS];   /**< array [depth] of offsets */
+   struct offset_pair *image_offset[I915_MAX_TEXTURE_2D_LEVELS];
 
    /* The data is held here:
     */
    struct i915_winsys_buffer *buffer;
 };
 
+unsigned i915_texture_offset(struct i915_texture *tex,
+                             unsigned level, unsigned layer);
 void i915_init_screen_resource_functions(struct i915_screen *is);
 void i915_init_resource_functions(struct i915_context *i915);