aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2015-08-20 20:44:03 -0400
committerDave Airlie <airlied@redhat.com>2015-08-20 20:44:03 -0400
commitbef7d1961c81f2b68c9af2dc12f7956b110f73a7 (patch)
tree73c63e55c1fd32b46afadcb7e2481d95aec5669a
parent1c73d3b10e6976919ce3caa5110e05e04326a7ec (diff)
parented63baaf849e91c84ac3e042b1fd6a0af07c16f3 (diff)
Merge tag 'drm-intel-fixes-2015-08-20' of git://anongit.freedesktop.org/drm-intel into drm-fixes
Revert of a VBT parsing commit that should've been queued for drm-next, not v4.2. The revert unbreaks Braswell among other things. Also on Braswell removal of DP HBR2/TP3 and intermediate eDP frequency support. The code was optimistically added based on incorrect documentation; the platform does not support them. These are cc: stable. Finally a gpu state fix from Chris, also cc: stable. * tag 'drm-intel-fixes-2015-08-20' of git://anongit.freedesktop.org/drm-intel: 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/i915: Flag the execlists context object as dirty after every use
-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
3 files changed, 28 insertions, 36 deletions
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;