瀏覽代碼

disp: msm: dsi: add api to control dsi active status

Add DSI api to control the connection status of the
DSI interface. This would be used in the VM usecase,
where the connection would be enabled/disabled during
device assign/unassign while switching to the VM.

Change-Id: Ifff41244824ade7a6b8dca77651d82fd5207f8e0
Signed-off-by: Veera Sundaram Sankaran <[email protected]>
Veera Sundaram Sankaran 5 年之前
父節點
當前提交
988b1c6fc5
共有 2 個文件被更改,包括 15 次插入1 次删除
  1. 13 1
      msm/dsi/dsi_display.c
  2. 2 0
      msm/dsi/dsi_display.h

+ 13 - 1
msm/dsi/dsi_display.c

@@ -3736,6 +3736,8 @@ static int dsi_display_res_init(struct dsi_display *display)
 		goto error_ctrl_put;
 	}
 
+	display->is_active = true;
+
 	return 0;
 error_ctrl_put:
 	for (i = i - 1; i >= 0; i--) {
@@ -5385,6 +5387,16 @@ int dsi_display_get_active_displays(void **display_array, u32 max_display_count)
 	return count;
 }
 
+void dsi_display_set_active_state(struct dsi_display *display, bool is_active)
+{
+	if (!display)
+		return;
+
+	mutex_lock(&display->display_lock);
+	display->is_active = is_active;
+	mutex_unlock(&display->display_lock);
+}
+
 int dsi_display_drm_bridge_init(struct dsi_display *display,
 		struct drm_encoder *enc)
 {
@@ -5924,7 +5936,7 @@ int dsi_display_get_info(struct drm_connector *connector,
 	for (i = 0; i < info->num_of_h_tiles; i++)
 		info->h_tile_instance[i] = display->ctrl[i].ctrl->cell_index;
 
-	info->is_connected = true;
+	info->is_connected = display->is_active;
 
 	if (!strcmp(display->display_type, "primary"))
 		info->display_type = SDE_CONNECTOR_PRIMARY;

+ 2 - 0
msm/dsi/dsi_display.h

@@ -186,6 +186,7 @@ struct dsi_display_ext_bridge {
  * @queue_cmd_waits   Indicates if wait for dma commands done has to be queued.
  * @dma_cmd_workq:	Pointer to the workqueue of DMA command transfer done
  *				wait sequence.
+ * @is_active:        status of the display
  */
 struct dsi_display {
 	struct platform_device *pdev;
@@ -278,6 +279,7 @@ struct dsi_display {
 
 	/* panel id of the display */
 	u64 panel_id;
+	bool is_active;
 };
 
 int dsi_display_dev_probe(struct platform_device *pdev);