Commit ac451467 authored by Rob Clark's avatar Rob Clark

drm/msm: fix msm_gem_prime_get_sg_table()

We need to return a new sgt, since the caller takes ownership of it.
Reported-by: default avatarStanimir Varbanov <svarbanov@mm-sol.com>
Signed-off-by: default avatarRob Clark <robdclark@gmail.com>
parent 520e8bfc
...@@ -23,8 +23,12 @@ ...@@ -23,8 +23,12 @@
struct sg_table *msm_gem_prime_get_sg_table(struct drm_gem_object *obj) struct sg_table *msm_gem_prime_get_sg_table(struct drm_gem_object *obj)
{ {
struct msm_gem_object *msm_obj = to_msm_bo(obj); struct msm_gem_object *msm_obj = to_msm_bo(obj);
BUG_ON(!msm_obj->sgt); /* should have already pinned! */ int npages = obj->size >> PAGE_SHIFT;
return msm_obj->sgt;
if (WARN_ON(!msm_obj->pages)) /* should have already pinned! */
return NULL;
return drm_prime_pages_to_sg(msm_obj->pages, npages);
} }
void *msm_gem_prime_vmap(struct drm_gem_object *obj) void *msm_gem_prime_vmap(struct drm_gem_object *obj)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment