disp: msm: sde: wait for specific pp_done instead of zero

2 Frames transfer pending is possible with posted start.
One ongoing frame and another triggered frame. Current SW
waits for pp_done interrupt if pending frame count is greater
than 1. It is possible that interrupt may be missed for ongoing
frame. In that case, SW should run pp_done wait for one by one
frame instead of two frames together. It allows encoder to
check the ctl scheduler status and trigger the frame done
event on time.

Change-Id: I4817842292d96747890ee70da8a5bdf9b56816ed
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
This commit is contained in:
Dhaval Patel
2019-08-20 15:44:32 -07:00
parent dc6f198f99
commit 6f06e5cd6f
5 changed files with 24 additions and 10 deletions

View File

@@ -647,10 +647,11 @@ static int _sde_encoder_phys_cmd_wait_for_idle(
{
struct sde_encoder_phys_cmd *cmd_enc =
to_sde_encoder_phys_cmd(phys_enc);
struct sde_encoder_wait_info wait_info;
struct sde_encoder_wait_info wait_info = {0};
bool recovery_events;
int ret;
struct sde_hw_ctl *ctl;
bool wr_ptr_wait_success = true;
if (!phys_enc) {
SDE_ERROR("invalid encoder\n");
@@ -658,7 +659,11 @@ static int _sde_encoder_phys_cmd_wait_for_idle(
}
ctl = phys_enc->hw_ctl;
if (cmd_enc->wr_ptr_wait_success &&
if (sde_encoder_phys_cmd_is_master(phys_enc))
wr_ptr_wait_success = cmd_enc->wr_ptr_wait_success;
if (wr_ptr_wait_success &&
(phys_enc->frame_trigger_mode == FRAME_DONE_WAIT_POSTED_START) &&
ctl->ops.get_scheduler_status &&
(ctl->ops.get_scheduler_status(ctl) & BIT(0)) &&
@@ -672,6 +677,9 @@ static int _sde_encoder_phys_cmd_wait_for_idle(
return 0;
}
if (atomic_read(&phys_enc->pending_kickoff_cnt) > 1)
wait_info.count_check = 1;
wait_info.wq = &phys_enc->pending_kickoff_wq;
wait_info.atomic_cnt = &phys_enc->pending_kickoff_cnt;
wait_info.timeout_ms = KICKOFF_TIMEOUT_MS;
@@ -707,7 +715,7 @@ static int _sde_encoder_phys_cmd_wait_for_autorefresh_done(
{
struct sde_encoder_phys_cmd *cmd_enc =
to_sde_encoder_phys_cmd(phys_enc);
struct sde_encoder_wait_info wait_info;
struct sde_encoder_wait_info wait_info = {0};
int ret = 0;
if (!phys_enc) {
@@ -1334,7 +1342,7 @@ static int _sde_encoder_phys_cmd_wait_for_wr_ptr(
{
struct sde_encoder_phys_cmd *cmd_enc =
to_sde_encoder_phys_cmd(phys_enc);
struct sde_encoder_wait_info wait_info;
struct sde_encoder_wait_info wait_info = {0};
int ret;
bool frame_pending = true;
struct sde_hw_ctl *ctl;
@@ -1383,6 +1391,7 @@ static int _sde_encoder_phys_cmd_wait_for_wr_ptr(
}
cmd_enc->wr_ptr_wait_success = (ret == 0) ? true : false;
return ret;
}
@@ -1461,7 +1470,7 @@ static int sde_encoder_phys_cmd_wait_for_vblank(
{
int rc = 0;
struct sde_encoder_phys_cmd *cmd_enc;
struct sde_encoder_wait_info wait_info;
struct sde_encoder_wait_info wait_info = {0};
if (!phys_enc)
return -EINVAL;