drm/msm: Implement .gem_free_object_unlocked
We use a llist and a worker to delay the object cleanup. This avoids taking mmap_sem and struct_mutex in the wrong order when calling drm_gem_object_put_unlocked() from drm_gem_mmap(). Fixes lockdep problem with copy_from_user() in msm_ioctl_gem_submit(). Signed-off-by: Kristian H. Kristensen <hoegsberg@chromium.org> Signed-off-by: Rob Clark <robdclark@chromium.org>
This commit is contained in:

committed by
Rob Clark

parent
fb076b15d5
commit
48e7f18392
@@ -185,6 +185,10 @@ struct msm_drm_private {
|
||||
/* list of GEM objects: */
|
||||
struct list_head inactive_list;
|
||||
|
||||
/* worker for delayed free of objects: */
|
||||
struct work_struct free_work;
|
||||
struct llist_head free_list;
|
||||
|
||||
struct workqueue_struct *wq;
|
||||
|
||||
unsigned int num_planes;
|
||||
@@ -325,6 +329,7 @@ void msm_gem_kernel_put(struct drm_gem_object *bo,
|
||||
struct msm_gem_address_space *aspace, bool locked);
|
||||
struct drm_gem_object *msm_gem_import(struct drm_device *dev,
|
||||
struct dma_buf *dmabuf, struct sg_table *sgt);
|
||||
void msm_gem_free_work(struct work_struct *work);
|
||||
|
||||
__printf(2, 3)
|
||||
void msm_gem_object_set_name(struct drm_gem_object *bo, const char *fmt, ...);
|
||||
|
Reference in New Issue
Block a user