drm2: Make the PAT code more compatible with FreeBSD
authorFrançois Tigeot <ftigeot@wolfpond.org>
Thu, 18 Jul 2013 18:43:28 +0000 (20:43 +0200)
committerFrançois Tigeot <ftigeot@wolfpond.org>
Tue, 30 Jul 2013 18:46:05 +0000 (20:46 +0200)
* drm_mmap() still has issues with the memattr parameter

sys/dev/drm2/drm_gem.c
sys/dev/drm2/drm_vm.c
sys/vm/device_pager.c

index bfd15a1..509a733 100644 (file)
@@ -106,7 +106,6 @@ drm_gem_object_init(struct drm_device *dev, struct drm_gem_object *obj,
        obj->refcount = 1;
        obj->handle_count = 0;
        obj->size = size;
-       obj->vm_obj->pat_mode = PAT_WRITE_COMBINING;    /* XXX */
 
        return (0);
 }
index 44720df..cbbf16e 100644 (file)
@@ -120,13 +120,17 @@ drm_mmap(struct dev_mmap_args *ap)
        switch (type) {
        case _DRM_FRAME_BUFFER:
        case _DRM_AGP:
-               /* memattr set by type in map's object */
+#if 0  /* XXX */
+               memattr = VM_MEMATTR_WRITE_COMBINING;
+#endif
                /* FALLTHROUGH */
        case _DRM_REGISTERS:
                phys = map->offset + offset;
                break;
        case _DRM_SCATTER_GATHER:
-               /* memattr set by type in map's object */
+#if 0  /* XXX */
+               memattr = VM_MEMATTR_WRITE_COMBINING;
+#endif
                /* FALLTHROUGH */
        case _DRM_CONSISTENT:
        case _DRM_SHM:
index 57ea82a..6f93919 100644 (file)
@@ -360,7 +360,7 @@ static int old_dev_pager_fault(vm_object_t object, vm_ooffset_t offset,
                 * Replace the passed in reqpage page with our own fake page
                 * and free up all the original pages.
                 */
-               page = dev_pager_getfake(paddr, object->pat_mode);
+               page = dev_pager_getfake(paddr, object->memattr);
                TAILQ_INSERT_TAIL(&object->un_pager.devp.devp_pglist,
                                  page, pageq);
                vm_object_hold(object);