summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/vc4/vc4_gem.c17
-rw-r--r--include/uapi/drm/vc4_drm.h10
2 files changed, 17 insertions, 10 deletions
diff --git a/drivers/gpu/drm/vc4/vc4_gem.c b/drivers/gpu/drm/vc4/vc4_gem.c
index d0cef8627d1b..67edd30b9a72 100644
--- a/drivers/gpu/drm/vc4/vc4_gem.c
+++ b/drivers/gpu/drm/vc4/vc4_gem.c
@@ -301,7 +301,8 @@ vc4_cl_lookup_bos(struct drm_device *dev,
goto fail;
}
- ret = copy_from_user(handles, args->bo_handles,
+ ret = copy_from_user(handles,
+ (void __user *)(uintptr_t)args->bo_handles,
exec->bo_count * sizeof(uint32_t));
if (ret) {
DRM_ERROR("Failed to copy in GEM handles\n");
@@ -374,26 +375,32 @@ vc4_cl_validate(struct drm_device *dev, struct vc4_exec_info *exec)
exec->shader_state = temp + exec_size;
exec->shader_state_size = args->shader_rec_count;
- ret = copy_from_user(bin, args->bin_cl, args->bin_cl_size);
+ ret = copy_from_user(bin,
+ (void __user *)(uintptr_t)args->bin_cl,
+ args->bin_cl_size);
if (ret) {
DRM_ERROR("Failed to copy in bin cl\n");
goto fail;
}
- ret = copy_from_user(render, args->render_cl, args->render_cl_size);
+ ret = copy_from_user(render,
+ (void __user *)(uintptr_t)args->render_cl,
+ args->render_cl_size);
if (ret) {
DRM_ERROR("Failed to copy in render cl\n");
goto fail;
}
- ret = copy_from_user(exec->shader_rec_u, args->shader_rec,
+ ret = copy_from_user(exec->shader_rec_u,
+ (void __user *)(uintptr_t)args->shader_rec,
args->shader_rec_size);
if (ret) {
DRM_ERROR("Failed to copy in shader recs\n");
goto fail;
}
- ret = copy_from_user(exec->uniforms_u, args->uniforms,
+ ret = copy_from_user(exec->uniforms_u,
+ (void __user *)(uintptr_t)args->uniforms,
args->uniforms_size);
if (ret) {
DRM_ERROR("Failed to copy in uniforms cl\n");
diff --git a/include/uapi/drm/vc4_drm.h b/include/uapi/drm/vc4_drm.h
index 258eb9d37158..453fb7013c68 100644
--- a/include/uapi/drm/vc4_drm.h
+++ b/include/uapi/drm/vc4_drm.h
@@ -56,7 +56,7 @@ struct drm_vc4_submit_cl {
* then writes out the state updates and draw calls necessary per tile
* to the tile allocation BO.
*/
- void __user *bin_cl;
+ uint64_t bin_cl;
/* Pointer to the render command list.
*
@@ -66,7 +66,7 @@ struct drm_vc4_submit_cl {
* stored rendering for that tile, then store the tile's state back to
* memory.
*/
- void __user *render_cl;
+ uint64_t render_cl;
/* Pointer to the shader records.
*
@@ -77,7 +77,7 @@ struct drm_vc4_submit_cl {
* and an attribute count), so those BO indices into bo_handles are
* just stored as uint32_ts before each shader record passed in.
*/
- void __user *shader_rec;
+ uint64_t shader_rec;
/* Pointer to uniform data and texture handles for the textures
* referenced by the shader.
@@ -93,8 +93,8 @@ struct drm_vc4_submit_cl {
* because the kernel has to determine the sizes anyway during shader
* code validation.
*/
- void __user *uniforms;
- void __user *bo_handles;
+ uint64_t uniforms;
+ uint64_t bo_handles;
/* Size in bytes of the binner command list. */
uint32_t bin_cl_size;