diff options
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 60 |
1 files changed, 35 insertions, 25 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index dae976f51d83..5b60e25baa32 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -7825,14 +7825,12 @@ static int intel_crtc_cursor_set(struct drm_crtc *crtc, | |||
7825 | addr = i915_gem_obj_ggtt_offset(obj); | 7825 | addr = i915_gem_obj_ggtt_offset(obj); |
7826 | } else { | 7826 | } else { |
7827 | int align = IS_I830(dev) ? 16 * 1024 : 256; | 7827 | int align = IS_I830(dev) ? 16 * 1024 : 256; |
7828 | ret = i915_gem_attach_phys_object(dev, obj, | 7828 | ret = i915_gem_object_attach_phys(obj, align); |
7829 | (intel_crtc->pipe == 0) ? I915_GEM_PHYS_CURSOR_0 : I915_GEM_PHYS_CURSOR_1, | ||
7830 | align); | ||
7831 | if (ret) { | 7829 | if (ret) { |
7832 | DRM_DEBUG_KMS("failed to attach phys object\n"); | 7830 | DRM_DEBUG_KMS("failed to attach phys object\n"); |
7833 | goto fail_locked; | 7831 | goto fail_locked; |
7834 | } | 7832 | } |
7835 | addr = obj->phys_obj->handle->busaddr; | 7833 | addr = obj->phys_handle->busaddr; |
7836 | } | 7834 | } |
7837 | 7835 | ||
7838 | if (IS_GEN2(dev)) | 7836 | if (IS_GEN2(dev)) |
@@ -7840,10 +7838,7 @@ static int intel_crtc_cursor_set(struct drm_crtc *crtc, | |||
7840 | 7838 | ||
7841 | finish: | 7839 | finish: |
7842 | if (intel_crtc->cursor_bo) { | 7840 | if (intel_crtc->cursor_bo) { |
7843 | if (INTEL_INFO(dev)->cursor_needs_physical) { | 7841 | if (!INTEL_INFO(dev)->cursor_needs_physical) |
7844 | if (intel_crtc->cursor_bo != obj) | ||
7845 | i915_gem_detach_phys_object(dev, intel_crtc->cursor_bo); | ||
7846 | } else | ||
7847 | i915_gem_object_unpin_from_display_plane(intel_crtc->cursor_bo); | 7842 | i915_gem_object_unpin_from_display_plane(intel_crtc->cursor_bo); |
7848 | drm_gem_object_unreference(&intel_crtc->cursor_bo->base); | 7843 | drm_gem_object_unreference(&intel_crtc->cursor_bo->base); |
7849 | } | 7844 | } |
@@ -9654,11 +9649,22 @@ intel_pipe_config_compare(struct drm_device *dev, | |||
9654 | PIPE_CONF_CHECK_I(pipe_src_w); | 9649 | PIPE_CONF_CHECK_I(pipe_src_w); |
9655 | PIPE_CONF_CHECK_I(pipe_src_h); | 9650 | PIPE_CONF_CHECK_I(pipe_src_h); |
9656 | 9651 | ||
9657 | PIPE_CONF_CHECK_I(gmch_pfit.control); | 9652 | /* |
9658 | /* pfit ratios are autocomputed by the hw on gen4+ */ | 9653 | * FIXME: BIOS likes to set up a cloned config with lvds+external |
9659 | if (INTEL_INFO(dev)->gen < 4) | 9654 | * screen. Since we don't yet re-compute the pipe config when moving |
9660 | PIPE_CONF_CHECK_I(gmch_pfit.pgm_ratios); | 9655 | * just the lvds port away to another pipe the sw tracking won't match. |
9661 | PIPE_CONF_CHECK_I(gmch_pfit.lvds_border_bits); | 9656 | * |
9657 | * Proper atomic modesets with recomputed global state will fix this. | ||
9658 | * Until then just don't check gmch state for inherited modes. | ||
9659 | */ | ||
9660 | if (!PIPE_CONF_QUIRK(PIPE_CONFIG_QUIRK_INHERITED_MODE)) { | ||
9661 | PIPE_CONF_CHECK_I(gmch_pfit.control); | ||
9662 | /* pfit ratios are autocomputed by the hw on gen4+ */ | ||
9663 | if (INTEL_INFO(dev)->gen < 4) | ||
9664 | PIPE_CONF_CHECK_I(gmch_pfit.pgm_ratios); | ||
9665 | PIPE_CONF_CHECK_I(gmch_pfit.lvds_border_bits); | ||
9666 | } | ||
9667 | |||
9662 | PIPE_CONF_CHECK_I(pch_pfit.enabled); | 9668 | PIPE_CONF_CHECK_I(pch_pfit.enabled); |
9663 | if (current_config->pch_pfit.enabled) { | 9669 | if (current_config->pch_pfit.enabled) { |
9664 | PIPE_CONF_CHECK_I(pch_pfit.pos); | 9670 | PIPE_CONF_CHECK_I(pch_pfit.pos); |
@@ -11384,15 +11390,6 @@ void intel_modeset_init(struct drm_device *dev) | |||
11384 | } | 11390 | } |
11385 | } | 11391 | } |
11386 | 11392 | ||
11387 | static void | ||
11388 | intel_connector_break_all_links(struct intel_connector *connector) | ||
11389 | { | ||
11390 | connector->base.dpms = DRM_MODE_DPMS_OFF; | ||
11391 | connector->base.encoder = NULL; | ||
11392 | connector->encoder->connectors_active = false; | ||
11393 | connector->encoder->base.crtc = NULL; | ||
11394 | } | ||
11395 | |||
11396 | static void intel_enable_pipe_a(struct drm_device *dev) | 11393 | static void intel_enable_pipe_a(struct drm_device *dev) |
11397 | { | 11394 | { |
11398 | struct intel_connector *connector; | 11395 | struct intel_connector *connector; |
@@ -11474,8 +11471,17 @@ static void intel_sanitize_crtc(struct intel_crtc *crtc) | |||
11474 | if (connector->encoder->base.crtc != &crtc->base) | 11471 | if (connector->encoder->base.crtc != &crtc->base) |
11475 | continue; | 11472 | continue; |
11476 | 11473 | ||
11477 | intel_connector_break_all_links(connector); | 11474 | connector->base.dpms = DRM_MODE_DPMS_OFF; |
11475 | connector->base.encoder = NULL; | ||
11478 | } | 11476 | } |
11477 | /* multiple connectors may have the same encoder: | ||
11478 | * handle them and break crtc link separately */ | ||
11479 | list_for_each_entry(connector, &dev->mode_config.connector_list, | ||
11480 | base.head) | ||
11481 | if (connector->encoder->base.crtc == &crtc->base) { | ||
11482 | connector->encoder->base.crtc = NULL; | ||
11483 | connector->encoder->connectors_active = false; | ||
11484 | } | ||
11479 | 11485 | ||
11480 | WARN_ON(crtc->active); | 11486 | WARN_ON(crtc->active); |
11481 | crtc->base.enabled = false; | 11487 | crtc->base.enabled = false; |
@@ -11557,6 +11563,8 @@ static void intel_sanitize_encoder(struct intel_encoder *encoder) | |||
11557 | drm_get_encoder_name(&encoder->base)); | 11563 | drm_get_encoder_name(&encoder->base)); |
11558 | encoder->disable(encoder); | 11564 | encoder->disable(encoder); |
11559 | } | 11565 | } |
11566 | encoder->base.crtc = NULL; | ||
11567 | encoder->connectors_active = false; | ||
11560 | 11568 | ||
11561 | /* Inconsistent output/port/pipe state happens presumably due to | 11569 | /* Inconsistent output/port/pipe state happens presumably due to |
11562 | * a bug in one of the get_hw_state functions. Or someplace else | 11570 | * a bug in one of the get_hw_state functions. Or someplace else |
@@ -11567,8 +11575,8 @@ static void intel_sanitize_encoder(struct intel_encoder *encoder) | |||
11567 | base.head) { | 11575 | base.head) { |
11568 | if (connector->encoder != encoder) | 11576 | if (connector->encoder != encoder) |
11569 | continue; | 11577 | continue; |
11570 | 11578 | connector->base.dpms = DRM_MODE_DPMS_OFF; | |
11571 | intel_connector_break_all_links(connector); | 11579 | connector->base.encoder = NULL; |
11572 | } | 11580 | } |
11573 | } | 11581 | } |
11574 | /* Enabled encoders without active connectors will be fixed in | 11582 | /* Enabled encoders without active connectors will be fixed in |
@@ -11616,6 +11624,8 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev) | |||
11616 | base.head) { | 11624 | base.head) { |
11617 | memset(&crtc->config, 0, sizeof(crtc->config)); | 11625 | memset(&crtc->config, 0, sizeof(crtc->config)); |
11618 | 11626 | ||
11627 | crtc->config.quirks |= PIPE_CONFIG_QUIRK_INHERITED_MODE; | ||
11628 | |||
11619 | crtc->active = dev_priv->display.get_pipe_config(crtc, | 11629 | crtc->active = dev_priv->display.get_pipe_config(crtc, |
11620 | &crtc->config); | 11630 | &crtc->config); |
11621 | 11631 | ||