Merged mga branch with trunk
[platform/upstream/libdrm.git] / linux / bufs.c
index 85244c7..7902f0c 100644 (file)
@@ -102,6 +102,11 @@ int drm_addmap(struct inode *inode, struct file *filp, unsigned int cmd,
                        dev->lock.hw_lock = map->handle; /* Pointer to lock */
                }
                break;
+#ifdef DRM_AGP
+       case _DRM_AGP:
+               map->offset = map->offset + dev->agp->base;
+               break;
+#endif
        default:
                drm_free(map, sizeof(*map), DRM_MEM_MAPS);
                return -EINVAL;
@@ -172,7 +177,7 @@ int drm_addbufs(struct inode *inode, struct file *filp, unsigned int cmd,
        if (order < DRM_MIN_ORDER || order > DRM_MAX_ORDER) return -EINVAL;
        if (dev->queue_count) return -EBUSY; /* Not while in use */
 
-       alignment  = (request.flags & DRM_PAGE_ALIGN) ? PAGE_ALIGN(size) :size;
+       alignment  = (request.flags & _DRM_PAGE_ALIGN) ? PAGE_ALIGN(size):size;
        page_order = order - PAGE_SHIFT > 0 ? order - PAGE_SHIFT : 0;
        total      = PAGE_SIZE << page_order;