disp: msm: sde: use wr_ptr interrupt instead of ctl_start
SDE driver triggers the frame and waits for the ctl_start interrupt for command mode display. This interrupt provides confirmation that hardware has picked up the frame. Retire fence signaling is associated with this interrupt and it is sent at the rd_ptr interrupt after ctl_start. Due to lut dma delay, ctl_start interrupt may be trigger before rd_ptr or after rd_ptr. SW manages this complexity and handle retire fence for different cases with 500us threshold logic. This change replaces the ctl_start interrupt with wr_ptr interrupt by programming it to trigger at 1st write line count. This is guaranteed to come every time and it is close to rd_ptr interrupt. That allows retire fence trigger at wr_ptr interrupt and simplifies the SW logic. CRTC commit thread would be held slightly longer with this change as the wr_ptr is always close to rd_ptr and after ctl_start. Change-Id: Ic47a8f82c854b4aded0d70c95af853b28a68ffd6 Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
This commit is contained in:

committed by
Dhaval Patel

parent
3be27eafcc
commit
6daf1c58e7
@@ -189,9 +189,9 @@ struct sde_encoder_phys_ops {
|
||||
/**
|
||||
* enum sde_intr_idx - sde encoder interrupt index
|
||||
* @INTR_IDX_VSYNC: Vsync interrupt for video mode panel
|
||||
* @INTR_IDX_PINGPONG: Pingpong done unterrupt for cmd mode panel
|
||||
* @INTR_IDX_UNDERRUN: Underrun unterrupt for video and cmd mode panel
|
||||
* @INTR_IDX_RDPTR: Readpointer done unterrupt for cmd mode panel
|
||||
* @INTR_IDX_PINGPONG: Pingpong done interrupt for cmd mode panel
|
||||
* @INTR_IDX_UNDERRUN: Underrun interrupt for video and cmd mode panel
|
||||
* @INTR_IDX_RDPTR: Readpointer done interrupt for cmd mode panel
|
||||
* @INTR_IDX_WB_DONE: Writeback done interrupt for WB
|
||||
* @INTR_IDX_PP1_OVFL: Pingpong overflow interrupt on PP1 for Concurrent WB
|
||||
* @INTR_IDX_PP2_OVFL: Pingpong overflow interrupt on PP2 for Concurrent WB
|
||||
@@ -200,6 +200,7 @@ struct sde_encoder_phys_ops {
|
||||
* @INTR_IDX_PP5_OVFL: Pingpong overflow interrupt on PP5 for Concurrent WB
|
||||
* @INTR_IDX_AUTOREFRESH_DONE: Autorefresh done for cmd mode panel meaning
|
||||
* autorefresh has triggered a double buffer flip
|
||||
* @INTR_IDX_WRPTR: Writepointer start interrupt for cmd mode panel
|
||||
*/
|
||||
enum sde_intr_idx {
|
||||
INTR_IDX_VSYNC,
|
||||
@@ -214,6 +215,7 @@ enum sde_intr_idx {
|
||||
INTR_IDX_PP3_OVFL,
|
||||
INTR_IDX_PP4_OVFL,
|
||||
INTR_IDX_PP5_OVFL,
|
||||
INTR_IDX_WRPTR,
|
||||
INTR_IDX_MAX,
|
||||
};
|
||||
|
||||
@@ -274,12 +276,9 @@ struct sde_encoder_irq {
|
||||
* vs. the number of done/vblank irqs. Should hover
|
||||
* between 0-2 Incremented when a new kickoff is
|
||||
* scheduled. Decremented in irq handler
|
||||
* @pending_ctlstart_cnt: Atomic counter tracking the number of ctl start
|
||||
* pending.
|
||||
* @pending_retire_fence_cnt: Atomic counter tracking the pending retire
|
||||
* fences that have to be signalled.
|
||||
* @pending_kickoff_wq: Wait queue for blocking until kickoff completes
|
||||
* @ctlstart_timeout: Indicates if ctl start timeout occurred
|
||||
* @irq: IRQ tracking structures
|
||||
* @has_intf_te: Interface TE configuration support
|
||||
* @cont_splash_single_flush Variable to check if single flush is enabled.
|
||||
@@ -320,10 +319,8 @@ struct sde_encoder_phys {
|
||||
atomic_t wbirq_refcount;
|
||||
atomic_t vsync_cnt;
|
||||
atomic_t underrun_cnt;
|
||||
atomic_t pending_ctlstart_cnt;
|
||||
atomic_t pending_kickoff_cnt;
|
||||
atomic_t pending_retire_fence_cnt;
|
||||
atomic_t ctlstart_timeout;
|
||||
wait_queue_head_t pending_kickoff_wq;
|
||||
struct sde_encoder_irq irq[INTR_IDX_MAX];
|
||||
bool has_intf_te;
|
||||
@@ -336,7 +333,6 @@ struct sde_encoder_phys {
|
||||
|
||||
static inline int sde_encoder_phys_inc_pending(struct sde_encoder_phys *phys)
|
||||
{
|
||||
atomic_inc_return(&phys->pending_ctlstart_cnt);
|
||||
return atomic_inc_return(&phys->pending_kickoff_cnt);
|
||||
}
|
||||
|
||||
@@ -373,24 +369,16 @@ struct sde_encoder_phys_cmd_autorefresh {
|
||||
* @stream_sel: Stream selection for multi-stream interfaces
|
||||
* @pp_timeout_report_cnt: number of pingpong done irq timeout errors
|
||||
* @autorefresh: autorefresh feature state
|
||||
* @pending_rd_ptr_cnt: atomic counter to indicate if retire fence can be
|
||||
* signaled at the next rd_ptr_irq
|
||||
* @rd_ptr_timestamp: last rd_ptr_irq timestamp
|
||||
* @pending_vblank_cnt: Atomic counter tracking pending wait for VBLANK
|
||||
* @pending_vblank_wq: Wait queue for blocking until VBLANK received
|
||||
* @ctl_start_threshold: A threshold in microseconds allows command mode
|
||||
* engine to trigger the retire fence without waiting for rd_ptr.
|
||||
*/
|
||||
struct sde_encoder_phys_cmd {
|
||||
struct sde_encoder_phys base;
|
||||
int stream_sel;
|
||||
int pp_timeout_report_cnt;
|
||||
struct sde_encoder_phys_cmd_autorefresh autorefresh;
|
||||
atomic_t pending_rd_ptr_cnt;
|
||||
ktime_t rd_ptr_timestamp;
|
||||
atomic_t pending_vblank_cnt;
|
||||
wait_queue_head_t pending_vblank_wq;
|
||||
u32 ctl_start_threshold;
|
||||
};
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user