From: Eric Anholt Date: Fri, 8 Aug 2008 22:32:24 +0000 (-0700) Subject: Merge branch 'drm-gem' X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=53675e5c05c0598b7ea206d5c27dbcae786a2c03;p=mesa.git Merge branch 'drm-gem' 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. --- 53675e5c05c0598b7ea206d5c27dbcae786a2c03 diff --cc src/mesa/drivers/dri/intel/intel_span.c index 742b1b87350,079b9e6a9d9..edede3a74b4 --- a/src/mesa/drivers/dri/intel/intel_span.c +++ b/src/mesa/drivers/dri/intel/intel_span.c @@@ -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" @@@ -133,13 -439,10 +442,12 @@@ ** 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 ) { \ @@@ -152,17 -455,54 +460,58 @@@ /** - ** 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"