summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSuprith Malligere Shankaregowda <supgow@codeaurora.org>2018-07-05 17:24:45 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2018-07-15 22:11:04 -0700
commit225c6e1feeda95ebf2c54e9324a64494c3bc2c2d (patch)
treeec0fdf0e20c743ab39e5d613566984c13d846409
parent65a0403464fde6fa34b9dbddaeed9eceef339c80 (diff)
drm: msm: add skip_ddc support for hdmi display
HDMI display on auto boards has disabled pluggable function and hardcoded 1080p mode for output. So ddc related function should also be skipped. Otherwise, some error messages are printed when accessing ddc. Change-Id: I42694b0586dd870e7881b422cd3d6ee960276b17 Signed-off-by: Suprith Malligere Shankaregowda <supgow@codeaurora.org> Signed-off-by: Guchun Chen <guchunc@codeaurora.org>
-rw-r--r--Documentation/devicetree/bindings/drm/msm/hdmi-display.txt1
-rw-r--r--drivers/gpu/drm/msm/hdmi-staging/sde_hdmi.c7
-rw-r--r--drivers/gpu/drm/msm/hdmi-staging/sde_hdmi.h1
-rw-r--r--drivers/gpu/drm/msm/hdmi-staging/sde_hdmi_bridge.c9
4 files changed, 15 insertions, 3 deletions
diff --git a/Documentation/devicetree/bindings/drm/msm/hdmi-display.txt b/Documentation/devicetree/bindings/drm/msm/hdmi-display.txt
index 9329fb74dea0..762103277593 100644
--- a/Documentation/devicetree/bindings/drm/msm/hdmi-display.txt
+++ b/Documentation/devicetree/bindings/drm/msm/hdmi-display.txt
@@ -8,6 +8,7 @@ Optional properties:
- qcom,display-type: display type of this manager. It could be "primary",
"secondary", "tertiary", etc.
- qcom,non-pluggable: Boolean to indicate if display is non pluggable.
+- qcom,skip_ddc: Boolean to indicate if display skips ddc function.
- qcom,customize-modes: Customized modes when it's non pluggable display.
- qcom,customize-mode-id: Customized mode node.
- qcom,mode-name: String which indicates the mode name which shall be used
diff --git a/drivers/gpu/drm/msm/hdmi-staging/sde_hdmi.c b/drivers/gpu/drm/msm/hdmi-staging/sde_hdmi.c
index 46cc521a09f3..302ed39d9218 100644
--- a/drivers/gpu/drm/msm/hdmi-staging/sde_hdmi.c
+++ b/drivers/gpu/drm/msm/hdmi-staging/sde_hdmi.c
@@ -3069,6 +3069,8 @@ static int _sde_hdmi_parse_dt(struct device_node *node,
{
int rc = 0;
+ struct hdmi *hdmi = display->ctrl.ctrl;
+
display->name = of_get_property(node, "label", NULL);
display->display_type = of_get_property(node,
@@ -3079,6 +3081,11 @@ static int _sde_hdmi_parse_dt(struct device_node *node,
display->non_pluggable = of_property_read_bool(node,
"qcom,non-pluggable");
+ display->skip_ddc = of_property_read_bool(node,
+ "qcom,skip_ddc");
+ if (!display->non_pluggable)
+ hdmi_i2c_destroy(hdmi->i2c);
+
rc = _sde_hdmi_parse_dt_modes(node, &display->mode_list,
&display->num_of_modes);
if (rc)
diff --git a/drivers/gpu/drm/msm/hdmi-staging/sde_hdmi.h b/drivers/gpu/drm/msm/hdmi-staging/sde_hdmi.h
index 9cf807e829c7..2aa8d9496c5b 100644
--- a/drivers/gpu/drm/msm/hdmi-staging/sde_hdmi.h
+++ b/drivers/gpu/drm/msm/hdmi-staging/sde_hdmi.h
@@ -154,6 +154,7 @@ struct sde_hdmi {
struct sde_edid_ctrl *edid_ctrl;
bool non_pluggable;
+ bool skip_ddc;
u32 num_of_modes;
struct list_head mode_list;
struct drm_display_mode mode;
diff --git a/drivers/gpu/drm/msm/hdmi-staging/sde_hdmi_bridge.c b/drivers/gpu/drm/msm/hdmi-staging/sde_hdmi_bridge.c
index bae6b1c84420..2d65fc924f07 100644
--- a/drivers/gpu/drm/msm/hdmi-staging/sde_hdmi_bridge.c
+++ b/drivers/gpu/drm/msm/hdmi-staging/sde_hdmi_bridge.c
@@ -512,8 +512,8 @@ static void _sde_hdmi_bridge_pre_enable(struct drm_bridge *bridge)
}
hdmi->power_on = true;
}
-
- _sde_hdmi_bridge_setup_scrambler(hdmi, &display->mode);
+ if (!display->skip_ddc)
+ _sde_hdmi_bridge_setup_scrambler(hdmi, &display->mode);
if (phy)
phy->funcs->powerup(phy, hdmi->pixclock);
@@ -822,6 +822,8 @@ static u32 _sde_hdmi_choose_best_format(struct hdmi *hdmi,
*/
int dc_format;
struct drm_connector *connector = hdmi->connector;
+ struct sde_connector *c_conn = to_sde_connector(connector);
+ struct sde_hdmi *display = (struct sde_hdmi *)c_conn->display;
dc_format = sde_hdmi_sink_dc_support(connector, mode);
if (dc_format & MSM_MODE_FLAG_RGB444_DC_ENABLE)
@@ -835,7 +837,8 @@ static u32 _sde_hdmi_choose_best_format(struct hdmi *hdmi,
else if (mode->flags & DRM_MODE_FLAG_SUPPORTS_YUV)
return MSM_MODE_FLAG_COLOR_FORMAT_YCBCR420;
- SDE_ERROR("Can't get available best display format\n");
+ if (display && !display->non_pluggable)
+ SDE_ERROR("Can't get available best display format\n");
return MSM_MODE_FLAG_COLOR_FORMAT_RGB444;
}