summaryrefslogtreecommitdiff
path: root/linux-core/i915_buffer.c
diff options
context:
space:
mode:
authorThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2007-02-06 16:59:45 +0100
committerThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2007-02-06 16:59:45 +0100
commit71b9e876f99db219fcbf4e3ab977b64b068cc2b4 (patch)
treed55a70612ab8d75abc0146a8c6ebddaea4ce0d05 /linux-core/i915_buffer.c
parent40ce53dfde11f84d7bf8db5db93fb73715b2e96e (diff)
Simplify pci map vs no pci map choice.
Diffstat (limited to 'linux-core/i915_buffer.c')
-rw-r--r--linux-core/i915_buffer.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/linux-core/i915_buffer.c b/linux-core/i915_buffer.c
index 13a3e9bb..c1cdd112 100644
--- a/linux-core/i915_buffer.c
+++ b/linux-core/i915_buffer.c
@@ -71,8 +71,17 @@ int i915_init_mem_type(drm_device_t *dev, uint32_t type,
switch(type) {
case DRM_BO_MEM_LOCAL:
case DRM_BO_MEM_TT:
+ if (!(drm_core_has_AGP(dev) && dev->agp)) {
+ DRM_ERROR("AGP is not enabled for memory type %u\n",
+ (unsigned) type);
+ return -EINVAL;
+ }
+ man->io_offset = dev->agp->agp_info.aper_base;
+ man->io_size = dev->agp->agp_info.aper_size * 1024 * 1024;
+ man->io_addr = NULL;
man->flags = _DRM_FLAG_MEMTYPE_MAPPABLE |
- _DRM_FLAG_MEMTYPE_CACHED;
+ _DRM_FLAG_MEMTYPE_CACHED |
+ _DRM_FLAG_NEEDS_IOREMAP;
break;
case DRM_BO_MEM_PRIV0:
if (!(drm_core_has_AGP(dev) && dev->agp)) {
@@ -82,13 +91,11 @@ int i915_init_mem_type(drm_device_t *dev, uint32_t type,
}
man->io_offset = dev->agp->agp_info.aper_base;
man->io_size = dev->agp->agp_info.aper_size * 1024 * 1024;
-
+ man->io_addr = NULL;
man->flags = _DRM_FLAG_MEMTYPE_MAPPABLE |
- _DRM_FLAG_MEMTYPE_CACHED |
_DRM_FLAG_MEMTYPE_FIXED |
_DRM_FLAG_NEEDS_IOREMAP;
- man->io_addr = NULL;
break;
default:
DRM_ERROR("Unsupported memory type %u\n", (unsigned) type);