Skip to content

Commit

Permalink
drm/bochs: fix bochs_gem_prime_mmap
Browse files Browse the repository at this point in the history
ttm_fbdev_mmap() just doesn't work.  It appears to work fine, mmap()
returns success, but any attempt to actually access the mapping causes a
SIGBUS.

We can just use drm_gem_prime_mmap() instead.  Almost.  We have to copy
over the start offset from the ttm_buffer_object vm_node to the
drm_gem_object vm_node so the offset math in drm_gem_prime_mmap() works
correctly for us even though we use ttm to manage our objects.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20190204183858.8976-1-kraxel@redhat.com
  • Loading branch information
Gerd Hoffmann committed Feb 5, 2019
1 parent db97dd0 commit 86c5b35
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/gpu/drm/bochs/bochs_mm.c
Original file line number Diff line number Diff line change
Expand Up @@ -442,5 +442,6 @@ int bochs_gem_prime_mmap(struct drm_gem_object *obj,
{
struct bochs_bo *bo = gem_to_bochs_bo(obj);

return ttm_fbdev_mmap(vma, &bo->bo);
bo->gem.vma_node.vm_node.start = bo->bo.vma_node.vm_node.start;
return drm_gem_prime_mmap(obj, vma);
}

0 comments on commit 86c5b35

Please sign in to comment.