Merge branch 'display-kernel.lnx.5.10' into display-kernel.lnx.1.0
Change-Id: I5d2b08380b6b0eb09492b950fb38cd9a0b3196c1
这个提交包含在:
@@ -61,6 +61,10 @@
|
||||
|
||||
#define DEFAULT_PANEL_MIN_V_PREFILL 35
|
||||
|
||||
/* add 10ms constant for low fps cases and use default timeout for existing cases */
|
||||
#define RSC_VSYNC_TIMEOUT_MS(x) ((x && x->cmd_config.fps < 30) ? \
|
||||
((1000 / x->cmd_config.fps) + 10) : PRIMARY_VBLANK_WORST_CASE_MS)
|
||||
|
||||
static struct sde_rsc_priv *rsc_prv_list[MAX_RSC_COUNT];
|
||||
static struct device *rpmh_dev[MAX_RSC_COUNT];
|
||||
|
||||
@@ -168,7 +172,7 @@ void sde_rsc_client_destroy(struct sde_rsc_client *client)
|
||||
SDE_EVT32(client->id, state, rsc->current_state,
|
||||
client->crtc_id, wait_vblank_crtc_id,
|
||||
SDE_EVTLOG_ERROR);
|
||||
msleep(PRIMARY_VBLANK_WORST_CASE_MS);
|
||||
msleep(RSC_VSYNC_TIMEOUT_MS(rsc));
|
||||
}
|
||||
}
|
||||
mutex_lock(&rsc->client_lock);
|
||||
@@ -311,7 +315,7 @@ static u32 sde_rsc_timer_calculate(struct sde_rsc_priv *rsc,
|
||||
|
||||
default_prefill_lines = (rsc->cmd_config.fps *
|
||||
DEFAULT_PANEL_MIN_V_PREFILL) / DEFAULT_PANEL_FPS;
|
||||
if ((state == SDE_RSC_CMD_STATE) || !rsc->cmd_config.prefill_lines)
|
||||
if (!rsc->cmd_config.prefill_lines)
|
||||
rsc->cmd_config.prefill_lines = default_prefill_lines;
|
||||
|
||||
pr_debug("frame fps:%d jitter_numer:%d jitter_denom:%d vtotal:%d prefill lines:%d\n",
|
||||
@@ -332,12 +336,7 @@ static u32 sde_rsc_timer_calculate(struct sde_rsc_priv *rsc,
|
||||
line_time_ns = div_u64(line_time_ns, rsc->cmd_config.vtotal);
|
||||
prefill_time_ns = line_time_ns * rsc->cmd_config.prefill_lines;
|
||||
|
||||
/* only take jitter into account for CMD mode */
|
||||
if (state == SDE_RSC_CMD_STATE)
|
||||
total = frame_time_ns - frame_jitter - prefill_time_ns;
|
||||
else
|
||||
total = frame_time_ns - prefill_time_ns;
|
||||
|
||||
total = frame_time_ns - frame_jitter - prefill_time_ns;
|
||||
if (total < 0) {
|
||||
pr_err("invalid total time period time:%llu jiter_time:%llu blanking time:%llu\n",
|
||||
frame_time_ns, frame_jitter, prefill_time_ns);
|
||||
@@ -370,9 +369,8 @@ static u32 sde_rsc_timer_calculate(struct sde_rsc_priv *rsc,
|
||||
rsc_time_slot_0_ns = div_u64(rsc_time_slot_0_ns, cxo_period_ns);
|
||||
rsc->timer_config.rsc_time_slot_0_ns = (u32) rsc_time_slot_0_ns;
|
||||
|
||||
/* time_slot_1 for mode1 latency */
|
||||
rsc_time_slot_1_ns = frame_time_ns;
|
||||
rsc_time_slot_1_ns = div_u64(rsc_time_slot_1_ns, cxo_period_ns);
|
||||
/* time_slot_1 for mode1 latency - 1 fps */
|
||||
rsc_time_slot_1_ns = div_u64(TICKS_IN_NANO_SECOND, cxo_period_ns);
|
||||
rsc->timer_config.rsc_time_slot_1_ns = (u32) rsc_time_slot_1_ns;
|
||||
|
||||
/* mode 2 is infinite */
|
||||
@@ -543,7 +541,7 @@ vsync_wait:
|
||||
SDE_EVT32(caller_client->id, rsc->current_state,
|
||||
caller_client->crtc_id,
|
||||
wait_vblank_crtc_id, SDE_EVTLOG_ERROR);
|
||||
msleep(PRIMARY_VBLANK_WORST_CASE_MS);
|
||||
msleep(RSC_VSYNC_TIMEOUT_MS(rsc));
|
||||
} else {
|
||||
*wait_vblank_crtc_id = rsc->primary_client->crtc_id;
|
||||
}
|
||||
@@ -590,7 +588,7 @@ static int sde_rsc_switch_to_clk(struct sde_rsc_priv *rsc,
|
||||
rsc->hw_ops.hw_vsync(rsc, VSYNC_ENABLE, NULL, 0, 0);
|
||||
if (!wait_vblank_crtc_id) {
|
||||
pr_err("invalid crtc id wait pointer provided\n");
|
||||
msleep(PRIMARY_VBLANK_WORST_CASE_MS);
|
||||
msleep(RSC_VSYNC_TIMEOUT_MS(rsc));
|
||||
} else {
|
||||
*wait_vblank_crtc_id = rsc->primary_client->crtc_id;
|
||||
|
||||
@@ -605,7 +603,7 @@ static int sde_rsc_switch_to_clk(struct sde_rsc_priv *rsc,
|
||||
/* Wait for the vsync, if the refcount is set */
|
||||
rc = wait_event_timeout(rsc->rsc_vsync_waitq,
|
||||
atomic_read(&rsc->rsc_vsync_wait) == 0,
|
||||
msecs_to_jiffies(PRIMARY_VBLANK_WORST_CASE_MS*2));
|
||||
msecs_to_jiffies(RSC_VSYNC_TIMEOUT_MS(rsc) * 2));
|
||||
if (!rc) {
|
||||
pr_err("Timeout waiting for vsync\n");
|
||||
rc = -ETIMEDOUT;
|
||||
@@ -691,7 +689,7 @@ vsync_wait:
|
||||
SDE_EVT32(caller_client->id, rsc->current_state,
|
||||
caller_client->crtc_id,
|
||||
wait_vblank_crtc_id, SDE_EVTLOG_ERROR);
|
||||
msleep(PRIMARY_VBLANK_WORST_CASE_MS);
|
||||
msleep(RSC_VSYNC_TIMEOUT_MS(rsc));
|
||||
} else {
|
||||
*wait_vblank_crtc_id = rsc->primary_client->crtc_id;
|
||||
}
|
||||
|
在新工单中引用
屏蔽一个用户