Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 306969
b: refs/heads/master
c: 149c840
h: refs/heads/master
i:
  306967: 4f152b5
v: v3
  • Loading branch information
Daniel Vetter committed Mar 20, 2012
1 parent 5388576 commit 672e914
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 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: 74898d7edc701bdae3cbd099d783dfb80b42350f
refs/heads/master: 149c84077fe717af883bae459623ef1cebd86388
14 changes: 13 additions & 1 deletion trunk/drivers/gpu/drm/i915/i915_gem_execbuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ i915_gem_execbuffer_relocate_entry(struct drm_i915_gem_object *obj,
{
struct drm_device *dev = obj->base.dev;
struct drm_gem_object *target_obj;
struct drm_i915_gem_object *target_i915_obj;
uint32_t target_offset;
int ret = -EINVAL;

Expand All @@ -281,7 +282,8 @@ i915_gem_execbuffer_relocate_entry(struct drm_i915_gem_object *obj,
if (unlikely(target_obj == NULL))
return -ENOENT;

target_offset = to_intel_bo(target_obj)->gtt_offset;
target_i915_obj = to_intel_bo(target_obj);
target_offset = target_i915_obj->gtt_offset;

/* The target buffer should have appeared before us in the
* exec_object list, so it should have a GTT space bound by now.
Expand Down Expand Up @@ -383,6 +385,16 @@ i915_gem_execbuffer_relocate_entry(struct drm_i915_gem_object *obj,
io_mapping_unmap_atomic(reloc_page);
}

/* Sandybridge PPGTT errata: We need a global gtt mapping for MI and
* pipe_control writes because the gpu doesn't properly redirect them
* through the ppgtt for non_secure batchbuffers. */
if (unlikely(IS_GEN6(dev) &&
reloc->write_domain == I915_GEM_DOMAIN_INSTRUCTION &&
!target_i915_obj->has_global_gtt_mapping)) {
i915_gem_gtt_bind_object(target_i915_obj,
target_i915_obj->cache_level);
}

/* and update the user's relocation entry */
reloc->presumed_offset = target_offset;

Expand Down

0 comments on commit 672e914

Please sign in to comment.