Skip to content

Commit

Permalink
Merge a3c036f on remote branch
Browse files Browse the repository at this point in the history
Change-Id: I4a418bf5cd379b55e70ce5fb1a63c53117ac1643
  • Loading branch information
Linux Build Service Account committed Aug 15, 2019
2 parents c41bda2 + a3c036f commit e0463d3
Show file tree
Hide file tree
Showing 16 changed files with 95 additions and 56 deletions.
6 changes: 5 additions & 1 deletion drivers/char/diag/diagchar_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ static void diag_close_logging_process(const int pid)
int i, j;
int session_mask = 0;
int device_mask = 0;
uint32_t p_mask;
uint32_t p_mask = 0;
struct diag_md_session_t *session_info = NULL;
struct diag_logging_mode_param_t params;

Expand Down Expand Up @@ -498,9 +498,11 @@ static void diag_close_logging_process(const int pid)
}
}
}
mutex_lock(&driver->hdlc_disable_mutex);
mutex_lock(&driver->md_session_lock);
diag_md_session_close(pid);
mutex_unlock(&driver->md_session_lock);
mutex_unlock(&driver->hdlc_disable_mutex);
diag_switch_logging(&params);
mutex_unlock(&driver->diagchar_mutex);
}
Expand Down Expand Up @@ -1436,6 +1438,8 @@ static void diag_md_session_close(int pid)
driver->md_session_map[proc][i] = NULL;
driver->md_session_mask[proc] &=
~session_info->peripheral_mask[proc];
driver->p_hdlc_disabled[i] =
driver->hdlc_disabled;
}
}
diag_log_mask_free(session_info->log_mask);
Expand Down
6 changes: 5 additions & 1 deletion drivers/char/diag/diagfwd_mhi.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,8 @@ static int __mhi_open(struct diag_mhi_info *mhi_info, int open_flag)

