diff options
author | Thomas Hellström <thomas@shipmail.org> | 2008-10-29 10:56:34 +0000 |
---|---|---|
committer | Thomas Hellström <thomas@shipmail.org> | 2008-10-29 10:56:34 +0000 |
commit | 6c8df98ccf9eb73a03893e86dfc03f413aa1bc70 (patch) | |
tree | 807062711d93921406d8e6f51003084dec0cc963 | |
parent | fe96558a0a5f6c01fb17c0d2df3b3fd0f3f2d49e (diff) |
Some accel cleanups. Fix a VT switch segfault
-rw-r--r-- | src/via_accel.c | 28 | ||||
-rw-r--r-- | src/via_driver.c | 9 | ||||
-rw-r--r-- | src/via_driver.h | 1 |
3 files changed, 6 insertions, 32 deletions
diff --git a/src/via_accel.c b/src/via_accel.c index ed13667..b6a5433 100644 --- a/src/via_accel.c +++ b/src/via_accel.c @@ -588,32 +588,12 @@ viaExaPixmapIsOffscreen(PixmapPtr p) ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; VIAPtr pVia = VIAPTR(pScrn); - return (viaInBuffer(&pVia->offscreen, p->devPrivate.ptr) != NULL); -} - -static unsigned long -viaExaPixmapOffset(PixmapPtr p) -{ - ScreenPtr pScreen = p->drawable.pScreen; - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - VIAPtr pVia = VIAPTR(pScrn); - void *ptr; - struct _ViaOffscreenBuffer *buf; - - ptr = (void *) exaGetPixmapOffset(p) + - (unsigned long) pVia->exaMem.virtual; - - buf = viaInBuffer(&pVia->offscreen, ptr); - - if (!buf) - FatalError("Offscreen pixmap is not offscreen.\n"); + if (pVia->vtNotified == TRUE) + return FALSE; - return (unsigned long)ptr - (unsigned long) buf->virtual + - driBOOffset(buf->buf); + return (viaInBuffer(&pVia->offscreen, p->devPrivate.ptr) != NULL); } - - static Bool viaExaPrepareSolid(PixmapPtr pPixmap, int alu, Pixel planeMask, Pixel fg) { @@ -702,8 +682,6 @@ viaExaPrepareCopy(PixmapPtr pSrcPixmap, PixmapPtr pDstPixmap, int xdir, if (exaGetPixmapPitch(pDstPixmap) & 7) return FALSE; - tdc->srcOffset = viaExaPixmapOffset(pSrcPixmap); - tdc->cmd = VIA_GEC_BLT | VIAACCELCOPYROP(alu); if (xdir < 0) tdc->cmd |= VIA_GEC_DECX; diff --git a/src/via_driver.c b/src/via_driver.c index 2c96a0f..53e4940 100644 --- a/src/via_driver.c +++ b/src/via_driver.c @@ -1789,7 +1789,7 @@ VIAEnterVT(int scrnIndex, int flags) &vt, sizeof(vt)) < 0) ErrorF("Failed DRM VT enter.\n"); else - pVia->vtNotified = GL_TRUE; + pVia->vtNotified = FALSE; } #endif @@ -1918,9 +1918,6 @@ VIALeaveVT(int scrnIndex, int flags) 0, DRM_BO_FLAG_NO_EVICT); - // (void) driBOData(pVia->scanout.bufs[VIA_SCANOUT_OVERLAY], - // 0, NULL, NULL, 0); - (void) driBOData(pVia->scanout.bufs[VIA_SCANOUT_DISPLAY], 0, NULL, NULL, 0); @@ -1934,7 +1931,7 @@ VIALeaveVT(int scrnIndex, int flags) &vt, sizeof(vt)) < 0) ErrorF("Failed DRM VT leave.\n"); else - pVia->vtNotified = GL_TRUE; + pVia->vtNotified = TRUE; } #endif @@ -2863,7 +2860,7 @@ VIACloseScreen(int scrnIndex, ScreenPtr pScreen) &vt, sizeof(vt)) < 0) ErrorF("Failed DRM VT leave.\n"); else - pVia->vtNotified = GL_FALSE; + pVia->vtNotified = FALSE; } VIADRICloseScreen(pScreen); } diff --git a/src/via_driver.h b/src/via_driver.h index 912244c..957049a 100644 --- a/src/via_driver.h +++ b/src/via_driver.h @@ -181,7 +181,6 @@ typedef struct _twodContext { CARD32 pattern1; CARD32 patternAddr; CARD32 keyControl; - unsigned srcOffset; unsigned srcPitch; unsigned bpp; unsigned bytesPPShift; |