diff options
author | Ken Lin <lyenting@google.com> | 2023-09-28 06:31:51 +0000 |
---|---|---|
committer | Ken Lin <lyenting@google.com> | 2023-10-16 11:49:26 +0000 |
commit | 92b621c76ae2e47ecfa6927d1707362ffc02aa28 (patch) | |
tree | 9e546222142309372ff26468eb7398e749920efd | |
parent | f69da18ea4efd2928ae2fc1614d8bc9bff6a491c (diff) | |
download | display-android-gs-shusky-5.15-android14-qpr1.tar.gz |
drm: samsung: prevent notifications from resolution switchandroid-u-qpr1-beta-2.2_r0.7android-14.0.0_r0.45android-14.0.0_r0.38android-gs-shusky-5.15-android14-qpr1-betaandroid-gs-shusky-5.15-android14-qpr1
Support sysfs notification asynchronously during RRS transition
Bug: 294185955
Test: Reboot and see if snowflakes happen after switching mode
Change-Id: I124eaa9a9a8b3060a30a23a0d8b1094b743c80af
Signed-off-by: Ken Lin <lyenting@google.com>
-rw-r--r-- | samsung/panel/panel-samsung-drv.c | 28 | ||||
-rw-r--r-- | samsung/panel/panel-samsung-drv.h | 6 |
2 files changed, 30 insertions, 4 deletions
diff --git a/samsung/panel/panel-samsung-drv.c b/samsung/panel/panel-samsung-drv.c index 389dc3f..d4e6606 100644 --- a/samsung/panel/panel-samsung-drv.c +++ b/samsung/panel/panel-samsung-drv.c @@ -204,9 +204,6 @@ static void exynos_panel_update_te2(struct exynos_panel *ctx) return; funcs->update_te2(ctx); - - if (ctx->bl) - te2_state_changed(ctx->bl); } static int exynos_panel_parse_gpios(struct exynos_panel *ctx) @@ -1136,7 +1133,13 @@ static int exynos_update_status(struct backlight_device *bl) bl_range != ctx->bl_notifier.current_range) { ctx->bl_notifier.current_range = bl_range; - sysfs_notify(&ctx->bl->dev.kobj, NULL, "brightness"); + /* Prevent sysfs_notify from resolution switch */ + if (ctx->desc->use_async_notify && + (ctx->mode_in_progress == MODE_RES_IN_PROGRESS || + ctx->mode_in_progress == MODE_RES_AND_RR_IN_PROGRESS)) + schedule_work(&ctx->brightness_notify); + else + sysfs_notify(&ctx->bl->dev.kobj, NULL, "brightness"); dev_dbg(ctx->dev, "bl range is changed to %d\n", bl_range); } @@ -4690,6 +4693,20 @@ static void exynos_panel_check_mode_clock(struct exynos_panel *ctx, } } +static void state_notify_worker(struct work_struct *work) +{ + struct exynos_panel *ctx = container_of(work, struct exynos_panel, state_notify); + + sysfs_notify(&ctx->bl->dev.kobj, NULL, "state"); +} + +static void brightness_notify_worker(struct work_struct *work) +{ + struct exynos_panel *ctx = container_of(work, struct exynos_panel, brightness_notify); + + sysfs_notify(&ctx->bl->dev.kobj, NULL, "brightness"); +} + int exynos_panel_common_init(struct mipi_dsi_device *dsi, struct exynos_panel *ctx) { @@ -4786,6 +4803,9 @@ int exynos_panel_common_init(struct mipi_dsi_device *dsi, ctx->panel_idle_enabled = exynos_panel_func && exynos_panel_func->set_self_refresh != NULL; INIT_DELAYED_WORK(&ctx->idle_work, panel_idle_work); + INIT_WORK(&ctx->state_notify, state_notify_worker); + INIT_WORK(&ctx->brightness_notify, brightness_notify_worker); + if (exynos_panel_func && exynos_panel_func->run_normal_mode_work && ctx->desc->normal_mode_work_delay_ms) { ctx->normal_mode_work_delay_ms = ctx->desc->normal_mode_work_delay_ms; diff --git a/samsung/panel/panel-samsung-drv.h b/samsung/panel/panel-samsung-drv.h index a85ff24..0440663 100644 --- a/samsung/panel/panel-samsung-drv.h +++ b/samsung/panel/panel-samsung-drv.h @@ -606,6 +606,8 @@ struct exynos_panel_desc { * - if `freq set` is changed when lhbm is on, lhbm may not work normally. */ bool no_lhbm_rr_constraints; + /* schedule sysfs_notify in workq */ + bool use_async_notify; const u32 lhbm_post_cmd_delay_frames; const u32 lhbm_effective_delay_frames; /** @@ -780,6 +782,10 @@ struct exynos_panel { ktime_t last_panel_idle_set_ts; struct delayed_work idle_work; + /* works of sysfs_notify */ + struct work_struct state_notify; + struct work_struct brightness_notify; + /** * Record the last refresh rate switch. Note the mode switch doesn't * mean rr switch so it differs from last_mode_set_ts |