diff options
author | Jesse Barnes <jbarnes@virtuousgeek.org> | 2009-03-31 21:22:31 -0400 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2009-04-02 17:28:32 -0400 |
commit | 1055f9ddad093f54dfd708a0f976582034d4ce1a (patch) | |
tree | 0e13654a1cc5cbd204b7b2cbaebd48b11821d507 /drivers/gpu | |
parent | 5e118f4139feafe97e913df67b1f7c1e5083e535 (diff) |
drm: Use pgprot_writecombine in GEM GTT mapping to get the right bits for !PAT.
Otherwise, the PAGE_CACHE_WC would end up getting us a UC-only mapping, and
the write performance of GTT maps dropped 10x.
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
[anholt: cleaned up unused var]
Signed-off-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/drm_gem.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c index c1173d8c4588..4984aa89cf3d 100644 --- a/drivers/gpu/drm/drm_gem.c +++ b/drivers/gpu/drm/drm_gem.c | |||
@@ -505,7 +505,6 @@ int drm_gem_mmap(struct file *filp, struct vm_area_struct *vma) | |||
505 | struct drm_local_map *map = NULL; | 505 | struct drm_local_map *map = NULL; |
506 | struct drm_gem_object *obj; | 506 | struct drm_gem_object *obj; |
507 | struct drm_hash_item *hash; | 507 | struct drm_hash_item *hash; |
508 | unsigned long prot; | ||
509 | int ret = 0; | 508 | int ret = 0; |
510 | 509 | ||
511 | mutex_lock(&dev->struct_mutex); | 510 | mutex_lock(&dev->struct_mutex); |
@@ -538,11 +537,7 @@ int drm_gem_mmap(struct file *filp, struct vm_area_struct *vma) | |||
538 | vma->vm_ops = obj->dev->driver->gem_vm_ops; | 537 | vma->vm_ops = obj->dev->driver->gem_vm_ops; |
539 | vma->vm_private_data = map->handle; | 538 | vma->vm_private_data = map->handle; |
540 | /* FIXME: use pgprot_writecombine when available */ | 539 | /* FIXME: use pgprot_writecombine when available */ |
541 | prot = pgprot_val(vma->vm_page_prot); | 540 | vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot); |
542 | #ifdef CONFIG_X86 | ||
543 | prot |= _PAGE_CACHE_WC; | ||
544 | #endif | ||
545 | vma->vm_page_prot = __pgprot(prot); | ||
546 | 541 | ||
547 | /* Take a ref for this mapping of the object, so that the fault | 542 | /* Take a ref for this mapping of the object, so that the fault |
548 | * handler can dereference the mmap offset's pointer to the object. | 543 | * handler can dereference the mmap offset's pointer to the object. |