Merge "disp: msm: Address static analysis issues"

This commit is contained in:
qctecmdr
2022-04-30 18:45:41 -07:00
committed by Gerrit - the friendly Code Review server
6 changed files with 19 additions and 17 deletions

View File

@@ -345,7 +345,7 @@ struct dp_hpd *dp_lphw_hpd_get(struct device *dev, struct dp_parser *parser,
{ {
int rc = 0; int rc = 0;
const char *hpd_gpio_name = "qcom,dp-hpd-gpio"; const char *hpd_gpio_name = "qcom,dp-hpd-gpio";
struct dp_lphw_hpd_private *lphw_hpd; struct dp_lphw_hpd_private *lphw_hpd = NULL;
unsigned int gpio; unsigned int gpio;
if (!dev || !parser || !cb) { if (!dev || !parser || !cb) {
@@ -358,7 +358,7 @@ struct dp_hpd *dp_lphw_hpd_get(struct device *dev, struct dp_parser *parser,
if (!gpio_is_valid(gpio)) { if (!gpio_is_valid(gpio)) {
DP_DEBUG("%s gpio not specified\n", hpd_gpio_name); DP_DEBUG("%s gpio not specified\n", hpd_gpio_name);
rc = -EINVAL; rc = -EINVAL;
goto gpio_error; goto error;
} }
lphw_hpd = devm_kzalloc(dev, sizeof(*lphw_hpd), GFP_KERNEL); lphw_hpd = devm_kzalloc(dev, sizeof(*lphw_hpd), GFP_KERNEL);

View File

@@ -621,7 +621,7 @@ int dsi_conn_get_mode_info(struct drm_connector *connector,
convert_to_dsi_mode(drm_mode, &partial_dsi_mode); convert_to_dsi_mode(drm_mode, &partial_dsi_mode);
rc = dsi_display_find_mode(dsi_display, &partial_dsi_mode, sub_mode, &dsi_mode); rc = dsi_display_find_mode(dsi_display, &partial_dsi_mode, sub_mode, &dsi_mode);
if (rc || !dsi_mode->priv_info) if (rc || !dsi_mode->priv_info || !dsi_display || !dsi_display->panel)
return -EINVAL; return -EINVAL;
memset(mode_info, 0, sizeof(*mode_info)); memset(mode_info, 0, sizeof(*mode_info));
@@ -641,12 +641,12 @@ int dsi_conn_get_mode_info(struct drm_connector *connector,
mode_info->qsync_min_fps = dsi_mode->timing.qsync_min_fps; mode_info->qsync_min_fps = dsi_mode->timing.qsync_min_fps;
mode_info->wd_jitter = dsi_mode->priv_info->wd_jitter; mode_info->wd_jitter = dsi_mode->priv_info->wd_jitter;
if (dsi_display->panel) mode_info->vpadding = dsi_display->panel->host_config.vpadding;
mode_info->vpadding = dsi_display->panel->host_config.vpadding;
if (mode_info->vpadding < drm_mode->vdisplay) { if (mode_info->vpadding < drm_mode->vdisplay) {
mode_info->vpadding = 0; mode_info->vpadding = 0;
dsi_display->panel->host_config.line_insertion_enable = 0; dsi_display->panel->host_config.line_insertion_enable = 0;
} }
memcpy(&mode_info->topology, &dsi_mode->priv_info->topology, memcpy(&mode_info->topology, &dsi_mode->priv_info->topology,
sizeof(struct msm_display_topology)); sizeof(struct msm_display_topology));

View File

@@ -1652,6 +1652,12 @@ static void _sde_cp_crtc_commit_feature(struct sde_cp_node *prop_node,
struct sde_mdss_cfg *catalog = NULL; struct sde_mdss_cfg *catalog = NULL;
struct sde_crtc_state *sde_crtc_state; struct sde_crtc_state *sde_crtc_state;
sde_crtc_state = to_sde_crtc_state(sde_crtc->base.state);
if (!sde_crtc_state) {
DRM_ERROR("sde_crtc_state is null\n");
return;
}
memset(&hw_cfg, 0, sizeof(hw_cfg)); memset(&hw_cfg, 0, sizeof(hw_cfg));
_sde_cp_get_cached_payload(prop_node, &hw_cfg, &feature_enabled); _sde_cp_get_cached_payload(prop_node, &hw_cfg, &feature_enabled);
hw_cfg.num_of_mixers = sde_crtc->num_mixers; hw_cfg.num_of_mixers = sde_crtc->num_mixers;
@@ -1663,11 +1669,6 @@ static void _sde_cp_crtc_commit_feature(struct sde_cp_node *prop_node,
hw_cfg.skip_blend_plane_h = sde_crtc->skip_blend_plane_h; hw_cfg.skip_blend_plane_h = sde_crtc->skip_blend_plane_h;
hw_cfg.skip_blend_plane_w = sde_crtc->skip_blend_plane_w; hw_cfg.skip_blend_plane_w = sde_crtc->skip_blend_plane_w;
sde_crtc_state = to_sde_crtc_state(sde_crtc->base.state);
if (!sde_crtc_state) {
DRM_ERROR("invalid sde_crtc_state %pK\n", sde_crtc_state);
return;
}
hw_cfg.num_ds_enabled = sde_crtc_state->num_ds_enabled; hw_cfg.num_ds_enabled = sde_crtc_state->num_ds_enabled;
SDE_EVT32(hw_cfg.panel_width, hw_cfg.panel_height); SDE_EVT32(hw_cfg.panel_width, hw_cfg.panel_height);

View File

@@ -3136,7 +3136,8 @@ static int _sde_connector_install_properties(struct drm_device *dev,
msm_property_install_enum(&c_conn->property_info, "dsc_mode", 0, msm_property_install_enum(&c_conn->property_info, "dsc_mode", 0,
0, e_dsc_mode, ARRAY_SIZE(e_dsc_mode), 0, CONNECTOR_PROP_DSC_MODE); 0, e_dsc_mode, ARRAY_SIZE(e_dsc_mode), 0, CONNECTOR_PROP_DSC_MODE);
if (display_info->capabilities & MSM_DISPLAY_CAP_CMD_MODE && if (dsi_display && dsi_display->panel &&
display_info->capabilities & MSM_DISPLAY_CAP_CMD_MODE &&
display_info->capabilities & MSM_DISPLAY_CAP_VID_MODE) display_info->capabilities & MSM_DISPLAY_CAP_VID_MODE)
msm_property_install_enum(&c_conn->property_info, msm_property_install_enum(&c_conn->property_info,
"panel_mode", 0, 0, "panel_mode", 0, 0,

View File

@@ -3711,7 +3711,7 @@ bool sde_crtc_is_line_insertion_supported(struct drm_crtc *crtc)
return false; return false;
kms = _sde_crtc_get_kms(crtc); kms = _sde_crtc_get_kms(crtc);
if (!kms->catalog->has_line_insertion) if (!kms || !kms->catalog || !kms->catalog->has_line_insertion)
return false; return false;
list_for_each_entry(enc, &crtc->dev->mode_config.encoder_list, head) { list_for_each_entry(enc, &crtc->dev->mode_config.encoder_list, head) {

View File

@@ -1091,6 +1091,11 @@ static void _sde_encoder_phys_wb_setup_sys_cache(struct sde_encoder_phys *phys_e
return; return;
} }
if (!hw_wb || !hw_wb->ops.setup_sys_cache) {
SDE_DEBUG("unsupported ops: setup_sys_cache WB %d\n", WBID(wb_enc));
return;
}
/* /*
* - use LLCC_DISP for cwb static display * - use LLCC_DISP for cwb static display
* - use LLCC_DISP_1 for cwb static display read path only * - use LLCC_DISP_1 for cwb static display read path only
@@ -1113,11 +1118,6 @@ static void _sde_encoder_phys_wb_setup_sys_cache(struct sde_encoder_phys *phys_e
return; return;
} }
if (!hw_wb || !hw_wb->ops.setup_sys_cache) {
SDE_DEBUG("unsupported ops: setup_sys_cache WB %d\n", WBID(wb_enc));
return;
}
cache_enable = sde_connector_get_property(state, CONNECTOR_PROP_CACHE_STATE); cache_enable = sde_connector_get_property(state, CONNECTOR_PROP_CACHE_STATE);
if (!cfg->wr_en && !cache_enable) if (!cfg->wr_en && !cache_enable)