Merge branch 'drm-gem'
authorEric Anholt <eric@anholt.net>
Fri, 8 Aug 2008 22:32:24 +0000 (15:32 -0700)
committerEric Anholt <eric@anholt.net>
Fri, 8 Aug 2008 22:32:24 +0000 (15:32 -0700)
Conflicts:

src/mesa/drivers/dri/intel/intel_span.c
src/mesa/main/fbobject.c

This converts the i915 driver to use the GEM interfaces for object management.

1  2 
src/mesa/drivers/dri/intel/intel_screen.c
src/mesa/drivers/dri/intel/intel_span.c

index 742b1b87350bc19655642786857145ddeb7c1210,079b9e6a9d92db46bacaa06a1b9647bf6658e689..edede3a74b406947f8b436372f1f867e51fac8bf
@@@ -114,16 -404,32 +404,35 @@@ static uint32_t y_tile_swizzle(struct i
  /**
   ** 16-bit depthbuffer functions.
   **/
 +#define VALUE_TYPE GLushort
+ #define WRITE_DEPTH(_x, _y, d) \
+    pwrite_16(irb, no_tile_swizzle(irb, intel, _x, _y), d)
+ #define READ_DEPTH(d, _x, _y) \
+    d = pread_16(irb, no_tile_swizzle(irb, intel, _x, _y))
+ #define TAG(x) intel##x##_z16
+ #include "depthtmp.h"
  
- #define WRITE_DEPTH( _x, _y, d ) \
-    ((GLushort *)buf)[(_x) + (_y) * pitch] = d;
- #define READ_DEPTH( d, _x, _y )       \
-    d = ((GLushort *)buf)[(_x) + (_y) * pitch];
  
+ /**
+  ** 16-bit x tile depthbuffer functions.
+  **/
++#define VALUE_TYPE GLushort
+ #define WRITE_DEPTH(_x, _y, d) \
+    pwrite_16(irb, x_tile_swizzle(irb, intel, _x, _y), d)
+ #define READ_DEPTH(d, _x, _y) \
+    d = pread_16(irb, x_tile_swizzle(irb, intel, _x, _y))
+ #define TAG(x) intel_XTile_##x##_z16
+ #include "depthtmp.h"
  
- #define TAG(x) intel##x##_z16
+ /**
+  ** 16-bit y tile depthbuffer functions.
+  **/
++#define VALUE_TYPE GLushort
+ #define WRITE_DEPTH(_x, _y, d) \
+    pwrite_16(irb, y_tile_swizzle(irb, intel, _x, _y), d)
+ #define READ_DEPTH(d, _x, _y) \
+    d = pread_16(irb, y_tile_swizzle(irb, intel, _x, _y))
+ #define TAG(x) intel_YTile_##x##_z16
  #include "depthtmp.h"
  
  
   ** The wrappers in main/depthstencil.c are used to extract the depth
   ** and stencil values.
   **/
 +#define VALUE_TYPE GLuint
 +
  /* Change ZZZS -> SZZZ */
- #define WRITE_DEPTH( _x, _y, d ) {                            \
-    GLuint tmp = ((d) >> 8) | ((d) << 24);                     \
-    ((GLuint *)buf)[(_x) + (_y) * pitch] = tmp;                        \
- }
+ #define WRITE_DEPTH(_x, _y, d)                                        \
+    pwrite_32(irb, no_tile_swizzle(irb, intel, _x, _y),                \
+            ((d) >> 8) | ((d) << 24))
  
  /* Change SZZZ -> ZZZS */
  #define READ_DEPTH( d, _x, _y ) {                             \
  
  
  /**
-  ** 8-bit stencil function (XXX FBO: This is obsolete)
+  ** 24/8-bit x-tile interleaved depth/stencil functions
+  ** Note: we're actually reading back combined depth+stencil values.
+  ** The wrappers in main/depthstencil.c are used to extract the depth
+  ** and stencil values.
   **/
- #define WRITE_STENCIL( _x, _y, d ) {                          \
-    GLuint tmp = ((GLuint *)buf)[(_x) + (_y) * pitch];         \
-    tmp &= 0xffffff;                                           \
-    tmp |= ((d) << 24);                                                \
-    ((GLuint *) buf)[(_x) + (_y) * pitch] = tmp;                       \
++#define VALUE_TYPE GLuint
++
+ /* Change ZZZS -> SZZZ */
+ #define WRITE_DEPTH(_x, _y, d)                                        \
+    pwrite_32(irb, x_tile_swizzle(irb, intel, _x, _y),         \
+            ((d) >> 8) | ((d) << 24))                          \
+ /* Change SZZZ -> ZZZS */
+ #define READ_DEPTH( d, _x, _y ) {                             \
+    GLuint tmp = pread_32(irb, x_tile_swizzle(irb, intel, _x, _y));    \
+    d = (tmp << 8) | (tmp >> 24);                              \
  }
  
- #define READ_STENCIL( d, _x, _y )                             \
-    d = ((GLuint *)buf)[(_x) + (_y) * pitch] >> 24;
+ #define TAG(x) intel_XTile_##x##_z24_s8
+ #include "depthtmp.h"
+ /**
+  ** 24/8-bit y-tile interleaved depth/stencil functions
+  ** Note: we're actually reading back combined depth+stencil values.
+  ** The wrappers in main/depthstencil.c are used to extract the depth
+  ** and stencil values.
+  **/
++#define VALUE_TYPE GLuint
++
+ /* Change ZZZS -> SZZZ */
+ #define WRITE_DEPTH(_x, _y, d)                                        \
+    pwrite_32(irb, y_tile_swizzle(irb, intel, _x, _y),         \
+            ((d) >> 8) | ((d) << 24))
+ /* Change SZZZ -> ZZZS */
+ #define READ_DEPTH( d, _x, _y ) {                             \
+    GLuint tmp = pread_32(irb, y_tile_swizzle(irb, intel, _x, _y));    \
+    d = (tmp << 8) | (tmp >> 24);                              \
+ }
+ #define TAG(x) intel_YTile_##x##_z24_s8
+ #include "depthtmp.h"
+ /**
+  ** 8-bit stencil function (XXX FBO: This is obsolete)
+  **/
+ #define WRITE_STENCIL(_x, _y, d)                              \
+    pwrite_8(irb, no_tile_swizzle(irb, intel, _x, _y) + 3, d)
+ #define READ_STENCIL(d, _x, _y)                                       \
+    d = pread_8(irb, no_tile_swizzle(irb, intel, _x, _y) + 3);
  
  #define TAG(x) intel##x##_z24_s8
  #include "stenciltmp.h"