Searched hist:"9786 b65bc61acec63f923978c75e707afbb74bc7" (Results 1 – 2 of 2) sorted by relevance
/openbmc/linux/drivers/gpu/drm/ |
H A D | drm_gem_ttm_helper.c | diff 9786b65bc61acec63f923978c75e707afbb74bc7 Wed Nov 13 07:56:12 CST 2019 Gerd Hoffmann <kraxel@redhat.com> drm/ttm: fix mmap refcounting
When mapping ttm objects via drm_gem_ttm_mmap() helper drm_gem_mmap_obj() will take an object reference. That gets never released due to ttm having its own reference counting.
Fix that by dropping the gem object reference once the ttm mmap completed (and ttm refcount got bumped).
For that to work properly the drm_gem_object_get() call in drm_gem_ttm_mmap() must be moved so it happens before calling obj->funcs->mmap(), otherwise the gem refcount would go down to zero.
Fixes: 231927d939f0 ("drm/ttm: add drm_gem_ttm_mmap()") Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Tested-by: Thomas Zimmermann <tzimmermann@suse.de> Link: http://patchwork.freedesktop.org/patch/msgid/20191113135612.19679-1-kraxel@redhat.com
|
H A D | drm_gem.c | diff 9786b65bc61acec63f923978c75e707afbb74bc7 Wed Nov 13 07:56:12 CST 2019 Gerd Hoffmann <kraxel@redhat.com> drm/ttm: fix mmap refcounting
When mapping ttm objects via drm_gem_ttm_mmap() helper drm_gem_mmap_obj() will take an object reference. That gets never released due to ttm having its own reference counting.
Fix that by dropping the gem object reference once the ttm mmap completed (and ttm refcount got bumped).
For that to work properly the drm_gem_object_get() call in drm_gem_ttm_mmap() must be moved so it happens before calling obj->funcs->mmap(), otherwise the gem refcount would go down to zero.
Fixes: 231927d939f0 ("drm/ttm: add drm_gem_ttm_mmap()") Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Tested-by: Thomas Zimmermann <tzimmermann@suse.de> Link: http://patchwork.freedesktop.org/patch/msgid/20191113135612.19679-1-kraxel@redhat.com
|