cell: attempt conversion to sw_winsys
[mesa.git] / src / gallium / drivers / cell / ppu / cell_texture.h
index 7018b0c9bf75862d5c3bad78837e85c45fd82b56..55b983218f97605c6af14a9ea9249e89fb75d4ec 100644 (file)
@@ -43,16 +43,34 @@ struct cell_texture
    unsigned long level_offset[CELL_MAX_TEXTURE_LEVELS];
    unsigned long stride[CELL_MAX_TEXTURE_LEVELS];
 
-   /* The data is held here:
+   /**
+    * Display target, for textures with the PIPE_TEXTURE_USAGE_DISPLAY_TARGET
+    * usage.
+    */
+   struct sw_displaytarget *dt;
+
+   /**
+    * Malloc'ed data for regular textures, or a mapping to dt above.
+    */
+   void *data;
+
+   /* Size of the linear buffer??
     */
-   struct pipe_buffer *buffer;
    unsigned long buffer_size;
 
-   /** Texture data in tiled layout is held here */
-   struct pipe_buffer *tiled_buffer[CELL_MAX_TEXTURE_LEVELS];
-   /** Mapped, tiled texture data */
-   void *tiled_mapped[CELL_MAX_TEXTURE_LEVELS];
-   void *untiled_data[CELL_MAX_TEXTURE_LEVELS];
+   /** The buffer above, mapped.  This is the memory from which the
+    * SPUs will fetch texels.  This texture data is in the tiled layout.
+    */
+   ubyte *mapped;
+};
+
+
+struct cell_transfer
+{
+   struct pipe_transfer base;
+
+   unsigned long offset;
+   void *map;
 };
 
 
@@ -64,6 +82,13 @@ cell_texture(struct pipe_texture *pt)
 }
 
 
+/** cast wrapper */
+static INLINE struct cell_transfer *
+cell_transfer(struct pipe_transfer *pt)
+{
+   return (struct cell_transfer *) pt;
+}
+
 
 extern void
 cell_init_screen_texture_funcs(struct pipe_screen *screen);