Commit 741c3aeb authored by Philippe CORNU's avatar Philippe CORNU Committed by Andrzej Hajda

drm/bridge/synopsys: dsi: use adjusted_mode in mode_set

The "adjusted_mode" clock value (ie the real pixel clock) is more
accurate than "mode" clock value (ie the panel/bridge requested
clock value). It offers a better preciseness for timing
computations and allows to reduce the extra dsi bandwidth in
burst mode (from ~20% to ~10-12%, hw platform dependent).
Signed-off-by: default avatarPhilippe Cornu <philippe.cornu@st.com>
Tested-by: default avatarBrian Norris <briannorris@chromium.org>
Reviewed-by: default avatarYannick Fertré <yannick.fertre@st.com>
Tested-by: default avatarYannick Fertré <yannick.fertre@st.com>
Signed-off-by: default avatarAndrzej Hajda <a.hajda@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180125155504.8611-1-philippe.cornu@st.com
parent 66499101
...@@ -771,20 +771,20 @@ static void dw_mipi_dsi_bridge_mode_set(struct drm_bridge *bridge, ...@@ -771,20 +771,20 @@ static void dw_mipi_dsi_bridge_mode_set(struct drm_bridge *bridge,
clk_prepare_enable(dsi->pclk); clk_prepare_enable(dsi->pclk);
ret = phy_ops->get_lane_mbps(priv_data, mode, dsi->mode_flags, ret = phy_ops->get_lane_mbps(priv_data, adjusted_mode, dsi->mode_flags,
dsi->lanes, dsi->format, &dsi->lane_mbps); dsi->lanes, dsi->format, &dsi->lane_mbps);
if (ret) if (ret)
DRM_DEBUG_DRIVER("Phy get_lane_mbps() failed\n"); DRM_DEBUG_DRIVER("Phy get_lane_mbps() failed\n");
pm_runtime_get_sync(dsi->dev); pm_runtime_get_sync(dsi->dev);
dw_mipi_dsi_init(dsi); dw_mipi_dsi_init(dsi);
dw_mipi_dsi_dpi_config(dsi, mode); dw_mipi_dsi_dpi_config(dsi, adjusted_mode);
dw_mipi_dsi_packet_handler_config(dsi); dw_mipi_dsi_packet_handler_config(dsi);
dw_mipi_dsi_video_mode_config(dsi); dw_mipi_dsi_video_mode_config(dsi);
dw_mipi_dsi_video_packet_config(dsi, mode); dw_mipi_dsi_video_packet_config(dsi, adjusted_mode);
dw_mipi_dsi_command_mode_config(dsi); dw_mipi_dsi_command_mode_config(dsi);
dw_mipi_dsi_line_timer_config(dsi, mode); dw_mipi_dsi_line_timer_config(dsi, adjusted_mode);
dw_mipi_dsi_vertical_timing_config(dsi, mode); dw_mipi_dsi_vertical_timing_config(dsi, adjusted_mode);
dw_mipi_dsi_dphy_init(dsi); dw_mipi_dsi_dphy_init(dsi);
dw_mipi_dsi_dphy_timing_config(dsi); dw_mipi_dsi_dphy_timing_config(dsi);
...@@ -798,7 +798,7 @@ static void dw_mipi_dsi_bridge_mode_set(struct drm_bridge *bridge, ...@@ -798,7 +798,7 @@ static void dw_mipi_dsi_bridge_mode_set(struct drm_bridge *bridge,
dw_mipi_dsi_dphy_enable(dsi); dw_mipi_dsi_dphy_enable(dsi);
dw_mipi_dsi_wait_for_two_frames(mode); dw_mipi_dsi_wait_for_two_frames(adjusted_mode);
/* Switch to cmd mode for panel-bridge pre_enable & panel prepare */ /* Switch to cmd mode for panel-bridge pre_enable & panel prepare */
dw_mipi_dsi_set_mode(dsi, 0); dw_mipi_dsi_set_mode(dsi, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment