diff options
| -rw-r--r-- | drivers/gpu/drm/msm/sde/sde_encoder.c | 9 | ||||
| -rw-r--r-- | drivers/gpu/drm/msm/sde/sde_encoder_phys.h | 3 | ||||
| -rw-r--r-- | drivers/gpu/drm/msm/sde/sde_encoder_phys_cmd.c | 16 | ||||
| -rw-r--r-- | drivers/gpu/drm/msm/sde/sde_encoder_phys_vid.c | 15 | ||||
| -rw-r--r-- | drivers/gpu/drm/msm/sde/sde_encoder_phys_wb.c | 19 | ||||
| -rw-r--r-- | drivers/gpu/drm/msm/sde/sde_hw_ctl.c | 8 | ||||
| -rw-r--r-- | drivers/gpu/drm/msm/sde/sde_hw_ctl.h | 6 |
7 files changed, 71 insertions, 5 deletions
diff --git a/drivers/gpu/drm/msm/sde/sde_encoder.c b/drivers/gpu/drm/msm/sde/sde_encoder.c index cddbb19c7504..b91fd7f42af3 100644 --- a/drivers/gpu/drm/msm/sde/sde_encoder.c +++ b/drivers/gpu/drm/msm/sde/sde_encoder.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2018, The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2019, The Linux Foundation. All rights reserved. * Copyright (C) 2013 Red Hat * Author: Rob Clark <robdclark@gmail.com> * @@ -563,6 +563,13 @@ static void sde_encoder_virt_disable(struct drm_encoder *drm_enc) if (sde_enc->cur_master && sde_enc->cur_master->ops.disable) sde_enc->cur_master->ops.disable(sde_enc->cur_master); + for (i = 0; i < sde_enc->num_phys_encs; i++) { + struct sde_encoder_phys *phys = sde_enc->phys_encs[i]; + + if (phys && phys->ops.post_disable) + phys->ops.post_disable(phys); + } + sde_enc->cur_master = NULL; SDE_DEBUG_ENC(sde_enc, "cleared master\n"); diff --git a/drivers/gpu/drm/msm/sde/sde_encoder_phys.h b/drivers/gpu/drm/msm/sde/sde_encoder_phys.h index 089083816c50..4653a7fe650b 100644 --- a/drivers/gpu/drm/msm/sde/sde_encoder_phys.h +++ b/drivers/gpu/drm/msm/sde/sde_encoder_phys.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2016 The Linux Foundation. All rights reserved. + * Copyright (c) 2015-2019 The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -106,6 +106,7 @@ struct sde_encoder_phys_ops { struct drm_display_mode *adjusted_mode); void (*enable)(struct sde_encoder_phys *encoder); void (*disable)(struct sde_encoder_phys *encoder); + void (*post_disable)(struct sde_encoder_phys *encoder); int (*atomic_check)(struct sde_encoder_phys *encoder, struct drm_crtc_state *crtc_state, struct drm_connector_state *conn_state); diff --git a/drivers/gpu/drm/msm/sde/sde_encoder_phys_cmd.c b/drivers/gpu/drm/msm/sde/sde_encoder_phys_cmd.c index 76d6fe0e3023..6baaa1652892 100644 --- a/drivers/gpu/drm/msm/sde/sde_encoder_phys_cmd.c +++ b/drivers/gpu/drm/msm/sde/sde_encoder_phys_cmd.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2016 The Linux Foundation. All rights reserved. + * Copyright (c) 2015-2019 The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -572,6 +572,19 @@ static void sde_encoder_phys_cmd_disable(struct sde_encoder_phys *phys_enc) atomic_read(&phys_enc->vblank_refcount)); } +static void sde_encoder_phys_cmd_post_disable( + struct sde_encoder_phys *phys_enc) +{ + if (!phys_enc || !phys_enc->hw_ctl) { + SDE_ERROR("invalid encoder %d\n", phys_enc != NULL); + return; + } + + if (!_sde_encoder_phys_is_ppsplit_slave(phys_enc) && + phys_enc->hw_ctl->ops.clear_intf_cfg) + phys_enc->hw_ctl->ops.clear_intf_cfg(phys_enc->hw_ctl); +} + static void sde_encoder_phys_cmd_destroy(struct sde_encoder_phys *phys_enc) { struct sde_encoder_phys_cmd *cmd_enc = @@ -648,6 +661,7 @@ static void sde_encoder_phys_cmd_init_ops( ops->mode_fixup = sde_encoder_phys_cmd_mode_fixup; ops->enable = sde_encoder_phys_cmd_enable; ops->disable = sde_encoder_phys_cmd_disable; + ops->post_disable = sde_encoder_phys_cmd_post_disable; ops->destroy = sde_encoder_phys_cmd_destroy; ops->get_hw_resources = sde_encoder_phys_cmd_get_hw_resources; ops->control_vblank_irq = sde_encoder_phys_cmd_control_vblank_irq; diff --git a/drivers/gpu/drm/msm/sde/sde_encoder_phys_vid.c b/drivers/gpu/drm/msm/sde/sde_encoder_phys_vid.c index 8db77f2c60e8..0d5cc47294ab 100644 --- a/drivers/gpu/drm/msm/sde/sde_encoder_phys_vid.c +++ b/drivers/gpu/drm/msm/sde/sde_encoder_phys_vid.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved. +/* Copyright (c) 2015-2019, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -835,6 +835,18 @@ static void sde_encoder_phys_vid_disable(struct sde_encoder_phys *phys_enc) phys_enc->enable_state = SDE_ENC_DISABLED; } +static void sde_encoder_phys_vid_post_disable( + struct sde_encoder_phys *phys_enc) +{ + if (!phys_enc || !phys_enc->hw_ctl) { + SDE_ERROR("invalid encoder %d\n", phys_enc != NULL); + return; + } + + if (phys_enc->hw_ctl->ops.clear_intf_cfg) + phys_enc->hw_ctl->ops.clear_intf_cfg(phys_enc->hw_ctl); +} + static void sde_encoder_phys_vid_handle_post_kickoff( struct sde_encoder_phys *phys_enc) { @@ -890,6 +902,7 @@ static void sde_encoder_phys_vid_init_ops(struct sde_encoder_phys_ops *ops) ops->mode_fixup = sde_encoder_phys_vid_mode_fixup; ops->enable = sde_encoder_phys_vid_enable; ops->disable = sde_encoder_phys_vid_disable; + ops->post_disable = sde_encoder_phys_vid_post_disable; ops->destroy = sde_encoder_phys_vid_destroy; ops->get_hw_resources = sde_encoder_phys_vid_get_hw_resources; ops->control_vblank_irq = sde_encoder_phys_vid_control_vblank_irq; diff --git a/drivers/gpu/drm/msm/sde/sde_encoder_phys_wb.c b/drivers/gpu/drm/msm/sde/sde_encoder_phys_wb.c index 65b16419fcec..38bd11bf162e 100644 --- a/drivers/gpu/drm/msm/sde/sde_encoder_phys_wb.c +++ b/drivers/gpu/drm/msm/sde/sde_encoder_phys_wb.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2016 The Linux Foundation. All rights reserved. + * Copyright (c) 2015-2019 The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -767,6 +767,22 @@ static void sde_encoder_phys_wb_disable(struct sde_encoder_phys *phys_enc) } /** + * sde_encoder_phys_wb_post_disable - post disable writeback encoder + * @phys_enc: Pointer to physical encoder + */ +static void sde_encoder_phys_wb_post_disable( + struct sde_encoder_phys *phys_enc) +{ + if (!phys_enc || !phys_enc->hw_ctl) { + SDE_ERROR("invalid encoder %d\n", phys_enc != NULL); + return; + } + + if (phys_enc->hw_ctl->ops.clear_intf_cfg) + phys_enc->hw_ctl->ops.clear_intf_cfg(phys_enc->hw_ctl); +} + +/** * sde_encoder_phys_wb_get_hw_resources - get hardware resources * @phys_enc: Pointer to physical encoder * @hw_res: Pointer to encoder resources @@ -903,6 +919,7 @@ static void sde_encoder_phys_wb_init_ops(struct sde_encoder_phys_ops *ops) ops->mode_set = sde_encoder_phys_wb_mode_set; ops->enable = sde_encoder_phys_wb_enable; ops->disable = sde_encoder_phys_wb_disable; + ops->post_disable = sde_encoder_phys_wb_post_disable; ops->destroy = sde_encoder_phys_wb_destroy; ops->atomic_check = sde_encoder_phys_wb_atomic_check; ops->get_hw_resources = sde_encoder_phys_wb_get_hw_resources; diff --git a/drivers/gpu/drm/msm/sde/sde_hw_ctl.c b/drivers/gpu/drm/msm/sde/sde_hw_ctl.c index e9fb9a2e3183..7cd7b5f234b8 100644 --- a/drivers/gpu/drm/msm/sde/sde_hw_ctl.c +++ b/drivers/gpu/drm/msm/sde/sde_hw_ctl.c @@ -500,6 +500,13 @@ static void sde_hw_ctl_intf_cfg(struct sde_hw_ctl *ctx, SDE_REG_WRITE(c, CTL_TOP, intf_cfg); } +static void sde_hw_ctl_clear_intf_cfg(struct sde_hw_ctl *ctx) +{ + struct sde_hw_blk_reg_map *c = &ctx->hw; + + SDE_REG_WRITE(c, CTL_TOP, 0); +} + static inline u32 sde_hw_ctl_read_ctl_top_for_splash(struct sde_hw_ctl *ctx) { struct sde_hw_blk_reg_map *c; @@ -542,6 +549,7 @@ static void _setup_ctl_ops(struct sde_hw_ctl_ops *ops, ops->get_flush_register = sde_hw_ctl_get_flush_register; ops->trigger_start = sde_hw_ctl_trigger_start; ops->setup_intf_cfg = sde_hw_ctl_intf_cfg; + ops->clear_intf_cfg = sde_hw_ctl_clear_intf_cfg; ops->reset = sde_hw_ctl_reset_control; ops->wait_reset_status = sde_hw_ctl_wait_reset_status; ops->clear_all_blendstages = sde_hw_ctl_clear_all_blendstages; diff --git a/drivers/gpu/drm/msm/sde/sde_hw_ctl.h b/drivers/gpu/drm/msm/sde/sde_hw_ctl.h index ef4ddfafa566..6711bf227fe9 100644 --- a/drivers/gpu/drm/msm/sde/sde_hw_ctl.h +++ b/drivers/gpu/drm/msm/sde/sde_hw_ctl.h @@ -109,6 +109,12 @@ struct sde_hw_ctl_ops { void (*setup_intf_cfg)(struct sde_hw_ctl *ctx, struct sde_hw_intf_cfg *cfg); + /** + * Clear ctl_path interface config + * @ctx : ctl path ctx pointer + */ + void (*clear_intf_cfg)(struct sde_hw_ctl *ctx); + int (*reset)(struct sde_hw_ctl *c); /* |
