[Intel-gfx] [PATCH] [drm/i915] In execbuffer, split handle lookup and relocation

Keith Packard keithp at keithp.com
Fri Nov 21 10:00:14 CET 2008


Splitting these will make re-trying the relocation cleaner

Signed-off-by: Keith Packard <keithp at keithp.com>
---
 drivers/gpu/drm/i915/i915_gem.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 3e074ab..7fd1b26 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1944,7 +1944,7 @@ i915_gem_execbuffer(struct drm_device *dev, void *data,
 		return -EBUSY;
 	}
 
-	/* Look up object handles and perform the relocations */
+	/* Look up object handles */
 	for (i = 0; i < args->buffer_count; i++) {
 		object_list[i] = drm_gem_object_lookup(dev, file_priv,
 						       exec_list[i].handle);
@@ -1954,7 +1954,10 @@ i915_gem_execbuffer(struct drm_device *dev, void *data,
 			ret = -EBADF;
 			goto err;
 		}
+	}
 
+	/* Pin and relocate */
+	for (i = 0; i < args->buffer_count; i++) {
 		object_list[i]->pending_read_domains = 0;
 		object_list[i]->pending_write_domain = 0;
 		ret = i915_gem_object_pin_and_relocate(object_list[i],
-- 
1.5.6.5




More information about the Intel-gfx mailing list