diff options
author | Adrian Salido <salidoa@google.com> | 2022-03-30 16:36:41 -0700 |
---|---|---|
committer | Adrian Salido <salidoa@google.com> | 2022-04-01 20:00:11 +0000 |
commit | 19cb8d3d2e06318a3f76574195bb7418c485d08e (patch) | |
tree | dbbf9998f7b97c778424d7fd28d3cdc4d0e7bb52 /samsung/panel/panel-samsung-drv.c | |
parent | fba8a99281bf372b1441ad509bfb605d87dfab44 (diff) | |
download | display-19cb8d3d2e06318a3f76574195bb7418c485d08e.tar.gz |
drm: panel: add MODESET panel state
The new panel state "PANEL_STATE_MODESET" indicates that panel is going
through modeset in which panel will received disable followed by enable
call with the new mode. Panel drivers can make use of this to allow a
smooth transition if the panel allows.
Bug: 223115232
Test: switch resolution while display on
Signed-off-by: Adrian Salido <salidoa@google.com>
Change-Id: I88c83b4407f1a15fa70645f4d878787987877c39
Diffstat (limited to 'samsung/panel/panel-samsung-drv.c')
-rw-r--r-- | samsung/panel/panel-samsung-drv.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/samsung/panel/panel-samsung-drv.c b/samsung/panel/panel-samsung-drv.c index 96fd5fb..bd4e995 100644 --- a/samsung/panel/panel-samsung-drv.c +++ b/samsung/panel/panel-samsung-drv.c @@ -2905,6 +2905,8 @@ static unsigned long get_backlight_state_from_panel(struct backlight_device *bl, state &= ~(BL_STATE_STANDBY); state |= BL_STATE_LP; break; + case PANEL_STATE_MODESET: /* no change */ + break; case PANEL_STATE_OFF: case PANEL_STATE_BLANK: default: @@ -3071,7 +3073,7 @@ static void exynos_panel_bridge_enable(struct drm_bridge *bridge, is_active = !exynos_panel_init(ctx); } else if (ctx->panel_state == PANEL_STATE_HANDOFF_MODESET) { if (!exynos_panel_init(ctx)) { - ctx->panel_state = PANEL_STATE_BLANK; + ctx->panel_state = PANEL_STATE_MODESET; mutex_unlock(&ctx->mode_lock); drm_panel_disable(&ctx->panel); mutex_lock(&ctx->mode_lock); @@ -3148,16 +3150,12 @@ static void exynos_panel_bridge_pre_enable(struct drm_bridge *bridge, { struct exynos_panel *ctx = bridge_to_exynos_panel(bridge); - if (is_panel_active(ctx) || (ctx->panel_state == PANEL_STATE_HANDOFF) || - (ctx->panel_state == PANEL_STATE_HANDOFF_MODESET)) - return; - if (ctx->panel_state == PANEL_STATE_BLANK) { const struct exynos_panel_funcs *funcs = ctx->desc->exynos_panel_func; if (funcs && funcs->panel_reset) funcs->panel_reset(ctx); - } else { + } else if (!is_panel_enabled(ctx)) { drm_panel_prepare(&ctx->panel); } } @@ -3178,9 +3176,10 @@ static void exynos_panel_bridge_disable(struct drm_bridge *bridge, panel_update_idle_mode_locked(ctx); mutex_unlock(&ctx->mode_lock); } else { - if ((crtc_state && crtc_state->mode_changed && - drm_atomic_crtc_effectively_active(crtc_state)) || - ctx->force_power_on) + if (crtc_state && crtc_state->mode_changed && + drm_atomic_crtc_effectively_active(crtc_state)) + ctx->panel_state = PANEL_STATE_MODESET; + else if (ctx->force_power_on) ctx->panel_state = PANEL_STATE_BLANK; else ctx->panel_state = PANEL_STATE_OFF; @@ -3195,7 +3194,7 @@ static void exynos_panel_bridge_post_disable(struct drm_bridge *bridge, struct exynos_panel *ctx = bridge_to_exynos_panel(bridge); /* fully power off only if panel is in full off mode */ - if (ctx->panel_state == PANEL_STATE_OFF) + if (!is_panel_enabled(ctx)) drm_panel_unprepare(&ctx->panel); exynos_panel_set_backlight_state(ctx, ctx->panel_state); |