All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 5/6] drm/i915: Assert the drm_mm_node is allocated when on the VM lists
Date: Thu, 19 Jan 2017 19:26:58 +0000	[thread overview]
Message-ID: <20170119192659.31789-5-chris@chris-wilson.co.uk> (raw)
In-Reply-To: <20170119192659.31789-1-chris@chris-wilson.co.uk>

Before moving the vma between the VM active/inactive lists, assert that
the node is still allocated.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_gem_stolen.c | 2 ++
 drivers/gpu/drm/i915/i915_vma.c        | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c b/drivers/gpu/drm/i915/i915_gem_stolen.c
index 61cc0fcae3d8..127d698e7c84 100644
--- a/drivers/gpu/drm/i915/i915_gem_stolen.c
+++ b/drivers/gpu/drm/i915/i915_gem_stolen.c
@@ -702,6 +702,8 @@ i915_gem_object_create_stolen_for_preallocated(struct drm_i915_private *dev_priv
 		goto err_pages;
 	}
 
+	GEM_BUG_ON(!drm_mm_node_allocated(&vma->node));
+
 	vma->pages = obj->mm.pages;
 	vma->flags |= I915_VMA_GLOBAL_BIND;
 	__i915_vma_set_map_and_fenceable(vma);
diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
index e58d8799bee2..ecb495b1c5d3 100644
--- a/drivers/gpu/drm/i915/i915_vma.c
+++ b/drivers/gpu/drm/i915/i915_vma.c
@@ -45,6 +45,7 @@ i915_vma_retire(struct i915_gem_active *active,
 	if (i915_vma_is_active(vma))
 		return;
 
+	GEM_BUG_ON(!drm_mm_node_allocated(&vma->node));
 	list_move_tail(&vma->vm_link, &vma->vm->inactive_list);
 	if (unlikely(i915_vma_is_closed(vma) && !i915_vma_is_pinned(vma)))
 		WARN_ON(i915_vma_unbind(vma));
@@ -493,6 +494,7 @@ i915_vma_insert(struct i915_vma *vma, u64 size, u64 alignment, u64 flags)
 		GEM_BUG_ON(vma->node.start < start);
 		GEM_BUG_ON(vma->node.start + vma->node.size > end);
 	}
+	GEM_BUG_ON(!drm_mm_node_allocated(&vma->node));
 	GEM_BUG_ON(!i915_gem_valid_gtt_space(vma, obj->cache_level));
 
 	list_move_tail(&obj->global_link, &dev_priv->mm.bound_list);
-- 
2.11.0

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

  parent reply	other threads:[~2017-01-19 19:27 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-19 19:26 [PATCH 1/6] drm/i915: Pass around gen to tile_height to special case gen2 Chris Wilson
2017-01-19 19:26 ` [PATCH 2/6] drm/i915: Use common LRU inactive vma bumping for unpin_from_display Chris Wilson
2017-01-20 12:32   ` Joonas Lahtinen
2017-01-19 19:26 ` [PATCH 3/6] drm/i915: Reject vma creation larger than address space Chris Wilson
2017-01-20 12:06   ` Joonas Lahtinen
2017-01-19 19:26 ` [PATCH 4/6] drm/i915: Treat an error from i915_vma_instance() as unlikely Chris Wilson
2017-01-20 12:34   ` Joonas Lahtinen
2017-01-19 19:26 ` Chris Wilson [this message]
2017-01-20 12:36   ` [PATCH 5/6] drm/i915: Assert the drm_mm_node is allocated when on the VM lists Joonas Lahtinen
2017-01-19 19:26 ` [PATCH 6/6] drm/i915: Assert that created vma has a whole number of pages Chris Wilson
2017-01-20 12:38   ` Joonas Lahtinen
2017-01-19 19:44 ` [PATCH 1/6] drm/i915: Pass around gen to tile_height to special case gen2 Ville Syrjälä
2017-01-20 10:36   ` Chris Wilson
2017-01-20 12:37     ` Joonas Lahtinen
2017-01-19 19:54 ` ✗ Fi.CI.BAT: failure for series starting with [1/6] " Patchwork
2017-01-20 12:29 ` [PATCH 1/6] " Joonas Lahtinen
2017-01-21 10:30   ` Chris Wilson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170119192659.31789-5-chris@chris-wilson.co.uk \
    --to=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.