diff options
Diffstat (limited to 'drivers/gpu/drm/i915/intel_crt.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_crt.c | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c index ea9022ef15d5..10d1de5bce6f 100644 --- a/drivers/gpu/drm/i915/intel_crt.c +++ b/drivers/gpu/drm/i915/intel_crt.c | |||
@@ -83,8 +83,7 @@ static bool intel_crt_get_hw_state(struct intel_encoder *encoder, | |||
83 | return true; | 83 | return true; |
84 | } | 84 | } |
85 | 85 | ||
86 | static void intel_crt_get_config(struct intel_encoder *encoder, | 86 | static unsigned int intel_crt_get_flags(struct intel_encoder *encoder) |
87 | struct intel_crtc_config *pipe_config) | ||
88 | { | 87 | { |
89 | struct drm_i915_private *dev_priv = encoder->base.dev->dev_private; | 88 | struct drm_i915_private *dev_priv = encoder->base.dev->dev_private; |
90 | struct intel_crt *crt = intel_encoder_to_crt(encoder); | 89 | struct intel_crt *crt = intel_encoder_to_crt(encoder); |
@@ -102,7 +101,25 @@ static void intel_crt_get_config(struct intel_encoder *encoder, | |||
102 | else | 101 | else |
103 | flags |= DRM_MODE_FLAG_NVSYNC; | 102 | flags |= DRM_MODE_FLAG_NVSYNC; |
104 | 103 | ||
105 | pipe_config->adjusted_mode.flags |= flags; | 104 | return flags; |
105 | } | ||
106 | |||
107 | static void intel_crt_get_config(struct intel_encoder *encoder, | ||
108 | struct intel_crtc_config *pipe_config) | ||
109 | { | ||
110 | pipe_config->adjusted_mode.flags |= intel_crt_get_flags(encoder); | ||
111 | } | ||
112 | |||
113 | static void hsw_crt_get_config(struct intel_encoder *encoder, | ||
114 | struct intel_crtc_config *pipe_config) | ||
115 | { | ||
116 | intel_ddi_get_config(encoder, pipe_config); | ||
117 | |||
118 | pipe_config->adjusted_mode.flags &= ~(DRM_MODE_FLAG_PHSYNC | | ||
119 | DRM_MODE_FLAG_NHSYNC | | ||
120 | DRM_MODE_FLAG_PVSYNC | | ||
121 | DRM_MODE_FLAG_NVSYNC); | ||
122 | pipe_config->adjusted_mode.flags |= intel_crt_get_flags(encoder); | ||
106 | } | 123 | } |
107 | 124 | ||
108 | /* Note: The caller is required to filter out dpms modes not supported by the | 125 | /* Note: The caller is required to filter out dpms modes not supported by the |
@@ -799,7 +816,10 @@ void intel_crt_init(struct drm_device *dev) | |||
799 | crt->base.mode_set = intel_crt_mode_set; | 816 | crt->base.mode_set = intel_crt_mode_set; |
800 | crt->base.disable = intel_disable_crt; | 817 | crt->base.disable = intel_disable_crt; |
801 | crt->base.enable = intel_enable_crt; | 818 | crt->base.enable = intel_enable_crt; |
802 | crt->base.get_config = intel_crt_get_config; | 819 | if (IS_HASWELL(dev)) |
820 | crt->base.get_config = hsw_crt_get_config; | ||
821 | else | ||
822 | crt->base.get_config = intel_crt_get_config; | ||
803 | if (I915_HAS_HOTPLUG(dev)) | 823 | if (I915_HAS_HOTPLUG(dev)) |
804 | crt->base.hpd_pin = HPD_CRT; | 824 | crt->base.hpd_pin = HPD_CRT; |
805 | if (HAS_DDI(dev)) | 825 | if (HAS_DDI(dev)) |