diff options
author | Dave Airlie <airlied@redhat.com> | 2016-11-17 19:33:28 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2016-11-17 19:33:28 -0500 |
commit | c2ee69d83b2b14d68ad7ee1773fc1d40e97f201d (patch) | |
tree | 769817629d06b60ec5122671dd2b850b6c86e3b1 | |
parent | 7d40c2cf080950eab63a0747482027f5f1dae0d3 (diff) | |
parent | bc9db5ad3253c8e17969bd802c47b73e63f125ab (diff) |
Merge tag 'drm-intel-fixes-2016-11-17' of ssh://git.freedesktop.org/git/drm-intel into drm-fixes
i915 misc fixes.
* tag 'drm-intel-fixes-2016-11-17' of ssh://git.freedesktop.org/git/drm-intel:
drm/i915: Assume non-DP++ port if dvo_port is HDMI and there's no AUX ch specified in the VBT
drm/i915: Refresh that status of MST capable connectors in ->detect()
drm/i915: Grab the rotation from the passed plane state for VLV sprites
drm/i915: Mark CPU cache as dirty when used for rendering
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_execbuffer.c | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_bios.c | 30 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_dp.c | 10 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_sprite.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_vbt_defs.h | 3 |
5 files changed, 33 insertions, 20 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c index 7adb4c77cc7f..a218c2e395e7 100644 --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c | |||
@@ -1281,6 +1281,12 @@ i915_gem_validate_context(struct drm_device *dev, struct drm_file *file, | |||
1281 | return ctx; | 1281 | return ctx; |
1282 | } | 1282 | } |
1283 | 1283 | ||
1284 | static bool gpu_write_needs_clflush(struct drm_i915_gem_object *obj) | ||
1285 | { | ||
1286 | return !(obj->cache_level == I915_CACHE_NONE || | ||
1287 | obj->cache_level == I915_CACHE_WT); | ||
1288 | } | ||
1289 | |||
1284 | void i915_vma_move_to_active(struct i915_vma *vma, | 1290 | void i915_vma_move_to_active(struct i915_vma *vma, |
1285 | struct drm_i915_gem_request *req, | 1291 | struct drm_i915_gem_request *req, |
1286 | unsigned int flags) | 1292 | unsigned int flags) |
@@ -1311,6 +1317,8 @@ void i915_vma_move_to_active(struct i915_vma *vma, | |||
1311 | 1317 | ||
1312 | /* update for the implicit flush after a batch */ | 1318 | /* update for the implicit flush after a batch */ |
1313 | obj->base.write_domain &= ~I915_GEM_GPU_DOMAINS; | 1319 | obj->base.write_domain &= ~I915_GEM_GPU_DOMAINS; |
1320 | if (!obj->cache_dirty && gpu_write_needs_clflush(obj)) | ||
1321 | obj->cache_dirty = true; | ||
1314 | } | 1322 | } |
1315 | 1323 | ||
1316 | if (flags & EXEC_OBJECT_NEEDS_FENCE) | 1324 | if (flags & EXEC_OBJECT_NEEDS_FENCE) |
diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c index 1f8af87c6294..cf2560708e03 100644 --- a/drivers/gpu/drm/i915/intel_bios.c +++ b/drivers/gpu/drm/i915/intel_bios.c | |||
@@ -1143,7 +1143,7 @@ static void parse_ddi_port(struct drm_i915_private *dev_priv, enum port port, | |||
1143 | if (!child) | 1143 | if (!child) |
1144 | return; | 1144 | return; |
1145 | 1145 | ||
1146 | aux_channel = child->raw[25]; | 1146 | aux_channel = child->common.aux_channel; |
1147 | ddc_pin = child->common.ddc_pin; | 1147 | ddc_pin = child->common.ddc_pin; |
1148 | 1148 | ||
1149 | is_dvi = child->common.device_type & DEVICE_TYPE_TMDS_DVI_SIGNALING; | 1149 | is_dvi = child->common.device_type & DEVICE_TYPE_TMDS_DVI_SIGNALING; |
@@ -1673,7 +1673,8 @@ bool intel_bios_is_port_edp(struct drm_i915_private *dev_priv, enum port port) | |||
1673 | return false; | 1673 | return false; |
1674 | } | 1674 | } |
1675 | 1675 | ||
1676 | bool intel_bios_is_port_dp_dual_mode(struct drm_i915_private *dev_priv, enum port port) | 1676 | static bool child_dev_is_dp_dual_mode(const union child_device_config *p_child, |
1677 | enum port port) | ||
1677 | { | 1678 | { |
1678 | static const struct { | 1679 | static const struct { |
1679 | u16 dp, hdmi; | 1680 | u16 dp, hdmi; |
@@ -1687,22 +1688,35 @@ bool intel_bios_is_port_dp_dual_mode(struct drm_i915_private *dev_priv, enum por | |||
1687 | [PORT_D] = { DVO_PORT_DPD, DVO_PORT_HDMID, }, | 1688 | [PORT_D] = { DVO_PORT_DPD, DVO_PORT_HDMID, }, |
1688 | [PORT_E] = { DVO_PORT_DPE, DVO_PORT_HDMIE, }, | 1689 | [PORT_E] = { DVO_PORT_DPE, DVO_PORT_HDMIE, }, |
1689 | }; | 1690 | }; |
1690 | int i; | ||
1691 | 1691 | ||
1692 | if (port == PORT_A || port >= ARRAY_SIZE(port_mapping)) | 1692 | if (port == PORT_A || port >= ARRAY_SIZE(port_mapping)) |
1693 | return false; | 1693 | return false; |
1694 | 1694 | ||
1695 | if (!dev_priv->vbt.child_dev_num) | 1695 | if ((p_child->common.device_type & DEVICE_TYPE_DP_DUAL_MODE_BITS) != |
1696 | (DEVICE_TYPE_DP_DUAL_MODE & DEVICE_TYPE_DP_DUAL_MODE_BITS)) | ||
1696 | return false; | 1697 | return false; |
1697 | 1698 | ||
1699 | if (p_child->common.dvo_port == port_mapping[port].dp) | ||
1700 | return true; | ||
1701 | |||
1702 | /* Only accept a HDMI dvo_port as DP++ if it has an AUX channel */ | ||
1703 | if (p_child->common.dvo_port == port_mapping[port].hdmi && | ||
1704 | p_child->common.aux_channel != 0) | ||
1705 | return true; | ||
1706 | |||
1707 | return false; | ||
1708 | } | ||
1709 | |||
1710 | bool intel_bios_is_port_dp_dual_mode(struct drm_i915_private *dev_priv, | ||
1711 | enum port port) | ||
1712 | { | ||
1713 | int i; | ||
1714 | |||
1698 | for (i = 0; i < dev_priv->vbt.child_dev_num; i++) { | 1715 | for (i = 0; i < dev_priv->vbt.child_dev_num; i++) { |
1699 | const union child_device_config *p_child = | 1716 | const union child_device_config *p_child = |
1700 | &dev_priv->vbt.child_dev[i]; | 1717 | &dev_priv->vbt.child_dev[i]; |
1701 | 1718 | ||
1702 | if ((p_child->common.dvo_port == port_mapping[port].dp || | 1719 | if (child_dev_is_dp_dual_mode(p_child, port)) |
1703 | p_child->common.dvo_port == port_mapping[port].hdmi) && | ||
1704 | (p_child->common.device_type & DEVICE_TYPE_DP_DUAL_MODE_BITS) == | ||
1705 | (DEVICE_TYPE_DP_DUAL_MODE & DEVICE_TYPE_DP_DUAL_MODE_BITS)) | ||
1706 | return true; | 1720 | return true; |
1707 | } | 1721 | } |
1708 | 1722 | ||
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 3581b5a7f716..bf344d08356a 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
@@ -4463,21 +4463,11 @@ static enum drm_connector_status | |||
4463 | intel_dp_detect(struct drm_connector *connector, bool force) | 4463 | intel_dp_detect(struct drm_connector *connector, bool force) |
4464 | { | 4464 | { |
4465 | struct intel_dp *intel_dp = intel_attached_dp(connector); | 4465 | struct intel_dp *intel_dp = intel_attached_dp(connector); |
4466 | struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp); | ||
4467 | struct intel_encoder *intel_encoder = &intel_dig_port->base; | ||
4468 | enum drm_connector_status status = connector->status; | 4466 | enum drm_connector_status status = connector->status; |
4469 | 4467 | ||
4470 | DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n", | 4468 | DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n", |
4471 | connector->base.id, connector->name); | 4469 | connector->base.id, connector->name); |
4472 | 4470 | ||
4473 | if (intel_dp->is_mst) { | ||
4474 | /* MST devices are disconnected from a monitor POV */ | ||
4475 | intel_dp_unset_edid(intel_dp); | ||
4476 | if (intel_encoder->type != INTEL_OUTPUT_EDP) | ||
4477 | intel_encoder->type = INTEL_OUTPUT_DP; | ||
4478 | return connector_status_disconnected; | ||
4479 | } | ||
4480 | |||
4481 | /* If full detect is not performed yet, do a full detect */ | 4471 | /* If full detect is not performed yet, do a full detect */ |
4482 | if (!intel_dp->detect_done) | 4472 | if (!intel_dp->detect_done) |
4483 | status = intel_dp_long_pulse(intel_dp->attached_connector); | 4473 | status = intel_dp_long_pulse(intel_dp->attached_connector); |
diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c index 73a521fdf1bd..dbed12c484c9 100644 --- a/drivers/gpu/drm/i915/intel_sprite.c +++ b/drivers/gpu/drm/i915/intel_sprite.c | |||
@@ -358,7 +358,7 @@ vlv_update_plane(struct drm_plane *dplane, | |||
358 | int plane = intel_plane->plane; | 358 | int plane = intel_plane->plane; |
359 | u32 sprctl; | 359 | u32 sprctl; |
360 | u32 sprsurf_offset, linear_offset; | 360 | u32 sprsurf_offset, linear_offset; |
361 | unsigned int rotation = dplane->state->rotation; | 361 | unsigned int rotation = plane_state->base.rotation; |
362 | const struct drm_intel_sprite_colorkey *key = &plane_state->ckey; | 362 | const struct drm_intel_sprite_colorkey *key = &plane_state->ckey; |
363 | int crtc_x = plane_state->base.dst.x1; | 363 | int crtc_x = plane_state->base.dst.x1; |
364 | int crtc_y = plane_state->base.dst.y1; | 364 | int crtc_y = plane_state->base.dst.y1; |
diff --git a/drivers/gpu/drm/i915/intel_vbt_defs.h b/drivers/gpu/drm/i915/intel_vbt_defs.h index 68db9621f1f0..8886cab19f98 100644 --- a/drivers/gpu/drm/i915/intel_vbt_defs.h +++ b/drivers/gpu/drm/i915/intel_vbt_defs.h | |||
@@ -280,7 +280,8 @@ struct common_child_dev_config { | |||
280 | u8 dp_support:1; | 280 | u8 dp_support:1; |
281 | u8 tmds_support:1; | 281 | u8 tmds_support:1; |
282 | u8 support_reserved:5; | 282 | u8 support_reserved:5; |
283 | u8 not_common3[12]; | 283 | u8 aux_channel; |
284 | u8 not_common3[11]; | ||
284 | u8 iboost_level; | 285 | u8 iboost_level; |
285 | } __packed; | 286 | } __packed; |
286 | 287 | ||