Loading drivers/gpu/drm/msm/sde/sde_connector.c +34 −14 Original line number Diff line number Diff line Loading @@ -1186,7 +1186,8 @@ static int sde_connector_atomic_set_property(struct drm_connector *connector, struct sde_connector *c_conn; struct sde_connector_state *c_state; int idx, rc; uint64_t fence_fd; uint64_t fence_user_fd; uint64_t __user prev_user_fd; if (!connector || !state || !property) { SDE_ERROR("invalid argument(s), conn %pK, state %pK, prp %pK\n", Loading Loading @@ -1229,24 +1230,43 @@ static int sde_connector_atomic_set_property(struct drm_connector *connector, if (!val) goto end; rc = copy_from_user(&prev_user_fd, (void __user *)val, sizeof(uint64_t)); if (rc) { SDE_ERROR("copy from user failed rc:%d\n", rc); rc = -EFAULT; goto end; } /* * update the the offset to a timeline for commit completion * client is expected to reset the property to -1 before * requesting for the retire fence */ rc = sde_fence_create(c_conn->retire_fence, &fence_fd, 1); if (prev_user_fd == -1) { /* * update the offset to a timeline for * commit completion */ rc = sde_fence_create(c_conn->retire_fence, &fence_user_fd, 1); if (rc) { SDE_ERROR("fence create failed rc:%d\n", rc); goto end; } rc = copy_to_user((uint64_t __user *)(uintptr_t)val, &fence_fd, sizeof(uint64_t)); rc = copy_to_user((uint64_t __user *)(uintptr_t)val, &fence_user_fd, sizeof(uint64_t)); if (rc) { SDE_ERROR("copy to user failed rc:%d\n", rc); /* fence will be released with timeline update */ put_unused_fd(fence_fd); /* * fence will be released with timeline * update */ put_unused_fd(fence_user_fd); rc = -EFAULT; goto end; } } break; case CONNECTOR_PROP_ROI_V1: rc = _sde_connector_set_roi_v1(c_conn, c_state, Loading drivers/gpu/drm/msm/sde/sde_crtc.c +26 −10 Original line number Diff line number Diff line Loading @@ -5112,7 +5112,8 @@ static int sde_crtc_atomic_set_property(struct drm_crtc *crtc, struct sde_crtc *sde_crtc; struct sde_crtc_state *cstate; int idx, ret; uint64_t fence_fd; uint64_t fence_user_fd; uint64_t __user prev_user_fd; if (!crtc || !state || !property) { SDE_ERROR("invalid argument(s)\n"); Loading Loading @@ -5172,20 +5173,35 @@ static int sde_crtc_atomic_set_property(struct drm_crtc *crtc, if (!val) goto exit; ret = _sde_crtc_get_output_fence(crtc, state, &fence_fd); ret = copy_from_user(&prev_user_fd, (void __user *)val, sizeof(uint64_t)); if (ret) { SDE_ERROR("copy from user failed rc:%d\n", ret); ret = -EFAULT; goto exit; } /* * client is expected to reset the property to -1 before * requesting for the release fence */ if (prev_user_fd == -1) { ret = _sde_crtc_get_output_fence(crtc, state, &fence_user_fd); if (ret) { SDE_ERROR("fence create failed rc:%d\n", ret); goto exit; } ret = copy_to_user((uint64_t __user *)(uintptr_t)val, &fence_fd, sizeof(uint64_t)); ret = copy_to_user((uint64_t __user *)(uintptr_t)val, &fence_user_fd, sizeof(uint64_t)); if (ret) { SDE_ERROR("copy to user failed rc:%d\n", ret); put_unused_fd(fence_fd); put_unused_fd(fence_user_fd); ret = -EFAULT; goto exit; } } break; default: /* nothing to do */ Loading Loading
drivers/gpu/drm/msm/sde/sde_connector.c +34 −14 Original line number Diff line number Diff line Loading @@ -1186,7 +1186,8 @@ static int sde_connector_atomic_set_property(struct drm_connector *connector, struct sde_connector *c_conn; struct sde_connector_state *c_state; int idx, rc; uint64_t fence_fd; uint64_t fence_user_fd; uint64_t __user prev_user_fd; if (!connector || !state || !property) { SDE_ERROR("invalid argument(s), conn %pK, state %pK, prp %pK\n", Loading Loading @@ -1229,24 +1230,43 @@ static int sde_connector_atomic_set_property(struct drm_connector *connector, if (!val) goto end; rc = copy_from_user(&prev_user_fd, (void __user *)val, sizeof(uint64_t)); if (rc) { SDE_ERROR("copy from user failed rc:%d\n", rc); rc = -EFAULT; goto end; } /* * update the the offset to a timeline for commit completion * client is expected to reset the property to -1 before * requesting for the retire fence */ rc = sde_fence_create(c_conn->retire_fence, &fence_fd, 1); if (prev_user_fd == -1) { /* * update the offset to a timeline for * commit completion */ rc = sde_fence_create(c_conn->retire_fence, &fence_user_fd, 1); if (rc) { SDE_ERROR("fence create failed rc:%d\n", rc); goto end; } rc = copy_to_user((uint64_t __user *)(uintptr_t)val, &fence_fd, sizeof(uint64_t)); rc = copy_to_user((uint64_t __user *)(uintptr_t)val, &fence_user_fd, sizeof(uint64_t)); if (rc) { SDE_ERROR("copy to user failed rc:%d\n", rc); /* fence will be released with timeline update */ put_unused_fd(fence_fd); /* * fence will be released with timeline * update */ put_unused_fd(fence_user_fd); rc = -EFAULT; goto end; } } break; case CONNECTOR_PROP_ROI_V1: rc = _sde_connector_set_roi_v1(c_conn, c_state, Loading
drivers/gpu/drm/msm/sde/sde_crtc.c +26 −10 Original line number Diff line number Diff line Loading @@ -5112,7 +5112,8 @@ static int sde_crtc_atomic_set_property(struct drm_crtc *crtc, struct sde_crtc *sde_crtc; struct sde_crtc_state *cstate; int idx, ret; uint64_t fence_fd; uint64_t fence_user_fd; uint64_t __user prev_user_fd; if (!crtc || !state || !property) { SDE_ERROR("invalid argument(s)\n"); Loading Loading @@ -5172,20 +5173,35 @@ static int sde_crtc_atomic_set_property(struct drm_crtc *crtc, if (!val) goto exit; ret = _sde_crtc_get_output_fence(crtc, state, &fence_fd); ret = copy_from_user(&prev_user_fd, (void __user *)val, sizeof(uint64_t)); if (ret) { SDE_ERROR("copy from user failed rc:%d\n", ret); ret = -EFAULT; goto exit; } /* * client is expected to reset the property to -1 before * requesting for the release fence */ if (prev_user_fd == -1) { ret = _sde_crtc_get_output_fence(crtc, state, &fence_user_fd); if (ret) { SDE_ERROR("fence create failed rc:%d\n", ret); goto exit; } ret = copy_to_user((uint64_t __user *)(uintptr_t)val, &fence_fd, sizeof(uint64_t)); ret = copy_to_user((uint64_t __user *)(uintptr_t)val, &fence_user_fd, sizeof(uint64_t)); if (ret) { SDE_ERROR("copy to user failed rc:%d\n", ret); put_unused_fd(fence_fd); put_unused_fd(fence_user_fd); ret = -EFAULT; goto exit; } } break; default: /* nothing to do */ Loading