summaryrefslogtreecommitdiff
path: root/shared-core
diff options
context:
space:
mode:
authorXiang, Haihao <haihao.xiang@intel.com>2008-03-05 15:08:46 +0800
committerXiang, Haihao <haihao.xiang@intel.com>2008-03-05 15:09:17 +0800
commit638353103d009d44bd5bdbe97cc7cef1bf011cdf (patch)
tree2202ec17ecb80e95f320774156170ce2b638b6b4 /shared-core
parenta6a2f2c8c491617de702dc7d62bb55cbada4d42b (diff)
i915: Evict if relocatee buffer is CACHED_MAPPED before
writting relocations, otherwise the GPU probably sees some inconsistent data. Fix fd.o bug#14656
Diffstat (limited to 'shared-core')
-rw-r--r--shared-core/i915_dma.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/shared-core/i915_dma.c b/shared-core/i915_dma.c
index f9e02c77..9e474bc6 100644
--- a/shared-core/i915_dma.c
+++ b/shared-core/i915_dma.c
@@ -806,6 +806,7 @@ struct i915_relocatee_info {
struct drm_bo_kmap_obj kmap;
int is_iomem;
int idle;
+ int evicted;
};
struct drm_i915_validate_buffer {
@@ -878,6 +879,12 @@ int i915_apply_reloc(struct drm_file *file_priv, int num_buffers,
relocatee->data_page = drm_bmo_virtual(&relocatee->kmap,
&relocatee->is_iomem);
relocatee->page_offset = (relocatee->offset & PAGE_MASK);
+
+ if (!relocatee->evicted &&
+ relocatee->buf->mem.flags & DRM_BO_FLAG_CACHED_MAPPED) {
+ drm_bo_evict_cached(relocatee->buf);
+ relocatee->evicted = 1;
+ }
}
val = buffers[buf_index].buffer->offset;