Skip to content

Commit

Permalink
drm/mgag200: Invalidate page tables when pinning a BO
Browse files Browse the repository at this point in the history
When a BO gets pinned the placement may get changed. If the memory is
mapped into user space and user space has already accessed the mapped
range the page tables are set up but now point to the wrong memory.
Set bo.mdev->dev_mapping in mgag200_bo_create() to make sure that
ttm_bo_unmap_virtual() called from ttm_bo_handle_move_mem() will take
care of this.

v2: Don't call ttm_bo_unmap_virtual() in mgag200_bo_pin(), fix comment.

Signed-off-by: Egbert Eich <eich@suse.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
  • Loading branch information
Egbert Eich authored and Dave Airlie committed Aug 7, 2013
1 parent 109a515 commit ecaac1c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/gpu/drm/mgag200/mgag200_ttm.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ int mgag200_bo_create(struct drm_device *dev, int size, int align,

mgabo->gem.driver_private = NULL;
mgabo->bo.bdev = &mdev->ttm.bdev;
mgabo->bo.bdev->dev_mapping = dev->dev_mapping;

mgag200_ttm_placement(mgabo, TTM_PL_FLAG_VRAM | TTM_PL_FLAG_SYSTEM);

Expand Down

0 comments on commit ecaac1c

Please sign in to comment.