summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Huang <kenbshuang@google.com>2022-06-20 14:27:01 +0800
committerTreeHugger Robot <treehugger-gerrit@google.com>2022-07-06 02:57:58 +0000
commit1bc011d3ea049d2894dcaf7aa6c90cf0c1f3e2c3 (patch)
tree4f4d315f46739ce26cd3aefb0a1106af2ab309c0
parentbef5ea0e21f64e7598e85d6712b15678179a8e9b (diff)
downloaddisplay-1bc011d3ea049d2894dcaf7aa6c90cf0c1f3e2c3.tar.gz
panel: update te2 in commit done if there changes state or frequency
Update TE2 settings if updating state or frequency in commit_done. Bug: 235463516 Test: enable/disable smooth display frequently Signed-off-by: Ken Huang <kenbshuang@google.com> Change-Id: I8e507c6e5a44ec62353ffee209d89c4fd076a92a
-rw-r--r--samsung/panel/panel-boe-nt37290.c18
-rw-r--r--samsung/panel/panel-samsung-s6e3hc3-c10.c14
-rw-r--r--samsung/panel/panel-samsung-s6e3hc4.c14
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,