diff options
author | Eric Anholt <eric@anholt.net> | 2008-05-29 12:53:13 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2008-05-29 12:53:21 -0700 |
commit | 3b1e4e6dc38029e697afb8e6ec81ebbed7adf442 (patch) | |
tree | 684d17ac193ee172689d18842fc3383a3b927f85 | |
parent | 19ff3366e4ed591741af4bcf49991823115bdb17 (diff) |
[intel-gem] Write the presumed_offset back out after updating it.
Otherwise, 965 constant state buffers get re-relocated every exec. Ouch.
-rw-r--r-- | linux-core/i915_gem.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/linux-core/i915_gem.c b/linux-core/i915_gem.c index 1fc48e0c..52a57d5e 100644 --- a/linux-core/i915_gem.c +++ b/linux-core/i915_gem.c @@ -1137,6 +1137,16 @@ i915_gem_reloc_and_validate_object(struct drm_gem_object *obj, #endif writel(reloc_val, reloc_entry); + /* Write the updated presumed offset for this entry back out + * to the user. + */ + reloc.presumed_offset = target_obj_priv->gtt_offset; + ret = copy_to_user(relocs + i, &reloc, sizeof(reloc)); + if (ret != 0) { + drm_gem_object_unreference(target_obj); + return ret; + } + drm_gem_object_unreference(target_obj); } |