static int mhi_open(int id)
{
int err = 0;

if (id < 0 || id >= NUM_MHI_DEV) {
pr_err("diag: In %s, invalid index %d\n", __func__, id);
return -EINVAL;
Expand All @@ -330,7 +332,9 @@ static int mhi_open(int id)
* explicitly by Diag. Open both the read and write channels (denoted by
* OPEN_CHANNELS flag)
*/
__mhi_open(&diag_mhi[id], OPEN_CHANNELS);
err = __mhi_open(&diag_mhi[id], OPEN_CHANNELS);
if (err)
return err;
diag_remote_dev_open(diag_mhi[id].dev_id);
queue_work(diag_mhi[id].mhi_wq, &(diag_mhi[id].read_work));

Expand Down
18 changes: 15 additions & 3 deletions drivers/gpu/drm/msm/sde/sde_crtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1391,14 +1391,24 @@ static u32 _sde_crtc_get_displays_affected(struct drm_crtc *crtc,
{
struct sde_crtc *sde_crtc;
struct sde_crtc_state *crtc_state;
struct drm_encoder *encoder;
u32 disp_bitmask = 0;
int i;
bool is_ppsplit = false;

sde_crtc = to_sde_crtc(crtc);
crtc_state = to_sde_crtc_state(state);

list_for_each_entry(encoder,
&crtc->dev->mode_config.encoder_list, head) {
if (encoder->crtc != state->crtc)
continue;

is_ppsplit |= sde_encoder_is_topology_ppsplit(encoder);
}

/* pingpong split: one ROI, one LM, two physical displays */
if (crtc_state->is_ppsplit) {
if (is_ppsplit) {
u32 lm_split_width = crtc_state->lm_bounds[0].w / 2;
struct sde_rect *roi = &crtc_state->lm_roi[0];

Expand Down Expand Up @@ -2016,7 +2026,8 @@ static void _sde_crtc_blend_setup_mixer(struct drm_crtc *crtc,
cnt++;
}

sort(pstates, cnt, sizeof(pstates[0]), pstate_cmp, NULL);
if (cnt)
sort(pstates, cnt, sizeof(pstates[0]), pstate_cmp, NULL);
_sde_crtc_set_src_split_order(crtc, pstates, cnt);

if (lm && lm->ops.setup_dim_layer) {
Expand Down Expand Up @@ -5278,7 +5289,8 @@ static int sde_crtc_atomic_check(struct drm_crtc *crtc,
}

/* assign mixer stages based on sorted zpos property */
sort(pstates, cnt, sizeof(pstates[0]), pstate_cmp, NULL);
if (cnt)
sort(pstates, cnt, sizeof(pstates[0]), pstate_cmp, NULL);

rc = _sde_crtc_excl_dim_layer_check(state, pstates, cnt);
if (rc)
Expand Down
34 changes: 18 additions & 16 deletions drivers/gpu/drm/msm/sde/sde_encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -943,6 +943,24 @@ bool sde_encoder_in_clone_mode(struct drm_encoder *drm_enc)
return false;
}

bool sde_encoder_is_topology_ppsplit(struct drm_encoder *drm_enc)
{
struct sde_encoder_virt *sde_enc;
struct sde_encoder_phys *master;

if (!drm_enc)
return false;

sde_enc = to_sde_encoder_virt(drm_enc);
master = sde_enc->cur_master;

if (!master || !master->connector)
return false;

return (sde_connector_get_topology_name(master->connector)
== SDE_RM_TOPOLOGY_PPSPLIT);
}

static int sde_encoder_virt_atomic_check(
struct drm_encoder *drm_enc,
struct drm_crtc_state *crtc_state,
Expand Down Expand Up @@ -2684,8 +2702,6 @@ static void sde_encoder_virt_mode_set(struct drm_encoder *drm_enc,
struct sde_kms *sde_kms;
struct list_head *connector_list;
struct drm_connector *conn = NULL, *conn_iter;
struct sde_connector_state *sde_conn_state = NULL;
struct sde_connector *sde_conn = NULL;
struct sde_rm_hw_iter dsc_iter, pp_iter;
struct sde_rm_hw_request request_hw;
bool is_cmd_mode = false;
Expand Down Expand Up @@ -2734,20 +2750,6 @@ static void sde_encoder_virt_mode_set(struct drm_encoder *drm_enc,
return;
}

sde_conn = to_sde_connector(conn);
sde_conn_state = to_sde_connector_state(conn->state);
if (sde_conn && sde_conn_state) {
ret = sde_conn->ops.get_mode_info(&sde_conn->base, adj_mode,
&sde_conn_state->mode_info,
sde_kms->catalog->max_mixer_width,
sde_conn->display);
if (ret) {
SDE_ERROR_ENC(sde_enc,
"failed to get mode info from the display\n");
return;
}
}

/* release resources before seamless mode change */
if (msm_is_mode_seamless_dms(adj_mode) ||
(msm_is_mode_seamless_dyn_clk(adj_mode) &&
Expand Down
8 changes: 8 additions & 0 deletions drivers/gpu/drm/msm/sde/sde_encoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,14 @@ void sde_encoder_recovery_events_handler(struct drm_encoder *encoder,
*/
bool sde_encoder_in_clone_mode(struct drm_encoder *enc);

/**
*sde_encoder_is_topology_ppsplit - checks if the current encoder is in
ppsplit topology.
*@drm_enc: Pointer to drm encoder structure
*@Return: true if the present topology is ppsplit
*/
bool sde_encoder_is_topology_ppsplit(struct drm_encoder *drm_enc);

/**
* sde_encoder_is_primary_display - checks if underlying display is primary
* display or not.
Expand Down
22 changes: 11 additions & 11 deletions drivers/media/platform/msm/vidc/venus_hfi.c
Original file line number Diff line number Diff line change
Expand Up @@ -4043,11 +4043,8 @@ static inline void __unprepare_ahb2axi_bridge(struct venus_hfi_device *device,
if (version != (0x5 << 28 | 0x10 << 16))
return;

if (!(device->intr_status & VIDC_WRAPPER_INTR_STATUS_A2HWD_BMSK))
return;

dprintk(VIDC_ERR,
"reset axi cbcr to recover from hung\n");
"reset axi cbcr to recover\n");

/* read registers */
axi0_cbcr_status = __read_gcc_register(device, VIDEO_GCC_AXI0_CBCR);
Expand Down Expand Up @@ -4800,7 +4797,8 @@ static int __venus_power_on(struct venus_hfi_device *device)
return rc;
}

static void __venus_power_off(struct venus_hfi_device *device)
static void __venus_power_off(struct venus_hfi_device *device,
bool axi_reset)
{
u32 version;

Expand All @@ -4810,11 +4808,13 @@ static void __venus_power_off(struct venus_hfi_device *device)
if (!(device->intr_status & VIDC_WRAPPER_INTR_STATUS_A2HWD_BMSK))
disable_irq_nosync(device->hal_data->irq);

version = __read_register(device, VIDC_WRAPPER_HW_VERSION);
if (axi_reset)
version = __read_register(device, VIDC_WRAPPER_HW_VERSION);

__disable_unprepare_clks(device);

__unprepare_ahb2axi_bridge(device, version);
if (axi_reset)
__unprepare_ahb2axi_bridge(device, version);

device->intr_status = 0;

Expand Down Expand Up @@ -4852,7 +4852,7 @@ static inline int __suspend(struct venus_hfi_device *device)

__disable_subcaches(device);

__venus_power_off(device);
__venus_power_off(device, false);
dprintk(VIDC_PROF, "Venus power off\n");
return rc;

Expand Down Expand Up @@ -4927,7 +4927,7 @@ static inline int __resume(struct venus_hfi_device *device)
err_reset_core:
__tzbsp_set_video_state(TZBSP_VIDEO_STATE_SUSPEND);
err_set_video_state:
__venus_power_off(device);
__venus_power_off(device, false);
err_venus_power_on:
dprintk(VIDC_ERR, "Failed to resume from power collapse\n");
return rc;
Expand Down Expand Up @@ -4986,7 +4986,7 @@ static int __load_fw(struct venus_hfi_device *device)
subsystem_put(device->resources.fw.cookie);
device->resources.fw.cookie = NULL;
fail_load_fw:
__venus_power_off(device);
__venus_power_off(device, true);
fail_venus_power_on:
fail_init_pkt:
__deinit_resources(device);
Expand All @@ -5007,7 +5007,7 @@ static void __unload_fw(struct venus_hfi_device *device)
__vote_buses(device, NULL, 0);
subsystem_put(device->resources.fw.cookie);
__interface_queues_release(device);
__venus_power_off(device);
__venus_power_off(device, true);
device->resources.fw.cookie = NULL;
__deinit_resources(device);

Expand Down
6 changes: 4 additions & 2 deletions drivers/misc/qseecom.c
Original file line number Diff line number Diff line change
Expand Up @@ -6734,9 +6734,11 @@ static int __qseecom_update_qteec_req_buf(struct qseecom_qteec_modfd_req *req,
for (i = 0; i < MAX_ION_FD; i++) {
if (req->ifd_data[i].fd > 0) {
ion_fd = req->ifd_data[i].fd;
if ((req->req_len < sizeof(uint32_t)) ||
if ((req->req_len <
sizeof(struct qseecom_param_memref)) ||
(req->ifd_data[i].cmd_buf_offset >
req->req_len - sizeof(uint32_t))) {
req->req_len -
sizeof(struct qseecom_param_memref))) {
pr_err("Invalid offset/req len 0x%x/0x%x\n",
req->req_len,
req->ifd_data[i].cmd_buf_offset);
Expand Down
6 changes: 4 additions & 2 deletions drivers/platform/msm/gsi/gsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@ static void gsi_channel_state_change_wait(unsigned long chan_hdl,
}

if (op == GSI_CH_START) {
if (curr_state == GSI_CHAN_STATE_STARTED) {
if (curr_state == GSI_CHAN_STATE_STARTED ||
curr_state == GSI_CHAN_STATE_FLOW_CONTROL) {
ctx->state = curr_state;
return;
}
Expand Down Expand Up @@ -2697,7 +2698,8 @@ int gsi_start_channel(unsigned long chan_hdl)
ctx,
GSI_START_CMD_TIMEOUT_MS, op);

if (ctx->state != GSI_CHAN_STATE_STARTED) {
if (ctx->state != GSI_CHAN_STATE_STARTED &&
ctx->state != GSI_CHAN_STATE_FLOW_CONTROL) {
/*
* Hardware returned unexpected status, unexpected
* hardware state.
Expand Down
3 changes: 2 additions & 1 deletion drivers/platform/msm/gsi/gsi.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2015-2019, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
Expand Down Expand Up @@ -90,6 +90,7 @@ enum gsi_chan_state {
GSI_CHAN_STATE_STARTED = 0x2,
GSI_CHAN_STATE_STOPPED = 0x3,
GSI_CHAN_STATE_STOP_IN_PROC = 0x4,
GSI_CHAN_STATE_FLOW_CONTROL = 0x5,
GSI_CHAN_STATE_ERROR = 0xf
};

Expand Down
8 changes: 4 additions & 4 deletions drivers/power/supply/qcom/fg-alg.c
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,7 @@ static int get_step_chg_current_window(struct ttf *ttf)
struct range_data *step_chg_cfg = ttf->step_chg_cfg;
int i, rc, curr_window, vbatt;

if (ttf->mode == TTF_MODE_V_STEP_CHG) {
if (ttf->mode == TTF_MODE_VBAT_STEP_CHG) {
rc = ttf->get_ttf_param(ttf->data, TTF_VBAT, &vbatt);
if (rc < 0) {
pr_err("failed to get battery voltage, rc=%d\n", rc);
Expand Down Expand Up @@ -1024,7 +1024,7 @@ static int get_time_to_full_locked(struct ttf *ttf, int *val)
/* estimated battery current at the CC to CV transition */
switch (ttf->mode) {
case TTF_MODE_NORMAL:
case TTF_MODE_V_STEP_CHG:
case TTF_MODE_VBAT_STEP_CHG:
case TTF_MODE_OCV_STEP_CHG:
i_cc2cv = ibatt_avg * vbatt_avg /
max(MILLI_UNIT, float_volt_uv / MILLI_UNIT);
Expand Down Expand Up @@ -1082,7 +1082,7 @@ static int get_time_to_full_locked(struct ttf *ttf, int *val)
ibatt_this_step, t_predicted_this_step);
}
break;
case TTF_MODE_V_STEP_CHG:
case TTF_MODE_VBAT_STEP_CHG:
case TTF_MODE_OCV_STEP_CHG:
if (!step_chg_data || !step_chg_cfg)
break;
Expand Down Expand Up @@ -1123,7 +1123,7 @@ static int get_time_to_full_locked(struct ttf *ttf, int *val)
MILLI_UNIT);
}

if (ttf->mode == TTF_MODE_V_STEP_CHG)
if (ttf->mode == TTF_MODE_VBAT_STEP_CHG)
step_chg_data[i].ocv =
step_chg_cfg[i].high_threshold -
(rbatt * i_step);
Expand Down
2 changes: 1 addition & 1 deletion drivers/power/supply/qcom/fg-alg.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ struct cap_learning {
enum ttf_mode {
TTF_MODE_NORMAL = 0,
TTF_MODE_QNOVO,
TTF_MODE_V_STEP_CHG,
TTF_MODE_VBAT_STEP_CHG,
TTF_MODE_OCV_STEP_CHG,
};

Expand Down
2 changes: 1 addition & 1 deletion drivers/power/supply/qcom/qpnp-fg-gen4.c
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,7 @@ static int fg_gen4_get_ttf_param(void *data, enum ttf_param param, int *val)
if (is_qnovo_en(fg))
*val = TTF_MODE_QNOVO;
else if (chip->ttf->step_chg_cfg_valid)
*val = TTF_MODE_V_STEP_CHG;
*val = TTF_MODE_VBAT_STEP_CHG;
else if (chip->ttf->ocv_step_chg_cfg_valid)
*val = TTF_MODE_OCV_STEP_CHG;
else
Expand Down
2 changes: 1 addition & 1 deletion drivers/power/supply/qcom/qpnp-qg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1615,7 +1615,7 @@ static int qg_get_ttf_param(void *data, enum ttf_param param, int *val)
break;
case TTF_MODE:
if (chip->ttf->step_chg_cfg_valid)
*val = TTF_MODE_V_STEP_CHG;
*val = TTF_MODE_VBAT_STEP_CHG;
else
*val = TTF_MODE_NORMAL;
break;
Expand Down
Loading

0 comments on commit e0463d3

Please sign in to comment.