drm/ttm: Correctly set page mapping and -index members
[deliverable/linux.git] / drivers / gpu / drm / ttm / ttm_bo_vm.c
index 12d7f53b7c13e441f92cd06f7c86a81e7984aea1..cfcdf5b5440acb76d834a49e71b74fae14cb0fc1 100644 (file)
@@ -226,6 +226,9 @@ static int ttm_bo_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
                        } else if (unlikely(!page)) {
                                break;
                        }
+                       page->mapping = vma->vm_file->f_mapping;
+                       page->index = drm_vma_node_start(&bo->vma_node) +
+                               page_offset;
                        pfn = page_to_pfn(page);
                }
 
@@ -263,6 +266,8 @@ static void ttm_bo_vm_open(struct vm_area_struct *vma)
        struct ttm_buffer_object *bo =
            (struct ttm_buffer_object *)vma->vm_private_data;
 
+       WARN_ON(bo->bdev->dev_mapping != vma->vm_file->f_mapping);
+
        (void)ttm_bo_reference(bo);
 }
 
This page took 0.028398 seconds and 5 git commands to generate.