All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: dri-devel@lists.freedesktop.org
Subject: [PATCH] drm/mm: Adjust start/end for coloring first
Date: Mon, 19 May 2014 07:52:37 +0100	[thread overview]
Message-ID: <1400482357-24988-1-git-send-email-chris@chris-wilson.co.uk> (raw)

The current user of the coloring will adjust the end points of the node
to leave a hole between disjoint memory types. This adjustment must be
performed first or else the derived size will conflict with the
adjustment and trigger the BUG_ON sanity checks that the node is within
bounds.

Fixes regression from
commit 62347f9e0f81d50e9b0923ec8a192f60ab7a1801
Author: Lauri Kasanen <cand@gmx.com>
Date:   Wed Apr 2 20:03:57 2014 +0300

    drm: Add support for two-ended allocation, v3

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/drm_mm.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/drm_mm.c b/drivers/gpu/drm/drm_mm.c
index 04a209e2b66d..911863bed9f3 100644
--- a/drivers/gpu/drm/drm_mm.c
+++ b/drivers/gpu/drm/drm_mm.c
@@ -264,12 +264,12 @@ static void drm_mm_insert_helper_range(struct drm_mm_node *hole_node,
 	if (adj_end > end)
 		adj_end = end;
 
-	if (flags & DRM_MM_CREATE_TOP)
-		adj_start = adj_end - size;
-
 	if (mm->color_adjust)
 		mm->color_adjust(hole_node, color, &adj_start, &adj_end);
 
+	if (flags & DRM_MM_CREATE_TOP)
+		adj_start = adj_end - size;
+
 	if (alignment) {
 		unsigned tmp = adj_start % alignment;
 		if (tmp) {
-- 
2.0.0.rc2

             reply	other threads:[~2014-05-19  6:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-19  6:52 Chris Wilson [this message]
2014-05-19  8:14 ` [PATCH] drm/mm: Adjust start/end for coloring first Daniel Vetter
2014-05-19  8:21   ` Chris Wilson
2014-05-19 10:22     ` Daniel Vetter
2014-05-19 10:24 ` Daniel Vetter

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=1400482357-24988-1-git-send-email-chris@chris-wilson.co.uk \
    --to=chris@chris-wilson.co.uk \
    --cc=dri-devel@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.