Connector virtualization for Dual-DSI
v2 cover Connector virtualization for Dual-DSI
This patch series adds support to DSI connector
virtualization for Dual-DSI configuration.
These changes have been tested using dual-dsi truly panel on sdm845 platform.
Additional changes that will be needed to have end-to-end functionality:
--> DSI6G-v2 changes: https://patchwork.kernel.org/patch/10294605/ --> truly panel patches: https://patchwork.kernel.org/patch/10327749/ --> DPU changes that will be uploaded soon.
Changes in V2:
Addressed Sean's review comments:
-Removed Change-Id from the commit text tags.
-Remove extra parentheses
Chandan Uddaraju (2):
drm/msm/dsi: adjust dsi timing for dual dsi mode drm/msm/dsi: Use one connector for dual DSI mode
drivers/gpu/drm/msm/dsi/dsi.c | 3 + drivers/gpu/drm/msm/dsi/dsi.h | 2 + drivers/gpu/drm/msm/dsi/dsi_host.c | 17 +++++ drivers/gpu/drm/msm/dsi/dsi_manager.c | 125 +++++++++++----------------------- 4 files changed, 62 insertions(+), 85 deletions(-)
Signature · 7 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 1/2 drm/msm/dsi: adjust dsi timing for dual dsi mode
For dual dsi mode, the horizontal timing needs to be divided by half since both the dsi controllers will be driving this panel. Adjust the pixel clock and DSI timing accordingly.
Changes in V2:
--Removed Change-Id from the commit text tags.
--- drivers/gpu/drm/msm/dsi/dsi.h | 1 + drivers/gpu/drm/msm/dsi/dsi_host.c | 17 +++++++++++++++++ drivers/gpu/drm/msm/dsi/dsi_manager.c | 15 +++++++++++++++ 3 files changed, 33 insertions(+)
drivers/gpu/drm/msm/dsi/dsi.h +1 -0
@@ -161,6 +161,7 @@ void msm_dsi_host_cmd_xfer_commit(struct mipi_dsi_host *host, u32 dma_base, u32 len);int msm_dsi_host_enable (struct mipi_dsi_host *host);int msm_dsi_host_disable (struct mipi_dsi_host *host); +void msm_dsi_host_adjust_timing_config (struct mipi_dsi_host *host);int msm_dsi_host_power_on (struct mipi_dsi_host *host,struct msm_dsi_phy_shared_timings *phy_shared_timings);int msm_dsi_host_power_off (struct mipi_dsi_host *host);
drivers/gpu/drm/msm/dsi/dsi_host.c +17 -0
@@ -2237,6 +2237,23 @@ static void msm_dsi_sfpb_config(struct msm_dsi_host *msm_host, bool enable) SFPB_GPREG_MASTER_PORT_EN(en)); } +void msm_dsi_host_adjust_timing_config (struct mipi_dsi_host *host) +{ +struct msm_dsi_host *msm_host =to_msm_dsi_host (host); +struct drm_display_mode *mode =NULL ; + + mode = msm_host->mode; + +mutex_lock (&msm_host->dev_mutex); + mode->htotal >>=1 ; + mode->hdisplay >>=1 ; + mode->hsync_start >>=1 ; + mode->hsync_end >>=1 ; + + mode->clock >>=1 ; +mutex_unlock (&msm_host->dev_mutex); +} +int msm_dsi_host_power_on (struct mipi_dsi_host *host,struct msm_dsi_phy_shared_timings *phy_shared_timings) {
drivers/gpu/drm/msm/dsi/dsi_manager.c +15 -0
@@ -627,6 +627,21 @@ static void dsi_mgr_bridge_mode_set(struct drm_bridge *bridge,msm_dsi_host_set_display_mode (host, adjusted_mode);if (is_dual_dsi && other_dsi)msm_dsi_host_set_display_mode (other_dsi->host, adjusted_mode); + +/* +* For dual DSI mode, the current DRM mode has +* the complete width of the panel. Since, the complete +* panel is driven by two DSI controllers, the +* horizontal timings and the pixel clock have to be +* split between the two dsi controllers. Adjust the +* DSI host timing structures accordingly. +*/ +if (is_dual_dsi) { +msm_dsi_host_adjust_timing_config (host); +if (other_dsi) +msm_dsi_host_adjust_timing_config (other_dsi->host); + } + }static const struct drm_connector_funcs dsi_mgr_connector_funcs = {
Signature · 7 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [DPU PATCH v2 1/2] drm/msm/dsi: adjust dsi timing for dual dsi mode
Quoted 7 lines · Chandan Uddaraju
For dual dsi mode, the horizontal timing needs to be divided by half since both the dsi controllers will be driving this panel. Adjust the pixel clock and DSI timing accordingly.
Changes in V2:
--Removed Change-Id from the commit text tags.
You ignored my feedback on v1
Quoted 78 lines
Signed-off-by Chandan Uddaraju <[email protected]>--- drivers/gpu/drm/msm/dsi/dsi.h | 1 + drivers/gpu/drm/msm/dsi/dsi_host.c | 17 +++++++++++++++++ drivers/gpu/drm/msm/dsi/dsi_manager.c | 15 +++++++++++++++ 3 files changed, 33 insertions(+)drivers/gpu/drm/msm/dsi/dsi.h +1
-0@@ -161,6 +161,7 @@ void msm_dsi_host_cmd_xfer_commit(struct mipi_dsi_host *host, u32 dma_base, u32 len);int msm_dsi_host_enable (struct mipi_dsi_host *host);int msm_dsi_host_disable (struct mipi_dsi_host *host); +void msm_dsi_host_adjust_timing_config (struct mipi_dsi_host *host);int msm_dsi_host_power_on (struct mipi_dsi_host *host,struct msm_dsi_phy_shared_timings *phy_shared_timings);int msm_dsi_host_power_off (struct mipi_dsi_host *host);drivers/gpu/drm/msm/dsi/dsi_host.c +17
-0@@ -2237,6 +2237,23 @@ static void msm_dsi_sfpb_config(struct msm_dsi_host *msm_host, bool enable) SFPB_GPREG_MASTER_PORT_EN(en)); } +void msm_dsi_host_adjust_timing_config (struct mipi_dsi_host *host) +{ +struct msm_dsi_host *msm_host =to_msm_dsi_host (host); +struct drm_display_mode *mode =NULL ; + + mode = msm_host->mode; + +mutex_lock (&msm_host->dev_mutex); + mode->htotal >>=1 ; + mode->hdisplay >>=1 ; + mode->hsync_start >>=1 ; + mode->hsync_end >>=1 ; + + mode->clock >>=1 ; +mutex_unlock (&msm_host->dev_mutex); +} +int msm_dsi_host_power_on (struct mipi_dsi_host *host,struct msm_dsi_phy_shared_timings *phy_shared_timings) {drivers/gpu/drm/msm/dsi/dsi_manager.c +15
-0@@ -627,6 +627,21 @@ static void dsi_mgr_bridge_mode_set(struct drm_bridge *bridge,msm_dsi_host_set_display_mode (host, adjusted_mode);if (is_dual_dsi && other_dsi)msm_dsi_host_set_display_mode (other_dsi->host, adjusted_mode); + +/* +* For dual DSI mode, the current DRM mode has +* the complete width of the panel. Since, the complete +* panel is driven by two DSI controllers, the +* horizontal timings and the pixel clock have to be +* split between the two dsi controllers. Adjust the +* DSI host timing structures accordingly. +*/ +if (is_dual_dsi) { +msm_dsi_host_adjust_timing_config (host); +if (other_dsi) +msm_dsi_host_adjust_timing_config (other_dsi->host); + } + }static const struct drm_connector_funcs dsi_mgr_connector_funcs = {Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
Signature · 5 lines
Sean Paul, Software Engineer, Google / Chromium OS _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [DPU PATCH v2 1/2] drm/msm/dsi: adjust dsi timing for dual dsi mode
Quoted 11 lines · Sean Paul
Quoted 7 lines · Chandan Uddaraju
For dual dsi mode, the horizontal timing needs to be divided by half since both the dsi controllers will be driving this panel. Adjust the pixel clock and DSI timing accordingly.
Changes in V2:
--Removed Change-Id from the commit text tags.You ignored my feedback on v1
Sorry Sean, I missed fixing your comment for this patch. I have uploaded V3 patch series for review.
thanks
Chandan
Quoted 76 lines
Quoted 76 lines
Signed-off-by Chandan Uddaraju <[email protected]>--- drivers/gpu/drm/msm/dsi/dsi.h | 1 + drivers/gpu/drm/msm/dsi/dsi_host.c | 17 +++++++++++++++++ drivers/gpu/drm/msm/dsi/dsi_manager.c | 15 +++++++++++++++ 3 files changed, 33 insertions(+)drivers/gpu/drm/msm/dsi/dsi.h +1
-0@@ -161,6 +161,7 @@ void msm_dsi_host_cmd_xfer_commit(structmipi_dsi_host *host, u32 dma_base, u32 len);int msm_dsi_host_enable (struct mipi_dsi_host *host);int msm_dsi_host_disable (struct mipi_dsi_host *host); +void msm_dsi_host_adjust_timing_config (struct mipi_dsi_host *host);int msm_dsi_host_power_on (struct mipi_dsi_host *host,struct msm_dsi_phy_shared_timings *phy_shared_timings);int
msm_dsi_host_power_off(struct mipi_dsi_host *host);drivers/gpu/drm/msm/dsi/dsi_host.c +17
-0@@ -2237,6 +2237,23 @@ static void msm_dsi_sfpb_config(struct msm_dsi_host *msm_host, bool enable) SFPB_GPREG_MASTER_PORT_EN(en)); } +void msm_dsi_host_adjust_timing_config (struct mipi_dsi_host *host) +{ +struct msm_dsi_host *msm_host =to_msm_dsi_host (host); +struct drm_display_mode *mode =NULL ; + + mode = msm_host->mode; + +mutex_lock (&msm_host->dev_mutex); + mode->htotal >>=1 ; + mode->hdisplay >>=1 ; + mode->hsync_start >>=1 ; + mode->hsync_end >>=1 ; + + mode->clock >>=1 ; +mutex_unlock (&msm_host->dev_mutex); +} +int msm_dsi_host_power_on (struct mipi_dsi_host *host,struct msm_dsi_phy_shared_timings *phy_shared_timings){
drivers/gpu/drm/msm/dsi/dsi_manager.c +15
-0@@ -627,6 +627,21 @@ static void dsi_mgr_bridge_mode_set(structdrm_bridge *bridge,msm_dsi_host_set_display_mode (host ,adjusted_mode );if (is_dual_dsi && other_dsi)msm_dsi_host_set_display_mode (other_dsi->host, adjusted_mode); + +/* +* For dual DSI mode, the current DRM mode has +* the complete width of the panel. Since, the complete +* panel is driven by two DSI controllers, the +* horizontal timings and the pixel clock have to be +* split between the two dsi controllers. Adjust the +* DSI host timing structures accordingly. +*/ +if (is_dual_dsi) { +msm_dsi_host_adjust_timing_config (host); +if (other_dsi) +msm_dsi_host_adjust_timing_config (other_dsi->host); + } + }
Quoted 5 lines
Quoted 5 lines
static const struct
drm_connector_funcsdsi_mgr_connector_funcs= {
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
_______________________________________________
Freedreno mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/freedreno
A message that is not in the archive (sent off-list or not yet received): 1523925614-28337-1-git-send-email-chandanu-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org
PATCH v2 2/2 drm/msm/dsi: Use one connector for dual DSI mode
Current DSI driver uses two connectors for dual DSI case even though we only have one panel. Fix this by implementing one connector/bridge for dual DSI use case. Use master DSI controllers to register one connector/bridge.
Changes in V2:
-Removed Change-Id from the commit text tags.
-Remove extra parentheses
--- drivers/gpu/drm/msm/dsi/dsi.c | 3 + drivers/gpu/drm/msm/dsi/dsi.h | 1 + drivers/gpu/drm/msm/dsi/dsi_manager.c | 110 ++++++++-------------------------- 3 files changed, 29 insertions(+), 85 deletions(-)
drivers/gpu/drm/msm/dsi/dsi.c +3 -0
@@ -208,6 +208,9 @@ int msm_dsi_modeset_init(struct msm_dsi *msm_dsi, struct drm_device *dev, goto fail; } +if (!msm_dsi_manager_validate_current_config (msm_dsi->id)) + goto fail; + msm_dsi->encoder = encoder; msm_dsi->bridge =msm_dsi_manager_bridge_init (msm_dsi->id);
drivers/gpu/drm/msm/dsi/dsi.h +1 -0
@@ -100,6 +100,7 @@ struct msm_dsi {void msm_dsi_manager_attach_dsi_device (int id,u32 device_flags);int msm_dsi_manager_register (struct msm_dsi *msm_dsi);void msm_dsi_manager_unregister (struct msm_dsi *msm_dsi); +bool msm_dsi_manager_validate_current_config (u8 id);/* msm dsi */ static inline bool msm_dsi_device_connected (struct msm_dsi *msm_dsi)
drivers/gpu/drm/msm/dsi/dsi_manager.c +25 -85
155 lines not on this page · raw message
Signature · 7 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project _______________________________________________ Freedreno mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/freedreno