Merge "msm: vidc: Fix various decoder downscalar issues"
diff --git a/Documentation/devicetree/bindings/media/video/msm-cci.txt b/Documentation/devicetree/bindings/media/video/msm-cci.txt
index f256d78..da54138 100644
--- a/Documentation/devicetree/bindings/media/video/msm-cci.txt
+++ b/Documentation/devicetree/bindings/media/video/msm-cci.txt
@@ -171,6 +171,22 @@
- 0 -> MASTER 0
- 1 -> MASTER 1
+Optional properties:
+- qcom,cam-vreg-name : should contain names of all regulators needed by this
+ actuator
+ - "cam_vaf"
+- qcom,cam-vreg-type : should contain regulator type for regulators mentioned in
+ qcom,cam-vreg-name property (in the same order)
+ - 0 for LDO and 1 for LVS
+- qcom,cam-vreg-min-voltage : should contain minimum voltage level in mcrovolts
+ for regulators mentioned in qcom,cam-vreg-name property (in the same order)
+- qcom,cam-vreg-max-voltage : should contain maximum voltage level in mcrovolts
+ for regulators mentioned in qcom,cam-vreg-name property (in the same order)
+- qcom,cam-vreg-op-mode : should contain the maximum current in microamps
+ required from the regulators mentioned in the qcom,cam-vreg-name property
+ (in the same order).
+- cam_vaf-supply : should contain regulator from which AF voltage is supplied
+
Example:
qcom,cci@0xfda0c000 {
@@ -200,8 +216,14 @@
actuator0: qcom,actuator@18 {
cell-index = <0>;
reg = <0x18>;
- compatible = "qcom,actuator";
- qcom,cci-master = <0>;
+ compatible = "qcom,actuator";
+ qcom,cci-master = <0>;
+ cam_vaf-supply = <&pm8941_l23>;
+ qcom,cam-vreg-name = "cam_vaf";
+ qcom,cam-vreg-type = <0>;
+ qcom,cam-vreg-min-voltage = <3000000>;
+ qcom,cam-vreg-max-voltage = <3000000>;
+ qcom,cam-vreg-op-mode = <100000>;
};
qcom,s5k3l1yx@6e {
diff --git a/arch/arm/boot/dts/msm8610.dtsi b/arch/arm/boot/dts/msm8610.dtsi
index 90dae06..d243b78 100644
--- a/arch/arm/boot/dts/msm8610.dtsi
+++ b/arch/arm/boot/dts/msm8610.dtsi
@@ -895,6 +895,9 @@
qcom,hotplug-temp-hysteresis = <20>;
qcom,cpu-sensors = "tsens_tz_sensor5", "tsens_tz_sensor5",
"tsens_tz_sensor5", "tsens_tz_sensor5";
+ qcom,default-temp = <80>;
+ qcom,efuse-data = <0xfc4b8000 0x1000 23 30 0x3>;
+ qcom,efuse-temperature-map = <0x1 70>;
qcom,vdd-restriction-temp = <5>;
qcom,vdd-restriction-temp-hysteresis = <10>;
vdd-dig-supply = <&pm8110_s1_floor_corner>;
diff --git a/drivers/media/platform/msm/camera_v2/sensor/actuator/msm_actuator.c b/drivers/media/platform/msm/camera_v2/sensor/actuator/msm_actuator.c
index 50f37db..cce6525 100644
--- a/drivers/media/platform/msm/camera_v2/sensor/actuator/msm_actuator.c
+++ b/drivers/media/platform/msm/camera_v2/sensor/actuator/msm_actuator.c
@@ -27,6 +27,10 @@
#define CDBG(fmt, args...) pr_debug(fmt, ##args)
#endif
+
+static int32_t msm_actuator_power_up(struct msm_actuator_ctrl_t *a_ctrl);
+static int32_t msm_actuator_power_down(struct msm_actuator_ctrl_t *a_ctrl);
+
static struct msm_actuator msm_vcm_actuator_table;
static struct msm_actuator msm_piezo_actuator_table;
@@ -447,6 +451,31 @@
return rc;
}
+static int32_t msm_actuator_vreg_control(struct msm_actuator_ctrl_t *a_ctrl,
+ int config)
+{
+ int rc = 0, i, cnt;
+ struct msm_actuator_vreg *vreg_cfg;
+
+ vreg_cfg = &a_ctrl->vreg_cfg;
+ cnt = vreg_cfg->num_vreg;
+ if (!cnt)
+ return 0;
+
+ if (cnt >= MSM_ACTUATOT_MAX_VREGS) {
+ pr_err("%s failed %d cnt %d\n", __func__, __LINE__, cnt);
+ return -EINVAL;
+ }
+
+ for (i = 0; i < cnt; i++) {
+ rc = msm_camera_config_single_vreg(&(a_ctrl->pdev->dev),
+ &vreg_cfg->cam_vreg[i],
+ (struct regulator **)&vreg_cfg->data[i],
+ config);
+ }
+ return rc;
+}
+
static int32_t msm_actuator_power_down(struct msm_actuator_ctrl_t *a_ctrl)
{
int32_t rc = 0;
@@ -456,6 +485,11 @@
if (!rc)
gpio_free(a_ctrl->vcm_pwd);
}
+ rc = msm_actuator_vreg_control(a_ctrl, 0);
+ if (rc < 0) {
+ pr_err("%s failed %d\n", __func__, __LINE__);
+ return rc;
+ }
kfree(a_ctrl->step_position_table);
a_ctrl->step_position_table = NULL;
@@ -671,6 +705,13 @@
if (rc < 0)
pr_err("actuator_set_position failed %d\n", rc);
break;
+
+ case CFG_ACTUATOR_POWERUP:
+ rc = msm_actuator_power_up(a_ctrl);
+ if (rc < 0)
+ pr_err("Failed actuator power up%d\n", rc);
+ break;
+
default:
break;
}
@@ -794,6 +835,13 @@
CDBG("vcm info: %x %x\n", a_ctrl->vcm_pwd,
a_ctrl->vcm_enable);
+
+ rc = msm_actuator_vreg_control(a_ctrl, 1);
+ if (rc < 0) {
+ pr_err("%s failed %d\n", __func__, __LINE__);
+ return rc;
+ }
+
if (a_ctrl->vcm_enable) {
rc = gpio_request(a_ctrl->vcm_pwd, "msm_actuator");
if (!rc) {
@@ -909,6 +957,7 @@
int32_t rc = 0;
struct msm_camera_cci_client *cci_client = NULL;
struct msm_actuator_ctrl_t *msm_actuator_t = NULL;
+ struct msm_actuator_vreg *vreg_cfg;
CDBG("Enter\n");
if (!pdev->dev.of_node) {
@@ -940,6 +989,18 @@
return rc;
}
+ if (of_find_property((&pdev->dev)->of_node,
+ "qcom,cam-vreg-name", NULL)) {
+ vreg_cfg = &msm_actuator_t->vreg_cfg;
+ rc = msm_camera_get_dt_vreg_data((&pdev->dev)->of_node,
+ &vreg_cfg->cam_vreg, &vreg_cfg->num_vreg);
+ if (rc < 0) {
+ kfree(msm_actuator_t);
+ pr_err("failed rc %d\n", rc);
+ return rc;
+ }
+ }
+
msm_actuator_t->act_v4l2_subdev_ops = &msm_actuator_subdev_ops;
msm_actuator_t->actuator_mutex = &msm_actuator_mutex;
msm_actuator_t->cam_name = pdev->id;
@@ -952,6 +1013,7 @@
msm_actuator_t->i2c_client.cci_client = kzalloc(sizeof(
struct msm_camera_cci_client), GFP_KERNEL);
if (!msm_actuator_t->i2c_client.cci_client) {
+ kfree(msm_actuator_t->vreg_cfg.cam_vreg);
kfree(msm_actuator_t);
pr_err("failed no memory\n");
return -ENOMEM;
diff --git a/drivers/media/platform/msm/camera_v2/sensor/actuator/msm_actuator.h b/drivers/media/platform/msm/camera_v2/sensor/actuator/msm_actuator.h
index 772b12e..b0d9430 100644
--- a/drivers/media/platform/msm/camera_v2/sensor/actuator/msm_actuator.h
+++ b/drivers/media/platform/msm/camera_v2/sensor/actuator/msm_actuator.h
@@ -18,10 +18,15 @@
#include <media/v4l2-subdev.h>
#include <media/msmb_camera.h>
#include "msm_camera_i2c.h"
+#include "msm_camera_dt_util.h"
+#include "msm_camera_io_util.h"
+
#define DEFINE_MSM_MUTEX(mutexname) \
static struct mutex mutexname = __MUTEX_INITIALIZER(mutexname)
+#define MSM_ACTUATOT_MAX_VREGS (10)
+
struct msm_actuator_ctrl_t;
struct msm_actuator_func_tbl {
@@ -52,6 +57,12 @@
struct msm_actuator_func_tbl func_tbl;
};
+struct msm_actuator_vreg {
+ struct camera_vreg_t *cam_vreg;
+ void *data[MSM_ACTUATOT_MAX_VREGS];
+ int num_vreg;
+};
+
struct msm_actuator_ctrl_t {
struct i2c_driver *i2c_driver;
struct platform_driver *pdriver;
@@ -83,6 +94,7 @@
uint16_t i2c_tbl_index;
enum cci_i2c_master_t cci_master;
uint32_t subdev_id;
+ struct msm_actuator_vreg vreg_cfg;
};
#endif
diff --git a/drivers/video/msm/mdss/mdss.h b/drivers/video/msm/mdss/mdss.h
index 72cceaa..afa0bc1 100644
--- a/drivers/video/msm/mdss/mdss.h
+++ b/drivers/video/msm/mdss/mdss.h
@@ -220,7 +220,7 @@
void mdss_enable_irq(struct mdss_hw *hw);
void mdss_disable_irq(struct mdss_hw *hw);
void mdss_disable_irq_nosync(struct mdss_hw *hw);
-void mdss_bus_bandwidth_ctrl(int enable);
+int mdss_bus_bandwidth_ctrl(int enable);
static inline struct ion_client *mdss_get_ionclient(void)
{
diff --git a/drivers/video/msm/mdss/mdss_debug.h b/drivers/video/msm/mdss/mdss_debug.h
index e2c9edd..684bd45 100644
--- a/drivers/video/msm/mdss/mdss_debug.h
+++ b/drivers/video/msm/mdss/mdss_debug.h
@@ -16,6 +16,7 @@
#include <stdarg.h>
#include "mdss.h"
+#include "mdss_mdp_trace.h"
#define MISR_POLL_SLEEP 2000
#define MISR_POLL_TIMEOUT 32000
@@ -30,6 +31,13 @@
#define MDSS_XLOG_TOUT_HANDLER(...) \
mdss_xlog_tout_handler(__func__, ##__VA_ARGS__, XLOG_TOUT_DATA_LIMITER)
+#define ATRACE_END(name) trace_tracing_mark_write(current->tgid, name, 0)
+#define ATRACE_BEGIN(name) trace_tracing_mark_write(current->tgid, name, 1)
+#define ATRACE_FUNC() ATRACE_BEGIN(__func__)
+
+#define ATRACE_INT(name, value) \
+ trace_mdp_trace_counter(current->tgid, name, value)
+
#ifdef CONFIG_DEBUG_FS
struct mdss_debug_base {
struct mdss_debug_data *mdd;
diff --git a/drivers/video/msm/mdss/mdss_dsi_host.c b/drivers/video/msm/mdss/mdss_dsi_host.c
index 46ca84f..74d2739 100644
--- a/drivers/video/msm/mdss/mdss_dsi_host.c
+++ b/drivers/video/msm/mdss/mdss_dsi_host.c
@@ -1264,7 +1264,11 @@
* also, axi bus bandwidth need since dsi controller will
* fetch dcs commands from axi bus
*/
- mdss_bus_bandwidth_ctrl(1);
+ ret = mdss_bus_bandwidth_ctrl(1);
+ if (ret) {
+ pr_err("bus bandwidth request failed ret=%d\n", ret);
+ goto need_lock;
+ }
pr_debug("%s: from_mdp=%d pid=%d\n", __func__, from_mdp, current->pid);
mdss_dsi_clk_ctrl(ctrl, DSI_ALL_CLKS, 1);
diff --git a/drivers/video/msm/mdss/mdss_mdp.c b/drivers/video/msm/mdss/mdss_mdp.c
index 037a183..bf151f4 100644
--- a/drivers/video/msm/mdss/mdss_mdp.c
+++ b/drivers/video/msm/mdss/mdss_mdp.c
@@ -627,18 +627,29 @@
* Function place bus bandwidth request to allocate saved bandwidth
* if enabled or free bus bandwidth allocation if disabled.
* Bus bandwidth is required by mdp.For dsi, it only requires to send
- * dcs coammnd.
+ * dcs coammnd. It returns error if bandwidth request fails.
*/
-void mdss_bus_bandwidth_ctrl(int enable)
+int mdss_bus_bandwidth_ctrl(int enable)
{
struct mdss_data_type *mdata = mdss_mdp_get_mdata();
static int bus_bw_cnt;
int changed = 0;
+ int rc = 0;
mutex_lock(&bus_bw_lock);
if (enable) {
- if (bus_bw_cnt == 0)
+ if (bus_bw_cnt == 0) {
changed++;
+ if (!mdata->handoff_pending) {
+ rc = mdss_iommu_attach(mdata);
+ if (rc) {
+ pr_err("iommu attach failed rc=%d\n",
+ rc);
+ goto end;
+ }
+ }
+ }
+
bus_bw_cnt++;
} else {
if (bus_bw_cnt) {
@@ -663,12 +674,12 @@
pm_runtime_get_sync(&mdata->pdev->dev);
msm_bus_scale_client_update_request(
mdata->bus_hdl, mdata->curr_bw_uc_idx);
- if (!mdata->handoff_pending)
- mdss_iommu_attach(mdata);
}
}
+end:
mutex_unlock(&bus_bw_lock);
+ return rc;
}
EXPORT_SYMBOL(mdss_bus_bandwidth_ctrl);
@@ -676,7 +687,7 @@
{
struct mdss_data_type *mdata = mdss_mdp_get_mdata();
static int mdp_clk_cnt;
- int changed = 0;
+ int changed = 0, rc;
mutex_lock(&mdp_clk_lock);
if (enable) {
@@ -709,7 +720,9 @@
if (mdata->vsync_ena)
mdss_mdp_clk_update(MDSS_CLK_MDP_VSYNC, enable);
- mdss_bus_bandwidth_ctrl(enable);
+ rc = mdss_bus_bandwidth_ctrl(enable);
+ if (rc)
+ pr_err("bus bandwidth control failed rc=%d", rc);
if (!enable)
pm_runtime_put(&mdata->pdev->dev);
@@ -794,15 +807,14 @@
{
struct iommu_domain *domain;
struct mdss_iommu_map_type *iomap;
- int i;
+ int i, rc = 0;
mutex_lock(&mdp_iommu_lock);
MDSS_XLOG(mdata->iommu_attached);
if (mdata->iommu_attached) {
pr_debug("mdp iommu already attached\n");
- mutex_unlock(&mdp_iommu_lock);
- return 0;
+ goto end;
}
for (i = 0; i < MDSS_IOMMU_MAX_DOMAIN; i++) {
@@ -814,13 +826,23 @@
iomap->client_name, iomap->ctx_name);
continue;
}
- iommu_attach_device(domain, iomap->ctx);
+
+ rc = iommu_attach_device(domain, iomap->ctx);
+ if (rc) {
+ WARN(1, "mdp::iommu device attach failed rc:%d\n", rc);
+ for (i--; i >= 0; i--) {
+ iomap = mdata->iommu_map + i;
+ iommu_detach_device(domain, iomap->ctx);
+ }
+ goto end;
+ }
}
mdata->iommu_attached = true;
+end:
mutex_unlock(&mdp_iommu_lock);
- return 0;
+ return rc;
}
int mdss_iommu_dettach(struct mdss_data_type *mdata)
@@ -2558,22 +2580,31 @@
* MDSS GDSC can be voted off during idle-screen usecase for MIPI DSI command
* mode displays with Ultra-Low Power State (ULPS) feature enabled. Upon
* subsequent frame update, MDSS GDSC needs to turned back on and hw state
- * needs to be restored.
+ * needs to be restored. It returns error if footswitch control API
+ * fails.
*/
-void mdss_mdp_footswitch_ctrl_ulps(int on, struct device *dev)
+int mdss_mdp_footswitch_ctrl_ulps(int on, struct device *dev)
{
struct mdss_data_type *mdata = mdss_mdp_get_mdata();
+ int rc = 0;
pr_debug("called on=%d\n", on);
if (on) {
pm_runtime_get_sync(dev);
- mdss_iommu_attach(mdata);
+ rc = mdss_iommu_attach(mdata);
+ if (rc) {
+ pr_err("mdss iommu attach failed rc=%d\n", rc);
+ goto end;
+ }
mdss_hw_init(mdata);
mdata->ulps = false;
} else {
mdata->ulps = true;
pm_runtime_put_sync(dev);
}
+
+end:
+ return rc;
}
static inline int mdss_mdp_suspend_sub(struct mdss_data_type *mdata)
diff --git a/drivers/video/msm/mdss/mdss_mdp.h b/drivers/video/msm/mdss/mdss_mdp.h
index 0c10d8c..8e83f51 100644
--- a/drivers/video/msm/mdss/mdss_mdp.h
+++ b/drivers/video/msm/mdss/mdss_mdp.h
@@ -736,7 +736,7 @@
int mdss_mdp_wb_set_secure(struct msm_fb_data_type *mfd, int enable);
int mdss_mdp_wb_get_secure(struct msm_fb_data_type *mfd, uint8_t *enable);
void mdss_mdp_ctl_restore(struct mdss_mdp_ctl *ctl);
-void mdss_mdp_footswitch_ctrl_ulps(int on, struct device *dev);
+int mdss_mdp_footswitch_ctrl_ulps(int on, struct device *dev);
int mdss_mdp_pipe_program_pixel_extn(struct mdss_mdp_pipe *pipe);
#define mfd_to_mdp5_data(mfd) (mfd->mdp.private1)
diff --git a/drivers/video/msm/mdss/mdss_mdp_ctl.c b/drivers/video/msm/mdss/mdss_mdp_ctl.c
index 307d247..4b7f89d 100644
--- a/drivers/video/msm/mdss/mdss_mdp_ctl.c
+++ b/drivers/video/msm/mdss/mdss_mdp_ctl.c
@@ -24,6 +24,7 @@
#include "mdss_mdp.h"
#include "mdss_debug.h"
#include "mdss_mdp_trace.h"
+#include "mdss_debug.h"
static void mdss_mdp_xlog_mixer_reg(struct mdss_mdp_ctl *ctl);
static inline u64 fudge_factor(u64 val, u32 numer, u32 denom)
@@ -830,7 +831,7 @@
if (!ctl || !ctl->mdata)
return;
-
+ ATRACE_BEGIN(__func__);
mdata = ctl->mdata;
for (i = 0; i < mdata->nctl; i++) {
struct mdss_mdp_ctl *ctl;
@@ -845,8 +846,10 @@
bus_ab_quota = apply_fudge_factor(bw_sum_of_intfs,
&mdss_res->ab_factor);
trace_mdp_perf_update_bus(bus_ab_quota, bus_ib_quota);
+ ATRACE_INT("bus_quota", bus_ib_quota);
mdss_mdp_bus_scale_set_quota(bus_ab_quota, bus_ib_quota);
pr_debug("ab=%llu ib=%llu\n", bus_ab_quota, bus_ib_quota);
+ ATRACE_END(__func__);
}
/**
@@ -929,7 +932,7 @@
if (!ctl || !ctl->mdata)
return;
-
+ ATRACE_BEGIN(__func__);
mutex_lock(&mdss_mdp_ctl_lock);
mdata = ctl->mdata;
@@ -988,11 +991,13 @@
}
clk_rate = mdss_mdp_select_clk_lvl(ctl, clk_rate);
+ ATRACE_INT("mdp_clk", clk_rate);
mdss_mdp_set_clk_rate(clk_rate);
pr_debug("update clk rate = %d HZ\n", clk_rate);
}
mutex_unlock(&mdss_mdp_ctl_lock);
+ ATRACE_END(__func__);
}
static struct mdss_mdp_ctl *mdss_mdp_ctl_alloc(struct mdss_data_type *mdata,
@@ -2499,8 +2504,10 @@
return 0;
}
+ ATRACE_BEGIN("wait_fnc");
if (ctl->wait_fnc)
ret = ctl->wait_fnc(ctl, NULL);
+ ATRACE_END("wait_fnc");
trace_mdp_commit(ctl);
@@ -2569,13 +2576,16 @@
if (is_bw_released || mixer1_changed || mixer2_changed
|| ctl->force_screen_state) {
+ ATRACE_BEGIN("prepare_fnc");
if (ctl->prepare_fnc)
ret = ctl->prepare_fnc(ctl, arg);
+ ATRACE_END("prepare_fnc");
if (ret) {
pr_err("error preparing display\n");
goto done;
}
+ ATRACE_BEGIN("mixer_programming");
mdss_mdp_ctl_perf_update(ctl, 1);
if (mixer1_changed)
@@ -2591,21 +2601,29 @@
sctl->opmode);
sctl->flush_bits |= BIT(17);
}
+ ATRACE_END("mixer_programming");
}
+ ATRACE_BEGIN("frame_ready");
if (!ctl->shared_lock)
mdss_mdp_ctl_notify(ctl, MDP_NOTIFY_FRAME_READY);
+ ATRACE_END("frame_ready");
+ ATRACE_BEGIN("wait_pingpong");
if (ctl->wait_pingpong)
ctl->wait_pingpong(ctl, NULL);
+ ATRACE_END("wait_pingpong");
ctl->roi_bkup.w = ctl->roi.w;
ctl->roi_bkup.h = ctl->roi.h;
+ ATRACE_BEGIN("postproc_programming");
if (ctl->mfd && ctl->mfd->dcm_state != DTM_ENTER)
/* postprocessing setup, including dspp */
mdss_mdp_pp_setup_locked(ctl);
+ ATRACE_END("postproc_programming");
+ ATRACE_BEGIN("flush_kickoff");
mdss_mdp_ctl_write(ctl, MDSS_MDP_REG_CTL_FLUSH, ctl->flush_bits);
if (sctl) {
mdss_mdp_ctl_write(sctl, MDSS_MDP_REG_CTL_FLUSH,
@@ -2622,6 +2640,7 @@
pr_warn("error displaying frame\n");
ctl->play_cnt++;
+ ATRACE_END("flush_kickoff");
done:
mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_OFF, false);
diff --git a/drivers/video/msm/mdss/mdss_mdp_overlay.c b/drivers/video/msm/mdss/mdss_mdp_overlay.c
index 92b2a20..52c220f 100644
--- a/drivers/video/msm/mdss/mdss_mdp_overlay.c
+++ b/drivers/video/msm/mdss/mdss_mdp_overlay.c
@@ -702,12 +702,15 @@
int num_planes,
u32 flags)
{
- int i, rc = 0;
+ int i, rc;
if ((num_planes <= 0) || (num_planes > MAX_PLANES))
return -EINVAL;
- mdss_bus_bandwidth_ctrl(1);
+ rc = mdss_bus_bandwidth_ctrl(1);
+ if (rc)
+ goto end;
+
memset(data, 0, sizeof(*data));
for (i = 0; i < num_planes; i++) {
data->p[i].flags = flags;
@@ -725,21 +728,27 @@
data->num_planes = i;
+end:
return rc;
}
int mdss_mdp_overlay_free_buf(struct mdss_mdp_data *data)
{
int i;
+ int rc;
- mdss_bus_bandwidth_ctrl(1);
+ rc = mdss_bus_bandwidth_ctrl(1);
+ if (rc)
+ goto end;
+
for (i = 0; i < data->num_planes && data->p[i].len; i++)
mdss_mdp_put_img(&data->p[i]);
mdss_bus_bandwidth_ctrl(0);
data->num_planes = 0;
- return 0;
+end:
+ return rc;
}
/**
@@ -898,14 +907,25 @@
if (ctl->power_on) {
if (mdp5_data->mdata->ulps) {
- mdss_mdp_footswitch_ctrl_ulps(1, &mfd->pdev->dev);
+ rc = mdss_mdp_footswitch_ctrl_ulps(1, &mfd->pdev->dev);
+ if (rc) {
+ pr_err("footswtich control power on failed rc=%d\n",
+ rc);
+ goto end;
+ }
+
mdss_mdp_ctl_restore(ctl);
}
if (!mdp5_data->mdata->batfet)
mdss_mdp_batfet_ctrl(mdp5_data->mdata, true);
- if (!mfd->panel_info->cont_splash_enabled)
- mdss_iommu_attach(mdp5_data->mdata);
+ if (!mfd->panel_info->cont_splash_enabled) {
+ rc = mdss_iommu_attach(mdp5_data->mdata);
+ if (rc) {
+ pr_err("mdss iommu attach failed rc=%d\n", rc);
+ goto end;
+ }
+ }
mdss_mdp_release_splash_pipe(mfd);
return 0;
}
@@ -915,7 +935,7 @@
rc = pm_runtime_get_sync(&mfd->pdev->dev);
if (IS_ERR_VALUE(rc)) {
pr_err("unable to resume with pm_runtime_get_sync rc=%d\n", rc);
- return rc;
+ goto end;
}
/*
@@ -927,8 +947,13 @@
* we would have called in to TZ to restore security configs from LK.
*/
if (!is_mdss_iommu_attached()) {
- if (!mfd->panel_info->cont_splash_enabled)
- mdss_iommu_attach(mdss_res);
+ if (!mfd->panel_info->cont_splash_enabled) {
+ rc = mdss_iommu_attach(mdss_res);
+ if (rc) {
+ pr_err("mdss iommu attach failed rc=%d\n", rc);
+ goto pm_error;
+ }
+ }
mdss_hw_init(mdss_res);
}
@@ -940,17 +965,19 @@
&mfd->mdp_sync_pt_data.notifier);
} else {
pr_err("mdp ctl start failed.\n");
- goto error;
+ goto ctl_error;
}
rc = mdss_mdp_splash_cleanup(mfd, true);
-error:
- if (rc) {
- mdss_mdp_ctl_destroy(ctl);
- mdp5_data->ctl = NULL;
- pm_runtime_put(&mfd->pdev->dev);
- }
+ if (!rc)
+ goto end;
+ctl_error:
+ mdss_mdp_ctl_destroy(ctl);
+ mdp5_data->ctl = NULL;
+pm_error:
+ pm_runtime_put(&mfd->pdev->dev);
+end:
return rc;
}
@@ -1057,7 +1084,9 @@
mdss_mdp_display_commit(ctl, NULL);
mdss_mdp_display_wait4comp(ctl);
+ ATRACE_BEGIN("sspp_programming");
__overlay_queue_pipes(mfd);
+ ATRACE_END("sspp_programming");
mdss_mdp_display_commit(ctl, NULL);
mdss_mdp_display_wait4comp(ctl);
@@ -1073,6 +1102,7 @@
int sd_in_pipe = 0;
bool need_cleanup = false;
+ ATRACE_BEGIN(__func__);
if (ctl->shared_lock) {
mdss_mdp_ctl_notify(ctl, MDP_NOTIFY_FRAME_BEGIN);
mdss_mdp_ctl_notify(ctl, MDP_NOTIFY_FRAME_READY);
@@ -1119,12 +1149,19 @@
need_cleanup = true;
}
+ ATRACE_BEGIN("sspp_programming");
ret = __overlay_queue_pipes(mfd);
+ ATRACE_END("sspp_programming");
- if (mfd->panel.type == WRITEBACK_PANEL)
+ if (mfd->panel.type == WRITEBACK_PANEL) {
+ ATRACE_BEGIN("wb_kickoff");
ret = mdss_mdp_wb_kickoff(mfd);
- else
+ ATRACE_END("wb_kickoff");
+ } else {
+ ATRACE_BEGIN("display_commit");
ret = mdss_mdp_display_commit(mdp5_data->ctl, NULL);
+ ATRACE_END("display_commit");
+ }
if (!need_cleanup) {
atomic_set(&mfd->kickoff_pending, 0);
@@ -1138,7 +1175,9 @@
mutex_unlock(&mdp5_data->ov_lock);
mdss_mdp_overlay_update_pm(mdp5_data);
+ ATRACE_BEGIN("display_wait4comp");
ret = mdss_mdp_display_wait4comp(mdp5_data->ctl);
+ ATRACE_END("display_wait4comp");
mutex_lock(&mdp5_data->ov_lock);
if (ret == 0) {
@@ -1153,7 +1192,9 @@
mdss_fb_update_notify_update(mfd);
commit_fail:
+ ATRACE_BEGIN("overlay_cleanup");
mdss_mdp_overlay_cleanup(mfd);
+ ATRACE_END("overlay_cleanup");
mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_OFF, false);
mdss_mdp_ctl_notify(ctl, MDP_NOTIFY_FRAME_FLUSHED);
if (need_cleanup) {
@@ -1163,7 +1204,7 @@
mutex_unlock(&mdp5_data->ov_lock);
if (ctl->shared_lock)
mutex_unlock(ctl->shared_lock);
-
+ ATRACE_END(__func__);
return ret;
}
@@ -1344,8 +1385,13 @@
flags = (pipe->flags & MDP_SECURE_OVERLAY_SESSION);
flags |= (pipe->flags & MDP_SECURE_DISPLAY_OVERLAY_SESSION);
- if (!mfd->panel_info->cont_splash_enabled)
- mdss_iommu_attach(mdata);
+ if (!mfd->panel_info->cont_splash_enabled) {
+ ret = mdss_iommu_attach(mdata);
+ if (ret) {
+ pr_err("mdss iommu attach failed ret=%d\n", ret);
+ goto end;
+ }
+ }
src_data = &pipe->back_buf;
if (src_data->num_planes) {
@@ -1358,6 +1404,8 @@
if (IS_ERR_VALUE(ret)) {
pr_err("src_data pmem error\n");
}
+
+end:
mdss_mdp_pipe_unmap(pipe);
return ret;
diff --git a/drivers/video/msm/mdss/mdss_mdp_rotator.c b/drivers/video/msm/mdss/mdss_mdp_rotator.c
index ee892e2..6953469 100755
--- a/drivers/video/msm/mdss/mdss_mdp_rotator.c
+++ b/drivers/video/msm/mdss/mdss_mdp_rotator.c
@@ -23,6 +23,7 @@
#include "mdss_mdp.h"
#include "mdss_mdp_rotator.h"
#include "mdss_fb.h"
+#include "mdss_debug.h"
#define MAX_ROTATOR_SESSIONS 8
@@ -281,8 +282,9 @@
pr_err("unable to queue rot data\n");
goto error;
}
-
+ ATRACE_BEGIN("rotator_kickoff");
ret = mdss_mdp_rotator_kickoff(rot_ctl, rot, dst_data);
+ ATRACE_END("rotator_kickoff");
return ret;
error:
diff --git a/drivers/video/msm/mdss/mdss_mdp_trace.h b/drivers/video/msm/mdss/mdss_mdp_trace.h
index 0e0c1e7..33fe3a4 100644
--- a/drivers/video/msm/mdss/mdss_mdp_trace.h
+++ b/drivers/video/msm/mdss/mdss_mdp_trace.h
@@ -215,6 +215,40 @@
__entry->kickoff_cnt)
);
+TRACE_EVENT(tracing_mark_write,
+ TP_PROTO(int pid, const char *name, bool trace_begin),
+ TP_ARGS(pid, name, trace_begin),
+ TP_STRUCT__entry(
+ __field(int, pid)
+ __string(trace_name, name)
+ __field(bool, trace_begin)
+ ),
+ TP_fast_assign(
+ __entry->pid = pid;
+ __assign_str(trace_name, name);
+ __entry->trace_begin = trace_begin;
+ ),
+ TP_printk("%s|%d|%s", __entry->trace_begin ? "B" : "E",
+ __entry->pid, __get_str(trace_name))
+);
+
+TRACE_EVENT(mdp_trace_counter,
+ TP_PROTO(int pid, char *name, int value),
+ TP_ARGS(pid, name, value),
+ TP_STRUCT__entry(
+ __field(int, pid)
+ __string(counter_name, name)
+ __field(int, value)
+ ),
+ TP_fast_assign(
+ __entry->pid = current->tgid;
+ __assign_str(counter_name, name);
+ __entry->value = value;
+ ),
+ TP_printk("%d|%s|%d", __entry->pid,
+ __get_str(counter_name), __entry->value)
+);
+
#endif /* if !defined(TRACE_MDSS_MDP_H) || defined(TRACE_HEADER_MULTI_READ) */
/* This part must be outside protection */
diff --git a/drivers/video/msm/mdss/mdss_mdp_wb.c b/drivers/video/msm/mdss/mdss_mdp_wb.c
index aa17472..0e59a26 100644
--- a/drivers/video/msm/mdss/mdss_mdp_wb.c
+++ b/drivers/video/msm/mdss/mdss_mdp_wb.c
@@ -481,8 +481,13 @@
pr_debug("fb%d queue\n", wb->fb_ndx);
- if (!mfd->panel_info->cont_splash_enabled)
- mdss_iommu_attach(mdp5_data->mdata);
+ if (!mfd->panel_info->cont_splash_enabled) {
+ ret = mdss_iommu_attach(mdp5_data->mdata);
+ if (ret) {
+ pr_err("mdss iommu attach failed rc=%d", ret);
+ return ret;
+ }
+ }
mutex_lock(&wb->lock);
if (local)
diff --git a/include/media/msm_cam_sensor.h b/include/media/msm_cam_sensor.h
index b1b54cb..d583601 100644
--- a/include/media/msm_cam_sensor.h
+++ b/include/media/msm_cam_sensor.h
@@ -486,6 +486,8 @@
CFG_SET_DEFAULT_FOCUS,
CFG_MOVE_FOCUS,
CFG_SET_POSITION,
+ CFG_ACTUATOR_POWERDOWN,
+ CFG_ACTUATOR_POWERUP,
};
enum actuator_type {
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
index 30b88d7..cada6a7 100644
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -368,7 +368,7 @@
static inline void free_leaf(struct leaf *l)
{
- call_rcu_bh(&l->rcu, __leaf_free_rcu);
+ call_rcu(&l->rcu, __leaf_free_rcu);
}
static inline void free_leaf_info(struct leaf_info *leaf)