From f5a91ba3b3316e57c2c3fcf58c1931b5ef0a7c10 Mon Sep 17 00:00:00 2001 From: Samantha Tran Date: Mon, 24 May 2021 14:49:20 -0700 Subject: [PATCH] disp: msm: sde: pass disp info to setup vsync source While setting up vsync source, display info is used to decide whether or not watchdog TE should be used. This change passes display info as a parameter to vsync setup rather than using the encoder's display info which is not updated in the case of panel dead error. Change-Id: I928ee2012eec7bf63f4ba3538082bc3e47d5e99d Signed-off-by: Samantha Tran --- msm/sde/sde_encoder.c | 2 +- msm/sde/sde_encoder_phys.h | 3 ++- msm/sde/sde_encoder_phys_cmd.c | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/msm/sde/sde_encoder.c b/msm/sde/sde_encoder.c index fd08a1b9..7b549761 100644 --- a/msm/sde/sde_encoder.c +++ b/msm/sde/sde_encoder.c @@ -1342,7 +1342,7 @@ static void _sde_encoder_update_vsync_source(struct sde_encoder_virt *sde_enc, phys = sde_enc->phys_encs[i]; if (phys && phys->ops.setup_vsync_source) - phys->ops.setup_vsync_source(phys, vsync_source); + phys->ops.setup_vsync_source(phys, vsync_source, disp_info); } } } diff --git a/msm/sde/sde_encoder_phys.h b/msm/sde/sde_encoder_phys.h index 7c5e25d8..291fe025 100644 --- a/msm/sde/sde_encoder_phys.h +++ b/msm/sde/sde_encoder_phys.h @@ -183,7 +183,8 @@ struct sde_encoder_phys_ops { int (*get_line_count)(struct sde_encoder_phys *phys); bool (*wait_dma_trigger)(struct sde_encoder_phys *phys); int (*wait_for_active)(struct sde_encoder_phys *phys); - void (*setup_vsync_source)(struct sde_encoder_phys *phys, u32 vsync_source); + void (*setup_vsync_source)(struct sde_encoder_phys *phys, u32 vsync_source, + struct msm_display_info *disp_info); u32 (*get_underrun_line_count)(struct sde_encoder_phys *phys); }; diff --git a/msm/sde/sde_encoder_phys_cmd.c b/msm/sde/sde_encoder_phys_cmd.c index 442373b5..ffd0954b 100644 --- a/msm/sde/sde_encoder_phys_cmd.c +++ b/msm/sde/sde_encoder_phys_cmd.c @@ -1839,8 +1839,8 @@ static void sde_encoder_phys_cmd_trigger_start( cmd_enc->wr_ptr_wait_success = false; } -static void sde_encoder_phys_cmd_setup_vsync_source( - struct sde_encoder_phys *phys_enc, u32 vsync_source) +static void sde_encoder_phys_cmd_setup_vsync_source(struct sde_encoder_phys *phys_enc, + u32 vsync_source, struct msm_display_info *disp_info) { struct sde_encoder_virt *sde_enc; @@ -1851,7 +1851,7 @@ static void sde_encoder_phys_cmd_setup_vsync_source( if (!sde_enc) return; - if (sde_enc->disp_info.is_te_using_watchdog_timer && + if (disp_info->is_te_using_watchdog_timer && phys_enc->hw_intf->ops.setup_vsync_source) { vsync_source = SDE_VSYNC_SOURCE_WD_TIMER_0; phys_enc->hw_intf->ops.setup_vsync_source(phys_enc->hw_intf,