diff -r e5259db5befc -r 068c11b419c9 open-src/lib/mesa/6709720.patch --- a/open-src/lib/mesa/6709720.patch Sat Jan 10 10:35:32 2009 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,323 +0,0 @@ ---- src/mesa/drivers/dri/i965/intel_context.c Mon Apr 28 14:46:55 2008 -+++ src/mesa/drivers/dri/i965/intel_context.c Tue Apr 29 08:35:16 2008 -@@ -117,6 +117,12 @@ - case PCI_CHIP_I946_GZ: - chipset = "Intel(R) 946GZ"; break; - break; -+ case PCI_CHIP_I965_GM: -+ chipset = "Intel(R) 965GM"; break; -+ break; -+ case PCI_CHIP_I965_GME: -+ chipset = "Intel(R) 965GME/GLE"; -+ break; - default: - chipset = "Unknown Intel Chipset"; break; - } -@@ -537,6 +543,11 @@ - return GL_TRUE; - } - -+static void lost_hardware( struct intel_context *intel ) -+{ -+ bm_fake_NotifyContendedLockTake( intel ); -+ intel->vtbl.lost_hardware( intel ); -+} - - static void intelContendedLock( struct intel_context *intel, GLuint flags ) - { -@@ -565,7 +576,7 @@ - if (sarea->ctxOwner != me) { - DBG("Lost Context: sarea->ctxOwner %x me %x\n", sarea->ctxOwner, me); - sarea->ctxOwner = me; -- intel->vtbl.lost_hardware( intel ); -+ lost_hardware( intel ); - } - - /* As above, but don't evict the texture data on transitions ---- src/mesa/drivers/dri/i965/intel_context.h Sat Dec 2 10:14:17 2006 -+++ src/mesa/drivers/dri/i965/intel_context.h Tue Apr 29 08:36:18 2008 -@@ -383,8 +383,11 @@ - #define PCI_CHIP_I965_Q 0x2992 - #define PCI_CHIP_I965_G_1 0x2982 - #define PCI_CHIP_I946_GZ 0x2972 -+#define PCI_CHIP_I965_GM 0x2A02 -+#define PCI_CHIP_I965_GME 0x2A12 - - -+ - /* ================================================================ - * intel_context.c: - */ ---- src/mesa/drivers/dri/i965/intel_ioctl.c Sat Oct 28 16:10:56 2006 -+++ src/mesa/drivers/dri/i965/intel_ioctl.c Tue Apr 29 08:37:39 2008 -@@ -75,7 +75,7 @@ - { - if (!intel->no_hw) { - drmI830IrqWait iw; -- int ret; -+ int ret, lastdispatch; - - if (0) - fprintf(stderr, "%s %d\n", __FUNCTION__, seq ); -@@ -83,12 +83,14 @@ - iw.irq_seq = seq; - - do { -+ lastdispatch = intel->sarea->last_dispatch; - ret = drmCommandWrite( intel->driFd, DRM_I830_IRQ_WAIT, &iw, sizeof(iw) ); - - /* This seems quite often to return before it should!?! - */ -- } while (ret == -EAGAIN || ret == -EINTR || (ret == 0 && seq > intel->sarea->last_dispatch)); -- -+ } while (ret == -EAGAIN || ret == -EINTR || (ret == -EBUSY && lastdispa -+tch != intel->sarea->last_dispatch) || (ret == 0 && seq > intel->sarea->last_dis -+patch) || (ret == 0 && intel->sarea->last_dispatch - seq >= (1 << 24))); - - if ( ret ) { - fprintf( stderr, "%s: drmI830IrqWait: %d\n", __FUNCTION__, ret ); - ---- src/mesa/drivers/dri/i965/intel_regions.c Tue Nov 21 07:03:46 2006 -+++ src/mesa/drivers/dri/i965/intel_regions.c Tue Apr 29 08:38:35 2008 -@@ -122,10 +122,10 @@ - GLuint cpp, - GLuint pitch, - GLuint height, -+ GLuint size, - GLboolean tiled ) - { - struct intel_region *region = calloc(sizeof(*region), 1); -- GLuint size = cpp * pitch * height; - GLint pool; - - DBG("%s\n", __FUNCTION__); - ---- src/mesa/drivers/dri/i965/intel_regions.h Mon Sep 11 14:35:49 2006 -+++ src/mesa/drivers/dri/i965/intel_regions.h Tue Apr 29 08:39:25 2008 -@@ -78,6 +78,7 @@ - GLuint cpp, - GLuint pitch, - GLuint height, -+ GLuint size, - GLboolean tiled ); - - /* Map/unmap regions. This is refcounted also: - - ---- src/mesa/drivers/dri/i965/brw_exec_api.c Mon Sep 25 17:46:39 2006 -+++ src/mesa/drivers/dri/i965/brw_exec_api.c Tue Apr 29 08:28:37 2008 -@@ -40,6 +40,7 @@ - #include "api_arrayelt.h" - #include "api_noop.h" - #include "dispatch.h" -+#include "intel_context.h" - - #include "brw_exec.h" - -@@ -522,6 +523,15 @@ - - } - -+static GLuint brw_max_prim( GLcontext *ctx ) -+{ -+ struct intel_context *intel = intel_context( ctx ); -+ if (intel->numClipRects <= 1) -+ return BRW_MAX_PRIM; -+ return BRW_MAX_PRIM/intel->numClipRects; -+} -+ -+ - static void GLAPIENTRY brw_exec_End( void ) - { - GET_CURRENT_CONTEXT( ctx ); -@@ -536,7 +546,7 @@ - - ctx->Driver.CurrentExecPrimitive = GL_POLYGON+1; - -- if (exec->vtx.prim_count == BRW_MAX_PRIM) -+ if (exec->vtx.prim_count >= brw_max_prim(ctx)) - brw_exec_vtx_flush( exec ); - } - else - ---- src/mesa/drivers/dri/i965/brw_save_api.c Tue Nov 21 07:03:46 2006 -+++ src/mesa/drivers/dri/i965/brw_save_api.c Tue Apr 29 08:30:41 2008 -@@ -417,7 +417,7 @@ - struct brw_save_context *save = IMM_CONTEXT(ctx)->save; - GLuint i; - -- for (i = BRW_ATTRIB_POS+1 ; i < BRW_ATTRIB_MAX ; i++) { -+ for (i = 0 ; i < BRW_ATTRIB_MAX ; i++) { - if (save->attrsz[i]) { - save->currentsz[i][0] = save->attrsz[i]; - COPY_CLEAN_4V(save->current[i], -@@ -445,7 +445,7 @@ - struct brw_save_context *save = IMM_CONTEXT(ctx)->save; - GLint i; - -- for (i = BRW_ATTRIB_POS+1 ; i < BRW_ATTRIB_MAX ; i++) -+ for (i = 0 ; i < BRW_ATTRIB_MAX ; i++) - switch (save->attrsz[i]) { - case 4: save->attrptr[i][3] = save->current[i][3]; - case 3: save->attrptr[i][2] = save->current[i][2]; - ---- src/mesa/drivers/dri/i965/brw_save_draw.c Tue Nov 21 07:03:46 2006 -+++ src/mesa/drivers/dri/i965/brw_save_draw.c Tue Apr 29 08:31:47 2008 -@@ -37,6 +37,7 @@ - #include "brw_save.h" - #include "brw_draw.h" - #include "brw_fallback.h" -+#include "brw_context.h" - - /* - * After playback, copy everything but the position from the -@@ -77,12 +78,6 @@ - } - } - -- /* Edgeflag requires special treatment: -- */ -- if (node->attrsz[BRW_ATTRIB_EDGEFLAG]) { -- ctx->Current.EdgeFlag = (data[0] == 1.0); -- } -- - - #if 1 - /* Colormaterial -- this kindof sucks. - ---- src/mesa/drivers/dri/i915/intel_context.c Thu Nov 2 14:29:39 2006 -+++ src/mesa/drivers/dri/i915/intel_context.c Tue Apr 29 08:21:01 2008 -@@ -122,6 +122,14 @@ - chipset = "Intel(R) 945G"; break; - case PCI_CHIP_I945_GM: - chipset = "Intel(R) 945GM"; break; -+ case PCI_CHIP_I945_GME: -+ chipset = "Intel(R) 945GME"; break; -+ case PCI_CHIP_G33_G: -+ chipset = "Intel(R) G33"; break; -+ case PCI_CHIP_Q35_G: -+ chipset = "Intel(R) Q35"; break; -+ case PCI_CHIP_Q33_G: -+ chipset = "Intel(R) Q33"; break; - default: - chipset = "Unknown Intel Chipset"; break; - } - ---- src/mesa/drivers/dri/i915/intel_screen.c Mon Apr 28 14:46:55 2008 -+++ src/mesa/drivers/dri/i915/intel_screen.c Tue Apr 29 08:23:52 2008 -@@ -530,6 +530,10 @@ - case PCI_CHIP_I915_GM: - case PCI_CHIP_I945_G: - case PCI_CHIP_I945_GM: -+ case PCI_CHIP_I945_GME: -+ case PCI_CHIP_G33_G: -+ case PCI_CHIP_Q35_G: -+ case PCI_CHIP_Q33_G: - return i915CreateContext( mesaVis, driContextPriv, - sharedContextPrivate ); - ---- src/mesa/drivers/dri/i915/intel_tex.c Fri Apr 7 01:50:39 2006 -+++ src/mesa/drivers/dri/i915/intel_tex.c Tue Apr 29 08:25:03 2008 -@@ -675,7 +675,11 @@ - /* Time for another vtbl entry: - */ - else if (intel->intelScreen->deviceID == PCI_CHIP_I945_G || -- intel->intelScreen->deviceID == PCI_CHIP_I945_GM) { -+ intel->intelScreen->deviceID == PCI_CHIP_I945_GM || -+ intel->intelScreen->deviceID == PCI_CHIP_I945_GME || -+ intel->intelScreen->deviceID == PCI_CHIP_G33_G || -+ intel->intelScreen->deviceID == PCI_CHIP_Q33_G || -+ intel->intelScreen->deviceID == PCI_CHIP_Q35_G) { - GLuint row_len = image->Width * image->TexFormat->TexelBytes; - GLubyte *dst = (GLubyte *)(t->BufAddr + offset); - GLubyte *src = (GLubyte *)image->Data; - ---- src/mesa/drivers/dri/i915/i915_texstate.c Thu Apr 6 09:23:40 2006 -+++ src/mesa/drivers/dri/i915/i915_texstate.c Tue Apr 29 08:19:12 2008 -@@ -496,11 +496,19 @@ - } - - -- if (i915->intel.intelScreen->deviceID == PCI_CHIP_I945_G || -- i915->intel.intelScreen->deviceID == PCI_CHIP_I945_GM) -- i945LayoutTextureImages( i915, tObj ); -- else -- i915LayoutTextureImages( i915, tObj ); -+ switch (i915->intel.intelScreen->deviceID) { -+ case PCI_CHIP_I945_G: -+ case PCI_CHIP_I945_GM: -+ case PCI_CHIP_I945_GME: -+ case PCI_CHIP_G33_G: -+ case PCI_CHIP_Q33_G: -+ case PCI_CHIP_Q35_G: -+ i945LayoutTextureImages( i915, tObj ); -+ break; -+ default: -+ i915LayoutTextureImages( i915, tObj ); -+ break; -+ } - - t->Setup[I915_TEXREG_MS3] = - (((tObj->Image[0][t->intel.base.firstLevel]->Height - 1) << MS3_HEIGHT_SHIFT) | - ---- src/mesa/drivers/dri/i915/intel_context.h Tue Apr 29 08:51:01 2008 -+++ src/mesa/drivers/dri/i915/intel_context.h Tue Apr 29 08:57:33 2008 -@@ -495,8 +495,13 @@ - #define PCI_CHIP_I915_GM 0x2592 - #define PCI_CHIP_I945_G 0x2772 - #define PCI_CHIP_I945_GM 0x27A2 -+#define PCI_CHIP_I945_GME 0x27AE -+#define PCI_CHIP_G33_G 0x29C2 -+#define PCI_CHIP_Q35_G 0x29B2 -+#define PCI_CHIP_Q33_G 0x29D2 - - -+ - /* ================================================================ - * intel_context.c: - */ ---- src/mesa/drivers/dri/i965/intel_context.c Tue Apr 29 09:04:54 2008 -+++ src/mesa/drivers/dri/i965/intel_context.c Tue Apr 29 09:12:22 2008 -@@ -409,7 +409,8 @@ - intelScreen->cpp, - intelScreen->front.pitch / intelScreen->cpp, - intelScreen->height, -- GL_FALSE); -+ intelScreen->front.size, -+ intelScreen->front.tiled != 0); - - - intel->back_region = -@@ -420,7 +421,8 @@ - intelScreen->cpp, - intelScreen->back.pitch / intelScreen->cpp, - intelScreen->height, -- (INTEL_DEBUG & DEBUG_TILE) ? 0 : 1); -+ intelScreen->back.size, -+ intelScreen->back.tiled != 0); - - /* Still assuming front.cpp == depth.cpp - * -@@ -436,7 +438,8 @@ - intelScreen->cpp, - intelScreen->depth.pitch / intelScreen->cpp, - intelScreen->height, -- (INTEL_DEBUG & DEBUG_TILE) ? 0 : 1); -+ intelScreen->depth.size, -+ intelScreen->depth.tiled != 0); - - intel_bufferobj_init( intel ); - intel->batch = intel_batchbuffer_alloc( intel ); ---- src/mesa/drivers/dri/i965/intel_ioctl.c Tue Apr 29 09:18:46 2008 -+++ src/mesa/drivers/dri/i965/intel_ioctl.c Tue Apr 29 09:30:08 2008 -@@ -88,9 +88,7 @@ - - /* This seems quite often to return before it should!?! - */ -- } while (ret == -EAGAIN || ret == -EINTR || (ret == -EBUSY && lastdispa --tch != intel->sarea->last_dispatch) || (ret == 0 && seq > intel->sarea->last_dis --patch) || (ret == 0 && intel->sarea->last_dispatch - seq >= (1 << 24))); -+ } while (ret == -EAGAIN || ret == -EINTR || (ret == -EBUSY && lastdispatch != intel->sarea->last_dispatch) || (ret == 0 && seq > intel->sarea->last_dispatch) || (ret == 0 && intel->sarea->last_dispatch - seq >= (1 << 24))); - - if ( ret ) { - fprintf( stderr, "%s: drmI830IrqWait: %d\n", __FUNCTION__, ret );