Fixing dri3 pixmap allocating issue

This commit is contained in:
Twaik Yont 2024-04-08 19:18:55 +03:00
parent dd9df40f3e
commit 27dba2abb2
2 changed files with 7 additions and 7 deletions

View File

@ -559,14 +559,14 @@ lorieScreenInit(ScreenPtr pScreen, unused int argc, unused char **argv) {
pScreen->whitePixel = 1;
if (FALSE
|| !lorieInitDri3(pScreen)
|| !miSetVisualTypesAndMasks(24, ((1 << TrueColor) | (1 << DirectColor)), 8, TrueColor, 0xFF0000, 0x00FF00, 0x0000FF)
|| !miSetPixmapDepths()
|| !fbScreenInit(pScreen, NULL, pvfb->root.width, pvfb->root.height, monitorResolution, monitorResolution, 0, 32)
|| !fbPictureInit(pScreen, 0, 0)
|| !lorieRandRInit(pScreen)
|| !miPointerInitialize(pScreen, &loriePointerSpriteFuncs, &loriePointerCursorFuncs, TRUE)
|| !fbCreateDefColormap(pScreen)
|| !lorieInitDri3(pScreen))
|| !fbCreateDefColormap(pScreen))
return FALSE;
wrap(pvfb, pScreen, CreateScreenResources, lorieCreateScreenResources)
@ -728,4 +728,4 @@ __GLXprovider __glXDRISWRastProvider = {
glXDRIscreenProbe,
"DRISWRAST",
NULL
};
};

View File

@ -408,7 +408,7 @@ lorieDestroyPixmap(PixmapPtr pPixmap) {
ScreenPtr pScreen = pPixmap->drawable.pScreen;
lorieScrPriv(pScreen);
if (pPixmap->refcnt == 1) {
if (pPixmap->refcnt == 1 && !pPixmap->drawable.width && !pPixmap->drawable.height) {
ptr = dixLookupPrivate(&pPixmap->devPrivates, &lorieMmappedPixPrivateKey);
pPixPriv = dixLookupPrivate(&pPixmap->devPrivates, &lorieAHBPixPrivateKey);
size = pPixmap->devKind * pPixmap->drawable.height;
@ -490,7 +490,7 @@ static PixmapPtr loriePixmapFromFds(ScreenPtr screen, CARD8 num_fds, const int *
goto fail;
}
dixSetPrivate(&pixmap->devPrivates, &lorieMmappedPixPrivateKey, pPixPriv);
dixSetPrivate(&pixmap->devPrivates, &lorieAHBPixPrivateKey, pPixPriv);
// Sending signal to other end of socket to send buffer.
uint8_t buf = 1;
@ -517,7 +517,7 @@ static PixmapPtr loriePixmapFromFds(ScreenPtr screen, CARD8 num_fds, const int *
goto fail;
}
screen->ModifyPixmapHeader(pixmap, desc.width, desc.height, 0, 0, desc.stride, NULL);
screen->ModifyPixmapHeader(pixmap, desc.width, desc.height, 0, 0, desc.stride * 4, NULL);
return pixmap;
}
@ -579,4 +579,4 @@ Bool lorieInitDri3(ScreenPtr pScreen) {
dixSetPrivate(&pScreen->devPrivates, &lorieScrPrivateKey, pScrPriv);
return TRUE;
}
}