Loading msm/dp/dp_debug.c +4 −4 Original line number Diff line number Diff line Loading @@ -157,7 +157,7 @@ static ssize_t dp_debug_write_edid(struct file *file, edid = debug->edid; bail: kfree(buf); debug->panel->set_edid(debug->panel, edid); debug->panel->set_edid(debug->panel, edid, debug->edid_size); /* * print edid status as this code is executed Loading Loading @@ -520,10 +520,10 @@ static ssize_t dp_debug_write_mst_con_id(struct file *file, debug->dp_debug.mst_hpd_sim = true; if (status == connector_status_connected) { DP_INFO("plug mst connector\n", con_id, status); DP_INFO("plug mst connector %d\n", con_id); debug->dp_debug.mst_sim_add_con = true; } else { DP_INFO("unplug mst connector %d\n", con_id, status); DP_INFO("unplug mst connector %d\n", con_id); } debug->hpd->simulate_attention(debug->hpd, vdo); Loading Loading @@ -1617,7 +1617,7 @@ static void dp_debug_set_sim_mode(struct dp_debug_private *debug, bool sim) debug->ctrl->set_sim_mode(debug->ctrl, false); debug->dp_debug.sim_mode = false; debug->panel->set_edid(debug->panel, 0); debug->panel->set_edid(debug->panel, 0, 0); if (debug->edid) { devm_kfree(debug->dev, debug->edid); debug->edid = NULL; Loading msm/dp/dp_display.c +8 −3 Original line number Diff line number Diff line Loading @@ -1604,6 +1604,7 @@ static void dp_display_attention_work(struct work_struct *work) { struct dp_display_private *dp = container_of(work, struct dp_display_private, attention_work); int rc = 0; SDE_EVT32_EXTERNAL(SDE_EVTLOG_FUNC_ENTRY, dp->state); mutex_lock(&dp->session_lock); Loading Loading @@ -1673,16 +1674,20 @@ static void dp_display_attention_work(struct work_struct *work) if (dp->link->sink_request & DP_TEST_LINK_TRAINING) { SDE_EVT32_EXTERNAL(dp->state, DP_TEST_LINK_TRAINING); dp->link->send_test_response(dp->link); dp->ctrl->link_maintenance(dp->ctrl); rc = dp->ctrl->link_maintenance(dp->ctrl); } if (dp->link->sink_request & DP_LINK_STATUS_UPDATED) { SDE_EVT32_EXTERNAL(dp->state, DP_LINK_STATUS_UPDATED); dp->ctrl->link_maintenance(dp->ctrl); rc = dp->ctrl->link_maintenance(dp->ctrl); } if (!rc) dp_audio_enable(dp, true); mutex_unlock(&dp->session_lock); if (rc) goto exit; if (dp->link->sink_request & (DP_TEST_LINK_PHY_TEST_PATTERN | DP_TEST_LINK_TRAINING)) Loading msm/dp/dp_panel.c +21 −2 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ #include "dp_debug.h" #include <drm/drm_dsc.h> #include "sde_dsc_helper.h" #include <drm/drm_edid.h> #define DP_KHZ_TO_HZ 1000 #define DP_PANEL_DEFAULT_BPP 24 Loading Loading @@ -1616,7 +1617,25 @@ static int dp_panel_set_default_link_params(struct dp_panel *dp_panel) return 0; } static int dp_panel_set_edid(struct dp_panel *dp_panel, u8 *edid) static bool dp_panel_validate_edid(struct edid *edid, size_t edid_size) { if (!edid || (edid_size < EDID_LENGTH)) return false; if (EDID_LENGTH * (edid->extensions + 1) > edid_size) { DP_ERR("edid size does not match allocated.\n"); return false; } if (!drm_edid_is_valid(edid)) { DP_ERR("invalid edid.\n"); return false; } return true; } static int dp_panel_set_edid(struct dp_panel *dp_panel, u8 *edid, size_t edid_size) { struct dp_panel_private *panel; Loading @@ -1627,7 +1646,7 @@ static int dp_panel_set_edid(struct dp_panel *dp_panel, u8 *edid) panel = container_of(dp_panel, struct dp_panel_private, dp_panel); if (edid) { if (edid && dp_panel_validate_edid((struct edid *)edid, edid_size)) { dp_panel->edid_ctrl->edid = (struct edid *)edid; panel->custom_edid = true; } else { Loading msm/dp/dp_panel.h +1 −1 Original line number Diff line number Diff line Loading @@ -148,7 +148,7 @@ struct dp_panel { int (*get_modes)(struct dp_panel *dp_panel, struct drm_connector *connector, struct dp_display_mode *mode); void (*handle_sink_request)(struct dp_panel *dp_panel); int (*set_edid)(struct dp_panel *dp_panel, u8 *edid); int (*set_edid)(struct dp_panel *dp_panel, u8 *edid, size_t edid_size); int (*set_dpcd)(struct dp_panel *dp_panel, u8 *dpcd); int (*setup_hdr)(struct dp_panel *dp_panel, struct drm_msm_ext_hdr_metadata *hdr_meta, Loading msm/dsi/dsi_ctrl.c +15 −2 Original line number Diff line number Diff line Loading @@ -1373,8 +1373,21 @@ static void dsi_kickoff_msg_tx(struct dsi_ctrl *dsi_ctrl, dsi_hw_ops.reset_trig_ctrl(&dsi_ctrl->hw, &dsi_ctrl->host_config.common_config); /* check if custom dma scheduling line needed */ if (flags & DSI_CTRL_CMD_CUSTOM_DMA_SCHED) /* * Always enable DMA scheduling for video mode panel. * * In video mode panel, if the DMA is triggered very close to * the beginning of the active window and the DMA transfer * happens in the last line of VBP, then the HW state will * stay in ‘wait’ and return to ‘idle’ in the first line of VFP. * But somewhere in the middle of the active window, if SW * disables DSI command mode engine while the HW is still * waiting and re-enable after timing engine is OFF. So the * HW never ‘sees’ another vblank line and hence it gets * stuck in the ‘wait’ state. */ if ((flags & DSI_CTRL_CMD_CUSTOM_DMA_SCHED) || (dsi_ctrl->host_config.panel_mode == DSI_OP_VIDEO_MODE)) dsi_configure_command_scheduling(dsi_ctrl, cmd_mem); dsi_ctrl->cmd_mode = (dsi_ctrl->host_config.panel_mode == Loading Loading
msm/dp/dp_debug.c +4 −4 Original line number Diff line number Diff line Loading @@ -157,7 +157,7 @@ static ssize_t dp_debug_write_edid(struct file *file, edid = debug->edid; bail: kfree(buf); debug->panel->set_edid(debug->panel, edid); debug->panel->set_edid(debug->panel, edid, debug->edid_size); /* * print edid status as this code is executed Loading Loading @@ -520,10 +520,10 @@ static ssize_t dp_debug_write_mst_con_id(struct file *file, debug->dp_debug.mst_hpd_sim = true; if (status == connector_status_connected) { DP_INFO("plug mst connector\n", con_id, status); DP_INFO("plug mst connector %d\n", con_id); debug->dp_debug.mst_sim_add_con = true; } else { DP_INFO("unplug mst connector %d\n", con_id, status); DP_INFO("unplug mst connector %d\n", con_id); } debug->hpd->simulate_attention(debug->hpd, vdo); Loading Loading @@ -1617,7 +1617,7 @@ static void dp_debug_set_sim_mode(struct dp_debug_private *debug, bool sim) debug->ctrl->set_sim_mode(debug->ctrl, false); debug->dp_debug.sim_mode = false; debug->panel->set_edid(debug->panel, 0); debug->panel->set_edid(debug->panel, 0, 0); if (debug->edid) { devm_kfree(debug->dev, debug->edid); debug->edid = NULL; Loading
msm/dp/dp_display.c +8 −3 Original line number Diff line number Diff line Loading @@ -1604,6 +1604,7 @@ static void dp_display_attention_work(struct work_struct *work) { struct dp_display_private *dp = container_of(work, struct dp_display_private, attention_work); int rc = 0; SDE_EVT32_EXTERNAL(SDE_EVTLOG_FUNC_ENTRY, dp->state); mutex_lock(&dp->session_lock); Loading Loading @@ -1673,16 +1674,20 @@ static void dp_display_attention_work(struct work_struct *work) if (dp->link->sink_request & DP_TEST_LINK_TRAINING) { SDE_EVT32_EXTERNAL(dp->state, DP_TEST_LINK_TRAINING); dp->link->send_test_response(dp->link); dp->ctrl->link_maintenance(dp->ctrl); rc = dp->ctrl->link_maintenance(dp->ctrl); } if (dp->link->sink_request & DP_LINK_STATUS_UPDATED) { SDE_EVT32_EXTERNAL(dp->state, DP_LINK_STATUS_UPDATED); dp->ctrl->link_maintenance(dp->ctrl); rc = dp->ctrl->link_maintenance(dp->ctrl); } if (!rc) dp_audio_enable(dp, true); mutex_unlock(&dp->session_lock); if (rc) goto exit; if (dp->link->sink_request & (DP_TEST_LINK_PHY_TEST_PATTERN | DP_TEST_LINK_TRAINING)) Loading
msm/dp/dp_panel.c +21 −2 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ #include "dp_debug.h" #include <drm/drm_dsc.h> #include "sde_dsc_helper.h" #include <drm/drm_edid.h> #define DP_KHZ_TO_HZ 1000 #define DP_PANEL_DEFAULT_BPP 24 Loading Loading @@ -1616,7 +1617,25 @@ static int dp_panel_set_default_link_params(struct dp_panel *dp_panel) return 0; } static int dp_panel_set_edid(struct dp_panel *dp_panel, u8 *edid) static bool dp_panel_validate_edid(struct edid *edid, size_t edid_size) { if (!edid || (edid_size < EDID_LENGTH)) return false; if (EDID_LENGTH * (edid->extensions + 1) > edid_size) { DP_ERR("edid size does not match allocated.\n"); return false; } if (!drm_edid_is_valid(edid)) { DP_ERR("invalid edid.\n"); return false; } return true; } static int dp_panel_set_edid(struct dp_panel *dp_panel, u8 *edid, size_t edid_size) { struct dp_panel_private *panel; Loading @@ -1627,7 +1646,7 @@ static int dp_panel_set_edid(struct dp_panel *dp_panel, u8 *edid) panel = container_of(dp_panel, struct dp_panel_private, dp_panel); if (edid) { if (edid && dp_panel_validate_edid((struct edid *)edid, edid_size)) { dp_panel->edid_ctrl->edid = (struct edid *)edid; panel->custom_edid = true; } else { Loading
msm/dp/dp_panel.h +1 −1 Original line number Diff line number Diff line Loading @@ -148,7 +148,7 @@ struct dp_panel { int (*get_modes)(struct dp_panel *dp_panel, struct drm_connector *connector, struct dp_display_mode *mode); void (*handle_sink_request)(struct dp_panel *dp_panel); int (*set_edid)(struct dp_panel *dp_panel, u8 *edid); int (*set_edid)(struct dp_panel *dp_panel, u8 *edid, size_t edid_size); int (*set_dpcd)(struct dp_panel *dp_panel, u8 *dpcd); int (*setup_hdr)(struct dp_panel *dp_panel, struct drm_msm_ext_hdr_metadata *hdr_meta, Loading
msm/dsi/dsi_ctrl.c +15 −2 Original line number Diff line number Diff line Loading @@ -1373,8 +1373,21 @@ static void dsi_kickoff_msg_tx(struct dsi_ctrl *dsi_ctrl, dsi_hw_ops.reset_trig_ctrl(&dsi_ctrl->hw, &dsi_ctrl->host_config.common_config); /* check if custom dma scheduling line needed */ if (flags & DSI_CTRL_CMD_CUSTOM_DMA_SCHED) /* * Always enable DMA scheduling for video mode panel. * * In video mode panel, if the DMA is triggered very close to * the beginning of the active window and the DMA transfer * happens in the last line of VBP, then the HW state will * stay in ‘wait’ and return to ‘idle’ in the first line of VFP. * But somewhere in the middle of the active window, if SW * disables DSI command mode engine while the HW is still * waiting and re-enable after timing engine is OFF. So the * HW never ‘sees’ another vblank line and hence it gets * stuck in the ‘wait’ state. */ if ((flags & DSI_CTRL_CMD_CUSTOM_DMA_SCHED) || (dsi_ctrl->host_config.panel_mode == DSI_OP_VIDEO_MODE)) dsi_configure_command_scheduling(dsi_ctrl, cmd_mem); dsi_ctrl->cmd_mode = (dsi_ctrl->host_config.panel_mode == Loading