mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
drm/ttm: fix offset in VMAs with a pg_offs in ttm_bo_vm_access
VMAs with a pg_offs that's offset from the start of the vma_node need to adjust the offset within the BO accordingly. This matches the offset calculation in ttm_bo_vm_fault_reserved. Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com> Tested-by: Laurent Morichetti <laurent.morichetti@amd.com> Signed-off-by: Christian König <christian.koenig@amd.com> Link: https://patchwork.freedesktop.org/patch/381169/
This commit is contained in:
parent
f4a1692491
commit
c0001213d1
1 changed files with 3 additions and 1 deletions
|
@ -505,8 +505,10 @@ static int ttm_bo_vm_access_kmap(struct ttm_buffer_object *bo,
|
|||
int ttm_bo_vm_access(struct vm_area_struct *vma, unsigned long addr,
|
||||
void *buf, int len, int write)
|
||||
{
|
||||
unsigned long offset = (addr) - vma->vm_start;
|
||||
struct ttm_buffer_object *bo = vma->vm_private_data;
|
||||
unsigned long offset = (addr) - vma->vm_start +
|
||||
((vma->vm_pgoff - drm_vma_node_start(&bo->base.vma_node))
|
||||
<< PAGE_SHIFT);
|
||||
int ret;
|
||||
|
||||
if (len < 1 || (offset + len) >> PAGE_SHIFT > bo->num_pages)
|
||||
|
|
Loading…
Add table
Reference in a new issue