Browse Source

Merge "disp: msm: dsi: flush CMD DMA of all ctrls in case of previous broadcast"

QCTECMDR Service 11 months ago
parent
commit
1e304fb082
3 changed files with 21 additions and 3 deletions
  1. 1 1
      msm/dsi/dsi_ctrl.c
  2. 8 1
      msm/dsi/dsi_ctrl.h
  3. 12 1
      msm/dsi/dsi_display.c

+ 1 - 1
msm/dsi/dsi_ctrl.c

@@ -467,7 +467,7 @@ static void dsi_ctrl_post_cmd_transfer_work(struct work_struct *work)
 	dsi_ctrl->post_tx_queued = false;
 }
 
-static void dsi_ctrl_flush_cmd_dma_queue(struct dsi_ctrl *dsi_ctrl)
+void dsi_ctrl_flush_cmd_dma_queue(struct dsi_ctrl *dsi_ctrl)
 {
 	/*
 	 * If a command is triggered right after another command,

+ 8 - 1
msm/dsi/dsi_ctrl.h

@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 /*
- * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved.
  * Copyright (c) 2015-2021, The Linux Foundation. All rights reserved.
  */
 
@@ -952,4 +952,11 @@ void dsi_ctrl_toggle_error_interrupt_status(struct dsi_ctrl *dsi_ctrl, bool enab
  * @dsi_ctrl:                 DSI controller handle.
  */
 void dsi_ctrl_transfer_cleanup(struct dsi_ctrl *dsi_ctrl);
+
+/**
+ * dsi_ctrl_flush_cmd_dma_queue() - Wait fot previous command transfer to complete
+ *				and flush any pending post_cmd_transfer works.
+ * @dsi_ctrl:                 DSI controller handle.
+ */
+void dsi_ctrl_flush_cmd_dma_queue(struct dsi_ctrl *dsi_ctrl);
 #endif /* _DSI_CTRL_H_ */

+ 12 - 1
msm/dsi/dsi_display.c

@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
- * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
  * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved.
  */
 
@@ -3450,6 +3450,17 @@ int dsi_host_transfer_sub(struct mipi_dsi_host *host, struct dsi_cmd_desc *cmd)
 
 	dsi_display_set_cmd_tx_ctrl_flags(display, cmd);
 
+	/*
+	 * Wait until any previous broadcast commands with ASYNC waits have been scheduled
+	 * and completed on both controllers.
+	 */
+	display_for_each_ctrl(i, display) {
+		ctrl = &display->ctrl[i];
+		if ((ctrl->ctrl->pending_cmd_flags & DSI_CTRL_CMD_BROADCAST) &&
+			ctrl->ctrl->post_tx_queued)
+			dsi_ctrl_flush_cmd_dma_queue(ctrl->ctrl);
+	}
+
 	if (cmd->ctrl_flags & DSI_CTRL_CMD_BROADCAST) {
 		rc = dsi_display_broadcast_cmd(display, cmd);
 		if (rc) {