Skip to content
Snippets Groups Projects
Commit b69dc0fb authored by Dmitry Osipenko's avatar Dmitry Osipenko
Browse files

fixup: drm/panfrost: Explicitly get and put drm-shmem pages

parent c249a81c
No related branches found
No related tags found
No related merge requests found
......@@ -75,17 +75,19 @@ static void panfrost_gem_mapping_release(struct kref *kref)
sg_free_table(&bo->sgts[i]);
}
}
drm_gem_shmem_put_pages(&bo->base);
kvfree(bo->sgts);
bo->sgts = NULL;
}
/* Pages ref is owned by the panfrost_gem_mapping object. We must
* release our pages ref (if any), before releasing the object
* ref.
* Non-heap BOs acquired the pages at panfrost_gem_mapping creation
* time, and heap BOs may have acquired pages if the fault handler
* was called, in which case bo->sgts should be non-NULL.
* time.
*/
if (!bo->base.base.import_attach && (!bo->is_heap || bo->sgts)) {
if (!bo->base.base.import_attach && !bo->is_heap && bo->sgts) {
drm_gem_shmem_put_pages(&bo->base);
bo->sgts = NULL;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment