On Mon, 2008-11-03 at 20:11 +0000, Alan Hourihane wrote:
> On Wed, 2008-10-15 at 00:11 -0400, Kristian Høgsberg wrote:
> > Hi,
> >
> > Here's a quick, last-minute note on the state of DRI2 before I take
> > off for 2 weeks of vacation. I just pushed the updated protocol+docs
> > to dri2proto and updated mesa, xserver and the dri2 branch of
> > xf86-video-intel with the corresponding changes. What's implemented
> > here is the lowest level of support that we've discussed: none vsync
> > handling or page-flipping idea we've discussed are there yet. What is
> > in place is the basic DRI2CopyRegion request, and more importantly,
> > the mechanism for adding further args and return values to that
> > request in later DRI2 revisions.
> >
> > I think we can merge the dri2 branch to master in xf86-video-intel
> > now, since it still requires an Option "DRI2" in xorg.conf to enable
> > and the APIs and protocol feels like they're in place at this point.
> > But since I don't expect to be back online and help with merging
> > issues until November, I can understand if we want to hold off on
> > that. Either way, please have a look and hopefully we can sort this
> > out next month at least.
>
> Kristian,
>
> I'm looking at this now and can see that we don't do anything when we
> need to release the teximage.
>
> What about the following patch ??
Additionally the spec says that other buffers can be specified but we
don't pass in the target buffer.
Shouldn't we add something similar to this as well ??
Alan.
diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h
index e4cc16b..c9a54fb 100644
--- a/include/GL/internal/dri_interface.h
+++ b/include/GL/internal/dri_interface.h
@@ -242,7 +242,8 @@ struct __DRItexBufferExtensionRec {
*/
void (*setTexBuffer)(__DRIcontext *pDRICtx,
GLint target,
- __DRIdrawable *pDraw);
+ __DRIdrawable *pDraw,
+ GLint buffer);
};
diff --git a/src/glx/x11/glxcmds.c b/src/glx/x11/glxcmds.c
index ff04853..8b5e9e2 100644
--- a/src/glx/x11/glxcmds.c
+++ b/src/glx/x11/glxcmds.c
@@ -2583,7 +2583,8 @@ static void __glXBindTexImageEXT(Display *dpy,
if (pdraw != NULL)
(*pdraw->psc->texBuffer->setTexBuffer)(gc->__driContext,
pdraw->textureTarget,
- pdraw->driDrawable);
+ pdraw->driDrawable,
+ buffer);
return;
}
diff --git a/glx/glxcmds.c b/glx/glxcmds.c
index ab2d91b..b1f53e0 100644
--- a/glx/glxcmds.c
+++ b/glx/glxcmds.c
@@ -1516,8 +1516,20 @@ int __glXDisp_BindTexImageEXT(__GLXclientState *cl, GLbyte *pc)
drawId = *((CARD32 *) (pc));
buffer = *((INT32 *) (pc + 4));
- if (buffer != GLX_FRONT_LEFT_EXT)
- return __glXError(GLXBadPixmap);
+ if (buffer != GLX_FRONT_LEFT_EXT ||
+ buffer != GLX_FRONT_RIGHT_EXT ||
+ buffer != GLX_BACK_LEFT_EXT ||
+ buffer != GLX_BACK_RIGHT_EXT ||
+ buffer != GLX_AUX0_EXT ||
+ buffer != GLX_AUX1_EXT ||
+ buffer != GLX_AUX2_EXT ||
+ buffer != GLX_AUX3_EXT ||
+ buffer != GLX_AUX4_EXT ||
+ buffer != GLX_AUX5_EXT ||
+ buffer != GLX_AUX6_EXT ||
+ buffer != GLX_AUX7_EXT ||
+ buffer != GLX_AUX8_EXT)
+ return __glXError(BadValue);
context = __glXForceCurrent (cl, req->contextTag, &error);
if (!context)
@@ -1551,6 +1563,21 @@ int __glXDisp_ReleaseTexImageEXT(__GLXclientState *cl, GLbyte *pc)
drawId = *((CARD32 *) (pc));
buffer = *((INT32 *) (pc + 4));
+
+ if (buffer != GLX_FRONT_LEFT_EXT ||
+ buffer != GLX_FRONT_RIGHT_EXT ||
+ buffer != GLX_BACK_LEFT_EXT ||
+ buffer != GLX_BACK_RIGHT_EXT ||
+ buffer != GLX_AUX0_EXT ||
+ buffer != GLX_AUX1_EXT ||
+ buffer != GLX_AUX2_EXT ||
+ buffer != GLX_AUX3_EXT ||
+ buffer != GLX_AUX4_EXT ||
+ buffer != GLX_AUX5_EXT ||
+ buffer != GLX_AUX6_EXT ||
+ buffer != GLX_AUX7_EXT ||
+ buffer != GLX_AUX8_EXT)
+ return __glXError(BadValue);
context = __glXForceCurrent (cl, req->contextTag, &error);
if (!context)
diff --git a/glx/glxdri2.c b/glx/glxdri2.c
index c4105e2..f2a7eef 100644
--- a/glx/glxdri2.c
+++ b/glx/glxdri2.c
@@ -219,7 +219,8 @@ __glXDRIbindTexImage(__GLXcontext *baseContext,
texBuffer->setTexBuffer(context->driContext,
glxPixmap->target,
- drawable->driDrawable);
+ drawable->driDrawable,
+ buffer);
return Success;
}
@@ -229,7 +230,18 @@ __glXDRIreleaseTexImage(__GLXcontext *baseContext,
int buffer,
__GLXdrawable *pixmap)
{
- /* FIXME: Just unbind the texture? */
+ __GLXDRIdrawable *drawable = (__GLXDRIdrawable *) glxPixmap;
+ const __DRItexBufferExtension *texBuffer = drawable->screen->texBuffer;
+ __GLXDRIcontext *context = (__GLXDRIcontext *) baseContext;
+
+ if (texBuffer == NULL)
+ return Success;
+
+ texBuffer->setTexBuffer(context->driContext,
+ GL_NONE, /* signify unbind */
+ drawable->driDrawable,
+ buffer);
+
return Success;
}
diff --git a/glx/glxdriswrast.c b/glx/glxdriswrast.c
index b425012..f9601c0 100644
--- a/glx/glxdriswrast.c
+++ b/glx/glxdriswrast.c
@@ -195,7 +195,8 @@ __glXDRIbindTexImage(__GLXcontext *baseContext,
texBuffer->setTexBuffer(context->driContext,
glxPixmap->target,
- drawable->driDrawable);
+ drawable->driDrawable,
+ buffer);
return Success;
}
_______________________________________________
xorg mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/xorg