summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/bochs
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2019-02-04 19:38:58 +0100
committerGerd Hoffmann <kraxel@redhat.com>2019-02-05 10:28:15 +0100
commit86c5b359d9e10b21eac1f936c498d8a81aa4373f (patch)
tree4a855626a4beba47a092f37a9c40b38320da1332 /drivers/gpu/drm/bochs
parentdb97dd0eef3af860a7e9886e271709590feafee7 (diff)
drm/bochs: fix bochs_gem_prime_mmap
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
Diffstat (limited to 'drivers/gpu/drm/bochs')
-rw-r--r--drivers/gpu/drm/bochs/bochs_mm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/bochs/bochs_mm.c b/drivers/gpu/drm/bochs/bochs_mm.c
index 641a33f134ee..49463348a07a 100644
--- a/drivers/gpu/drm/bochs/bochs_mm.c
+++ b/drivers/gpu/drm/bochs/bochs_mm.c
@@ -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);
}