summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/msm/msm_gem.h
diff options
context:
space:
mode:
authorKristian H. Kristensen <hoegsberg@gmail.com>2019-03-20 20:09:10 +0300
committerRob Clark <robdclark@chromium.org>2019-04-19 21:50:07 +0300
commitb673499ae738e7790b1b9f65e784999e5804abd3 (patch)
tree0ff449011902700b976bb2370ac1951e292a3055 /drivers/gpu/drm/msm/msm_gem.h
parent8ea274accda92d36bd510a3272adf745c6376d3f (diff)
downloadlinux-b673499ae738e7790b1b9f65e784999e5804abd3.tar.xz
drm/msm: Split submit_lookup_objects() into two loops
First loop does copy_from_user() without the table lock held and just stores the handle. Second loop looks up buffer objects with the table_lock held without potentially blocking or faulting. This lets us clean up a bunch of custom, non-faulting copy_from_user() code. Signed-off-by: Kristian H. Kristensen <hoegsberg@chromium.org> Signed-off-by: Rob Clark <robdclark@chromium.org>
Diffstat (limited to 'drivers/gpu/drm/msm/msm_gem.h')
-rw-r--r--drivers/gpu/drm/msm/msm_gem.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/drm/msm/msm_gem.h b/drivers/gpu/drm/msm/msm_gem.h
index 0617c44d99b0..c5ac781dffee 100644
--- a/drivers/gpu/drm/msm/msm_gem.h
+++ b/drivers/gpu/drm/msm/msm_gem.h
@@ -166,7 +166,10 @@ struct msm_gem_submit {
} *cmd; /* array of size nr_cmds */
struct {
uint32_t flags;
- struct msm_gem_object *obj;
+ union {
+ struct msm_gem_object *obj;
+ uint32_t handle;
+ };
uint64_t iova;
} bos[0];
};