Disable interrupt handling after the DRM handler has been removed,

preventing lockups (closes: #1886).
Allow pitches with a granularity of 32, rather than 64, because some
    clamshell iBooks have 800-byte pitches. Change Xv allocation
    granularity to 8 bytes, rather than 16 bytes, also (closes: #1888).
This commit is contained in:
Daniel Stone
2004-12-04 22:34:54 +00:00
parent 4706dfb780
commit 960d15ae3a
3 changed files with 15 additions and 11 deletions

View File

@@ -1297,6 +1297,7 @@ void R128DRICloseScreen(ScreenPtr pScreen)
if (info->irq) {
drmCtlUninstHandler(info->drmFD);
info->irq = 0;
info->gen_int_cntl = 0;
}
/* De-allocate vertex buffers */

View File

@@ -1642,7 +1642,11 @@ static Bool R128PreInitModes(ScrnInfoPtr pScrn)
NULL, /* linePitches */
8 * 64, /* minPitch */
8 * 1024, /* maxPitch */
8 * 64, /* pitchInc */
/*
* ATI docs say pitchInc must be 8 * 64, but this doesn't permit a pitch of
* 800 bytes, which is known to work on the Rage128 LF on clamshell iBooks
*/
8 * 32, /* pitchInc */
128, /* minHeight */
2048, /* maxHeight */
pScrn->display->virtualX,

View File

@@ -1,4 +1,4 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_video.c,v 1.28 2003/04/23 21:51:31 tsi Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_video.c,v 1.30 2003/11/10 18:22:18 tsi Exp $ */
#include "r128.h"
#include "r128_reg.h"
@@ -65,7 +65,7 @@ static void R128ECP(ScrnInfoPtr pScrn, R128PortPrivPtr pPriv)
R128InfoPtr info = R128PTR(pScrn);
unsigned char *R128MMIO = info->MMIO;
int dot_clock = info->ModeReg.dot_clock_freq;
if (dot_clock < 12500) pPriv->ecp_div = 0;
else if (dot_clock < 25000) pPriv->ecp_div = 1;
else pPriv->ecp_div = 2;
@@ -245,7 +245,7 @@ R128SetupImageVideo(ScreenPtr pScreen)
info->adaptor = adapt;
pPriv = (R128PortPrivPtr)(adapt->pPortPrivates[0].ptr);
REGION_INIT(pScreen, &(pPriv->clip), NullBox, 0);
REGION_NULL(pScreen, &(pPriv->clip));
R128ResetVideo(pScrn);
@@ -430,7 +430,7 @@ R128DMA(
return FALSE;
}
/* Copy parts of the block into buffers and fire them */
/* Copy parts of the block into buffers and fire them */
dstpassbytes = hpass*dstPitch;
dstPitch /= 8;
@@ -449,7 +449,7 @@ R128DMA(
} else {
int count = hpass;
while(count--) {
memcpy(buf, src, w);
memcpy(buf, src, w);
src += srcPitch;
buf += w;
}
@@ -579,20 +579,20 @@ R128AllocateMemory(
pScreen = screenInfo.screens[pScrn->scrnIndex];
new_linear = xf86AllocateOffscreenLinear(pScreen, size, 16,
new_linear = xf86AllocateOffscreenLinear(pScreen, size, 8,
NULL, NULL, NULL);
if(!new_linear) {
int max_size;
xf86QueryLargestOffscreenLinear(pScreen, &max_size, 16,
xf86QueryLargestOffscreenLinear(pScreen, &max_size, 8,
PRIORITY_EXTREME);
if(max_size < size)
return NULL;
xf86PurgeUnlockedOffscreenAreas(pScreen);
new_linear = xf86AllocateOffscreenLinear(pScreen, size, 16,
new_linear = xf86AllocateOffscreenLinear(pScreen, size, 8,
NULL, NULL, NULL);
}
@@ -770,7 +770,7 @@ R128PutImage(
R128InfoPtr info = R128PTR(pScrn);
R128PortPrivPtr pPriv = (R128PortPrivPtr)data;
INT32 xa, xb, ya, yb;
int pitch, new_size, offset, s1offset, s2offset, s3offset;
int new_size, offset, s1offset, s2offset, s3offset;
int srcPitch, srcPitch2, dstPitch;
int d1line, d2line, d3line, d1offset, d2offset, d3offset;
int top, left, npixels, nlines, bpp;
@@ -826,7 +826,6 @@ R128PutImage(
dstBox.y2 -= pScrn->frameY0;
bpp = pScrn->bitsPerPixel >> 3;
pitch = bpp * pScrn->displayWidth;
switch(id) {
case FOURCC_YV12: