Skip to content

Commit 1ac5167

Browse files
Andi Shytijlahtine-intel
authored andcommitted
drm/i915/gem: Adjust vma offset for framebuffer mmap offset
When mapping a framebuffer object, the virtual memory area (VMA) offset ('vm_pgoff') should be adjusted by the start of the 'vma_node' associated with the object. This ensures that the VMA offset is correctly aligned with the corresponding offset within the GGTT aperture. Increment vm_pgoff by the start of the vma_node with the offset= provided by the user. Suggested-by: Chris Wilson <[email protected]> Signed-off-by: Andi Shyti <[email protected]> Reviewed-by: Jonathan Cavitt <[email protected]> Reviewed-by: Rodrigo Vivi <[email protected]> Cc: <[email protected]> # v4.9+ [Joonas: Add Cc: stable] Signed-off-by: Joonas Lahtinen <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit 60a2066) Signed-off-by: Joonas Lahtinen <[email protected]>
1 parent 1b85bdb commit 1ac5167

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/gpu/drm/i915/gem/i915_gem_mman.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,6 +1084,8 @@ int i915_gem_fb_mmap(struct drm_i915_gem_object *obj, struct vm_area_struct *vma
10841084
mmo = mmap_offset_attach(obj, mmap_type, NULL);
10851085
if (IS_ERR(mmo))
10861086
return PTR_ERR(mmo);
1087+
1088+
vma->vm_pgoff += drm_vma_node_start(&mmo->vma_node);
10871089
}
10881090

10891091
/*

0 commit comments

Comments
 (0)