aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-08-21 13:46:56 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-08-21 13:46:56 -0400
commitdc9c12f46fcf01d42756a73c681f18a99e7223b6 (patch)
treedc9ac28ed53220f3bf745d695242fc39984fc5da
parent0bad90985d39e69ca035fdd70bcc743812641d18 (diff)
parent7f98ca454ad373fc1b76be804fa7138ff68c1d27 (diff)
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Pull drm fixes from Dave Airlie: "A bunch of i915 fixes, one revert a VBT fix that was a bit premature, and some braswell feature removal that the hw actually didn't support. One radeon race fix at boot, and one hlcdc build fix, one fix from Russell that fixes build as well with new audio features. This is hopefully all I have until -next" * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux: drm/radeon: fix hotplug race at startup drm/edid: add function to help find SADs drm/i915: Avoid TP3 on CHV drm/i915: remove HBR2 from chv supported list Revert "drm/i915: Add eDP intermediate frequencies for CHV" Revert "drm/i915: Allow parsing of variable size child device entries from VBT" drm/atmel-hlcdc: Compile suspend/resume for PM_SLEEP only drm/i915: Flag the execlists context object as dirty after every use
-rw-r--r--drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c2
-rw-r--r--drivers/gpu/drm/i915/intel_bios.c27
-rw-r--r--drivers/gpu/drm/i915/intel_dp.c35
-rw-r--r--drivers/gpu/drm/i915/intel_lrc.c2
-rw-r--r--drivers/gpu/drm/radeon/radeon_irq_kms.c5
-rw-r--r--include/drm/drm_edid.h19
6 files changed, 53 insertions, 37 deletions
diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
index 6fad1f9648f3..ef6182bc8e5e 100644
--- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
+++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
@@ -559,7 +559,7 @@ static int atmel_hlcdc_dc_drm_remove(struct platform_device *pdev)
559 return 0; 559 return 0;
560} 560}
561 561
562#ifdef CONFIG_PM 562#ifdef CONFIG_PM_SLEEP
563static int atmel_hlcdc_dc_drm_suspend(struct device *dev) 563static int atmel_hlcdc_dc_drm_suspend(struct device *dev)
564{ 564{
565 struct drm_device *drm_dev = dev_get_drvdata(dev); 565 struct drm_device *drm_dev = dev_get_drvdata(dev);
diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
index 3dcd59e694db..198fc3c3291b 100644
--- a/drivers/gpu/drm/i915/intel_bios.c
+++ b/drivers/gpu/drm/i915/intel_bios.c
@@ -1075,34 +1075,15 @@ parse_device_mapping(struct drm_i915_private *dev_priv,
1075 const union child_device_config *p_child; 1075 const union child_device_config *p_child;
1076 union child_device_config *child_dev_ptr; 1076 union child_device_config *child_dev_ptr;
1077 int i, child_device_num, count; 1077 int i, child_device_num, count;
1078 u8 expected_size; 1078 u16 block_size;
1079 u16 block_size;
1080 1079
1081 p_defs = find_section(bdb, BDB_GENERAL_DEFINITIONS); 1080 p_defs = find_section(bdb, BDB_GENERAL_DEFINITIONS);
1082 if (!p_defs) { 1081 if (!p_defs) {
1083 DRM_DEBUG_KMS("No general definition block is found, no devices defined.\n"); 1082 DRM_DEBUG_KMS("No general definition block is found, no devices defined.\n");
1084 return; 1083 return;
1085 } 1084 }
1086 if (bdb->version < 195) { 1085 if (p_defs->child_dev_size < sizeof(*p_child)) {
1087 expected_size = 33; 1086 DRM_ERROR("General definiton block child device size is too small.\n");
1088 } else if (bdb->version == 195) {
1089 expected_size = 37;
1090 } else if (bdb->version <= 197) {
1091 expected_size = 38;
1092 } else {
1093 expected_size = 38;
1094 DRM_DEBUG_DRIVER("Expected child_device_config size for BDB version %u not known; assuming %u\n",
1095 expected_size, bdb->version);
1096 }
1097
1098 if (expected_size > sizeof(*p_child)) {
1099 DRM_ERROR("child_device_config cannot fit in p_child\n");
1100 return;
1101 }
1102
1103 if (p_defs->child_dev_size != expected_size) {
1104 DRM_ERROR("Size mismatch; child_device_config size=%u (expected %u); bdb->version: %u\n",
1105 p_defs->child_dev_size, expected_size, bdb->version);
1106 return; 1087 return;
1107 } 1088 }
1108 /* get the block size of general definitions */ 1089 /* get the block size of general definitions */
@@ -1149,7 +1130,7 @@ parse_device_mapping(struct drm_i915_private *dev_priv,
1149 1130
1150 child_dev_ptr = dev_priv->vbt.child_dev + count; 1131 child_dev_ptr = dev_priv->vbt.child_dev + count;
1151 count++; 1132 count++;
1152 memcpy(child_dev_ptr, p_child, p_defs->child_dev_size); 1133 memcpy(child_dev_ptr, p_child, sizeof(*p_child));
1153 } 1134 }
1154 return; 1135 return;
1155} 1136}
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 6e8faa253792..1df0e1fe235f 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -93,9 +93,6 @@ static const struct dp_link_dpll chv_dpll[] = {
93 93
94static const int skl_rates[] = { 162000, 216000, 270000, 94static const int skl_rates[] = { 162000, 216000, 270000,
95 324000, 432000, 540000 }; 95 324000, 432000, 540000 };
96static const int chv_rates[] = { 162000, 202500, 210000, 216000,
97 243000, 270000, 324000, 405000,
98 420000, 432000, 540000 };
99static const int default_rates[] = { 162000, 270000, 540000 }; 96static const int default_rates[] = { 162000, 270000, 540000 };
100 97
101/** 98/**
@@ -1169,24 +1166,31 @@ intel_dp_sink_rates(struct intel_dp *intel_dp, const int **sink_rates)
1169 return (intel_dp_max_link_bw(intel_dp) >> 3) + 1; 1166 return (intel_dp_max_link_bw(intel_dp) >> 3) + 1;
1170} 1167}
1171 1168
1169static bool intel_dp_source_supports_hbr2(struct drm_device *dev)
1170{
1171 /* WaDisableHBR2:skl */
1172 if (IS_SKYLAKE(dev) && INTEL_REVID(dev) <= SKL_REVID_B0)
1173 return false;
1174
1175 if ((IS_HASWELL(dev) && !IS_HSW_ULX(dev)) || IS_BROADWELL(dev) ||
1176 (INTEL_INFO(dev)->gen >= 9))
1177 return true;
1178 else
1179 return false;
1180}
1181
1172static int 1182static int
1173intel_dp_source_rates(struct drm_device *dev, const int **source_rates) 1183intel_dp_source_rates(struct drm_device *dev, const int **source_rates)
1174{ 1184{
1175 if (IS_SKYLAKE(dev)) { 1185 if (IS_SKYLAKE(dev)) {
1176 *source_rates = skl_rates; 1186 *source_rates = skl_rates;
1177 return ARRAY_SIZE(skl_rates); 1187 return ARRAY_SIZE(skl_rates);
1178 } else if (IS_CHERRYVIEW(dev)) {
1179 *source_rates = chv_rates;
1180 return ARRAY_SIZE(chv_rates);
1181 } 1188 }
1182 1189
1183 *source_rates = default_rates; 1190 *source_rates = default_rates;
1184 1191
1185 if (IS_SKYLAKE(dev) && INTEL_REVID(dev) <= SKL_REVID_B0) 1192 /* This depends on the fact that 5.4 is last value in the array */
1186 /* WaDisableHBR2:skl */ 1193 if (intel_dp_source_supports_hbr2(dev))
1187 return (DP_LINK_BW_2_7 >> 3) + 1;
1188 else if (INTEL_INFO(dev)->gen >= 8 ||
1189 (IS_HASWELL(dev) && !IS_HSW_ULX(dev)))
1190 return (DP_LINK_BW_5_4 >> 3) + 1; 1194 return (DP_LINK_BW_5_4 >> 3) + 1;
1191 else 1195 else
1192 return (DP_LINK_BW_2_7 >> 3) + 1; 1196 return (DP_LINK_BW_2_7 >> 3) + 1;
@@ -3941,10 +3945,15 @@ intel_dp_get_dpcd(struct intel_dp *intel_dp)
3941 } 3945 }
3942 } 3946 }
3943 3947
3944 /* Training Pattern 3 support, both source and sink */ 3948 /* Training Pattern 3 support, Intel platforms that support HBR2 alone
3949 * have support for TP3 hence that check is used along with dpcd check
3950 * to ensure TP3 can be enabled.
3951 * SKL < B0: due it's WaDisableHBR2 is the only exception where TP3 is
3952 * supported but still not enabled.
3953 */
3945 if (intel_dp->dpcd[DP_DPCD_REV] >= 0x12 && 3954 if (intel_dp->dpcd[DP_DPCD_REV] >= 0x12 &&
3946 intel_dp->dpcd[DP_MAX_LANE_COUNT] & DP_TPS3_SUPPORTED && 3955 intel_dp->dpcd[DP_MAX_LANE_COUNT] & DP_TPS3_SUPPORTED &&
3947 (IS_HASWELL(dev_priv) || INTEL_INFO(dev_priv)->gen >= 8)) { 3956 intel_dp_source_supports_hbr2(dev)) {
3948 intel_dp->use_tps3 = true; 3957 intel_dp->use_tps3 = true;
3949 DRM_DEBUG_KMS("Displayport TPS3 supported\n"); 3958 DRM_DEBUG_KMS("Displayport TPS3 supported\n");
3950 } else 3959 } else
diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
index 9b74ffae5f5a..7f2161a1ff5d 100644
--- a/drivers/gpu/drm/i915/intel_lrc.c
+++ b/drivers/gpu/drm/i915/intel_lrc.c
@@ -1012,6 +1012,8 @@ static int intel_lr_context_pin(struct intel_engine_cs *ring,
1012 ret = intel_pin_and_map_ringbuffer_obj(ring->dev, ringbuf); 1012 ret = intel_pin_and_map_ringbuffer_obj(ring->dev, ringbuf);
1013 if (ret) 1013 if (ret)
1014 goto unpin_ctx_obj; 1014 goto unpin_ctx_obj;
1015
1016 ctx_obj->dirty = true;
1015 } 1017 }
1016 1018
1017 return ret; 1019 return ret;
diff --git a/drivers/gpu/drm/radeon/radeon_irq_kms.c b/drivers/gpu/drm/radeon/radeon_irq_kms.c
index 1162bfa464f3..171d3e43c30c 100644
--- a/drivers/gpu/drm/radeon/radeon_irq_kms.c
+++ b/drivers/gpu/drm/radeon/radeon_irq_kms.c
@@ -79,6 +79,11 @@ static void radeon_hotplug_work_func(struct work_struct *work)
79 struct drm_mode_config *mode_config = &dev->mode_config; 79 struct drm_mode_config *mode_config = &dev->mode_config;
80 struct drm_connector *connector; 80 struct drm_connector *connector;
81 81
82 /* we can race here at startup, some boards seem to trigger
83 * hotplug irqs when they shouldn't. */
84 if (!rdev->mode_info.mode_config_initialized)
85 return;
86
82 mutex_lock(&mode_config->mutex); 87 mutex_lock(&mode_config->mutex);
83 if (mode_config->num_connector) { 88 if (mode_config->num_connector) {
84 list_for_each_entry(connector, &mode_config->connector_list, head) 89 list_for_each_entry(connector, &mode_config->connector_list, head)
diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
index 799050198323..53c53c459b15 100644
--- a/include/drm/drm_edid.h
+++ b/include/drm/drm_edid.h
@@ -348,6 +348,25 @@ static inline int drm_eld_mnl(const uint8_t *eld)
348} 348}
349 349
350/** 350/**
351 * drm_eld_sad - Get ELD SAD structures.
352 * @eld: pointer to an eld memory structure with sad_count set
353 */
354static inline const uint8_t *drm_eld_sad(const uint8_t *eld)
355{
356 unsigned int ver, mnl;
357
358 ver = (eld[DRM_ELD_VER] & DRM_ELD_VER_MASK) >> DRM_ELD_VER_SHIFT;
359 if (ver != 2 && ver != 31)
360 return NULL;
361
362 mnl = drm_eld_mnl(eld);
363 if (mnl > 16)
364 return NULL;
365
366 return eld + DRM_ELD_CEA_SAD(mnl, 0);
367}
368
369/**
351 * drm_eld_sad_count - Get ELD SAD count. 370 * drm_eld_sad_count - Get ELD SAD count.
352 * @eld: pointer to an eld memory structure with sad_count set 371 * @eld: pointer to an eld memory structure with sad_count set
353 */ 372 */