msm: vidc: Apply a QOS vote when Venus is active

During video playback, L2 power collapse is occurring far too often to
actually save power.  As such, apply a vote to prevent L2 PC from
occurring.

Change-Id: I1d86b47a1ed9dffb02d099d3158892bf99ed955e
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
Signed-off-by: Vasantha Balla <vballa@codeaurora.org>
This commit is contained in:
Vasantha Balla 2016-08-09 13:11:23 +05:30 committed by syphyr
parent 5afcecba3c
commit 7405047309
5 changed files with 21 additions and 0 deletions

View File

@ -131,6 +131,8 @@ Optional properties:
clock settings if video hardware requests to do so.
- qcom,regulator-scaling = A bool indicating whether driver need to control
voltage settings.
- qcom,pm-qos-latency-us = The latency used to vote for QOS power manager. This
value is typically max(latencies of every cluster at all power levels) + 1
Example:

View File

@ -919,6 +919,10 @@ int read_platform_resources_from_dt(
dprintk(VIDC_DBG,
"Using fw-bias : %pa", &res->firmware_base);
}
of_property_read_u32(pdev->dev.of_node,
"qcom,pm-qos-latency-us", &res->pm_qos_latency_us);
return rc;
err_load_max_hw_load:
msm_vidc_free_clock_voltage_table(res);

View File

@ -153,6 +153,7 @@ struct msm_vidc_platform_resources {
bool early_fw_load;
bool thermal_mitigable;
const char *fw_name;
uint32_t pm_qos_latency_us;
};
static inline int is_iommu_present(struct msm_vidc_platform_resources *res)

View File

@ -19,6 +19,7 @@
#include <linux/of.h>
#include <linux/iommu.h>
#include <linux/qcom_iommu.h>
#include <linux/pm_qos.h>
#include <linux/regulator/consumer.h>
#include <linux/iopoll.h>
#include <linux/coresight-stm.h>
@ -1654,6 +1655,8 @@ static inline int venus_hfi_power_off(struct venus_hfi_device *device)
}
dprintk(VIDC_DBG, "Entering power collapse\n");
pm_qos_remove_request(&device->qos);
rc = venus_hfi_tzbsp_set_video_state(TZBSP_VIDEO_STATE_SUSPEND);
if (rc) {
dprintk(VIDC_WARN, "Failed to suspend video core %d\n", rc);
@ -1797,6 +1800,9 @@ static inline int venus_hfi_power_on(struct venus_hfi_device *device)
}
device->power_enabled = true;
if(device->res->pm_qos_latency_us)
pm_qos_add_request(&device->qos, PM_QOS_CPU_DMA_LATENCY,
device->res->pm_qos_latency_us);
dprintk(VIDC_INFO, "Resumed from power collapse\n");
return rc;
@ -2614,6 +2620,10 @@ static int venus_hfi_core_init(void *device)
if (rc || venus_hfi_iface_cmdq_write(dev, &version_pkt))
dprintk(VIDC_WARN, "Failed to send image version pkt to f/w\n");
if (dev->res->pm_qos_latency_us)
pm_qos_add_request(&dev->qos, PM_QOS_CPU_DMA_LATENCY,
dev->res->pm_qos_latency_us);
return rc;
err_core_init:
venus_hfi_set_state(dev, VENUS_STATE_DEINIT);
@ -2658,6 +2668,8 @@ static int venus_hfi_core_release(void *device)
disable_irq_nosync(dev->hal_data->irq);
dev->intr_status = 0;
}
pm_qos_remove_request(&dev->qos);
venus_hfi_set_state(dev, VENUS_STATE_DEINIT);
dprintk(VIDC_INFO, "HAL exited\n");

View File

@ -17,6 +17,7 @@
#include <linux/clk.h>
#include <linux/mutex.h>
#include <linux/platform_device.h>
#include <linux/pm_qos.h>
#include <linux/spinlock.h>
#include <linux/msm_iommu_domains.h>
#include <soc/qcom/ocmem.h>
@ -205,6 +206,7 @@ struct venus_hfi_device {
enum venus_hfi_state state;
struct hfi_packetization_ops *pkt_ops;
enum hfi_packetization_type packetization_type;
struct pm_qos_request qos;
};
void venus_hfi_delete_device(void *device);