aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'x11-base/xorg-server/files/aiglx-tfp-damage.patch')
-rw-r--r--x11-base/xorg-server/files/aiglx-tfp-damage.patch144
1 files changed, 144 insertions, 0 deletions
diff --git a/x11-base/xorg-server/files/aiglx-tfp-damage.patch b/x11-base/xorg-server/files/aiglx-tfp-damage.patch
new file mode 100644
index 0000000..0ae7dc7
--- /dev/null
+++ b/x11-base/xorg-server/files/aiglx-tfp-damage.patch
@@ -0,0 +1,144 @@
+? GL/glx/glxinterface.h
+? doc/Xserver.1x
+Index: GL/glx/glxcmds.c
+===================================================================
+RCS file: /cvs/xorg/xserver/xorg/GL/glx/glxcmds.c,v
+retrieving revision 1.10.2.5
+diff -u -p -r1.10.2.5 glxcmds.c
+--- GL/glx/glxcmds.c 6 Mar 2006 00:11:40 -0000 1.10.2.5
++++ GL/glx/glxcmds.c 6 Mar 2006 00:38:37 -0000
+@@ -1245,6 +1245,7 @@ int DoCreateGLXPixmap(__GLXclientState *
+ pGlxPixmap->pGlxScreen = pGlxScreen;
+ pGlxPixmap->pScreen = pScreen;
+ pGlxPixmap->idExists = True;
++ pGlxPixmap->pDamage = NULL;
+ pGlxPixmap->refcnt = 0;
+
+ pGlxPixmap->modes = modes;
+Index: GL/glx/glxdrawable.h
+===================================================================
+RCS file: /cvs/xorg/xserver/xorg/GL/glx/glxdrawable.h,v
+retrieving revision 1.4.10.1
+diff -u -p -r1.4.10.1 glxdrawable.h
+--- GL/glx/glxdrawable.h 24 Feb 2006 05:49:33 -0000 1.4.10.1
++++ GL/glx/glxdrawable.h 6 Mar 2006 00:38:37 -0000
+@@ -41,6 +41,8 @@
+ **
+ */
+
++#include <damage.h>
++
+ typedef struct {
+
+ DrawablePtr pDraw;
+@@ -49,7 +51,7 @@ typedef struct {
+ ScreenPtr pScreen;
+ Bool idExists;
+ int refcnt;
+-
++ DamagePtr pDamage;
+ } __GLXpixmap;
+
+ struct __GLXdrawable {
+Index: GL/glx/glxdri.c
+===================================================================
+RCS file: /cvs/xorg/xserver/xorg/GL/glx/Attic/glxdri.c,v
+retrieving revision 1.1.2.11
+diff -u -p -r1.1.2.11 glxdri.c
+--- GL/glx/glxdri.c 6 Mar 2006 00:11:40 -0000 1.1.2.11
++++ GL/glx/glxdri.c 6 Mar 2006 00:38:37 -0000
+@@ -334,13 +334,36 @@ __glXDRIbindTexImage(__GLXcontext *baseC
+ int buffer,
+ __GLXpixmap *glxPixmap)
+ {
++ RegionPtr pRegion;
+ PixmapPtr pixmap;
+- int bpp;
+- Bool npot;
++ int bpp, xoff, yoff, width, height;
++ GLenum target, format, type;
+
+ pixmap = (PixmapPtr) glxPixmap->pDraw;
+- bpp = pixmap->drawable.depth >= 24 ? 4 : 2; /* XXX 24bpp packed, 8, etc */
+-
++ if (!glxPixmap->pDamage) {
++ glxPixmap->pDamage = DamageCreate(NULL, NULL, DamageReportNone,
++ TRUE, glxPixmap->pScreen, NULL);
++ if (!glxPixmap->pDamage)
++ return BadAlloc;
++
++ DamageRegister ((DrawablePtr) pixmap, glxPixmap->pDamage);
++ } else {
++ pRegion = DamageRegion(glxPixmap->pDamage);
++ if (REGION_NIL(pRegion))
++ return Success;
++ }
++
++ /* XXX 24bpp packed, 8, etc */
++ if (pixmap->drawable.depth >= 24) {
++ bpp = 4;
++ format = GL_BGRA;
++ type = GL_UNSIGNED_BYTE;
++ } else {
++ bpp = 2;
++ format = GL_RGB;
++ type = GL_UNSIGNED_SHORT_5_6_5;
++ }
++
+ CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_ROW_LENGTH,
+ pixmap->devKind / bpp) );
+ CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SKIP_ROWS,
+@@ -351,22 +374,27 @@ __glXDRIbindTexImage(__GLXcontext *baseC
+ if (pixmap->drawable.depth == 24)
+ glxFillAlphaChannel(pixmap);
+
+- npot = !(glxCountBits(pixmap->drawable.width) == 1 &&
+- glxCountBits(pixmap->drawable.height) == 1) /* ||
+- strstr(CALL_GetString(GL_EXTENSIONS,
+- "GL_ARB_texture_non_power_of_two")) */ ;
+-
++ if (!(glxCountBits(pixmap->drawable.width) == 1 &&
++ glxCountBits(pixmap->drawable.height) == 1)
++ /* || strstr(CALL_GetString(GL_EXTENSIONS,
++ "GL_ARB_texture_non_power_of_two")) */)
++ target = GL_TEXTURE_RECTANGLE_ARB;
++ else
++ target = GL_TEXTURE_2D;
++
+ CALL_TexImage2D( GET_DISPATCH(),
+- ( npot ? GL_TEXTURE_RECTANGLE_ARB : GL_TEXTURE_2D,
++ ( target,
+ 0,
+ bpp == 4 ? 4 : 3,
+ pixmap->drawable.width,
+ pixmap->drawable.height,
+ 0,
+- bpp == 4 ? GL_BGRA : GL_RGB,
+- bpp == 4 ? GL_UNSIGNED_BYTE : GL_UNSIGNED_SHORT_5_6_5,
++ format,
++ type,
+ pixmap->devPrivate.ptr ) );
+
++ DamageEmpty(glxPixmap->pDamage);
++
+ return Success;
+ }
+
+Index: GL/glx/glxext.c
+===================================================================
+RCS file: /cvs/xorg/xserver/xorg/GL/glx/glxext.c,v
+retrieving revision 1.6.10.3
+diff -u -p -r1.6.10.3 glxext.c
+--- GL/glx/glxext.c 6 Mar 2006 00:11:40 -0000 1.6.10.3
++++ GL/glx/glxext.c 6 Mar 2006 00:38:37 -0000
+@@ -140,6 +140,10 @@ static int PixmapGone(__GLXpixmap *pGlxP
+
+ pGlxPixmap->idExists = False;
+ if (!pGlxPixmap->refcnt) {
++ if (pGlxPixmap->pDamage) {
++ DamageUnregister (pGlxPixmap->pDraw, pGlxPixmap->pDamage);
++ DamageDestroy(pGlxPixmap->pDamage);
++ }
+ /*
+ ** The DestroyPixmap routine should decrement the refcount and free
+ ** only if it's zero.