DRI2: Return event buffer head index in DRI2CreateDrawable.

And pass it to the DRI driver in AIGLX.
This commit is contained in:
Kristian Høgsberg 2008-03-09 21:39:19 -04:00
parent 911f0c1476
commit acedc03367
4 changed files with 10 additions and 6 deletions

View File

@ -704,7 +704,7 @@ __glXDRIscreenCreateDrawable(__GLXscreen *screen,
(driScreen->driScreen.createNewDrawable)(&driScreen->driScreen,
modes,
&private->driDrawable,
hwDrawable, 0, NULL);
hwDrawable, 0, 0, NULL);
if (private->driDrawable.private == NULL) {
__glXenterServer(GL_FALSE);

View File

@ -341,6 +341,7 @@ __glXDRIscreenCreateDrawable(__GLXscreen *screen,
__GLXDRIdrawable *private;
GLboolean retval;
drm_drawable_t hwDrawable;
unsigned int head;
private = xalloc(sizeof *private);
if (private == NULL)
@ -359,13 +360,14 @@ __glXDRIscreenCreateDrawable(__GLXscreen *screen,
private->base.swapBuffers = __glXDRIdrawableSwapBuffers;
private->base.copySubBuffer = __glXDRIdrawableCopySubBuffer;
retval = DRI2CreateDrawable(screen->pScreen, pDraw, &hwDrawable);
retval = DRI2CreateDrawable(screen->pScreen, pDraw,
&hwDrawable, &head);
private->driDrawable.private =
(driScreen->driScreen.createNewDrawable)(&driScreen->driScreen,
modes,
&private->driDrawable,
hwDrawable, 0, NULL);
hwDrawable, head, 0, NULL);
return &private->base;
}

View File

@ -262,8 +262,8 @@ DRI2CloseScreen(ScreenPtr pScreen)
}
Bool
DRI2CreateDrawable(ScreenPtr pScreen,
DrawablePtr pDraw, drm_drawable_t *pDrmDrawable)
DRI2CreateDrawable(ScreenPtr pScreen, DrawablePtr pDraw,
drm_drawable_t *pDrmDrawable, unsigned int *head)
{
DRI2ScreenPtr ds = DRI2GetScreen(pScreen);
WindowPtr pWin;
@ -293,6 +293,7 @@ DRI2CreateDrawable(ScreenPtr pScreen,
*pDrmDrawable = pPriv->drawable;
*head = ds->buffer->head;
DRI2PostDrawableConfig(pDraw);
DRI2PostBufferAttach(pDraw);
DRI2ScreenCommitEvents(ds);

View File

@ -66,7 +66,8 @@ void DRI2Unlock(ScreenPtr pScreen);
Bool DRI2CreateDrawable(ScreenPtr pScreen,
DrawablePtr pDraw,
drm_drawable_t *pDrmDrawable);
drm_drawable_t *pDrmDrawable,
unsigned int *head);
void DRI2DestroyDrawable(ScreenPtr pScreen,
DrawablePtr pDraw);