summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorThomas Hellström <[email protected]>2005-01-06 13:51:37 +0000
committerThomas Hellström <[email protected]>2005-01-06 13:51:37 +0000
commit4c1d373ce17ad0831a986c9e88f65425e5dab4f4 (patch)
treea30296ffc0cd3d7b883745c3a3bec88d91b11309 /src/mesa
parentdd1ef7c0d78fdb2dd6587c87394680c6e8c79648 (diff)
Small Unichrome fixes:
1. Unlock hardware before aborting and dumping DMA buffers. Otherwise display system may deadlock. 2. Fix DMA init IOCTL call that got mixed up in one of the previous commits. 3. Fix AGP command alignment
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/unichrome/via_fb.c2
-rw-r--r--src/mesa/drivers/dri/unichrome/via_ioctl.c3
-rw-r--r--src/mesa/drivers/dri/unichrome/via_tris.c2
3 files changed, 5 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/unichrome/via_fb.c b/src/mesa/drivers/dri/unichrome/via_fb.c
index 122d3b17cc7..241bf0b9a3b 100644
--- a/src/mesa/drivers/dri/unichrome/via_fb.c
+++ b/src/mesa/drivers/dri/unichrome/via_fb.c
@@ -76,7 +76,7 @@ via_alloc_dma_buffer(viaContextPtr vmesa)
*/
init.func = VIA_DMA_INITIALIZED;
vmesa->useAgp =
- ( 0 == drmCommandWrite(vmesa->driFd, VIA_INIT_DMA,
+ ( 0 == drmCommandWrite(vmesa->driFd, DRM_VIA_DMA_INIT,
&init, sizeof(init)));
if (vmesa->useAgp)
printf("unichrome_dri.so: Using AGP.\n");
diff --git a/src/mesa/drivers/dri/unichrome/via_ioctl.c b/src/mesa/drivers/dri/unichrome/via_ioctl.c
index bbb6651deef..1ea7b2fa806 100644
--- a/src/mesa/drivers/dri/unichrome/via_ioctl.c
+++ b/src/mesa/drivers/dri/unichrome/via_ioctl.c
@@ -458,6 +458,7 @@ static int fire_buffer(viaContextPtr vmesa)
&bSiz, sizeof(bSiz));
} while (ret == -EAGAIN);
if (ret) {
+ UNLOCK_HARDWARE(vmesa);
fprintf(stderr, "%s: DRM_VIA_CMDBUF_SIZE returned %d\n", __FUNCTION__, ret);
abort();
return ret;
@@ -470,6 +471,7 @@ static int fire_buffer(viaContextPtr vmesa)
&bufI, sizeof(bufI));
} while (ret == -EAGAIN);
if (ret) {
+ UNLOCK_HARDWARE(vmesa);
fprintf(stderr, "%s: DRM_VIA_CMDBUFFER returned %d\n", __FUNCTION__, ret);
abort();
/* If this fails, the original code fell back to the PCI path.
@@ -485,6 +487,7 @@ static int fire_buffer(viaContextPtr vmesa)
ret = drmCommandWrite(vmesa->driFd, DRM_VIA_PCICMD, &bufI, sizeof(bufI));
if (ret) {
+ UNLOCK_HARDWARE(vmesa);
dump_dma(vmesa);
fprintf(stderr, "%s: DRM_VIA_PCICMD returned %d\n", __FUNCTION__, ret);
abort();
diff --git a/src/mesa/drivers/dri/unichrome/via_tris.c b/src/mesa/drivers/dri/unichrome/via_tris.c
index 022399f6981..6fd5a2a64c4 100644
--- a/src/mesa/drivers/dri/unichrome/via_tris.c
+++ b/src/mesa/drivers/dri/unichrome/via_tris.c
@@ -987,7 +987,7 @@ void viaFinishPrimitive(viaContextPtr vmesa)
/* KW: modified 0x1 to 0x4 below:
*/
- if ((vmesa->dmaLow & 0x1) || !vmesa->useAgp) {
+ if ((vmesa->dmaLow & 0x4) || !vmesa->useAgp) {
BEGIN_RING_NOCHECK( 1 );
OUT_RING( cmdA );
ADVANCE_RING();