diff options
Diffstat (limited to 'linux-core/i915_buffer.c')
-rw-r--r-- | linux-core/i915_buffer.c | 15 |
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); |