msm_fb: Make Vsync IOCTL during disable sequence as NO WAIT

Change to make the vsync IOCTL no wait during the disable sequence.
This is to increase the performance. Handle the synchronization of
vsync interrupt using state variables in drivers from now.

Change-Id: Ia5ec14493f233a95f21d01ea627200a6c278239f
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
This commit is contained in:
Padmanabhan Komanduru 2012-09-12 11:10:26 +05:30 committed by Stephen Boyd
parent a57b7f57a4
commit 46fd6a9478
5 changed files with 27 additions and 27 deletions

View file

@ -1804,16 +1804,16 @@ irqreturn_t mdp_isr(int irq, void *ptr)
if (!vsync_isr) {
mdp_intr_mask &= ~MDP_PRIM_RDPTR;
outp32(MDP_INTR_ENABLE, mdp_intr_mask);
mdp_disable_irq_nosync(MDP_VSYNC_TERM);
vsync_cntrl.disabled_clocks = 1;
} else {
vsync_isr_handler();
}
spin_unlock_irqrestore(&mdp_spin_lock, flag);
if (vsync_isr) {
vsync_isr_handler();
} else {
if (!vsync_isr)
mdp_pipe_ctrl(MDP_CMD_BLOCK,
MDP_BLOCK_POWER_OFF, TRUE);
complete(&vsync_cntrl.vsync_wait);
}
}
/* DMA3 TV-Out Start */
@ -1872,16 +1872,16 @@ irqreturn_t mdp_isr(int irq, void *ptr)
if (!vsync_isr) {
mdp_intr_mask &= ~LCDC_FRAME_START;
outp32(MDP_INTR_ENABLE, mdp_intr_mask);
mdp_disable_irq_nosync(MDP_VSYNC_TERM);
vsync_cntrl.disabled_clocks = 1;
} else {
vsync_isr_handler();
}
spin_unlock_irqrestore(&mdp_spin_lock, flag);
if (vsync_isr) {
vsync_isr_handler();
} else {
if (!vsync_isr)
mdp_pipe_ctrl(MDP_CMD_BLOCK,
MDP_BLOCK_POWER_OFF, TRUE);
complete(&vsync_cntrl.vsync_wait);
}
}
/* DMA2 LCD-Out Complete */
@ -2012,7 +2012,7 @@ static void mdp_drv_init(void)
atomic_set(&mdp_block_power_cnt[i], 0);
}
INIT_WORK(&(vsync_cntrl.vsync_work), send_vsync_work);
init_completion(&vsync_cntrl.vsync_wait);
vsync_cntrl.disabled_clocks = 1;
#ifdef MSM_FB_ENABLE_DBGFS
{
struct dentry *root;

View file

@ -96,7 +96,7 @@ struct vsync {
struct device *dev;
struct work_struct vsync_work;
int vsync_irq_enabled;
struct completion vsync_wait;
int disabled_clocks;
};
extern struct vsync vsync_cntrl;

View file

@ -515,14 +515,18 @@ void mdp_dma2_update(struct msm_fb_data_type *mfd)
void mdp_dma_vsync_ctrl(int enable)
{
unsigned long flag;
int disabled_clocks;
if (vsync_cntrl.vsync_irq_enabled == enable)
return;
spin_lock_irqsave(&mdp_spin_lock, flag);
vsync_cntrl.vsync_irq_enabled = enable;
if (!enable)
vsync_cntrl.disabled_clocks = 0;
disabled_clocks = vsync_cntrl.disabled_clocks;
spin_unlock_irqrestore(&mdp_spin_lock, flag);
if (enable) {
if (enable && disabled_clocks) {
mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_ON, FALSE);
MDP_OUTP(MDP_BASE + 0x021c, 0x10); /* read pointer */
spin_lock_irqsave(&mdp_spin_lock, flag);
@ -531,10 +535,6 @@ void mdp_dma_vsync_ctrl(int enable)
outp32(MDP_INTR_ENABLE, mdp_intr_mask);
mdp_enable_irq(MDP_VSYNC_TERM);
spin_unlock_irqrestore(&mdp_spin_lock, flag);
} else {
INIT_COMPLETION(vsync_cntrl.vsync_wait);
wait_for_completion(&vsync_cntrl.vsync_wait);
mdp_disable_irq(MDP_VSYNC_TERM);
}
}

View file

@ -250,14 +250,18 @@ int mdp_dsi_video_off(struct platform_device *pdev)
void mdp_dma_video_vsync_ctrl(int enable)
{
unsigned long flag;
int disabled_clocks;
if (vsync_cntrl.vsync_irq_enabled == enable)
return;
spin_lock_irqsave(&mdp_spin_lock, flag);
vsync_cntrl.vsync_irq_enabled = enable;
if (!enable)
vsync_cntrl.disabled_clocks = 0;
disabled_clocks = vsync_cntrl.disabled_clocks;
spin_unlock_irqrestore(&mdp_spin_lock, flag);
if (enable) {
if (enable && disabled_clocks) {
mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_ON, FALSE);
spin_lock_irqsave(&mdp_spin_lock, flag);
outp32(MDP_INTR_CLEAR, LCDC_FRAME_START);
@ -265,10 +269,6 @@ void mdp_dma_video_vsync_ctrl(int enable)
outp32(MDP_INTR_ENABLE, mdp_intr_mask);
mdp_enable_irq(MDP_VSYNC_TERM);
spin_unlock_irqrestore(&mdp_spin_lock, flag);
} else {
INIT_COMPLETION(vsync_cntrl.vsync_wait);
wait_for_completion(&vsync_cntrl.vsync_wait);
mdp_disable_irq(MDP_VSYNC_TERM);
}
}

View file

@ -331,14 +331,18 @@ int mdp_lcdc_off(struct platform_device *pdev)
void mdp_dma_lcdc_vsync_ctrl(int enable)
{
unsigned long flag;
int disabled_clocks;
if (vsync_cntrl.vsync_irq_enabled == enable)
return;
spin_lock_irqsave(&mdp_spin_lock, flag);
vsync_cntrl.vsync_irq_enabled = enable;
if (!enable)
vsync_cntrl.disabled_clocks = 0;
disabled_clocks = vsync_cntrl.disabled_clocks;
spin_unlock_irqrestore(&mdp_spin_lock, flag);
if (enable) {
if (enable && disabled_clocks) {
mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_ON, FALSE);
spin_lock_irqsave(&mdp_spin_lock, flag);
outp32(MDP_INTR_CLEAR, LCDC_FRAME_START);
@ -346,10 +350,6 @@ void mdp_dma_lcdc_vsync_ctrl(int enable)
outp32(MDP_INTR_ENABLE, mdp_intr_mask);
mdp_enable_irq(MDP_VSYNC_TERM);
spin_unlock_irqrestore(&mdp_spin_lock, flag);
} else {
INIT_COMPLETION(vsync_cntrl.vsync_wait);
wait_for_completion(&vsync_cntrl.vsync_wait);
mdp_disable_irq(MDP_VSYNC_TERM);
}
}