Skip to content

Commit

Permalink
drm/ttm: Initialize eviction placement in case the driver callback do…
Browse files Browse the repository at this point in the history
…esn't

This would allow to catch driver callback error of not properly
setting the eviction placement structure.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
  • Loading branch information
Jerome Glisse authored and Dave Airlie committed Dec 10, 2009
1 parent cf0fe45 commit 7cb7d1d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/gpu/drm/ttm/ttm_bo.c
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,10 @@ static int ttm_bo_evict(struct ttm_buffer_object *bo, bool interruptible,
evict_mem = bo->mem;
evict_mem.mm_node = NULL;

placement.fpfn = 0;
placement.lpfn = 0;
placement.num_placement = 0;
placement.num_busy_placement = 0;
bdev->driver->evict_flags(bo, &placement);
ret = ttm_bo_mem_space(bo, &placement, &evict_mem, interruptible,
no_wait);
Expand Down

0 comments on commit 7cb7d1d

Please sign in to comment.