Commit c2ee69d8 authored by Dave Airlie's avatar Dave Airlie

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
parents 7d40c2cf bc9db5ad
...@@ -1281,6 +1281,12 @@ i915_gem_validate_context(struct drm_device *dev, struct drm_file *file, ...@@ -1281,6 +1281,12 @@ i915_gem_validate_context(struct drm_device *dev, struct drm_file *file,
return ctx; return ctx;
} }
static bool gpu_write_needs_clflush(struct drm_i915_gem_object *obj)
{
return !(obj->cache_level == I915_CACHE_NONE ||
obj->cache_level == I915_CACHE_WT);
}
void i915_vma_move_to_active(struct i915_vma *vma, void i915_vma_move_to_active(struct i915_vma *vma,
struct drm_i915_gem_request *req, struct drm_i915_gem_request *req,
unsigned int flags) unsigned int flags)
...@@ -1311,6 +1317,8 @@ void i915_vma_move_to_active(struct i915_vma *vma, ...@@ -1311,6 +1317,8 @@ void i915_vma_move_to_active(struct i915_vma *vma,
/* update for the implicit flush after a batch */ /* update for the implicit flush after a batch */
obj->base.write_domain &= ~I915_GEM_GPU_DOMAINS; obj->base.write_domain &= ~I915_GEM_GPU_DOMAINS;
if (!obj->cache_dirty && gpu_write_needs_clflush(obj))
obj->cache_dirty = true;
} }
if (flags & EXEC_OBJECT_NEEDS_FENCE) if (flags & EXEC_OBJECT_NEEDS_FENCE)
......
...@@ -1143,7 +1143,7 @@ static void parse_ddi_port(struct drm_i915_private *dev_priv, enum port port, ...@@ -1143,7 +1143,7 @@ static void parse_ddi_port(struct drm_i915_private *dev_priv, enum port port,
if (!child) if (!child)
return; return;
aux_channel = child->raw[25]; aux_channel = child->common.aux_channel;
ddc_pin = child->common.ddc_pin; ddc_pin = child->common.ddc_pin;
is_dvi = child->common.device_type & DEVICE_TYPE_TMDS_DVI_SIGNALING; 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,7 +1673,8 @@ bool intel_bios_is_port_edp(struct drm_i915_private *dev_priv, enum port port)
return false; return false;
} }
bool intel_bios_is_port_dp_dual_mode(struct drm_i915_private *dev_priv, enum port port) static bool child_dev_is_dp_dual_mode(const union child_device_config *p_child,
enum port port)
{ {
static const struct { static const struct {
u16 dp, hdmi; u16 dp, hdmi;
...@@ -1687,22 +1688,35 @@ bool intel_bios_is_port_dp_dual_mode(struct drm_i915_private *dev_priv, enum por ...@@ -1687,22 +1688,35 @@ bool intel_bios_is_port_dp_dual_mode(struct drm_i915_private *dev_priv, enum por
[PORT_D] = { DVO_PORT_DPD, DVO_PORT_HDMID, }, [PORT_D] = { DVO_PORT_DPD, DVO_PORT_HDMID, },
[PORT_E] = { DVO_PORT_DPE, DVO_PORT_HDMIE, }, [PORT_E] = { DVO_PORT_DPE, DVO_PORT_HDMIE, },
}; };
int i;
if (port == PORT_A || port >= ARRAY_SIZE(port_mapping)) if (port == PORT_A || port >= ARRAY_SIZE(port_mapping))
return false; return false;
if (!dev_priv->vbt.child_dev_num) if ((p_child->common.device_type & DEVICE_TYPE_DP_DUAL_MODE_BITS) !=
(DEVICE_TYPE_DP_DUAL_MODE & DEVICE_TYPE_DP_DUAL_MODE_BITS))
return false;
if (p_child->common.dvo_port == port_mapping[port].dp)
return true;
/* Only accept a HDMI dvo_port as DP++ if it has an AUX channel */
if (p_child->common.dvo_port == port_mapping[port].hdmi &&
p_child->common.aux_channel != 0)
return true;
return false; return false;
}
bool intel_bios_is_port_dp_dual_mode(struct drm_i915_private *dev_priv,
enum port port)
{
int i;
for (i = 0; i < dev_priv->vbt.child_dev_num; i++) { for (i = 0; i < dev_priv->vbt.child_dev_num; i++) {
const union child_device_config *p_child = const union child_device_config *p_child =
&dev_priv->vbt.child_dev[i]; &dev_priv->vbt.child_dev[i];
if ((p_child->common.dvo_port == port_mapping[port].dp || if (child_dev_is_dp_dual_mode(p_child, port))
p_child->common.dvo_port == port_mapping[port].hdmi) &&
(p_child->common.device_type & DEVICE_TYPE_DP_DUAL_MODE_BITS) ==
(DEVICE_TYPE_DP_DUAL_MODE & DEVICE_TYPE_DP_DUAL_MODE_BITS))
return true; return true;
} }
......
...@@ -4463,21 +4463,11 @@ static enum drm_connector_status ...@@ -4463,21 +4463,11 @@ static enum drm_connector_status
intel_dp_detect(struct drm_connector *connector, bool force) intel_dp_detect(struct drm_connector *connector, bool force)
{ {
struct intel_dp *intel_dp = intel_attached_dp(connector); struct intel_dp *intel_dp = intel_attached_dp(connector);
struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
struct intel_encoder *intel_encoder = &intel_dig_port->base;
enum drm_connector_status status = connector->status; enum drm_connector_status status = connector->status;
DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n", DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n",
connector->base.id, connector->name); connector->base.id, connector->name);
if (intel_dp->is_mst) {
/* MST devices are disconnected from a monitor POV */
intel_dp_unset_edid(intel_dp);
if (intel_encoder->type != INTEL_OUTPUT_EDP)
intel_encoder->type = INTEL_OUTPUT_DP;
return connector_status_disconnected;
}
/* If full detect is not performed yet, do a full detect */ /* If full detect is not performed yet, do a full detect */
if (!intel_dp->detect_done) if (!intel_dp->detect_done)
status = intel_dp_long_pulse(intel_dp->attached_connector); status = intel_dp_long_pulse(intel_dp->attached_connector);
......
...@@ -358,7 +358,7 @@ vlv_update_plane(struct drm_plane *dplane, ...@@ -358,7 +358,7 @@ vlv_update_plane(struct drm_plane *dplane,
int plane = intel_plane->plane; int plane = intel_plane->plane;
u32 sprctl; u32 sprctl;
u32 sprsurf_offset, linear_offset; u32 sprsurf_offset, linear_offset;
unsigned int rotation = dplane->state->rotation; unsigned int rotation = plane_state->base.rotation;
const struct drm_intel_sprite_colorkey *key = &plane_state->ckey; const struct drm_intel_sprite_colorkey *key = &plane_state->ckey;
int crtc_x = plane_state->base.dst.x1; int crtc_x = plane_state->base.dst.x1;
int crtc_y = plane_state->base.dst.y1; int crtc_y = plane_state->base.dst.y1;
......
...@@ -280,7 +280,8 @@ struct common_child_dev_config { ...@@ -280,7 +280,8 @@ struct common_child_dev_config {
u8 dp_support:1; u8 dp_support:1;
u8 tmds_support:1; u8 tmds_support:1;
u8 support_reserved:5; u8 support_reserved:5;
u8 not_common3[12]; u8 aux_channel;
u8 not_common3[11];
u8 iboost_level; u8 iboost_level;
} __packed; } __packed;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment