Loading drivers/gpu/drm/msm/dp/dp_display.c +3 −2 Original line number Diff line number Diff line Loading @@ -1716,7 +1716,7 @@ static enum drm_mode_status dp_display_validate_mode( enum drm_mode_status mode_status = MODE_BAD; bool in_list = false; struct dp_mst_connector *mst_connector; int hdis, vdis, vref, ar, _hdis, _vdis, _vref, _ar; int hdis, vdis, vref, ar, _hdis, _vdis, _vref, _ar, rate; if (!dp_display || !mode || !panel) { pr_err("invalid params\n"); Loading Loading @@ -1746,7 +1746,8 @@ static enum drm_mode_status dp_display_validate_mode( mode_bpp = dp_panel->get_mode_bpp(dp_panel, mode_bpp, mode->clock); mode_rate_khz = mode->clock * mode_bpp; supported_rate_khz = link_info->num_lanes * link_info->rate * 8; rate = drm_dp_bw_code_to_link_rate(dp->link->link_params.bw_code); supported_rate_khz = link_info->num_lanes * rate * 8; if (mode_rate_khz > supported_rate_khz) { DP_MST_DEBUG("pclk:%d, supported_rate:%d\n", Loading drivers/gpu/drm/msm/dp/dp_panel.c +1 −1 Original line number Diff line number Diff line Loading @@ -1567,7 +1567,7 @@ static int dp_panel_deinit_panel_info(struct dp_panel *dp_panel, u32 flags) panel = container_of(dp_panel, struct dp_panel_private, dp_panel); hdr = &panel->catalog->hdr_data; if (!panel->custom_edid) if (!panel->custom_edid && dp_panel->edid_ctrl->edid) sde_free_edid((void **)&dp_panel->edid_ctrl); dp_panel_set_stream_info(dp_panel, DP_STREAM_MAX, 0, 0, 0); Loading drivers/gpu/drm/msm/dsi-staging/dsi_parser.c +44 −75 Original line number Diff line number Diff line Loading @@ -890,19 +890,6 @@ void *dsi_parser_get_head_node(void *in, return NULL; } static int dsi_parser_check_buffer_overflow(int rc, int *max_size, int *len) { if (rc >= *max_size) { pr_err("buffer overflow, rc=%d, max_size=%d\n", rc, *max_size); return -ENOMEM; } *len += rc; *max_size = SZ_4K - *len; return 0; } static int dsi_parser_read_file(struct dsi_parser *parser, const u8 **buf, u32 *size) { Loading Loading @@ -1016,24 +1003,20 @@ static ssize_t dsi_parser_read_node(struct file *file, char __user *user_buff, size_t count, loff_t *ppos) { char *buf = NULL; int i, j, len = 0, rc = 0, max_size = SZ_4K; int i, j, len = 0, max_size = SZ_4K; struct dsi_parser *parser = file->private_data; struct dsi_parser_node *node; struct dsi_parser_prop *prop; if (!parser) { len = -ENODEV; goto error; } if (!parser) return -ENODEV; if (*ppos) goto error; return len; buf = devm_kzalloc(parser->dev, SZ_4K, GFP_KERNEL); if (!buf) { len = -ENOMEM; goto error; } buf = kzalloc(SZ_4K, GFP_KERNEL); if (!buf) return -ENOMEM; node = parser->current_node; if (!node) { Loading @@ -1043,68 +1026,59 @@ static ssize_t dsi_parser_read_node(struct file *file, prop = node->prop; rc = snprintf(buf + len, max_size, "node name=%s\n", node->name); rc = dsi_parser_check_buffer_overflow(rc, &max_size, &len); if (rc) goto error; len += scnprintf(buf + len, max_size - len, "node name=%s\n", node->name); if (len == max_size) goto buffer_overflow; rc = snprintf(buf + len, max_size, "children count=%d\n", len += scnprintf(buf + len, max_size - len, "children count=%d\n", node->children_count); rc = dsi_parser_check_buffer_overflow(rc, &max_size, &len); if (rc) goto error; if (len == max_size) goto buffer_overflow; for (i = 0; i < node->children_count; i++) { rc = snprintf(buf + len, max_size, "child[%d]=%s\n", len += scnprintf(buf + len, max_size - len, "child[%d]=%s\n", i, node->child[i]->name); rc = dsi_parser_check_buffer_overflow(rc, &max_size, &len); if (rc) goto error; if (len == max_size) goto buffer_overflow; } for (i = 0; i < node->prop_count; i++) { if (!prop[i].name) continue; rc = snprintf(buf + len, max_size, len += scnprintf(buf + len, max_size - len, "property=%s\n", prop[i].name); rc = dsi_parser_check_buffer_overflow(rc, &max_size, &len); if (rc) goto error; if (len == max_size) goto buffer_overflow; if (prop[i].value) { if (prop[i].type == DSI_PROP_TYPE_STR) { rc = snprintf(buf + len, max_size, len += scnprintf(buf + len, max_size - len, "value=%s\n", prop[i].value); rc = dsi_parser_check_buffer_overflow( rc, &max_size, &len); if (rc) goto error; if (len == max_size) goto buffer_overflow; } else { for (j = 0; j < prop[i].len; j++) { rc = snprintf(buf + len, max_size, len += scnprintf(buf + len, max_size - len, "%x", prop[i].value[j]); rc = dsi_parser_check_buffer_overflow( rc, &max_size, &len); if (rc) goto error; if (len == max_size) goto buffer_overflow; } rc = snprintf(buf + len, max_size, "\n"); rc = dsi_parser_check_buffer_overflow( rc, &max_size, &len); if (rc) goto error; len += scnprintf(buf + len, max_size - len, "\n"); if (len == max_size) goto buffer_overflow; } } if (prop[i].len) { rc = snprintf(buf + len, max_size, "items:\n"); rc = dsi_parser_check_buffer_overflow(rc, &max_size, &len); if (rc) goto error; len += scnprintf(buf + len, max_size - len, "items:\n"); if (len == max_size) goto buffer_overflow; } for (j = 0; j < prop[i].len; j++) { Loading @@ -1115,28 +1089,23 @@ static ssize_t dsi_parser_read_node(struct file *file, else delim = ' '; rc = snprintf(buf + len, max_size, "%s%c", len += scnprintf(buf + len, max_size - len, "%s%c", prop[i].items[j], delim); rc = dsi_parser_check_buffer_overflow(rc, &max_size, &len); if (rc) goto error; if (len == max_size) goto buffer_overflow; } rc = snprintf(buf + len, max_size, "\n\n"); rc = dsi_parser_check_buffer_overflow(rc, &max_size, &len); if (rc) goto error; len += scnprintf(buf + len, max_size - len, "\n\n"); if (len == max_size) goto buffer_overflow; } error: if (copy_to_user(user_buff, buf, len)) { buffer_overflow: if (simple_read_from_buffer(user_buff, count, ppos, buf, len)) { len = -EFAULT; goto error; } *ppos += len; if (buf) devm_kfree(parser->dev, buf); error: kfree(buf); return len; } Loading drivers/gpu/drm/msm/sde/sde_crtc.c +2 −1 Original line number Diff line number Diff line Loading @@ -2570,7 +2570,8 @@ static void _sde_crtc_dest_scaler_setup(struct drm_crtc *crtc) SDE_DEBUG("dest scaler feature not supported\n"); } else if (_sde_validate_hw_resources(sde_crtc)) { //do nothing } else if (!cstate->scl3_lut_cfg.is_configured) { } else if ((!cstate->scl3_lut_cfg.is_configured) && (!is_qseed3_rev_qseed3lite(kms->catalog))) { SDE_ERROR("crtc%d:no LUT data available\n", crtc->base.id); } else { for (i = 0; i < count; i++) { Loading Loading
drivers/gpu/drm/msm/dp/dp_display.c +3 −2 Original line number Diff line number Diff line Loading @@ -1716,7 +1716,7 @@ static enum drm_mode_status dp_display_validate_mode( enum drm_mode_status mode_status = MODE_BAD; bool in_list = false; struct dp_mst_connector *mst_connector; int hdis, vdis, vref, ar, _hdis, _vdis, _vref, _ar; int hdis, vdis, vref, ar, _hdis, _vdis, _vref, _ar, rate; if (!dp_display || !mode || !panel) { pr_err("invalid params\n"); Loading Loading @@ -1746,7 +1746,8 @@ static enum drm_mode_status dp_display_validate_mode( mode_bpp = dp_panel->get_mode_bpp(dp_panel, mode_bpp, mode->clock); mode_rate_khz = mode->clock * mode_bpp; supported_rate_khz = link_info->num_lanes * link_info->rate * 8; rate = drm_dp_bw_code_to_link_rate(dp->link->link_params.bw_code); supported_rate_khz = link_info->num_lanes * rate * 8; if (mode_rate_khz > supported_rate_khz) { DP_MST_DEBUG("pclk:%d, supported_rate:%d\n", Loading
drivers/gpu/drm/msm/dp/dp_panel.c +1 −1 Original line number Diff line number Diff line Loading @@ -1567,7 +1567,7 @@ static int dp_panel_deinit_panel_info(struct dp_panel *dp_panel, u32 flags) panel = container_of(dp_panel, struct dp_panel_private, dp_panel); hdr = &panel->catalog->hdr_data; if (!panel->custom_edid) if (!panel->custom_edid && dp_panel->edid_ctrl->edid) sde_free_edid((void **)&dp_panel->edid_ctrl); dp_panel_set_stream_info(dp_panel, DP_STREAM_MAX, 0, 0, 0); Loading
drivers/gpu/drm/msm/dsi-staging/dsi_parser.c +44 −75 Original line number Diff line number Diff line Loading @@ -890,19 +890,6 @@ void *dsi_parser_get_head_node(void *in, return NULL; } static int dsi_parser_check_buffer_overflow(int rc, int *max_size, int *len) { if (rc >= *max_size) { pr_err("buffer overflow, rc=%d, max_size=%d\n", rc, *max_size); return -ENOMEM; } *len += rc; *max_size = SZ_4K - *len; return 0; } static int dsi_parser_read_file(struct dsi_parser *parser, const u8 **buf, u32 *size) { Loading Loading @@ -1016,24 +1003,20 @@ static ssize_t dsi_parser_read_node(struct file *file, char __user *user_buff, size_t count, loff_t *ppos) { char *buf = NULL; int i, j, len = 0, rc = 0, max_size = SZ_4K; int i, j, len = 0, max_size = SZ_4K; struct dsi_parser *parser = file->private_data; struct dsi_parser_node *node; struct dsi_parser_prop *prop; if (!parser) { len = -ENODEV; goto error; } if (!parser) return -ENODEV; if (*ppos) goto error; return len; buf = devm_kzalloc(parser->dev, SZ_4K, GFP_KERNEL); if (!buf) { len = -ENOMEM; goto error; } buf = kzalloc(SZ_4K, GFP_KERNEL); if (!buf) return -ENOMEM; node = parser->current_node; if (!node) { Loading @@ -1043,68 +1026,59 @@ static ssize_t dsi_parser_read_node(struct file *file, prop = node->prop; rc = snprintf(buf + len, max_size, "node name=%s\n", node->name); rc = dsi_parser_check_buffer_overflow(rc, &max_size, &len); if (rc) goto error; len += scnprintf(buf + len, max_size - len, "node name=%s\n", node->name); if (len == max_size) goto buffer_overflow; rc = snprintf(buf + len, max_size, "children count=%d\n", len += scnprintf(buf + len, max_size - len, "children count=%d\n", node->children_count); rc = dsi_parser_check_buffer_overflow(rc, &max_size, &len); if (rc) goto error; if (len == max_size) goto buffer_overflow; for (i = 0; i < node->children_count; i++) { rc = snprintf(buf + len, max_size, "child[%d]=%s\n", len += scnprintf(buf + len, max_size - len, "child[%d]=%s\n", i, node->child[i]->name); rc = dsi_parser_check_buffer_overflow(rc, &max_size, &len); if (rc) goto error; if (len == max_size) goto buffer_overflow; } for (i = 0; i < node->prop_count; i++) { if (!prop[i].name) continue; rc = snprintf(buf + len, max_size, len += scnprintf(buf + len, max_size - len, "property=%s\n", prop[i].name); rc = dsi_parser_check_buffer_overflow(rc, &max_size, &len); if (rc) goto error; if (len == max_size) goto buffer_overflow; if (prop[i].value) { if (prop[i].type == DSI_PROP_TYPE_STR) { rc = snprintf(buf + len, max_size, len += scnprintf(buf + len, max_size - len, "value=%s\n", prop[i].value); rc = dsi_parser_check_buffer_overflow( rc, &max_size, &len); if (rc) goto error; if (len == max_size) goto buffer_overflow; } else { for (j = 0; j < prop[i].len; j++) { rc = snprintf(buf + len, max_size, len += scnprintf(buf + len, max_size - len, "%x", prop[i].value[j]); rc = dsi_parser_check_buffer_overflow( rc, &max_size, &len); if (rc) goto error; if (len == max_size) goto buffer_overflow; } rc = snprintf(buf + len, max_size, "\n"); rc = dsi_parser_check_buffer_overflow( rc, &max_size, &len); if (rc) goto error; len += scnprintf(buf + len, max_size - len, "\n"); if (len == max_size) goto buffer_overflow; } } if (prop[i].len) { rc = snprintf(buf + len, max_size, "items:\n"); rc = dsi_parser_check_buffer_overflow(rc, &max_size, &len); if (rc) goto error; len += scnprintf(buf + len, max_size - len, "items:\n"); if (len == max_size) goto buffer_overflow; } for (j = 0; j < prop[i].len; j++) { Loading @@ -1115,28 +1089,23 @@ static ssize_t dsi_parser_read_node(struct file *file, else delim = ' '; rc = snprintf(buf + len, max_size, "%s%c", len += scnprintf(buf + len, max_size - len, "%s%c", prop[i].items[j], delim); rc = dsi_parser_check_buffer_overflow(rc, &max_size, &len); if (rc) goto error; if (len == max_size) goto buffer_overflow; } rc = snprintf(buf + len, max_size, "\n\n"); rc = dsi_parser_check_buffer_overflow(rc, &max_size, &len); if (rc) goto error; len += scnprintf(buf + len, max_size - len, "\n\n"); if (len == max_size) goto buffer_overflow; } error: if (copy_to_user(user_buff, buf, len)) { buffer_overflow: if (simple_read_from_buffer(user_buff, count, ppos, buf, len)) { len = -EFAULT; goto error; } *ppos += len; if (buf) devm_kfree(parser->dev, buf); error: kfree(buf); return len; } Loading
drivers/gpu/drm/msm/sde/sde_crtc.c +2 −1 Original line number Diff line number Diff line Loading @@ -2570,7 +2570,8 @@ static void _sde_crtc_dest_scaler_setup(struct drm_crtc *crtc) SDE_DEBUG("dest scaler feature not supported\n"); } else if (_sde_validate_hw_resources(sde_crtc)) { //do nothing } else if (!cstate->scl3_lut_cfg.is_configured) { } else if ((!cstate->scl3_lut_cfg.is_configured) && (!is_qseed3_rev_qseed3lite(kms->catalog))) { SDE_ERROR("crtc%d:no LUT data available\n", crtc->base.id); } else { for (i = 0; i < count; i++) { Loading