From 602800a280ecaf562427eada19b118b990ab26e1 Mon Sep 17 00:00:00 2001 From: Thomas Hellstrom Date: Mon, 17 Mar 2008 11:37:10 +0100 Subject: Evict cached_mapped relocatee before applying reloc. Fix that got left out after the intel-post-reloc merge. --- linux-core/i915_execbuf.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'linux-core') 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) { -- cgit v1.2.3