public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: reject GTT domain in relocations
@ 2011-12-02 19:43 Daniel Vetter
  2011-12-02 19:59 ` Eric Anholt
  2011-12-02 20:31 ` Chris Wilson
  0 siblings, 2 replies; 3+ messages in thread
From: Daniel Vetter @ 2011-12-02 19:43 UTC (permalink / raw)
  To: intel-gfx; +Cc: 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 <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/i915/i915_gem_execbuffer.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
index 98bd628..d369eac 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
@@ -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,
-- 
1.7.7.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/i915: reject GTT domain in relocations
  2011-12-02 19:43 [PATCH] drm/i915: reject GTT domain in relocations Daniel Vetter
@ 2011-12-02 19:59 ` Eric Anholt
  2011-12-02 20:31 ` Chris Wilson
  1 sibling, 0 replies; 3+ messages in thread
From: Eric Anholt @ 2011-12-02 19:59 UTC (permalink / raw)
  To: intel-gfx; +Cc: Daniel Vetter


[-- Attachment #1.1: Type: text/plain, Size: 345 bytes --]

On Fri,  2 Dec 2011 20:43:21 +0100, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> 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 <daniel.vetter@ffwll.ch>

Reviewed-by: Eric Anholt <eric@anholt.net>

[-- Attachment #1.2: Type: application/pgp-signature, Size: 197 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/i915: reject GTT domain in relocations
  2011-12-02 19:43 [PATCH] drm/i915: reject GTT domain in relocations Daniel Vetter
  2011-12-02 19:59 ` Eric Anholt
@ 2011-12-02 20:31 ` Chris Wilson
  1 sibling, 0 replies; 3+ messages in thread
From: Chris Wilson @ 2011-12-02 20:31 UTC (permalink / raw)
  To: intel-gfx; +Cc: Daniel Vetter

On Fri,  2 Dec 2011 20:43:21 +0100, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> 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 <daniel.vetter@ffwll.ch>

If it was in deliberate use by userspace we would have been oopsing,
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>

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

-- 
Chris Wilson, Intel Open Source Technology Centre

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-12-02 20:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-02 19:43 [PATCH] drm/i915: reject GTT domain in relocations Daniel Vetter
2011-12-02 19:59 ` Eric Anholt
2011-12-02 20:31 ` Chris Wilson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox