dri2: declare variables where needed in DRI2UpdatePrime()

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult
2026-02-05 19:41:31 +01:00
committed by Enrico Weigelt
parent d8db7c3908
commit 654b491d58

View File

@@ -810,12 +810,8 @@ DRI2InvalidateDrawableAll(DrawablePtr pDraw)
DrawablePtr DRI2UpdatePrime(DrawablePtr pDraw, DRI2BufferPtr pDest)
{
DRI2DrawablePtr pPriv = DRI2GetDrawable(pDraw);
PixmapPtr spix;
PixmapPtr mpix = GetDrawablePixmap(pDraw);
ScreenPtr primary, secondary;
Bool ret;
primary = mpix->drawable.pScreen;
ScreenPtr primary = mpix->drawable.pScreen;
if (pDraw->type == DRAWABLE_WINDOW) {
WindowPtr pWin = (WindowPtr)pDraw;
@@ -834,8 +830,7 @@ DrawablePtr DRI2UpdatePrime(DrawablePtr pDraw, DRI2BufferPtr pDest)
if (!mpix)
return NULL;
ret = (*primary->ReplaceScanoutPixmap)(pDraw, mpix, TRUE);
if (ret == FALSE) {
if (!(primary->ReplaceScanoutPixmap(pDraw, mpix, TRUE))) {
dixDestroyPixmap(mpix, 0);
return NULL;
}
@@ -850,7 +845,7 @@ DrawablePtr DRI2UpdatePrime(DrawablePtr pDraw, DRI2BufferPtr pDest)
}
}
secondary = GetScreenPrime(pDraw->pScreen, pPriv->prime_id);
ScreenPtr secondary = GetScreenPrime(pDraw->pScreen, pPriv->prime_id);
/* check if the pixmap is still fine */
if (pPriv->prime_secondary_pixmap) {
@@ -864,7 +859,7 @@ DrawablePtr DRI2UpdatePrime(DrawablePtr pDraw, DRI2BufferPtr pDest)
}
}
spix = PixmapShareToSecondary(mpix, secondary);
PixmapPtr spix = PixmapShareToSecondary(mpix, secondary);
if (!spix)
return NULL;