Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 231087
b: refs/heads/master
c: dd6864a
h: refs/heads/master
i:
  231085: 321a58e
  231083: 4049843
  231079: 73a867e
  231071: 7d0cc22
v: v3
  • Loading branch information
Chris Wilson committed Jan 13, 2011
1 parent cc7a9b2 commit 522a37b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c37d9a5de94a6fe60a756af350cd21aa9bbbc8a1
refs/heads/master: dd6864a4edb9b2d0055a7f30e17cbc521098b1be
15 changes: 9 additions & 6 deletions trunk/drivers/gpu/drm/i915/i915_gem_execbuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,7 @@ i915_gem_execbuffer_relocate_slow(struct drm_device *dev,
{
struct drm_i915_gem_relocation_entry *reloc;
struct drm_i915_gem_object *obj;
int *reloc_offset;
int i, total, ret;

/* We may process another execbuffer during the unlock... */
Expand All @@ -653,8 +654,11 @@ i915_gem_execbuffer_relocate_slow(struct drm_device *dev,
for (i = 0; i < count; i++)
total += exec[i].relocation_count;

reloc_offset = drm_malloc_ab(count, sizeof(*reloc_offset));
reloc = drm_malloc_ab(total, sizeof(*reloc));
if (reloc == NULL) {
if (reloc == NULL || reloc_offset == NULL) {
drm_free_large(reloc);
drm_free_large(reloc_offset);
mutex_lock(&dev->struct_mutex);
return -ENOMEM;
}
Expand All @@ -672,6 +676,7 @@ i915_gem_execbuffer_relocate_slow(struct drm_device *dev,
goto err;
}

reloc_offset[i] = total;
total += exec[i].relocation_count;
}

Expand Down Expand Up @@ -705,17 +710,14 @@ i915_gem_execbuffer_relocate_slow(struct drm_device *dev,
if (ret)
goto err;

total = 0;
list_for_each_entry(obj, objects, exec_list) {
int offset = obj->exec_entry - exec;
obj->base.pending_read_domains = 0;
obj->base.pending_write_domain = 0;
ret = i915_gem_execbuffer_relocate_object_slow(obj, eb,
reloc + total);
reloc + reloc_offset[offset]);
if (ret)
goto err;

total += exec->relocation_count;
exec++;
}

/* Leave the user relocations as are, this is the painfully slow path,
Expand All @@ -726,6 +728,7 @@ i915_gem_execbuffer_relocate_slow(struct drm_device *dev,

err:
drm_free_large(reloc);
drm_free_large(reloc_offset);
return ret;
}

Expand Down

0 comments on commit 522a37b

Please sign in to comment.