|
@@ -62,6 +62,10 @@
|
|
|
|
|
|
#define DEFAULT_PANEL_MIN_V_PREFILL 35
|
|
#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 sde_rsc_priv *rsc_prv_list[MAX_RSC_COUNT];
|
|
static struct device *rpmh_dev[MAX_RSC_COUNT];
|
|
static struct device *rpmh_dev[MAX_RSC_COUNT];
|
|
|
|
|
|
@@ -169,7 +173,7 @@ void sde_rsc_client_destroy(struct sde_rsc_client *client)
|
|
SDE_EVT32(client->id, state, rsc->current_state,
|
|
SDE_EVT32(client->id, state, rsc->current_state,
|
|
client->crtc_id, wait_vblank_crtc_id,
|
|
client->crtc_id, wait_vblank_crtc_id,
|
|
SDE_EVTLOG_ERROR);
|
|
SDE_EVTLOG_ERROR);
|
|
- msleep(PRIMARY_VBLANK_WORST_CASE_MS);
|
|
|
|
|
|
+ msleep(RSC_VSYNC_TIMEOUT_MS(rsc));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
mutex_lock(&rsc->client_lock);
|
|
mutex_lock(&rsc->client_lock);
|
|
@@ -538,7 +542,7 @@ vsync_wait:
|
|
SDE_EVT32(caller_client->id, rsc->current_state,
|
|
SDE_EVT32(caller_client->id, rsc->current_state,
|
|
caller_client->crtc_id,
|
|
caller_client->crtc_id,
|
|
wait_vblank_crtc_id, SDE_EVTLOG_ERROR);
|
|
wait_vblank_crtc_id, SDE_EVTLOG_ERROR);
|
|
- msleep(PRIMARY_VBLANK_WORST_CASE_MS);
|
|
|
|
|
|
+ msleep(RSC_VSYNC_TIMEOUT_MS(rsc));
|
|
} else {
|
|
} else {
|
|
*wait_vblank_crtc_id = rsc->primary_client->crtc_id;
|
|
*wait_vblank_crtc_id = rsc->primary_client->crtc_id;
|
|
}
|
|
}
|
|
@@ -585,7 +589,7 @@ static int sde_rsc_switch_to_clk(struct sde_rsc_priv *rsc,
|
|
rsc->hw_ops.hw_vsync(rsc, VSYNC_ENABLE, NULL, 0, 0);
|
|
rsc->hw_ops.hw_vsync(rsc, VSYNC_ENABLE, NULL, 0, 0);
|
|
if (!wait_vblank_crtc_id) {
|
|
if (!wait_vblank_crtc_id) {
|
|
pr_err("invalid crtc id wait pointer provided\n");
|
|
pr_err("invalid crtc id wait pointer provided\n");
|
|
- msleep(PRIMARY_VBLANK_WORST_CASE_MS);
|
|
|
|
|
|
+ msleep(RSC_VSYNC_TIMEOUT_MS(rsc));
|
|
} else {
|
|
} else {
|
|
*wait_vblank_crtc_id = rsc->primary_client->crtc_id;
|
|
*wait_vblank_crtc_id = rsc->primary_client->crtc_id;
|
|
|
|
|
|
@@ -600,7 +604,7 @@ static int sde_rsc_switch_to_clk(struct sde_rsc_priv *rsc,
|
|
/* Wait for the vsync, if the refcount is set */
|
|
/* Wait for the vsync, if the refcount is set */
|
|
rc = wait_event_timeout(rsc->rsc_vsync_waitq,
|
|
rc = wait_event_timeout(rsc->rsc_vsync_waitq,
|
|
atomic_read(&rsc->rsc_vsync_wait) == 0,
|
|
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) {
|
|
if (!rc) {
|
|
pr_err("Timeout waiting for vsync\n");
|
|
pr_err("Timeout waiting for vsync\n");
|
|
rc = -ETIMEDOUT;
|
|
rc = -ETIMEDOUT;
|
|
@@ -686,7 +690,7 @@ vsync_wait:
|
|
SDE_EVT32(caller_client->id, rsc->current_state,
|
|
SDE_EVT32(caller_client->id, rsc->current_state,
|
|
caller_client->crtc_id,
|
|
caller_client->crtc_id,
|
|
wait_vblank_crtc_id, SDE_EVTLOG_ERROR);
|
|
wait_vblank_crtc_id, SDE_EVTLOG_ERROR);
|
|
- msleep(PRIMARY_VBLANK_WORST_CASE_MS);
|
|
|
|
|
|
+ msleep(RSC_VSYNC_TIMEOUT_MS(rsc));
|
|
} else {
|
|
} else {
|
|
*wait_vblank_crtc_id = rsc->primary_client->crtc_id;
|
|
*wait_vblank_crtc_id = rsc->primary_client->crtc_id;
|
|
}
|
|
}
|