diff options
Diffstat (limited to 'samsung')
-rw-r--r-- | samsung/panel/panel-boe-nt37290.c | 18 | ||||
-rw-r--r-- | samsung/panel/panel-samsung-s6e3hc3-c10.c | 14 | ||||
-rw-r--r-- | samsung/panel/panel-samsung-s6e3hc4.c | 14 |
3 files changed, 33 insertions, 13 deletions
diff --git a/samsung/panel/panel-boe-nt37290.c b/samsung/panel/panel-boe-nt37290.c index 947fddd..8835373 100644 --- a/samsung/panel/panel-boe-nt37290.c +++ b/samsung/panel/panel-boe-nt37290.c @@ -797,15 +797,16 @@ static bool nt37290_set_self_refresh(struct exynos_panel *ctx, bool enable) * Sends a command to panel to indicate a frame is about to come in case its been a while since * the last frame update and auto mode may have started to take effect and lowering refresh rate */ -static void nt37290_trigger_early_exit(struct exynos_panel *ctx) +static bool nt37290_trigger_early_exit(struct exynos_panel *ctx) { const ktime_t delta = ktime_sub(ktime_get(), ctx->last_commit_ts); const s64 delta_us = ktime_to_us(delta); + bool updated = false; if (delta_us < EARLY_EXIT_THRESHOLD_US) { dev_dbg(ctx->dev, "skip early exit. %lldus since last commit\n", delta_us); - return; + return false; } /* triggering early exit causes a switch to 120hz */ @@ -819,18 +820,22 @@ static void nt37290_trigger_early_exit(struct exynos_panel *ctx) dev_dbg(ctx->dev, "%s: disable auto idle mode for %s\n", __func__, pmode->mode.name); - nt37290_change_frequency(ctx, pmode); + updated = nt37290_change_frequency(ctx, pmode); } else { EXYNOS_DCS_WRITE_TABLE(ctx, stream_2c); } DPU_ATRACE_END(__func__); + + return updated; } +/* TODO: move update te2 to common display driver for other panel drivers */ static void nt37290_commit_done(struct exynos_panel *ctx) { struct nt37290_panel *spanel = to_spanel(ctx); const struct exynos_panel_mode *pmode = ctx->current_mode; + bool updated = false; if (!is_panel_active(ctx) || !pmode) return; @@ -842,14 +847,17 @@ static void nt37290_commit_done(struct exynos_panel *ctx) } if (test_bit(G10_FEAT_EARLY_EXIT, spanel->feat)) - nt37290_trigger_early_exit(ctx); + updated = nt37290_trigger_early_exit(ctx); /** * For IDLE_MODE_ON_INACTIVITY, we should go back to auto mode again * after the delay time has elapsed. */ else if (pmode->idle_mode == IDLE_MODE_ON_INACTIVITY && spanel->delayed_idle && !ctx->hbm.local_hbm.enabled) - nt37290_change_frequency(ctx, pmode); + updated = nt37290_change_frequency(ctx, pmode); + + if (updated) + nt37290_update_te2(ctx); } static void nt37290_set_lp_mode(struct exynos_panel *ctx, diff --git a/samsung/panel/panel-samsung-s6e3hc3-c10.c b/samsung/panel/panel-samsung-s6e3hc3-c10.c index 70ae4e1..9517055 100644 --- a/samsung/panel/panel-samsung-s6e3hc3-c10.c +++ b/samsung/panel/panel-samsung-s6e3hc3-c10.c @@ -808,20 +808,21 @@ static int s6e3hc3_c10_disable(struct drm_panel *panel) * - trigger early exit by command if it's changeable TE, which could result in * fast 120 Hz boost and seeing 120 Hz TE earlier */ -static void s6e3hc3_c10_update_idle_state(struct exynos_panel *ctx) +static bool s6e3hc3_c10_update_idle_state(struct exynos_panel *ctx) { s64 delta_us; struct s6e3hc3_c10_panel *spanel = to_spanel(ctx); + bool updated = false; ctx->panel_idle_vrefresh = 0; if (!test_bit(C10_FEAT_FRAME_AUTO, spanel->feat)) - return; + return false; delta_us = ktime_us_delta(ktime_get(), ctx->last_commit_ts); if (delta_us < EARLY_EXIT_THRESHOLD_US) { dev_dbg(ctx->dev, "skip early exit. %lldus since last commit\n", delta_us); - return; + return false; } /* triggering early exit causes a switch to 120hz */ @@ -835,6 +836,7 @@ static void s6e3hc3_c10_update_idle_state(struct exynos_panel *ctx) if (ctx->idle_delay_ms) { const struct exynos_panel_mode *pmode = ctx->current_mode; s6e3hc3_c10_update_refresh_mode(ctx, pmode, 0); + updated = true; } else if (spanel->force_changeable_te) { dev_dbg(ctx->dev, "sending early exit out cmd\n"); EXYNOS_DCS_BUF_ADD_SET(ctx, unlock_cmd_f0); @@ -843,14 +845,18 @@ static void s6e3hc3_c10_update_idle_state(struct exynos_panel *ctx) } DPU_ATRACE_END(__func__); + + return updated; } +/* TODO: move update te2 to common display driver for other panel drivers */ static void s6e3hc3_c10_commit_done(struct exynos_panel *ctx) { if (!ctx->enabled || !ctx->current_mode) return; - s6e3hc3_c10_update_idle_state(ctx); + if (s6e3hc3_c10_update_idle_state(ctx)) + s6e3hc3_c10_update_te2(ctx); } static void s6e3hc3_c10_set_hbm_mode(struct exynos_panel *ctx, diff --git a/samsung/panel/panel-samsung-s6e3hc4.c b/samsung/panel/panel-samsung-s6e3hc4.c index d9d6d74..1c2b6b3 100644 --- a/samsung/panel/panel-samsung-s6e3hc4.c +++ b/samsung/panel/panel-samsung-s6e3hc4.c @@ -937,20 +937,21 @@ static int s6e3hc4_disable(struct drm_panel *panel) * - trigger early exit by command if it's changeable TE, which could result in * fast 120 Hz boost and seeing 120 Hz TE earlier */ -static void s6e3hc4_update_idle_state(struct exynos_panel *ctx) +static bool s6e3hc4_update_idle_state(struct exynos_panel *ctx) { s64 delta_us; struct s6e3hc4_panel *spanel = to_spanel(ctx); + bool updated = false; ctx->panel_idle_vrefresh = 0; if (!test_bit(FEAT_FRAME_AUTO, spanel->feat)) - return; + return false; delta_us = ktime_us_delta(ktime_get(), ctx->last_commit_ts); if (delta_us < EARLY_EXIT_THRESHOLD_US) { dev_dbg(ctx->dev, "skip early exit. %lldus since last commit\n", delta_us); - return; + return false; } /* triggering early exit causes a switch to 120hz */ @@ -964,6 +965,7 @@ static void s6e3hc4_update_idle_state(struct exynos_panel *ctx) if (ctx->idle_delay_ms) { const struct exynos_panel_mode *pmode = ctx->current_mode; s6e3hc4_update_refresh_mode(ctx, pmode, 0); + updated = true; } else if (spanel->force_changeable_te) { dev_dbg(ctx->dev, "sending early exit out cmd\n"); EXYNOS_DCS_BUF_ADD_SET(ctx, unlock_cmd_f0); @@ -972,14 +974,18 @@ static void s6e3hc4_update_idle_state(struct exynos_panel *ctx) } DPU_ATRACE_END(__func__); + + return updated; } +/* TODO: move update te2 to common display driver for other panel drivers */ static void s6e3hc4_commit_done(struct exynos_panel *ctx) { if (!ctx->current_mode) return; - s6e3hc4_update_idle_state(ctx); + if (s6e3hc4_update_idle_state(ctx)) + s6e3hc4_update_te2(ctx); } static void s6e3hc4_set_hbm_mode(struct exynos_panel *ctx, |