aboutsummaryrefslogtreecommitdiff
path: root/linux-core/drm_compat.c
diff options
context:
space:
mode:
authorThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2007-02-01 13:19:05 +0100
committerThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2007-02-01 13:19:05 +0100
commitdd733dea3856e7ddbba7c4c3928ccaba909b4535 (patch)
tree070e49a765a974df2690140ea0e6b7d65abda39c /linux-core/drm_compat.c
parent9677c5ecc6b97ef75b3141b671fb5cfbbf8a3fa8 (diff)
Fix missing ttm_open_vma call from previous commit.
Honour the ttm backend cant-use-aperture flag.
Diffstat (limited to 'linux-core/drm_compat.c')
-rw-r--r--linux-core/drm_compat.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/linux-core/drm_compat.c b/linux-core/drm_compat.c
index 6bb58424..93d9b95d 100644
--- a/linux-core/drm_compat.c
+++ b/linux-core/drm_compat.c
@@ -277,7 +277,9 @@ int drm_ttm_map_bound(struct vm_area_struct *vma)
drm_ttm_t *ttm = (drm_ttm_t *) map->offset;
int ret = 0;
- if (ttm->page_flags & DRM_TTM_PAGE_UNCACHED) {
+ if ((ttm->page_flags & DRM_TTM_PAGE_UNCACHED) &&
+ !(ttm->be->flags & DRM_BE_FLAG_CMA)) {
+
unsigned long pfn = ttm->aper_offset +
(ttm->be->aperture_base >> PAGE_SHIFT);
pgprot_t pgprot = drm_io_prot(ttm->be->drm_map_type, vma);
@@ -286,6 +288,7 @@ int drm_ttm_map_bound(struct vm_area_struct *vma)
vma->vm_end - vma->vm_start,
pgprot);
}
+
return ret;
}
@@ -408,10 +411,14 @@ int drm_ttm_remap_bound(drm_ttm_t *ttm)
vma_entry_t *v_entry;
int ret = 0;
- list_for_each_entry(v_entry, &ttm->vma_list, head) {
- ret = drm_ttm_map_bound(v_entry->vma);
- if (ret)
- break;
+ if ((ttm->page_flags & DRM_TTM_PAGE_UNCACHED) &&
+ !(ttm->be->flags & DRM_BE_FLAG_CMA)) {
+
+ list_for_each_entry(v_entry, &ttm->vma_list, head) {
+ ret = drm_ttm_map_bound(v_entry->vma);
+ if (ret)
+ break;
+ }
}
drm_ttm_unlock_mm(ttm);