Skip to content

Commit b204142

Browse files
committed
drm/vmwgfx: Use VM_PFNMAP instead of VM_MIXEDMAP when possible
For shared, and read-only private mappings of graphics memory, use VM_PFNMAP instead of VM_MIXEDMAP. This means less accounting overhead when inserting and removing page-table entries. TTM doesn't do this by default, since there was a performance problem with book-keeping of write-combined mappings. Since vmwgfx solely uses cached mappings, that's not a problem and now that the TTM vm has largely been turned into helpers, we can use VM_PFNMAP on a per-driver basis Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
1 parent 61780dd commit b204142

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/gpu/drm/vmwgfx/vmwgfx_ttm_glue.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ int vmw_mmap(struct file *filp, struct vm_area_struct *vma)
4545

4646
vma->vm_ops = &vmw_vm_ops;
4747

48+
/* Use VM_PFNMAP rather than VM_MIXEDMAP if not a COW mapping */
49+
if ((vma->vm_flags & (VM_SHARED | VM_MAYWRITE)) != VM_MAYWRITE)
50+
vma->vm_flags = (vma->vm_flags & ~VM_MIXEDMAP) | VM_PFNMAP;
51+
4852
return 0;
4953
}
5054

0 commit comments

Comments
 (0)