aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/sti/sti_hdmi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/sti/sti_hdmi.c')
-rw-r--r--drivers/gpu/drm/sti/sti_hdmi.c38
1 files changed, 6 insertions, 32 deletions
diff --git a/drivers/gpu/drm/sti/sti_hdmi.c b/drivers/gpu/drm/sti/sti_hdmi.c
index c9151849d604..ce2dcba679d5 100644
--- a/drivers/gpu/drm/sti/sti_hdmi.c
+++ b/drivers/gpu/drm/sti/sti_hdmi.c
@@ -95,7 +95,6 @@
95#define HDMI_CFG_HDCP_EN BIT(2) 95#define HDMI_CFG_HDCP_EN BIT(2)
96#define HDMI_CFG_ESS_NOT_OESS BIT(3) 96#define HDMI_CFG_ESS_NOT_OESS BIT(3)
97#define HDMI_CFG_H_SYNC_POL_NEG BIT(4) 97#define HDMI_CFG_H_SYNC_POL_NEG BIT(4)
98#define HDMI_CFG_SINK_TERM_DET_EN BIT(5)
99#define HDMI_CFG_V_SYNC_POL_NEG BIT(6) 98#define HDMI_CFG_V_SYNC_POL_NEG BIT(6)
100#define HDMI_CFG_422_EN BIT(8) 99#define HDMI_CFG_422_EN BIT(8)
101#define HDMI_CFG_FIFO_OVERRUN_CLR BIT(12) 100#define HDMI_CFG_FIFO_OVERRUN_CLR BIT(12)
@@ -159,7 +158,6 @@ struct sti_hdmi_connector {
159 struct drm_encoder *encoder; 158 struct drm_encoder *encoder;
160 struct sti_hdmi *hdmi; 159 struct sti_hdmi *hdmi;
161 struct drm_property *colorspace_property; 160 struct drm_property *colorspace_property;
162 struct drm_property *hdmi_mode_property;
163}; 161};
164 162
165#define to_sti_hdmi_connector(x) \ 163#define to_sti_hdmi_connector(x) \
@@ -266,12 +264,9 @@ static void hdmi_config(struct sti_hdmi *hdmi)
266 264
267 /* Select encryption type and the framing mode */ 265 /* Select encryption type and the framing mode */
268 conf |= HDMI_CFG_ESS_NOT_OESS; 266 conf |= HDMI_CFG_ESS_NOT_OESS;
269 if (hdmi->hdmi_mode == HDMI_MODE_HDMI) 267 if (hdmi->hdmi_monitor)
270 conf |= HDMI_CFG_HDMI_NOT_DVI; 268 conf |= HDMI_CFG_HDMI_NOT_DVI;
271 269
272 /* Enable sink term detection */
273 conf |= HDMI_CFG_SINK_TERM_DET_EN;
274
275 /* Set Hsync polarity */ 270 /* Set Hsync polarity */
276 if (hdmi->mode.flags & DRM_MODE_FLAG_NHSYNC) { 271 if (hdmi->mode.flags & DRM_MODE_FLAG_NHSYNC) {
277 DRM_DEBUG_DRIVER("H Sync Negative\n"); 272 DRM_DEBUG_DRIVER("H Sync Negative\n");
@@ -607,9 +602,6 @@ static void hdmi_dbg_cfg(struct seq_file *s, int val)
607 tmp = val & HDMI_CFG_ESS_NOT_OESS; 602 tmp = val & HDMI_CFG_ESS_NOT_OESS;
608 DBGFS_PRINT_STR("HDCP mode:", tmp ? "ESS enable" : "OESS enable"); 603 DBGFS_PRINT_STR("HDCP mode:", tmp ? "ESS enable" : "OESS enable");
609 seq_puts(s, "\t\t\t\t\t"); 604 seq_puts(s, "\t\t\t\t\t");
610 tmp = val & HDMI_CFG_SINK_TERM_DET_EN;
611 DBGFS_PRINT_STR("Sink term detection:", tmp ? "enable" : "disable");
612 seq_puts(s, "\t\t\t\t\t");
613 tmp = val & HDMI_CFG_H_SYNC_POL_NEG; 605 tmp = val & HDMI_CFG_H_SYNC_POL_NEG;
614 DBGFS_PRINT_STR("Hsync polarity:", tmp ? "inverted" : "normal"); 606 DBGFS_PRINT_STR("Hsync polarity:", tmp ? "inverted" : "normal");
615 seq_puts(s, "\t\t\t\t\t"); 607 seq_puts(s, "\t\t\t\t\t");
@@ -977,6 +969,11 @@ static int sti_hdmi_connector_get_modes(struct drm_connector *connector)
977 if (!edid) 969 if (!edid)
978 goto fail; 970 goto fail;
979 971
972 hdmi->hdmi_monitor = drm_detect_hdmi_monitor(edid);
973 DRM_DEBUG_KMS("%s : %dx%d cm\n",
974 (hdmi->hdmi_monitor ? "hdmi monitor" : "dvi monitor"),
975 edid->width_cm, edid->height_cm);
976
980 count = drm_add_edid_modes(connector, edid); 977 count = drm_add_edid_modes(connector, edid);
981 drm_mode_connector_update_edid_property(connector, edid); 978 drm_mode_connector_update_edid_property(connector, edid);
982 drm_edid_to_eld(connector, edid); 979 drm_edid_to_eld(connector, edid);
@@ -1060,19 +1057,6 @@ static void sti_hdmi_connector_init_property(struct drm_device *drm_dev,
1060 } 1057 }
1061 hdmi_connector->colorspace_property = prop; 1058 hdmi_connector->colorspace_property = prop;
1062 drm_object_attach_property(&connector->base, prop, hdmi->colorspace); 1059 drm_object_attach_property(&connector->base, prop, hdmi->colorspace);
1063
1064 /* hdmi_mode property */
1065 hdmi->hdmi_mode = DEFAULT_HDMI_MODE;
1066 prop = drm_property_create_enum(drm_dev, 0, "hdmi_mode",
1067 hdmi_mode_names,
1068 ARRAY_SIZE(hdmi_mode_names));
1069 if (!prop) {
1070 DRM_ERROR("fails to create colorspace property\n");
1071 return;
1072 }
1073 hdmi_connector->hdmi_mode_property = prop;
1074 drm_object_attach_property(&connector->base, prop, hdmi->hdmi_mode);
1075
1076} 1060}
1077 1061
1078static int 1062static int
@@ -1090,11 +1074,6 @@ sti_hdmi_connector_set_property(struct drm_connector *connector,
1090 return 0; 1074 return 0;
1091 } 1075 }
1092 1076
1093 if (property == hdmi_connector->hdmi_mode_property) {
1094 hdmi->hdmi_mode = val;
1095 return 0;
1096 }
1097
1098 DRM_ERROR("failed to set hdmi connector property\n"); 1077 DRM_ERROR("failed to set hdmi connector property\n");
1099 return -EINVAL; 1078 return -EINVAL;
1100} 1079}
@@ -1114,11 +1093,6 @@ sti_hdmi_connector_get_property(struct drm_connector *connector,
1114 return 0; 1093 return 0;
1115 } 1094 }
1116 1095
1117 if (property == hdmi_connector->hdmi_mode_property) {
1118 *val = hdmi->hdmi_mode;
1119 return 0;
1120 }
1121
1122 DRM_ERROR("failed to get hdmi connector property\n"); 1096 DRM_ERROR("failed to get hdmi connector property\n");
1123 return -EINVAL; 1097 return -EINVAL;
1124} 1098}