galahad: do map/unmap counting for resources
[mesa.git] / src / gallium / drivers / i965 / brw_screen.h
index bd04e689d9070b713f4656f07be1674cf2a1fa86..522a3bf899528ea3046e96e7ca2506ae08ee91ac 100644 (file)
@@ -45,59 +45,38 @@ struct brw_screen
    struct pipe_screen base;
    struct brw_chipset chipset;
    struct brw_winsys_screen *sws;
+   boolean no_tiling;
 };
 
-/**
- * Subclass of pipe_transfer
- */
-struct brw_transfer
-{
-   struct pipe_transfer base;
 
-   unsigned offset;
-};
 
-struct brw_buffer
-{
-   struct pipe_buffer base;
-   struct brw_winsys_buffer *bo;
-   void *ptr;
-   boolean is_user_buffer;
+union brw_surface_id {
+   struct {
+      unsigned face:3;
+      unsigned zslice:13;
+      unsigned level:16;
+   } bits;
+   unsigned value;
 };
 
-#define BRW_TILING_NONE  0
-#define BRW_TILING_Y     1
-#define BRW_TILING_X     2
-
 
-struct brw_texture
+struct brw_surface
 {
-   struct pipe_texture base;
-
-   struct brw_winsys_buffer *bo;
-   struct brw_surface_state ss;
-
-   unsigned *image_offset[PIPE_MAX_TEXTURE_LEVELS];
-   unsigned nr_images[PIPE_MAX_TEXTURE_LEVELS];
-
-   unsigned level_offset[PIPE_MAX_TEXTURE_LEVELS];
-
-   boolean compressed;
-   unsigned brw_target;
+   struct pipe_surface base;
+   
+   union brw_surface_id id;
+   unsigned cpp;
    unsigned pitch;
+   unsigned draw_offset;
    unsigned tiling;
-   unsigned cpp;
-   unsigned total_height;
-};
-
 
-struct brw_surface
-{
-   struct pipe_surface base;
    struct brw_surface_state ss;
    struct brw_winsys_buffer *bo;
+   struct brw_surface *next, *prev;
 };
 
+
+
 /*
  * Cast wrappers
  */
@@ -107,11 +86,6 @@ brw_screen(struct pipe_screen *pscreen)
    return (struct brw_screen *) pscreen;
 }
 
-static INLINE struct brw_transfer *
-brw_transfer(struct pipe_transfer *transfer)
-{
-   return (struct brw_transfer *)transfer;
-}
 
 static INLINE struct brw_surface *
 brw_surface(struct pipe_surface *surface)
@@ -119,34 +93,10 @@ brw_surface(struct pipe_surface *surface)
    return (struct brw_surface *)surface;
 }
 
-static INLINE struct brw_buffer *
-brw_buffer(struct pipe_buffer *buffer)
-{
-   return (struct brw_buffer *)buffer;
-}
-
-
-/* Pipe buffer helpers
- */
-static INLINE boolean
-brw_buffer_is_user_buffer( const struct pipe_buffer *buf )
-{
-   return ((const struct brw_buffer *)buf)->is_user_buffer;
-}
-
-struct brw_winsys_buffer *
-brw_surface_bo( struct pipe_surface *surface );
-
 unsigned
 brw_surface_pitch( const struct pipe_surface *surface );
 
-/***********************************************************************
- * Internal functions 
- */
-GLboolean brw_texture_layout(struct brw_screen *brw_screen,
-                            struct brw_texture *tex );
-
-
+void brw_screen_tex_surface_init( struct brw_screen *brw_screen );
 
 
 #endif /* BRW_SCREEN_H */