drm/i915: reject GTT domain in relocations
Subsystems (2)
PATCH 1/1 drm/i915: reject GTT domain in relocations
This confuses our domain tracking and can (for gtt write domains) lead to a subsequent oops.
Tested by tests/gem_exec_bad_domains from i-g-t.
--- drivers/gpu/drm/i915/i915_gem_execbuffer.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_gem_execbuffer.c +3 -2
@@ -308,8 +308,9 @@ i915_gem_execbuffer_relocate_entry(struct drm_i915_gem_object *obj, reloc->write_domain);return ret; } -if (unlikely ((reloc->write_domain | reloc->read_domains) &I915_GEM_DOMAIN_CPU )) { - DRM_ERROR("reloc with read/write CPU domains: " +if (unlikely ((reloc->write_domain | reloc->read_domains) + & ~I915_GEM_GPU_DOMAINS )) { + DRM_ERROR("reloc with read/write non-GPU domains: " "obj %p target %d offset %d " "read %08x write %08x", obj, reloc->target_handle,
Signature · 1 line
1.7.7.3
Quoted 6 lines · Daniel Vetter
This confuses our domain tracking and can (for gtt write domains) lead to a subsequent oops.
Tested by tests/gem_exec_bad_domains from i-g-t.
Signed-off-by Daniel Vetter <[email protected]>
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 6 lines · Daniel Vetter
This confuses our domain tracking and can (for gtt write domains) lead to a subsequent oops.
Tested by tests/gem_exec_bad_domains from i-g-t.
Signed-off-by Daniel Vetter <[email protected]>
If it was in deliberate use by userspace we would have been oopsing,
In a similar vein is to add a
BUG_ON(obj->base.write_domain & ~I915_GEM_GPU_DOMAINS)
to move_to_active(). With this loop-hole closed, adding an invalid write buffer to the active list should only be possible through a kernel programming error (and helps remind us about what the limits upon the active list are).
-Chris
Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre