summaryrefslogtreecommitdiff
path: root/linux-core/drm_agpsupport.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@neko.keithp.com>2007-01-07 22:37:40 -0800
committerKeith Packard <keithp@neko.keithp.com>2007-01-07 22:37:40 -0800
commitc5aaf7648df82665851c9e67f5509b427ca34c8e (patch)
tree55b317738a99097cb02ba6a736b9ef20de6b34f3 /linux-core/drm_agpsupport.c
parent63c0f3946056d044b7c5688fa5cb670782212c77 (diff)
parentd0080d71b9f3df0d4f743324b7e8f1ce580bdcaf (diff)
Merge branch 'master' into crestline
Conflicts: shared-core/i915_drm.h Whitespace change only
Diffstat (limited to 'linux-core/drm_agpsupport.c')
-rw-r--r--linux-core/drm_agpsupport.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/linux-core/drm_agpsupport.c b/linux-core/drm_agpsupport.c
index a5f1f9ee..9cdbdaf0 100644
--- a/linux-core/drm_agpsupport.c
+++ b/linux-core/drm_agpsupport.c
@@ -106,10 +106,6 @@ int drm_agp_acquire(drm_device_t * dev)
return -ENODEV;
if (dev->agp->acquired)
return -EBUSY;
-#ifndef VMAP_4_ARGS
- if (dev->agp->cant_use_aperture)
- return -EINVAL;
-#endif
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,11)
if ((retcode = agp_backend_acquire()))
return retcode;
@@ -563,6 +559,8 @@ int drm_agp_unbind_memory(DRM_AGP_MEM * handle)
#define AGP_USER_MEMORY (AGP_USER_TYPES)
#define AGP_USER_CACHED_MEMORY (AGP_USER_TYPES + 1)
#endif
+#define AGP_REQUIRED_MAJOR 0
+#define AGP_REQUIRED_MINOR 102
static int drm_agp_needs_unbind_cache_adjust(drm_ttm_backend_t *backend) {
return ((backend->flags & DRM_BE_FLAG_BOUND_CACHED) ? 0 : 1);
@@ -673,6 +671,24 @@ drm_ttm_backend_t *drm_agp_init_ttm(struct drm_device *dev,
drm_ttm_backend_t *agp_be;
drm_agp_ttm_priv *agp_priv;
+ struct agp_kern_info *info;
+
+ if (!dev->agp) {
+ DRM_ERROR("AGP is not initialized.\n");
+ return NULL;
+ }
+ info = &dev->agp->agp_info;
+
+ if (info->version.major != AGP_REQUIRED_MAJOR ||
+ info->version.minor < AGP_REQUIRED_MINOR) {
+ DRM_ERROR("Wrong agpgart version %d.%d\n"
+ "\tYou need at least version %d.%d.\n",
+ info->version.major,
+ info->version.minor,
+ AGP_REQUIRED_MAJOR,
+ AGP_REQUIRED_MINOR);
+ return NULL;
+ }
agp_be = (backend != NULL) ? backend:
drm_ctl_calloc(1, sizeof(*agp_be), DRM_MEM_MAPPINGS);
@@ -687,6 +703,7 @@ drm_ttm_backend_t *drm_agp_init_ttm(struct drm_device *dev,
return NULL;
}
+
agp_priv->mem = NULL;
agp_priv->alloc_type = AGP_USER_MEMORY;
agp_priv->cached_type = AGP_USER_CACHED_MEMORY;