diff --git a/msm/dp/dp_catalog.h b/msm/dp/dp_catalog.h index 0b1f00408e43..65e8f2b8e19f 100644 --- a/msm/dp/dp_catalog.h +++ b/msm/dp/dp_catalog.h @@ -1,13 +1,13 @@ /* SPDX-License-Identifier: GPL-2.0-only */ /* - * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. */ #ifndef _DP_CATALOG_H_ #define _DP_CATALOG_H_ #include -#include +#include #include "dp_parser.h" diff --git a/msm/dp/dp_display.c b/msm/dp/dp_display.c index a7420c7bb955..fec870b085ae 100644 --- a/msm/dp/dp_display.c +++ b/msm/dp/dp_display.c @@ -2059,6 +2059,7 @@ static enum drm_mode_status dp_display_validate_mode( bool dsc_en; u32 num_lm = 0; int rc = 0; + u32 pclk_khz = 0; if (!dp_display || !mode || !panel || !avail_res || !avail_res->max_mixer_width) { @@ -2099,8 +2100,12 @@ static enum drm_mode_status dp_display_validate_mode( goto end; } - if (mode->clock > dp_display->max_pclk_khz) { - DP_MST_DEBUG("clk:%d, max:%d\n", mode->clock, + pclk_khz = dp_mode.timing.widebus_en ? + (dp_mode.timing.pixel_clk_khz >> 1) : + (dp_mode.timing.pixel_clk_khz); + + if (pclk_khz > dp_display->max_pclk_khz) { + DP_MST_DEBUG("clk:%d, max:%d\n", pclk_khz, dp_display->max_pclk_khz); goto end; } diff --git a/msm/dp/dp_display.h b/msm/dp/dp_display.h index 6091c709179a..d234d323cabd 100644 --- a/msm/dp/dp_display.h +++ b/msm/dp/dp_display.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0-only */ /* - * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. */ #ifndef _DP_DISPLAY_H_ @@ -8,7 +8,7 @@ #include #include -#include +#include #include "dp_panel.h" diff --git a/msm/dp/dp_drm.c b/msm/dp/dp_drm.c index a2022cf47345..4ac9ff52ff90 100644 --- a/msm/dp/dp_drm.c +++ b/msm/dp/dp_drm.c @@ -498,18 +498,20 @@ void dp_connector_post_open(struct drm_connector *connector, void *display) int dp_connector_atomic_check(struct drm_connector *connector, void *display, - struct drm_connector_state *c_state) + struct drm_atomic_state *a_state) { struct sde_connector *sde_conn; struct drm_connector_state *old_state; + struct drm_connector_state *c_state; - if (!connector || !display) + if (!connector || !display || a_state) return -EINVAL; + c_state = drm_atomic_get_new_connector_state(a_state, connector); old_state = - drm_atomic_get_old_connector_state(c_state->state, connector); + drm_atomic_get_old_connector_state(a_state, connector); - if (!old_state) + if (!old_state || !c_state) return -EINVAL; sde_conn = to_sde_connector(connector); diff --git a/msm/dp/dp_mst_drm.c b/msm/dp/dp_mst_drm.c index f7ecb5542eed..007853ecf324 100644 --- a/msm/dp/dp_mst_drm.c +++ b/msm/dp/dp_mst_drm.c @@ -1390,11 +1390,11 @@ static struct dp_mst_bridge *_dp_mst_get_bridge_from_encoder( } static int dp_mst_connector_atomic_check(struct drm_connector *connector, - void *display, struct drm_connector_state *new_conn_state) + void *display, struct drm_atomic_state *state) { int rc = 0, slots, i; - struct drm_atomic_state *state; struct drm_connector_state *old_conn_state; + struct drm_connector_state *new_conn_state; struct drm_crtc *old_crtc; struct drm_crtc_state *crtc_state; struct dp_mst_bridge *bridge = NULL; @@ -1412,13 +1412,15 @@ static int dp_mst_connector_atomic_check(struct drm_connector *connector, if (mst->state == PM_SUSPEND) return rc; + if (!state) + return rc; + + new_conn_state = drm_atomic_get_new_connector_state(state, connector); if (!new_conn_state) return rc; mutex_lock(&mst->mst_lock); - state = new_conn_state->state; - old_conn_state = drm_atomic_get_old_connector_state(state, connector); if (!old_conn_state) goto mode_set; diff --git a/msm/dp/dp_panel.c b/msm/dp/dp_panel.c index b6ae4727a8cd..885a8d6d6106 100644 --- a/msm/dp/dp_panel.c +++ b/msm/dp/dp_panel.c @@ -1682,8 +1682,6 @@ static void dp_panel_decode_dsc_dpcd(struct dp_panel *dp_panel) dp_panel->sink_dsc_caps.dsc_capable = false; dp_panel->dsc_en = false; } - - dp_panel->widebus_en = dp_panel->dsc_en; } static void dp_panel_read_sink_dsc_caps(struct dp_panel *dp_panel) @@ -1790,12 +1788,17 @@ static int dp_panel_read_sink_caps(struct dp_panel *dp_panel, } } + /* There is no need to read EDID from MST branch */ + if (panel->parser->has_mst && dp_panel->read_mst_cap(dp_panel)) + goto skip_edid; + rc = dp_panel_read_edid(dp_panel, connector); if (rc) { DP_ERR("panel edid read failed, set failsafe mode\n"); return rc; } +skip_edid: dp_panel->widebus_en = panel->parser->has_widebus; dp_panel->dsc_feature_enable = panel->parser->dsc_feature_enable; dp_panel->fec_feature_enable = panel->parser->fec_feature_enable; diff --git a/msm/dp/dp_panel.h b/msm/dp/dp_panel.h index 9120c476f348..f211639b0ade 100644 --- a/msm/dp/dp_panel.h +++ b/msm/dp/dp_panel.h @@ -6,7 +6,7 @@ #ifndef _DP_PANEL_H_ #define _DP_PANEL_H_ -#include +#include #include "dp_aux.h" #include "dp_link.h" diff --git a/msm/sde/sde_connector.c b/msm/sde/sde_connector.c index 939b4d03d64c..561c0d1724e3 100644 --- a/msm/sde/sde_connector.c +++ b/msm/sde/sde_connector.c @@ -2440,7 +2440,6 @@ static int _sde_connector_install_properties(struct drm_device *dev, { struct dsi_display *dsi_display; int rc; - struct drm_connector *connector; msm_property_install_blob(&c_conn->property_info, "capabilities", DRM_MODE_PROP_IMMUTABLE, CONNECTOR_PROP_SDE_INFO); @@ -2453,8 +2452,6 @@ static int _sde_connector_install_properties(struct drm_device *dev, return rc; } - connector = &c_conn->base; - msm_property_install_blob(&c_conn->property_info, "mode_properties", DRM_MODE_PROP_IMMUTABLE, CONNECTOR_PROP_MODE_INFO); @@ -2498,11 +2495,6 @@ static int _sde_connector_install_properties(struct drm_device *dev, &hdr, sizeof(hdr), CONNECTOR_PROP_EXT_HDR_INFO); - - /* create and attach colorspace property for DP */ - if (!drm_mode_create_colorspace_property(connector)) - drm_object_attach_property(&connector->base, - connector->colorspace_property, 0); } msm_property_install_volatile_range(&c_conn->property_info, diff --git a/msm/sde/sde_kms.c b/msm/sde/sde_kms.c index a56087da645f..17624217605c 100644 --- a/msm/sde/sde_kms.c +++ b/msm/sde/sde_kms.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2019, The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2020, The Linux Foundation. All rights reserved. * Copyright (C) 2013 Red Hat * Author: Rob Clark * @@ -2431,8 +2431,15 @@ static int sde_kms_get_mixer_count(const struct msm_kms *kms, temp = drm_fixp_mul(temp, vrefresh_fp); mode_clock_hz = drm_fixp_mul(temp, mdp_fudge_factor); if (mode_clock_hz > max_mdp_clock_hz || - mode->hdisplay > res->max_mixer_width) + mode->hdisplay > res->max_mixer_width) { *num_lm = 2; + if ((mode_clock_hz >> 1) > max_mdp_clock_hz) { + SDE_DEBUG("[%s] clock %d exceeds max_mdp_clk %d\n", + mode->name, mode_clock_hz, + max_mdp_clock_hz); + return -EINVAL; + } + } SDE_DEBUG("[%s] h=%d, v=%d, fps=%d, max_mdp_clk_hz=%llu, num_lm=%d\n", mode->name, mode->htotal, mode->vtotal, mode->vrefresh, sde_kms->perf.max_core_clk_rate, *num_lm);