disp: msm: sde: avoid duplicate fence create from client
SDE fence driver avoids duplicate fence creation if fence timeline is not increased. This may lead to issue if client closes the fence with failure ATOMIC_COMMIT. SDE fence driver provides the closed fd node to subsequent valid commit and leads to invalid state. This patch avoids duplicate fence creation from crtc and connector object instead of sde_fence. Change-Id: Ic7b43762f0ad251fb20e42edb5f4d5f401790e14 Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
这个提交包含在:
@@ -5025,7 +5025,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");
|
||||
@@ -5085,19 +5086,34 @@ 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("fence create failed rc:%d\n", ret);
|
||||
SDE_ERROR("copy from user failed rc:%d\n", ret);
|
||||
ret = -EFAULT;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
ret = copy_to_user((uint64_t __user *)(uintptr_t)val, &fence_fd,
|
||||
sizeof(uint64_t));
|
||||
if (ret) {
|
||||
SDE_ERROR("copy to user failed rc:%d\n", ret);
|
||||
put_unused_fd(fence_fd);
|
||||
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_user_fd, sizeof(uint64_t));
|
||||
if (ret) {
|
||||
SDE_ERROR("copy to user failed rc:%d\n", ret);
|
||||
put_unused_fd(fence_user_fd);
|
||||
ret = -EFAULT;
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
在新工单中引用
屏蔽一个用户