From: Thomas Hellstrom <thellstrom@vmware.com>
To: airlied@redhat.com
Cc: Thomas Hellstrom <thellstrom@vmware.com>,
dri-devel@lists.sourceforge.net
Subject: [PATCH 2/2] drm/ttm: Fix a bug occuring when validating a buffer object in a range.
Date: Fri, 12 Feb 2010 00:18:00 +0100 [thread overview]
Message-ID: <1265930280-4076-3-git-send-email-thellstrom@vmware.com> (raw)
In-Reply-To: <1265930280-4076-2-git-send-email-thellstrom@vmware.com>
If the buffer object was already in the requested memory type, but
outside of the requested range it was never moved into the requested range.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
---
drivers/gpu/drm/ttm/ttm_bo.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index 1a3e909..c7320ce 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -1020,6 +1020,12 @@ static int ttm_bo_mem_compat(struct ttm_placement *placement,
struct ttm_mem_reg *mem)
{
int i;
+ struct drm_mm_node *node = mem->mm_node;
+
+ if (node && placement->lpfn != 0 &&
+ (node->start < placement->fpfn ||
+ node->start + node->size > placement->lpfn))
+ return -1;
for (i = 0; i < placement->num_placement; i++) {
if ((placement->placement[i] & mem->placement &
--
1.6.2.5
------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
--
next prev parent reply other threads:[~2010-02-11 23:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-11 23:17 [PATCH 0/2] last minute range validation fixes Thomas Hellstrom
2010-02-11 23:17 ` [PATCH 1/2] drm: Fix a bug in the range manager. When searching for free space in a range, the function could return a node extending outside of the given range Thomas Hellstrom
2010-02-11 23:18 ` Thomas Hellstrom [this message]
2010-02-12 8:12 ` Michel Dänzer
2010-02-12 9:31 ` Thomas Hellstrom
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=1265930280-4076-3-git-send-email-thellstrom@vmware.com \
--to=thellstrom@vmware.com \
--cc=airlied@redhat.com \
--cc=dri-devel@lists.sourceforge.net \
/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.