summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Hellstrom <unichrome@shipmail.org>2005-05-08 20:33:04 +0000
committerThomas Hellstrom <unichrome@shipmail.org>2005-05-08 20:33:04 +0000
commite0fc400b681cb6b04ba0769c58f279a2aa4326a5 (patch)
tree2fe36e3aa3a93b5fb68a8893a9235f47f107a364
parent6aae7bd5b061c6a8130787ba3ea5aa07c744eda9 (diff)
VIA: Fix for oops when AGP ring-buffer initialization is called and there
is no AGP memory acquired.
-rw-r--r--shared-core/via_dma.c6
-rw-r--r--shared-core/via_drv.h4
-rw-r--r--shared/via.h4
-rw-r--r--shared/via_dma.c6
4 files changed, 16 insertions, 4 deletions
diff --git a/shared-core/via_dma.c b/shared-core/via_dma.c
index 2347d98b..82f83945 100644
--- a/shared-core/via_dma.c
+++ b/shared-core/via_dma.c
@@ -188,6 +188,12 @@ static int via_initialize(drm_device_t * dev,
return DRM_ERR(EFAULT);
}
+ if (!dev->agp || !dev->agp->base) {
+ DRM_ERROR("%s called with no agp memory available\n",
+ __FUNCTION__);
+ return DRM_ERR(EFAULT);
+ }
+
dev_priv->ring.map.offset = dev->agp->base + init->offset;
dev_priv->ring.map.size = init->size;
dev_priv->ring.map.type = 0;
diff --git a/shared-core/via_drv.h b/shared-core/via_drv.h
index a6164197..f29877cc 100644
--- a/shared-core/via_drv.h
+++ b/shared-core/via_drv.h
@@ -28,11 +28,11 @@
#define DRIVER_NAME "via"
#define DRIVER_DESC "VIA Unichrome / Pro"
-#define DRIVER_DATE "20050420"
+#define DRIVER_DATE "20050508"
#define DRIVER_MAJOR 2
#define DRIVER_MINOR 6
-#define DRIVER_PATCHLEVEL 2
+#define DRIVER_PATCHLEVEL 3
#include "via_verifier.h"
diff --git a/shared/via.h b/shared/via.h
index 985358b0..9a21e89a 100644
--- a/shared/via.h
+++ b/shared/via.h
@@ -30,11 +30,11 @@
#define DRIVER_NAME "via"
#define DRIVER_DESC "VIA Unichrome / Pro"
-#define DRIVER_DATE "20050420"
+#define DRIVER_DATE "20050508"
#define DRIVER_MAJOR 2
#define DRIVER_MINOR 6
-#define DRIVER_PATCHLEVEL 2
+#define DRIVER_PATCHLEVEL 3
#define DRIVER_IOCTLS \
[DRM_IOCTL_NR(DRM_IOCTL_VIA_ALLOCMEM)] = { via_mem_alloc, 1, 0 }, \
diff --git a/shared/via_dma.c b/shared/via_dma.c
index c6c14dc0..672552e4 100644
--- a/shared/via_dma.c
+++ b/shared/via_dma.c
@@ -189,6 +189,12 @@ static int via_initialize(drm_device_t * dev,
return DRM_ERR(EFAULT);
}
+ if (!dev->agp || !dev->agp->base) {
+ DRM_ERROR("%s called with no agp memory available\n",
+ __FUNCTION__);
+ return DRM_ERR(EFAULT);
+ }
+
dev_priv->ring.map.offset = dev->agp->base + init->offset;
dev_priv->ring.map.size = init->size;
dev_priv->ring.map.type = 0;