aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_display.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r--drivers/gpu/drm/i915/intel_display.c37
1 files changed, 17 insertions, 20 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 98b704998d81..efd3cf50cb0f 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -8101,14 +8101,12 @@ static int intel_crtc_cursor_set(struct drm_crtc *crtc,
8101 addr = i915_gem_obj_ggtt_offset(obj); 8101 addr = i915_gem_obj_ggtt_offset(obj);
8102 } else { 8102 } else {
8103 int align = IS_I830(dev) ? 16 * 1024 : 256; 8103 int align = IS_I830(dev) ? 16 * 1024 : 256;
8104 ret = i915_gem_attach_phys_object(dev, obj, 8104 ret = i915_gem_object_attach_phys(obj, align);
8105 (intel_crtc->pipe == 0) ? I915_GEM_PHYS_CURSOR_0 : I915_GEM_PHYS_CURSOR_1,
8106 align);
8107 if (ret) { 8105 if (ret) {
8108 DRM_DEBUG_KMS("failed to attach phys object\n"); 8106 DRM_DEBUG_KMS("failed to attach phys object\n");
8109 goto fail_locked; 8107 goto fail_locked;
8110 } 8108 }
8111 addr = obj->phys_obj->handle->busaddr; 8109 addr = obj->phys_handle->busaddr;
8112 } 8110 }
8113 8111
8114 if (IS_GEN2(dev)) 8112 if (IS_GEN2(dev))
@@ -8116,10 +8114,7 @@ static int intel_crtc_cursor_set(struct drm_crtc *crtc,
8116 8114
8117 finish: 8115 finish:
8118 if (intel_crtc->cursor_bo) { 8116 if (intel_crtc->cursor_bo) {
8119 if (INTEL_INFO(dev)->cursor_needs_physical) { 8117 if (!INTEL_INFO(dev)->cursor_needs_physical)
8120 if (intel_crtc->cursor_bo != obj)
8121 i915_gem_detach_phys_object(dev, intel_crtc->cursor_bo);
8122 } else
8123 i915_gem_object_unpin_from_display_plane(intel_crtc->cursor_bo); 8118 i915_gem_object_unpin_from_display_plane(intel_crtc->cursor_bo);
8124 drm_gem_object_unreference(&intel_crtc->cursor_bo->base); 8119 drm_gem_object_unreference(&intel_crtc->cursor_bo->base);
8125 } 8120 }
@@ -11797,15 +11792,6 @@ void intel_modeset_init(struct drm_device *dev)
11797 } 11792 }
11798} 11793}
11799 11794
11800static void
11801intel_connector_break_all_links(struct intel_connector *connector)
11802{
11803 connector->base.dpms = DRM_MODE_DPMS_OFF;
11804 connector->base.encoder = NULL;
11805 connector->encoder->connectors_active = false;
11806 connector->encoder->base.crtc = NULL;
11807}
11808
11809static void intel_enable_pipe_a(struct drm_device *dev) 11795static void intel_enable_pipe_a(struct drm_device *dev)
11810{ 11796{
11811 struct intel_connector *connector; 11797 struct intel_connector *connector;
@@ -11894,8 +11880,17 @@ static void intel_sanitize_crtc(struct intel_crtc *crtc)
11894 if (connector->encoder->base.crtc != &crtc->base) 11880 if (connector->encoder->base.crtc != &crtc->base)
11895 continue; 11881 continue;
11896 11882
11897 intel_connector_break_all_links(connector); 11883 connector->base.dpms = DRM_MODE_DPMS_OFF;
11884 connector->base.encoder = NULL;
11898 } 11885 }
11886 /* multiple connectors may have the same encoder:
11887 * handle them and break crtc link separately */
11888 list_for_each_entry(connector, &dev->mode_config.connector_list,
11889 base.head)
11890 if (connector->encoder->base.crtc == &crtc->base) {
11891 connector->encoder->base.crtc = NULL;
11892 connector->encoder->connectors_active = false;
11893 }
11899 11894
11900 WARN_ON(crtc->active); 11895 WARN_ON(crtc->active);
11901 crtc->base.enabled = false; 11896 crtc->base.enabled = false;
@@ -11986,6 +11981,8 @@ static void intel_sanitize_encoder(struct intel_encoder *encoder)
11986 encoder->base.name); 11981 encoder->base.name);
11987 encoder->disable(encoder); 11982 encoder->disable(encoder);
11988 } 11983 }
11984 encoder->base.crtc = NULL;
11985 encoder->connectors_active = false;
11989 11986
11990 /* Inconsistent output/port/pipe state happens presumably due to 11987 /* Inconsistent output/port/pipe state happens presumably due to
11991 * a bug in one of the get_hw_state functions. Or someplace else 11988 * a bug in one of the get_hw_state functions. Or someplace else
@@ -11996,8 +11993,8 @@ static void intel_sanitize_encoder(struct intel_encoder *encoder)
11996 base.head) { 11993 base.head) {
11997 if (connector->encoder != encoder) 11994 if (connector->encoder != encoder)
11998 continue; 11995 continue;
11999 11996 connector->base.dpms = DRM_MODE_DPMS_OFF;
12000 intel_connector_break_all_links(connector); 11997 connector->base.encoder = NULL;
12001 } 11998 }
12002 } 11999 }
12003 /* Enabled encoders without active connectors will be fixed in 12000 /* Enabled encoders without active connectors will be fixed in