mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
msm: display: buf sync enhancement
Support waiting for acquire fences in the buffer sync ioctl. Signed-off-by: Ken Zhang <kenz@codeaurora.org> Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
This commit is contained in:
parent
504021da52
commit
8b804aaf0b
2 changed files with 10 additions and 6 deletions
|
@ -3525,17 +3525,17 @@ static int msmfb_handle_pp_ioctl(struct msm_fb_data_type *mfd,
|
||||||
static int msmfb_handle_buf_sync_ioctl(struct msm_fb_data_type *mfd,
|
static int msmfb_handle_buf_sync_ioctl(struct msm_fb_data_type *mfd,
|
||||||
struct mdp_buf_sync *buf_sync)
|
struct mdp_buf_sync *buf_sync)
|
||||||
{
|
{
|
||||||
int i, fence_cnt = 0, ret;
|
int i, fence_cnt = 0, ret = 0;
|
||||||
int acq_fen_fd[MDP_MAX_FENCE_FD];
|
int acq_fen_fd[MDP_MAX_FENCE_FD];
|
||||||
struct sync_fence *fence;
|
struct sync_fence *fence;
|
||||||
|
|
||||||
if ((buf_sync->acq_fen_fd_cnt == 0) ||
|
if ((buf_sync->acq_fen_fd_cnt > MDP_MAX_FENCE_FD) ||
|
||||||
(buf_sync->acq_fen_fd_cnt > MDP_MAX_FENCE_FD) ||
|
|
||||||
(mfd->timeline == NULL))
|
(mfd->timeline == NULL))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
ret = copy_from_user(acq_fen_fd, buf_sync->acq_fen_fd,
|
if (buf_sync->acq_fen_fd_cnt)
|
||||||
buf_sync->acq_fen_fd_cnt * sizeof(int));
|
ret = copy_from_user(acq_fen_fd, buf_sync->acq_fen_fd,
|
||||||
|
buf_sync->acq_fen_fd_cnt * sizeof(int));
|
||||||
if (ret) {
|
if (ret) {
|
||||||
pr_err("%s:copy_from_user failed", __func__);
|
pr_err("%s:copy_from_user failed", __func__);
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -3554,6 +3554,10 @@ static int msmfb_handle_buf_sync_ioctl(struct msm_fb_data_type *mfd,
|
||||||
fence_cnt = i;
|
fence_cnt = i;
|
||||||
if (ret)
|
if (ret)
|
||||||
goto buf_sync_err_1;
|
goto buf_sync_err_1;
|
||||||
|
mfd->acq_fen_cnt = fence_cnt;
|
||||||
|
if (buf_sync->flags & MDP_BUF_SYNC_FLAG_WAIT) {
|
||||||
|
msm_fb_wait_for_fence(mfd);
|
||||||
|
}
|
||||||
mfd->cur_rel_sync_pt = sw_sync_pt_create(mfd->timeline,
|
mfd->cur_rel_sync_pt = sw_sync_pt_create(mfd->timeline,
|
||||||
mfd->timeline_value + 2);
|
mfd->timeline_value + 2);
|
||||||
if (mfd->cur_rel_sync_pt == NULL) {
|
if (mfd->cur_rel_sync_pt == NULL) {
|
||||||
|
@ -3580,7 +3584,6 @@ static int msmfb_handle_buf_sync_ioctl(struct msm_fb_data_type *mfd,
|
||||||
pr_err("%s:copy_to_user failed", __func__);
|
pr_err("%s:copy_to_user failed", __func__);
|
||||||
goto buf_sync_err_2;
|
goto buf_sync_err_2;
|
||||||
}
|
}
|
||||||
mfd->acq_fen_cnt = buf_sync->acq_fen_fd_cnt;
|
|
||||||
mutex_unlock(&mfd->sync_mutex);
|
mutex_unlock(&mfd->sync_mutex);
|
||||||
return ret;
|
return ret;
|
||||||
buf_sync_err_2:
|
buf_sync_err_2:
|
||||||
|
|
|
@ -490,6 +490,7 @@ struct msmfb_mdp_pp {
|
||||||
};
|
};
|
||||||
|
|
||||||
#define MDP_MAX_FENCE_FD 10
|
#define MDP_MAX_FENCE_FD 10
|
||||||
|
#define MDP_BUF_SYNC_FLAG_WAIT 1
|
||||||
|
|
||||||
struct mdp_buf_sync {
|
struct mdp_buf_sync {
|
||||||
uint32_t flags;
|
uint32_t flags;
|
||||||
|
|
Loading…
Reference in a new issue