diff options
author | Thomas Zimmermann <tzimmermann@suse.de> | 2019-02-07 09:59:31 +0100 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2019-03-19 21:03:53 +0100 |
commit | bf141a88b329d12c9aaea4f7e7a8fdbd2dfe987d (patch) | |
tree | 2046b3bd8faca73da578d2ee8a9ef0318e254af3 /drivers/gpu/drm/ttm | |
parent | drm/ttm: Quick-test mmap offset in ttm_bo_mmap() (diff) | |
download | linux-bf141a88b329d12c9aaea4f7e7a8fdbd2dfe987d.tar.xz linux-bf141a88b329d12c9aaea4f7e7a8fdbd2dfe987d.zip |
drm: Use the same mmap-range offset and size for GEM and TTM
GEM defines DRM_FILE_PAGE_OFFSET_{START,SIZE} constants for the
mmap-able range of addresses. TTM can use them as well.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Christian König <christian.koenig@amd.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/ttm')
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_bo.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_bo_vm.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index e1b65775f3ee..988416fb8a0b 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -1646,8 +1646,8 @@ int ttm_bo_device_init(struct ttm_bo_device *bdev, goto out_no_sys; drm_vma_offset_manager_init(&bdev->vma_manager, - DRM_FILE_PAGE_OFFSET, - 0x10000000); + DRM_FILE_PAGE_OFFSET_START, + DRM_FILE_PAGE_OFFSET_SIZE); INIT_DELAYED_WORK(&bdev->wq, ttm_bo_delayed_workqueue); INIT_LIST_HEAD(&bdev->ddestroy); bdev->dev_mapping = mapping; diff --git a/drivers/gpu/drm/ttm/ttm_bo_vm.c b/drivers/gpu/drm/ttm/ttm_bo_vm.c index e94c2ab3718a..6dacff49c1cc 100644 --- a/drivers/gpu/drm/ttm/ttm_bo_vm.c +++ b/drivers/gpu/drm/ttm/ttm_bo_vm.c @@ -432,7 +432,7 @@ int ttm_bo_mmap(struct file *filp, struct vm_area_struct *vma, struct ttm_buffer_object *bo; int ret; - if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET)) + if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET_START)) return -EINVAL; bo = ttm_bo_vm_lookup(bdev, vma->vm_pgoff, vma_pages(vma)); |