diff --git a/arch/arm64/boot/dts/qcom/sdmmagpie-sde-display.dtsi b/arch/arm64/boot/dts/qcom/sdmmagpie-sde-display.dtsi index f39f94baa14c..7b7f6edd99aa 100644 --- a/arch/arm64/boot/dts/qcom/sdmmagpie-sde-display.dtsi +++ b/arch/arm64/boot/dts/qcom/sdmmagpie-sde-display.dtsi @@ -788,6 +788,7 @@ qcom,mdss-dsi-panel-phy-timings = [00 20 08 08 24 23 08 08 05 02 04 00]; qcom,display-topology = <1 0 1>; + qcom,default-topology-index = <0>; }; }; }; diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index 78fd2b693cb9..7bde6c1c3ffc 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -401,7 +401,8 @@ static void dp_display_hdcp_cb_work(struct work_struct *work) dp_display_update_hdcp_status(dp, false); - if (dp->debug->force_encryption && ops && ops->force_encryption) + if (status->hdcp_state != HDCP_STATE_AUTHENTICATED && + dp->debug->force_encryption && ops && ops->force_encryption) ops->force_encryption(data, dp->debug->force_encryption); switch (status->hdcp_state) { diff --git a/drivers/gpu/drm/msm/dsi-staging/dsi_display.c b/drivers/gpu/drm/msm/dsi-staging/dsi_display.c index a4c4e957f10b..c6b2d35fe732 100644 --- a/drivers/gpu/drm/msm/dsi-staging/dsi_display.c +++ b/drivers/gpu/drm/msm/dsi-staging/dsi_display.c @@ -3648,7 +3648,7 @@ static int dsi_display_res_init(struct dsi_display *display) display->panel = dsi_panel_get(&display->pdev->dev, display->panel_of, display->parser_node, - display->display_type, + display->dsi_type, display->cmdline_topology); if (IS_ERR_OR_NULL(display->panel)) { rc = PTR_ERR(display->panel); @@ -5271,7 +5271,6 @@ int dsi_display_dev_probe(struct platform_device *pdev) for (i = 0; i < count; i++) { struct device_node *np; - const char *disp_type = NULL; np = of_parse_phandle(node, disp_list, i); name = of_get_property(np, "label", NULL); @@ -5280,16 +5279,6 @@ int dsi_display_dev_probe(struct platform_device *pdev) continue; } - disp_type = of_get_property(np, "qcom,display-type", NULL); - if (!disp_type) { - pr_err("display type not defined for %s\n", name); - continue; - } - - /* primary/secondary display should match with current dsi */ - if (strcmp(dsi_type, disp_type)) - continue; - if (boot_disp->boot_disp_en) { if (!strcmp(boot_disp->name, name)) { disp_node = np; @@ -5319,6 +5308,7 @@ int dsi_display_dev_probe(struct platform_device *pdev) display->name = name; display->pdev = pdev; display->boot_disp = boot_disp; + display->dsi_type = dsi_type; dsi_display_parse_cmdline_topology(display, index); @@ -5545,7 +5535,7 @@ static int dsi_display_ext_get_info(struct drm_connector *connector, info->is_connected = connector->status != connector_status_disconnected; - if (!strcmp(display->display_type, "primary")) + if (!strcmp(display->dsi_type, "primary")) info->is_primary = true; else info->is_primary = false; @@ -5901,7 +5891,7 @@ int dsi_display_get_info(struct drm_connector *connector, info->is_connected = true; info->is_primary = false; - if (!strcmp(display->display_type, "primary")) + if (!strcmp(display->dsi_type, "primary")) info->is_primary = true; info->width_mm = phy_props.panel_width_mm; diff --git a/drivers/gpu/drm/msm/dsi-staging/dsi_display.h b/drivers/gpu/drm/msm/dsi-staging/dsi_display.h index 4cf3cebb7d02..b4a5cf9fb40e 100644 --- a/drivers/gpu/drm/msm/dsi-staging/dsi_display.h +++ b/drivers/gpu/drm/msm/dsi-staging/dsi_display.h @@ -146,6 +146,7 @@ struct dsi_display_ext_bridge { * @ext_conn: Pointer to external connector attached to DSI connector * @name: Name of the display. * @display_type: Display type as defined in device tree. + * @dsi_type: Display label as defined in device tree. * @list: List pointer. * @is_active: Is display active. * @is_cont_splash_enabled: Is continuous splash enabled @@ -196,6 +197,7 @@ struct dsi_display { const char *name; const char *display_type; + const char *dsi_type; struct list_head list; bool is_cont_splash_enabled; bool sw_te_using_wd; diff --git a/drivers/gpu/drm/msm/sde/sde_connector.c b/drivers/gpu/drm/msm/sde/sde_connector.c index 18ce98191213..5dad84b2f4eb 100644 --- a/drivers/gpu/drm/msm/sde/sde_connector.c +++ b/drivers/gpu/drm/msm/sde/sde_connector.c @@ -135,7 +135,7 @@ static int sde_backlight_setup(struct sde_connector *c_conn, if (!c_conn || !dev || !dev->dev) { SDE_ERROR("invalid param\n"); return -EINVAL; - } else if (c_conn->connector_type != DRM_MODE_CONNECTOR_DSI) { + } else if (!c_conn->ops.set_backlight) { return 0; } diff --git a/drivers/gpu/drm/msm/sde/sde_encoder.c b/drivers/gpu/drm/msm/sde/sde_encoder.c index be06c3c964ef..3ddc4bf4bcef 100644 --- a/drivers/gpu/drm/msm/sde/sde_encoder.c +++ b/drivers/gpu/drm/msm/sde/sde_encoder.c @@ -5376,7 +5376,7 @@ struct drm_encoder *sde_encoder_init_with_ops( snprintf(name, SDE_NAME_SIZE, "rsc_enc%u", drm_enc->base.id); sde_enc->rsc_client = sde_rsc_client_create(SDE_RSC_INDEX, name, disp_info->is_primary ? SDE_RSC_PRIMARY_DISP_CLIENT : - SDE_RSC_EXTERNAL_DISP_CLIENT, intf_index); + SDE_RSC_EXTERNAL_DISP_CLIENT, intf_index + 1); if (IS_ERR_OR_NULL(sde_enc->rsc_client)) { SDE_DEBUG("sde rsc client create failed :%ld\n", PTR_ERR(sde_enc->rsc_client)); diff --git a/drivers/gpu/drm/msm/sde_hdcp_1x.c b/drivers/gpu/drm/msm/sde_hdcp_1x.c index 36484b2a1951..6f3339e8053e 100644 --- a/drivers/gpu/drm/msm/sde_hdcp_1x.c +++ b/drivers/gpu/drm/msm/sde_hdcp_1x.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2010-2018, The Linux Foundation. All rights reserved. +/* Copyright (c) 2010-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 @@ -214,6 +214,7 @@ struct sde_hdcp_1x { bool sink_r0_ready; bool reauth; bool ksv_ready; + bool force_encryption; enum sde_hdcp_state hdcp_state; struct HDCP_V2V1_MSG_TOPOLOGY current_tp; struct delayed_work hdcp_auth_work; @@ -1078,10 +1079,13 @@ static void sde_hdcp_1x_auth_work(struct work_struct *work) } /* - * program hw to enable encryption as soon as - * authentication is successful. + * Program h/w to enable encryption as soon as authentication is + * successful. This is applicable for HDMI sinks and HDCP 1.x compliance + * test cases. */ - hdcp1_set_enc(hdcp->hdcp1_handle, true); + if (hdcp->init_data.client_id == HDCP_CLIENT_HDMI || + hdcp->force_encryption) + hdcp1_set_enc(hdcp->hdcp1_handle, true); rc = sde_hdcp_1x_authentication_part1(hdcp); if (rc) @@ -1238,7 +1242,9 @@ static void sde_hdcp_1x_off(void *input) pr_debug("%s: Deleted hdcp auth work\n", SDE_HDCP_STATE_NAME); - hdcp1_set_enc(hdcp->hdcp1_handle, false); + if (hdcp->init_data.client_id == HDCP_CLIENT_HDMI || + hdcp->force_encryption) + hdcp1_set_enc(hdcp->hdcp1_handle, false); reg = DSS_REG_R(io, reg_set->reset); DSS_REG_W(io, reg_set->reset, reg | reg_set->reset_bit); @@ -1367,6 +1373,18 @@ static bool sde_hdcp_1x_feature_supported(void *input) return feature_supported; } +static void sde_hdcp_1x_force_encryption(void *input, bool enable) +{ + struct sde_hdcp_1x *hdcp = (struct sde_hdcp_1x *)input; + + if (!hdcp) { + pr_err("invalid input\n"); + return; + } + hdcp->force_encryption = enable; + pr_info("force_encryption=%d\n", hdcp->force_encryption); +} + static bool sde_hdcp_1x_sink_support(void *input) { return true; @@ -1490,6 +1508,7 @@ void *sde_hdcp_1x_init(struct sde_hdcp_init_data *init_data) .reauthenticate = sde_hdcp_1x_reauthenticate, .authenticate = sde_hdcp_1x_authenticate, .feature_supported = sde_hdcp_1x_feature_supported, + .force_encryption = sde_hdcp_1x_force_encryption, .sink_support = sde_hdcp_1x_sink_support, .off = sde_hdcp_1x_off }; @@ -1534,6 +1553,7 @@ void *sde_hdcp_1x_init(struct sde_hdcp_init_data *init_data) hdcp->hdcp_state = HDCP_STATE_INACTIVE; init_completion(&hdcp->r0_checked); init_completion(&hdcp->sink_r0_available); + hdcp->force_encryption = false; pr_debug("HDCP module initialized. HDCP_STATE=%s\n", SDE_HDCP_STATE_NAME); diff --git a/drivers/gpu/drm/msm/sde_rsc.c b/drivers/gpu/drm/msm/sde_rsc.c index 674fbff68b50..8f725ee0c90c 100644 --- a/drivers/gpu/drm/msm/sde_rsc.c +++ b/drivers/gpu/drm/msm/sde_rsc.c @@ -1097,7 +1097,9 @@ int sde_rsc_client_trigger_vote(struct sde_rsc_client *caller_client, rpmh_flush(rsc->disp_rsc); } - if (rsc->hw_ops.bwi_status && rsc->current_state == SDE_RSC_CMD_STATE) + if (rsc->hw_ops.bwi_status && + (rsc->current_state == SDE_RSC_CMD_STATE || + rsc->current_state == SDE_RSC_VID_STATE)) rsc->hw_ops.bwi_status(rsc, bw_increase); else if (rsc->hw_ops.tcs_use_ok) rsc->hw_ops.tcs_use_ok(rsc); diff --git a/drivers/gpu/drm/msm/shd/shd_drm.c b/drivers/gpu/drm/msm/shd/shd_drm.c index 738ba982b40c..58ce011473e7 100644 --- a/drivers/gpu/drm/msm/shd/shd_drm.c +++ b/drivers/gpu/drm/msm/shd/shd_drm.c @@ -335,6 +335,7 @@ static void shd_display_disable_base(struct drm_device *dev, base->enabled = false; base->connector->state->crtc = NULL; + base->connector->state->best_encoder = NULL; drm_connector_put(base->connector); } @@ -687,6 +688,9 @@ static int shd_conn_set_info_blob(struct drm_connector *connector, sde_kms_info_add_keyint(info, "max_blendstages", shd_display->stage_range.size); + sde_kms_info_add_keystr(info, "display type", + shd_display->display_type); + return 0; } @@ -1120,6 +1124,11 @@ static int shd_parse_display(struct shd_display *display) display->stage_range.start, display->stage_range.size); + display->display_type = of_get_property(of_node, + "qcom,display-type", NULL); + if (!display->display_type) + display->display_type = "unknown"; + error: return rc; } diff --git a/drivers/gpu/drm/msm/shd/shd_drm.h b/drivers/gpu/drm/msm/shd/shd_drm.h index 03aa95e511d8..35a927861358 100644 --- a/drivers/gpu/drm/msm/shd/shd_drm.h +++ b/drivers/gpu/drm/msm/shd/shd_drm.h @@ -53,6 +53,7 @@ struct shd_display_base { struct shd_display { struct drm_device *drm_dev; const char *name; + const char *display_type; struct shd_display_base *base; struct drm_bridge *bridge; diff --git a/drivers/gpu/drm/msm/shd/shd_hw.c b/drivers/gpu/drm/msm/shd/shd_hw.c index 6d11f25e6d72..1f6bd588793c 100644 --- a/drivers/gpu/drm/msm/shd/shd_hw.c +++ b/drivers/gpu/drm/msm/shd/shd_hw.c @@ -103,7 +103,6 @@ static void _sde_shd_hw_ctl_clear_blendstages_in_range( u32 mixermask[4] = {0, 0, 0, 0}; u32 start = hw_ctl->range.start + SDE_STAGE_0; u32 end = start + hw_ctl->range.size; - int pipes_per_stage; int i, j; u32 value, mask; const struct ctl_sspp_stage_reg_map *sspp_cfg; @@ -117,14 +116,8 @@ static void _sde_shd_hw_ctl_clear_blendstages_in_range( mixercfg[1] | mixercfg[2] | mixercfg[3])) goto end; - if (test_bit(SDE_MIXER_SOURCESPLIT, - &ctx->mixer_hw_caps->features)) - pipes_per_stage = PIPES_PER_STAGE; - else - pipes_per_stage = 1; - for (i = 1; i < SSPP_MAX; i++) { - for (j = 0 ; j < pipes_per_stage; j++) { + for (j = 0 ; j < CTL_SSPP_MAX_RECTS; j++) { sspp_cfg = &sspp_reg_cfg_tbl[i][j]; if (!sspp_cfg->bits) continue;