Skip to content

Commit

Permalink
drm/ttm: Fix a bug occuring when validating a buffer object in a range.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Thomas Hellstrom authored and Dave Airlie committed Feb 15, 2010
1 parent 775c670 commit e22238e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/gpu/drm/ttm/ttm_bo.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 &
Expand Down

0 comments on commit e22238e

Please sign in to comment.