Loading msm/dsi/dsi_ctrl.c +6 −9 Original line number Diff line number Diff line Loading @@ -390,13 +390,6 @@ static void dsi_ctrl_dma_cmd_wait_for_done(struct work_struct *work) dsi_hw_ops = dsi_ctrl->hw.ops; SDE_EVT32(dsi_ctrl->cell_index, SDE_EVTLOG_FUNC_ENTRY); /* * This atomic state will be set if ISR has been triggered, * so the wait is not needed. */ if (atomic_read(&dsi_ctrl->dma_irq_trig)) goto done; ret = wait_for_completion_timeout( &dsi_ctrl->irq_info.cmd_dma_done, msecs_to_jiffies(DSI_CTRL_TX_TO_MS)); Loading @@ -416,8 +409,8 @@ static void dsi_ctrl_dma_cmd_wait_for_done(struct work_struct *work) DSI_SINT_CMD_MODE_DMA_DONE); } done: dsi_ctrl->dma_wait_queued = false; SDE_EVT32(dsi_ctrl->cell_index, SDE_EVTLOG_FUNC_EXIT); } static int dsi_ctrl_check_state(struct dsi_ctrl *dsi_ctrl, Loading Loading @@ -933,6 +926,9 @@ int dsi_ctrl_pixel_format_to_bpp(enum dsi_pixel_format dst_format) case DSI_PIXEL_FORMAT_RGB888: bpp = 24; break; case DSI_PIXEL_FORMAT_RGB101010: bpp = 30; break; default: bpp = 24; break; Loading Loading @@ -1557,7 +1553,8 @@ static int dsi_message_tx(struct dsi_ctrl *dsi_ctrl, if (dsi_ctrl->dma_wait_queued) dsi_ctrl_flush_cmd_dma_queue(dsi_ctrl); if (!(*flags & DSI_CTRL_CMD_BROADCAST_MASTER)) if ((*flags & DSI_CTRL_CMD_BROADCAST) && (!(*flags & DSI_CTRL_CMD_BROADCAST_MASTER))) dsi_ctrl_clear_slave_dma_status(dsi_ctrl, *flags); if (*flags & DSI_CTRL_CMD_NON_EMBEDDED_MODE) { Loading msm/dsi/dsi_ctrl_hw_cmn.c +8 −5 Original line number Diff line number Diff line Loading @@ -41,9 +41,9 @@ static bool dsi_compression_enabled(struct dsi_mode_info *mode) /* Unsupported formats default to RGB888 */ static const u8 cmd_mode_format_map[DSI_PIXEL_FORMAT_MAX] = { 0x6, 0x7, 0x8, 0x8, 0x0, 0x3, 0x4 }; 0x6, 0x7, 0x8, 0x8, 0x0, 0x3, 0x4, 0x9 }; static const u8 video_mode_format_map[DSI_PIXEL_FORMAT_MAX] = { 0x0, 0x1, 0x2, 0x3, 0x3, 0x3, 0x3 }; 0x0, 0x1, 0x2, 0x3, 0x3, 0x3, 0x3, 0x4 }; /** * dsi_split_link_setup() - setup dsi split link configurations Loading Loading @@ -421,10 +421,13 @@ void dsi_ctrl_hw_cmn_setup_cmd_stream(struct dsi_ctrl_hw *ctrl, u32 reg = 0, offset = 0; int pic_width = 0, this_frame_slices = 0, intf_ip_w = 0; u32 pkt_per_line = 0, eol_byte_num = 0, bytes_in_slice = 0; u32 bpp; if (roi && (!roi->w || !roi->h)) return; bpp = dsi_pixel_format_to_bpp(cfg->dst_format); if (dsi_dsc_compression_enabled(mode)) { struct msm_display_dsc_info dsc; Loading Loading @@ -458,11 +461,11 @@ void dsi_ctrl_hw_cmn_setup_cmd_stream(struct dsi_ctrl_hw *ctrl, bytes_in_slice = vdc.bytes_in_slice; } else if (roi) { width_final = roi->w; stride_final = roi->w * 3; stride_final = DIV_ROUND_UP(roi->w * bpp, 8); height_final = roi->h; } else { width_final = mode->h_active; stride_final = mode->h_active * 3; stride_final = DIV_ROUND_UP(mode->h_active * bpp, 8); height_final = mode->v_active; } Loading Loading @@ -579,7 +582,7 @@ void dsi_ctrl_hw_cmn_video_engine_setup(struct dsi_ctrl_hw *ctrl, reg |= (cfg->bllp_lp11_en ? BIT(12) : 0); reg |= (cfg->traffic_mode & 0x3) << 8; reg |= (cfg->vc_id & 0x3); reg |= (video_mode_format_map[common_cfg->dst_format] & 0x3) << 4; reg |= (video_mode_format_map[common_cfg->dst_format] & 0x7) << 4; DSI_W32(ctrl, DSI_VIDEO_MODE_CTRL, reg); reg = (common_cfg->swap_mode & 0x7) << 12; Loading msm/dsi/dsi_defs.h +4 −0 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ * @DSI_PIXEL_FORMAT_RGB111: * @DSI_PIXEL_FORMAT_RGB332: * @DSI_PIXEL_FORMAT_RGB444: * @DSI_PIXEL_FORMAT_RGB101010: * @DSI_PIXEL_FORMAT_MAX: */ enum dsi_pixel_format { Loading @@ -49,6 +50,7 @@ enum dsi_pixel_format { DSI_PIXEL_FORMAT_RGB111, DSI_PIXEL_FORMAT_RGB332, DSI_PIXEL_FORMAT_RGB444, DSI_PIXEL_FORMAT_RGB101010, DSI_PIXEL_FORMAT_MAX }; Loading Loading @@ -740,6 +742,8 @@ static inline int dsi_pixel_format_to_bpp(enum dsi_pixel_format fmt) return 8; case DSI_PIXEL_FORMAT_RGB444: return 12; case DSI_PIXEL_FORMAT_RGB101010: return 30; } return 24; } Loading msm/dsi/dsi_panel.c +15 −0 Original line number Diff line number Diff line Loading @@ -378,6 +378,10 @@ static int dsi_panel_power_off(struct dsi_panel *panel) { int rc = 0; if (panel->is_twm_en) { DSI_DEBUG("TWM Enabled, skip panel power off\n"); return rc; } if (gpio_is_valid(panel->reset_config.disp_en_gpio)) gpio_set_value(panel->reset_config.disp_en_gpio, 0); Loading Loading @@ -929,6 +933,9 @@ static int dsi_panel_parse_pixel_format(struct dsi_host_common_cfg *host, case 18: fmt = DSI_PIXEL_FORMAT_RGB666; break; case 30: fmt = DSI_PIXEL_FORMAT_RGB101010; break; case 24: default: fmt = DSI_PIXEL_FORMAT_RGB888; Loading Loading @@ -4305,6 +4312,10 @@ int dsi_panel_set_nolp(struct dsi_panel *panel) return -EINVAL; } if (panel->is_twm_en) { DSI_DEBUG("TWM Enabled, skip idle off\n"); return rc; } mutex_lock(&panel->panel_lock); if (!panel->panel_initialized) goto exit; Loading Loading @@ -4717,6 +4728,10 @@ int dsi_panel_disable(struct dsi_panel *panel) return -EINVAL; } if (panel->is_twm_en) { DSI_DEBUG("TWM Enabled, skip panel disable\n"); return rc; } mutex_lock(&panel->panel_lock); /* Avoid sending panel off commands when ESD recovery is underway */ Loading msm/dsi/dsi_panel.h +2 −1 Original line number Diff line number Diff line /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. * Copyright (c) 2016-2020, 2021 The Linux Foundation. All rights reserved. */ #ifndef _DSI_PANEL_H_ Loading Loading @@ -244,6 +244,7 @@ struct dsi_panel { bool reset_gpio_always_on; atomic_t esd_recovery_pending; bool is_twm_en; bool panel_initialized; bool te_using_watchdog_timer; struct dsi_qsync_capabilities qsync_caps; Loading Loading
msm/dsi/dsi_ctrl.c +6 −9 Original line number Diff line number Diff line Loading @@ -390,13 +390,6 @@ static void dsi_ctrl_dma_cmd_wait_for_done(struct work_struct *work) dsi_hw_ops = dsi_ctrl->hw.ops; SDE_EVT32(dsi_ctrl->cell_index, SDE_EVTLOG_FUNC_ENTRY); /* * This atomic state will be set if ISR has been triggered, * so the wait is not needed. */ if (atomic_read(&dsi_ctrl->dma_irq_trig)) goto done; ret = wait_for_completion_timeout( &dsi_ctrl->irq_info.cmd_dma_done, msecs_to_jiffies(DSI_CTRL_TX_TO_MS)); Loading @@ -416,8 +409,8 @@ static void dsi_ctrl_dma_cmd_wait_for_done(struct work_struct *work) DSI_SINT_CMD_MODE_DMA_DONE); } done: dsi_ctrl->dma_wait_queued = false; SDE_EVT32(dsi_ctrl->cell_index, SDE_EVTLOG_FUNC_EXIT); } static int dsi_ctrl_check_state(struct dsi_ctrl *dsi_ctrl, Loading Loading @@ -933,6 +926,9 @@ int dsi_ctrl_pixel_format_to_bpp(enum dsi_pixel_format dst_format) case DSI_PIXEL_FORMAT_RGB888: bpp = 24; break; case DSI_PIXEL_FORMAT_RGB101010: bpp = 30; break; default: bpp = 24; break; Loading Loading @@ -1557,7 +1553,8 @@ static int dsi_message_tx(struct dsi_ctrl *dsi_ctrl, if (dsi_ctrl->dma_wait_queued) dsi_ctrl_flush_cmd_dma_queue(dsi_ctrl); if (!(*flags & DSI_CTRL_CMD_BROADCAST_MASTER)) if ((*flags & DSI_CTRL_CMD_BROADCAST) && (!(*flags & DSI_CTRL_CMD_BROADCAST_MASTER))) dsi_ctrl_clear_slave_dma_status(dsi_ctrl, *flags); if (*flags & DSI_CTRL_CMD_NON_EMBEDDED_MODE) { Loading
msm/dsi/dsi_ctrl_hw_cmn.c +8 −5 Original line number Diff line number Diff line Loading @@ -41,9 +41,9 @@ static bool dsi_compression_enabled(struct dsi_mode_info *mode) /* Unsupported formats default to RGB888 */ static const u8 cmd_mode_format_map[DSI_PIXEL_FORMAT_MAX] = { 0x6, 0x7, 0x8, 0x8, 0x0, 0x3, 0x4 }; 0x6, 0x7, 0x8, 0x8, 0x0, 0x3, 0x4, 0x9 }; static const u8 video_mode_format_map[DSI_PIXEL_FORMAT_MAX] = { 0x0, 0x1, 0x2, 0x3, 0x3, 0x3, 0x3 }; 0x0, 0x1, 0x2, 0x3, 0x3, 0x3, 0x3, 0x4 }; /** * dsi_split_link_setup() - setup dsi split link configurations Loading Loading @@ -421,10 +421,13 @@ void dsi_ctrl_hw_cmn_setup_cmd_stream(struct dsi_ctrl_hw *ctrl, u32 reg = 0, offset = 0; int pic_width = 0, this_frame_slices = 0, intf_ip_w = 0; u32 pkt_per_line = 0, eol_byte_num = 0, bytes_in_slice = 0; u32 bpp; if (roi && (!roi->w || !roi->h)) return; bpp = dsi_pixel_format_to_bpp(cfg->dst_format); if (dsi_dsc_compression_enabled(mode)) { struct msm_display_dsc_info dsc; Loading Loading @@ -458,11 +461,11 @@ void dsi_ctrl_hw_cmn_setup_cmd_stream(struct dsi_ctrl_hw *ctrl, bytes_in_slice = vdc.bytes_in_slice; } else if (roi) { width_final = roi->w; stride_final = roi->w * 3; stride_final = DIV_ROUND_UP(roi->w * bpp, 8); height_final = roi->h; } else { width_final = mode->h_active; stride_final = mode->h_active * 3; stride_final = DIV_ROUND_UP(mode->h_active * bpp, 8); height_final = mode->v_active; } Loading Loading @@ -579,7 +582,7 @@ void dsi_ctrl_hw_cmn_video_engine_setup(struct dsi_ctrl_hw *ctrl, reg |= (cfg->bllp_lp11_en ? BIT(12) : 0); reg |= (cfg->traffic_mode & 0x3) << 8; reg |= (cfg->vc_id & 0x3); reg |= (video_mode_format_map[common_cfg->dst_format] & 0x3) << 4; reg |= (video_mode_format_map[common_cfg->dst_format] & 0x7) << 4; DSI_W32(ctrl, DSI_VIDEO_MODE_CTRL, reg); reg = (common_cfg->swap_mode & 0x7) << 12; Loading
msm/dsi/dsi_defs.h +4 −0 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ * @DSI_PIXEL_FORMAT_RGB111: * @DSI_PIXEL_FORMAT_RGB332: * @DSI_PIXEL_FORMAT_RGB444: * @DSI_PIXEL_FORMAT_RGB101010: * @DSI_PIXEL_FORMAT_MAX: */ enum dsi_pixel_format { Loading @@ -49,6 +50,7 @@ enum dsi_pixel_format { DSI_PIXEL_FORMAT_RGB111, DSI_PIXEL_FORMAT_RGB332, DSI_PIXEL_FORMAT_RGB444, DSI_PIXEL_FORMAT_RGB101010, DSI_PIXEL_FORMAT_MAX }; Loading Loading @@ -740,6 +742,8 @@ static inline int dsi_pixel_format_to_bpp(enum dsi_pixel_format fmt) return 8; case DSI_PIXEL_FORMAT_RGB444: return 12; case DSI_PIXEL_FORMAT_RGB101010: return 30; } return 24; } Loading
msm/dsi/dsi_panel.c +15 −0 Original line number Diff line number Diff line Loading @@ -378,6 +378,10 @@ static int dsi_panel_power_off(struct dsi_panel *panel) { int rc = 0; if (panel->is_twm_en) { DSI_DEBUG("TWM Enabled, skip panel power off\n"); return rc; } if (gpio_is_valid(panel->reset_config.disp_en_gpio)) gpio_set_value(panel->reset_config.disp_en_gpio, 0); Loading Loading @@ -929,6 +933,9 @@ static int dsi_panel_parse_pixel_format(struct dsi_host_common_cfg *host, case 18: fmt = DSI_PIXEL_FORMAT_RGB666; break; case 30: fmt = DSI_PIXEL_FORMAT_RGB101010; break; case 24: default: fmt = DSI_PIXEL_FORMAT_RGB888; Loading Loading @@ -4305,6 +4312,10 @@ int dsi_panel_set_nolp(struct dsi_panel *panel) return -EINVAL; } if (panel->is_twm_en) { DSI_DEBUG("TWM Enabled, skip idle off\n"); return rc; } mutex_lock(&panel->panel_lock); if (!panel->panel_initialized) goto exit; Loading Loading @@ -4717,6 +4728,10 @@ int dsi_panel_disable(struct dsi_panel *panel) return -EINVAL; } if (panel->is_twm_en) { DSI_DEBUG("TWM Enabled, skip panel disable\n"); return rc; } mutex_lock(&panel->panel_lock); /* Avoid sending panel off commands when ESD recovery is underway */ Loading
msm/dsi/dsi_panel.h +2 −1 Original line number Diff line number Diff line /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. * Copyright (c) 2016-2020, 2021 The Linux Foundation. All rights reserved. */ #ifndef _DSI_PANEL_H_ Loading Loading @@ -244,6 +244,7 @@ struct dsi_panel { bool reset_gpio_always_on; atomic_t esd_recovery_pending; bool is_twm_en; bool panel_initialized; bool te_using_watchdog_timer; struct dsi_qsync_capabilities qsync_caps; Loading