galahad: do map/unmap counting for resources
[mesa.git] / src / gallium / drivers / i965 / brw_screen.h
index 716b55c52bc44d97dc89252f4db8ee16f9a697fa..522a3bf899528ea3046e96e7ca2506ae08ee91ac 100644 (file)
@@ -31,6 +31,8 @@
 #include "pipe/p_state.h"
 #include "pipe/p_screen.h"
 
+#include "brw_reg.h"
+#include "brw_structs.h"
 
 struct brw_winsys_screen;
 
@@ -41,24 +43,40 @@ struct brw_winsys_screen;
 struct brw_screen
 {
    struct pipe_screen base;
-
+   struct brw_chipset chipset;
    struct brw_winsys_screen *sws;
+   boolean no_tiling;
+};
+
 
-   boolean is_i945;
-   uint pci_id;
+
+union brw_surface_id {
+   struct {
+      unsigned face:3;
+      unsigned zslice:13;
+      unsigned level:16;
+   } bits;
+   unsigned value;
 };
 
-/**
- * Subclass of pipe_transfer
- */
-struct brw_transfer
+
+struct brw_surface
 {
-   struct pipe_transfer base;
+   struct pipe_surface base;
+   
+   union brw_surface_id id;
+   unsigned cpp;
+   unsigned pitch;
+   unsigned draw_offset;
+   unsigned tiling;
 
-   unsigned offset;
+   struct brw_surface_state ss;
+   struct brw_winsys_buffer *bo;
+   struct brw_surface *next, *prev;
 };
 
 
+
 /*
  * Cast wrappers
  */
@@ -68,11 +86,17 @@ brw_screen(struct pipe_screen *pscreen)
    return (struct brw_screen *) pscreen;
 }
 
-static INLINE struct brw_transfer *
-brw_transfer(struct pipe_transfer *transfer)
+
+static INLINE struct brw_surface *
+brw_surface(struct pipe_surface *surface)
 {
-   return (struct brw_transfer *)transfer;
+   return (struct brw_surface *)surface;
 }
 
+unsigned
+brw_surface_pitch( const struct pipe_surface *surface );
+
+void brw_screen_tex_surface_init( struct brw_screen *brw_screen );
+
 
 #endif /* BRW_SCREEN_H */