mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 12:58:12 -04:00
disp: msm: dp: add eDP support as a primary display
Add support for new eDP interface. As the protocol is similar to DP, the new eDP driver shall re-use the DP functionality wherever applicable. Change-Id: I0bcaa2bf2c401cbfb3470ecf232bf6643fb43a7d Signed-off-by: Sankeerth Billakanti <quic_sbillaka@quicinc.com> Signed-off-by: Nilesh Laad <quic_nlaad@quicinc.com>
This commit is contained in:
parent
4eb2953032
commit
372aa23cee
5 changed files with 41 additions and 5 deletions
|
|
@ -68,6 +68,10 @@ enum dp_display_states {
|
|||
DP_STATE_TUI_ACTIVE = BIT(11),
|
||||
};
|
||||
|
||||
struct dp_display_type_info {
|
||||
int display_type;
|
||||
};
|
||||
|
||||
static char *dp_display_state_name(enum dp_display_states state)
|
||||
{
|
||||
static char buf[SZ_1K];
|
||||
|
|
@ -203,8 +207,19 @@ struct dp_display_private {
|
|||
struct notifier_block usb_nb;
|
||||
};
|
||||
|
||||
static const struct dp_display_type_info dp_info = {
|
||||
.display_type = DRM_MODE_CONNECTOR_DisplayPort,
|
||||
};
|
||||
|
||||
static const struct dp_display_type_info edp_info = {
|
||||
.display_type = DRM_MODE_CONNECTOR_eDP,
|
||||
};
|
||||
|
||||
static const struct of_device_id dp_dt_match[] = {
|
||||
{.compatible = "qcom,dp-display"},
|
||||
{ .compatible = "qcom,dp-display",
|
||||
.data = &dp_info,},
|
||||
{ .compatible = "qcom,edp-display",
|
||||
.data = &edp_info,},
|
||||
{}
|
||||
};
|
||||
|
||||
|
|
@ -3596,6 +3611,8 @@ static int dp_display_probe(struct platform_device *pdev)
|
|||
{
|
||||
int rc = 0;
|
||||
struct dp_display_private *dp;
|
||||
const struct of_device_id *id;
|
||||
const struct dp_display_type_info *info;
|
||||
|
||||
if (!pdev || !pdev->dev.of_node) {
|
||||
DP_ERR("pdev not found\n");
|
||||
|
|
@ -3603,6 +3620,12 @@ static int dp_display_probe(struct platform_device *pdev)
|
|||
goto bail;
|
||||
}
|
||||
|
||||
id = of_match_node(dp_dt_match, pdev->dev.of_node);
|
||||
if (!id)
|
||||
return -ENODEV;
|
||||
|
||||
info = id->data;
|
||||
|
||||
dp = devm_kzalloc(&pdev->dev, sizeof(*dp), GFP_KERNEL);
|
||||
if (!dp) {
|
||||
rc = -ENOMEM;
|
||||
|
|
@ -3673,6 +3696,8 @@ static int dp_display_probe(struct platform_device *pdev)
|
|||
g_dp_display->mst_get_fixed_topology_display_type =
|
||||
dp_display_mst_get_fixed_topology_display_type;
|
||||
|
||||
g_dp_display->is_edp = (info->display_type == DRM_MODE_CONNECTOR_eDP) ? true : false;
|
||||
|
||||
rc = component_add(&pdev->dev, &dp_display_comp_ops);
|
||||
if (rc) {
|
||||
DP_ERR("component add failed, rc=%d\n", rc);
|
||||
|
|
|
|||
|
|
@ -71,6 +71,7 @@ struct dp_display {
|
|||
void *base_dp_panel;
|
||||
bool is_sst_connected;
|
||||
bool is_mst_supported;
|
||||
bool is_edp;
|
||||
bool dsc_cont_pps;
|
||||
u32 max_pclk_khz;
|
||||
void *dp_mst_prv_info;
|
||||
|
|
|
|||
|
|
@ -457,8 +457,15 @@ int dp_connector_get_info(struct drm_connector *connector,
|
|||
info->num_of_h_tiles = 1;
|
||||
info->h_tile_instance[0] = 0;
|
||||
info->is_connected = display->is_sst_connected;
|
||||
info->capabilities = MSM_DISPLAY_CAP_VID_MODE | MSM_DISPLAY_CAP_EDID |
|
||||
MSM_DISPLAY_CAP_HOT_PLUG;
|
||||
info->curr_panel_mode = MSM_DISPLAY_VIDEO_MODE;
|
||||
info->capabilities = MSM_DISPLAY_CAP_VID_MODE | MSM_DISPLAY_CAP_EDID;
|
||||
|
||||
if (display && display->is_edp) {
|
||||
info->intf_type = DRM_MODE_CONNECTOR_eDP;
|
||||
info->display_type = SDE_CONNECTOR_PRIMARY;
|
||||
} else {
|
||||
info->capabilities |= MSM_DISPLAY_CAP_HOT_PLUG;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
* Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
* Copyright (c) 2014-2021, The Linux Foundation. All rights reserved.
|
||||
* Copyright (C) 2013 Red Hat
|
||||
* Author: Rob Clark <robdclark@gmail.com>
|
||||
|
|
@ -4858,6 +4858,9 @@ static int sde_encoder_setup_display(struct sde_encoder_virt *sde_enc,
|
|||
if (disp_info->intf_type == DRM_MODE_CONNECTOR_DSI) {
|
||||
*drm_enc_mode = DRM_MODE_ENCODER_DSI;
|
||||
intf_type = INTF_DSI;
|
||||
} else if (disp_info->intf_type == DRM_MODE_CONNECTOR_eDP) {
|
||||
*drm_enc_mode = DRM_MODE_ENCODER_TMDS;
|
||||
intf_type = INTF_DP;
|
||||
} else if (disp_info->intf_type == DRM_MODE_CONNECTOR_HDMIA) {
|
||||
*drm_enc_mode = DRM_MODE_ENCODER_TMDS;
|
||||
intf_type = INTF_HDMI;
|
||||
|
|
|
|||
|
|
@ -1957,7 +1957,7 @@ static int _sde_kms_setup_displays(struct drm_device *dev,
|
|||
display,
|
||||
&dp_ops,
|
||||
DRM_CONNECTOR_POLL_HPD,
|
||||
DRM_MODE_CONNECTOR_DisplayPort);
|
||||
info.intf_type);
|
||||
if (connector) {
|
||||
priv->encoders[priv->num_encoders++] = encoder;
|
||||
priv->connectors[priv->num_connectors++] = connector;
|
||||
|
|
|
|||
Loading…
Reference in a new issue