summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPixelBot AutoMerger <android-nexus-securitybot@system.gserviceaccount.com>2023-10-22 18:53:56 -0700
committerSecurityBot <android-nexus-securitybot@system.gserviceaccount.com>2023-10-22 18:53:57 -0700
commit5c9cc00e4cb036f3ea8b146281d83dbcd73998fa (patch)
treecc2174931f446d68f7de1af1f560c1099a96e66a
parent83fc5f4b7580985cf44189235f6007e13a57b753 (diff)
parentabd1a44e2ef41cfb6484fddc3fd194c9f80d1741 (diff)
downloaddisplay-5c9cc00e4cb036f3ea8b146281d83dbcd73998fa.tar.gz
Merge android14-gs-pixel-5.15-udc-d2 into android14-gs-pixel-5.15-24Q1
SBMerger: 571992243 Change-Id: I3052b4f5a86c39b95cb4e9d89dc816d4f120b28c Signed-off-by: SecurityBot <android-nexus-securitybot@system.gserviceaccount.com>
-rw-r--r--samsung/panel/panel-samsung-drv.c28
-rw-r--r--samsung/panel/panel-samsung-drv.h6
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