drm: Fix mismerge of non-coherent DMA patch
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Sun, 20 Apr 2008 00:26:25 +0000 (10:26 +1000)
committerDave Airlie <airlied@linux.ie>
Sat, 26 Apr 2008 07:48:17 +0000 (17:48 +1000)
The patch for supporting non coherent PCI DMA in the DRM was mismerged
causing the page protection to be updated for the wrong type of
mapping.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/char/drm/drm_vm.c

index 945df72a51a9f2df78aac8f9a1c128ac85016a0e..b20c1e950d3e10fc7831e871ad407fe97002f36c 100644 (file)
@@ -640,12 +640,12 @@ static int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma)
                /* Don't let this area swap.  Change when
                   DRM_KERNEL advisory is supported. */
                vma->vm_flags |= VM_RESERVED;
-               vma->vm_page_prot = drm_dma_prot(map->type, vma);
                break;
        case _DRM_SCATTER_GATHER:
                vma->vm_ops = &drm_vm_sg_ops;
                vma->vm_private_data = (void *)map;
                vma->vm_flags |= VM_RESERVED;
+               vma->vm_page_prot = drm_dma_prot(map->type, vma);
                break;
        default:
                return -EINVAL; /* This should never happen. */