diff options
author | Thomas Hellstrom <thomas-at-tungstengraphics-dot-com> | 2008-03-17 11:37:10 +0100 |
---|---|---|
committer | Thomas Hellstrom <thomas-at-tungstengraphics-dot-com> | 2008-03-17 11:38:46 +0100 |
commit | 602800a280ecaf562427eada19b118b990ab26e1 (patch) | |
tree | 2394633c2b3847b648b26c124172c965eddcc4cc /linux-core | |
parent | 1f96e9a98245b18c99cc6a7e66372a076b9abf6b (diff) |
Evict cached_mapped relocatee before applying reloc.
Fix that got left out after the intel-post-reloc merge.
Diffstat (limited to 'linux-core')
-rw-r--r-- | linux-core/i915_execbuf.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/linux-core/i915_execbuf.c b/linux-core/i915_execbuf.c index ff83d795..ae4a6121 100644 --- a/linux-core/i915_execbuf.c +++ b/linux-core/i915_execbuf.c @@ -138,6 +138,8 @@ int i915_apply_reloc(struct drm_file *file_priv, int num_buffers, new_cmd_offset = reloc[0]; if (!relocatee->data_page || !drm_bo_same_page(relocatee->offset, new_cmd_offset)) { + struct drm_bo_mem_reg *mem = &relocatee->buf->mem; + drm_bo_kunmap(&relocatee->kmap); relocatee->data_page = NULL; relocatee->offset = new_cmd_offset; @@ -149,6 +151,10 @@ int i915_apply_reloc(struct drm_file *file_priv, int num_buffers, relocatee->idle = I915_RELOC_IDLE; } + if (unlikely((mem->mem_type != DRM_BO_MEM_LOCAL) && + (mem->flags & DRM_BO_FLAG_CACHED_MAPPED))) + drm_bo_evict_cached(relocatee->buf); + ret = drm_bo_kmap(relocatee->buf, new_cmd_offset >> PAGE_SHIFT, 1, &relocatee->kmap); if (ret) { |