aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2008-02-27 21:44:40 +0100
committerThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2008-02-27 21:44:40 +0100
commitfd595fa4dc6f788a8a1e1b56178e15f411706cb9 (patch)
treec55c1b546edfd404a579bcb90939dd1bd6e4d249
parent72983ff30183745cd96760aa07b857c44daebde7 (diff)
Reinstate buffer idle before applying relocations.
-rw-r--r--shared-core/i915_dma.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/shared-core/i915_dma.c b/shared-core/i915_dma.c
index 2d26fcc1..f9e02c77 100644
--- a/shared-core/i915_dma.c
+++ b/shared-core/i915_dma.c
@@ -805,6 +805,7 @@ struct i915_relocatee_info {
unsigned page_offset;
struct drm_bo_kmap_obj kmap;
int is_iomem;
+ int idle;
};
struct drm_i915_validate_buffer {
@@ -860,14 +861,13 @@ int i915_apply_reloc(struct drm_file *file_priv, int num_buffers,
drm_bo_kunmap(&relocatee->kmap);
relocatee->data_page = NULL;
relocatee->offset = new_cmd_offset;
-
- /*
- * Note on buffer idle:
- * Since we're applying relocations, this part of the
- * buffer is obviously not used by the GPU and we don't
- * need to wait for buffer idle. This is an important
- * consideration for user-space buffer pools.
- */
+
+ if (unlikely(!relocatee->idle)) {
+ ret = drm_bo_wait(relocatee->buf, 0, 0, 0);
+ if (ret)
+ return ret;
+ relocatee->idle = 1;
+ }
ret = drm_bo_kmap(relocatee->buf, new_cmd_offset >> PAGE_SHIFT,
1, &relocatee->kmap);