Skip to content
This repository has been archived by the owner on Jul 7, 2021. It is now read-only.

Commit

Permalink
Merge branch 'kerneltoast/neutrino-msm-hotdogb-4.14' of https://githu…
Browse files Browse the repository at this point in the history
…b.com/0ctobot/neutrino-staging into neutrino-msm-hotdogb-4.14

* kerneltoast/neutrino-msm-hotdogb-4.14: (1 commit)
  Reapply 35783aa ("drm/msm/sde: Wait for ctl_start asynchronously on cmd mode panels")

Signed-off-by: Adam W. Willis <return.of.octobot@gmail.com>
  • Loading branch information
0ctobot committed Oct 15, 2020
2 parents 7b85ada + 979e799 commit 7ff6b8a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
1 change: 1 addition & 0 deletions drivers/gpu/drm/msm/sde/sde_encoder_phys.h
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@ struct sde_encoder_phys_cmd {
atomic_t pending_vblank_cnt;
wait_queue_head_t pending_vblank_wq;
u32 ctl_start_threshold;
struct work_struct ctl_wait_work;
};

/**
Expand Down
17 changes: 15 additions & 2 deletions drivers/gpu/drm/msm/sde/sde_encoder_phys_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1471,6 +1471,15 @@ static int _sde_encoder_phys_cmd_wait_for_ctl_start(
return ret;
}

static void sde_encoder_phys_cmd_ctl_start_work(struct work_struct *work)
{
struct sde_encoder_phys_cmd *cmd_enc = container_of(work,
typeof(*cmd_enc),
ctl_wait_work);

_sde_encoder_phys_cmd_wait_for_ctl_start(&cmd_enc->base);
}

static int sde_encoder_phys_cmd_wait_for_tx_complete(
struct sde_encoder_phys *phys_enc)
{
Expand Down Expand Up @@ -1505,9 +1514,9 @@ static int sde_encoder_phys_cmd_wait_for_commit_done(

/* only required for master controller */
if (sde_encoder_phys_cmd_is_master(phys_enc))
rc = _sde_encoder_phys_cmd_wait_for_ctl_start(phys_enc);
queue_work(system_unbound_wq, &cmd_enc->ctl_wait_work);

if (!rc && sde_encoder_phys_cmd_is_master(phys_enc) &&
if (sde_encoder_phys_cmd_is_master(phys_enc) &&
cmd_enc->autorefresh.cfg.enable)
rc = _sde_encoder_phys_cmd_wait_for_autorefresh_done(phys_enc);

Expand Down Expand Up @@ -1592,6 +1601,9 @@ static void sde_encoder_phys_cmd_prepare_commit(
if (!sde_encoder_phys_cmd_is_master(phys_enc))
return;

/* Wait for ctl_start interrupt for the previous commit if needed */
flush_work(&cmd_enc->ctl_wait_work);

SDE_EVT32(DRMID(phys_enc->parent), phys_enc->intf_idx - INTF_0,
cmd_enc->autorefresh.cfg.enable);

Expand Down Expand Up @@ -1798,6 +1810,7 @@ struct sde_encoder_phys *sde_encoder_phys_cmd_init(
init_waitqueue_head(&cmd_enc->pending_vblank_wq);
atomic_set(&cmd_enc->autorefresh.kickoff_cnt, 0);
init_waitqueue_head(&cmd_enc->autorefresh.kickoff_wq);
INIT_WORK(&cmd_enc->ctl_wait_work, sde_encoder_phys_cmd_ctl_start_work);

SDE_DEBUG_CMDENC(cmd_enc, "created\n");

Expand Down

0 comments on commit 7ff6b8a

Please sign in to comment.