diff options
author | Thomas Hellstrom <thellstrom@vmware.com> | 2010-02-11 18:18:00 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-02-14 20:19:14 -0500 |
commit | e22238ea37a870f70e34668a4992bde0c92bba8d (patch) | |
tree | 71036caef29c04901df02f79a8c241503f3a9920 /drivers/gpu | |
parent | 775c67090c98780b44c4f95d5c05565df715b8bd (diff) |
drm/ttm: Fix a bug occuring when validating a buffer object in a range.
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>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | 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 1a3e909b7bba..c7320ce4567d 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, | |||
1020 | struct ttm_mem_reg *mem) | 1020 | struct ttm_mem_reg *mem) |
1021 | { | 1021 | { |
1022 | int i; | 1022 | int i; |
1023 | struct drm_mm_node *node = mem->mm_node; | ||
1024 | |||
1025 | if (node && placement->lpfn != 0 && | ||
1026 | (node->start < placement->fpfn || | ||
1027 | node->start + node->size > placement->lpfn)) | ||
1028 | return -1; | ||
1023 | 1029 | ||
1024 | for (i = 0; i < placement->num_placement; i++) { | 1030 | for (i = 0; i < placement->num_placement; i++) { |
1025 | if ((placement->placement[i] & mem->placement & | 1031 | if ((placement->placement[i] & mem->placement & |