summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPraneeth Paladugu <ppaladug@codeaurora.org>2016-07-12 21:34:35 -0700
committerPraneeth Paladugu <ppaladug@codeaurora.org>2016-08-03 15:43:14 -0700
commiteee3003ae91c6423ceece9e17529307286bd0099 (patch)
tree5bf8a95600ffc115c666b196fa49037d7c2f72b1
parent059df41e860f67a9ba59ff4af2c95d754d6e4a28 (diff)
msm: vidc: Allow venus to power collapse in batch mode
In batch mode Venus will be IDLE after sending EBD's and FBD's to host. Power collapsing Venus at this time can save power. CRs-Fixed: 1049499 Change-Id: I795d14fd4bc3b5f31897a70009546238117b0825 Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>
-rw-r--r--drivers/media/platform/msm/vidc/msm_vidc_common.c16
-rw-r--r--drivers/media/platform/msm/vidc/venus_hfi.c12
2 files changed, 18 insertions, 10 deletions
diff --git a/drivers/media/platform/msm/vidc/msm_vidc_common.c b/drivers/media/platform/msm/vidc/msm_vidc_common.c
index 40be56e874c3..6b934d175410 100644
--- a/drivers/media/platform/msm/vidc/msm_vidc_common.c
+++ b/drivers/media/platform/msm/vidc/msm_vidc_common.c
@@ -1718,6 +1718,19 @@ static struct vb2_buffer *get_vb_from_device_addr(struct buf_queue *bufq,
return vb;
}
+static void msm_vidc_try_suspend(struct msm_vidc_inst *inst)
+{
+ bool batch_mode;
+
+ batch_mode = msm_comm_g_ctrl_for_id(inst, V4L2_CID_VIDC_QBUF_MODE)
+ == V4L2_VIDC_QBUF_BATCHED;
+ if (batch_mode) {
+ dprintk(VIDC_DBG,
+ "Trying to suspend Venus after finishing Batch\n");
+ msm_comm_suspend(inst->core->id);
+ }
+}
+
static void handle_ebd(enum hal_command_response cmd, void *data)
{
struct msm_vidc_cb_data_done *response = data;
@@ -1789,6 +1802,8 @@ static void handle_ebd(enum hal_command_response cmd, void *data)
msm_vidc_debugfs_update(inst, MSM_VIDC_DEBUGFS_EVENT_EBD);
}
+ msm_vidc_try_suspend(inst);
+
put_inst(inst);
}
@@ -2088,6 +2103,7 @@ static void handle_fbd(enum hal_command_response cmd, void *data)
msm_vidc_debugfs_update(inst, MSM_VIDC_DEBUGFS_EVENT_FBD);
}
+ msm_vidc_try_suspend(inst);
err_handle_fbd:
put_inst(inst);
}
diff --git a/drivers/media/platform/msm/vidc/venus_hfi.c b/drivers/media/platform/msm/vidc/venus_hfi.c
index 20e217cc0445..50c0eb351d4f 100644
--- a/drivers/media/platform/msm/vidc/venus_hfi.c
+++ b/drivers/media/platform/msm/vidc/venus_hfi.c
@@ -1297,17 +1297,9 @@ static int venus_hfi_suspend(void *dev)
return -ENOTSUPP;
}
- mutex_lock(&device->lock);
+ dprintk(VIDC_DBG, "Suspending Venus\n");
+ rc = flush_delayed_work(&venus_hfi_pm_work);
- if (device->power_enabled) {
- dprintk(VIDC_DBG, "Venus is busy\n");
- rc = -EBUSY;
- } else {
- dprintk(VIDC_DBG, "Venus is power suspended\n");
- rc = 0;
- }
-
- mutex_unlock(&device->lock);
return rc;
}