|
@@ -1448,6 +1448,14 @@ static ssize_t debugfs_misr_setup(struct file *file,
|
|
|
display->misr_frame_count = frame_count;
|
|
|
|
|
|
mutex_lock(&display->display_lock);
|
|
|
+
|
|
|
+ if (!display->hw_ownership) {
|
|
|
+ DSI_DEBUG("[%s] op not supported due to HW unavailability\n",
|
|
|
+ display->name);
|
|
|
+ rc = -EOPNOTSUPP;
|
|
|
+ goto unlock;
|
|
|
+ }
|
|
|
+
|
|
|
rc = dsi_display_clk_ctrl(display->dsi_clk_handle,
|
|
|
DSI_CORE_CLK, DSI_CLK_ON);
|
|
|
if (rc) {
|
|
@@ -1499,6 +1507,14 @@ static ssize_t debugfs_misr_read(struct file *file,
|
|
|
return -ENOMEM;
|
|
|
|
|
|
mutex_lock(&display->display_lock);
|
|
|
+
|
|
|
+ if (!display->hw_ownership) {
|
|
|
+ DSI_DEBUG("[%s] op not supported due to HW unavailability\n",
|
|
|
+ display->name);
|
|
|
+ rc = -EOPNOTSUPP;
|
|
|
+ goto error;
|
|
|
+ }
|
|
|
+
|
|
|
rc = dsi_display_clk_ctrl(display->dsi_clk_handle,
|
|
|
DSI_CORE_CLK, DSI_CLK_ON);
|
|
|
if (rc) {
|
|
@@ -1596,6 +1612,15 @@ static ssize_t debugfs_esd_trigger_check(struct file *file,
|
|
|
|
|
|
display->esd_trigger = esd_trigger;
|
|
|
|
|
|
+ mutex_lock(&display->display_lock);
|
|
|
+
|
|
|
+ if (!display->hw_ownership) {
|
|
|
+ DSI_DEBUG("[%s] op not supported due to HW unavailability\n",
|
|
|
+ display->name);
|
|
|
+ rc = -EOPNOTSUPP;
|
|
|
+ goto unlock;
|
|
|
+ }
|
|
|
+
|
|
|
if (display->esd_trigger) {
|
|
|
DSI_INFO("ESD attack triggered by user\n");
|
|
|
rc = dsi_panel_trigger_esd_attack(display->panel,
|
|
@@ -1607,6 +1632,8 @@ static ssize_t debugfs_esd_trigger_check(struct file *file,
|
|
|
}
|
|
|
|
|
|
rc = len;
|
|
|
+unlock:
|
|
|
+ mutex_unlock(&display->display_lock);
|
|
|
error:
|
|
|
kfree(buf);
|
|
|
return rc;
|
|
@@ -4156,10 +4183,13 @@ static int dsi_display_res_init(struct dsi_display *display)
|
|
|
* In trusted vm, the connectors will not be enabled
|
|
|
* until the HW resources are assigned and accepted.
|
|
|
*/
|
|
|
- if (display->trusted_vm_env)
|
|
|
+ if (display->trusted_vm_env) {
|
|
|
display->is_active = false;
|
|
|
- else
|
|
|
+ display->hw_ownership = false;
|
|
|
+ } else {
|
|
|
display->is_active = true;
|
|
|
+ display->hw_ownership = true;
|
|
|
+ }
|
|
|
|
|
|
return 0;
|
|
|
error_ctrl_put:
|
|
@@ -4168,6 +4198,7 @@ error_ctrl_put:
|
|
|
dsi_ctrl_put(ctrl->ctrl);
|
|
|
dsi_phy_put(ctrl->phy);
|
|
|
}
|
|
|
+
|
|
|
return rc;
|
|
|
}
|
|
|
|
|
@@ -5379,19 +5410,33 @@ end:
|
|
|
|
|
|
static int dsi_display_pre_release(void *data)
|
|
|
{
|
|
|
+ struct dsi_display *display;
|
|
|
+
|
|
|
if (!data)
|
|
|
return -EINVAL;
|
|
|
|
|
|
- dsi_display_ctrl_irq_update((struct dsi_display *)data, false);
|
|
|
+ display = (struct dsi_display *)data;
|
|
|
+ mutex_lock(&display->display_lock);
|
|
|
+ display->hw_ownership = false;
|
|
|
+ mutex_unlock(&display->display_lock);
|
|
|
+
|
|
|
+ dsi_display_ctrl_irq_update(display, false);
|
|
|
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
static int dsi_display_pre_acquire(void *data)
|
|
|
{
|
|
|
+ struct dsi_display *display;
|
|
|
+
|
|
|
if (!data)
|
|
|
return -EINVAL;
|
|
|
|
|
|
+ display = (struct dsi_display *)data;
|
|
|
+ mutex_lock(&display->display_lock);
|
|
|
+ display->hw_ownership = true;
|
|
|
+ mutex_unlock(&display->display_lock);
|
|
|
+
|
|
|
dsi_display_ctrl_irq_update((struct dsi_display *)data, true);
|
|
|
|
|
|
return 0;
|
|
@@ -7666,6 +7711,7 @@ int dsi_display_prepare(struct dsi_display *display)
|
|
|
SDE_EVT32(SDE_EVTLOG_FUNC_ENTRY);
|
|
|
mutex_lock(&display->display_lock);
|
|
|
|
|
|
+ display->hw_ownership = true;
|
|
|
mode = display->panel->cur_mode;
|
|
|
|
|
|
dsi_display_set_ctrl_esd_check_flag(display, false);
|
|
@@ -8573,6 +8619,7 @@ int dsi_display_unprepare(struct dsi_display *display)
|
|
|
DSI_ERR("[%s] panel post-unprepare failed, rc=%d\n",
|
|
|
display->name, rc);
|
|
|
}
|
|
|
+ display->hw_ownership = false;
|
|
|
|
|
|
mutex_unlock(&display->display_lock);
|
|
|
|