aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_hdmi.c
diff options
context:
space:
mode:
authorPaulo Zanoni <paulo.r.zanoni@intel.com>2012-05-04 16:18:20 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-05-08 08:14:42 -0400
commitfa193ff7999a7c1cdd1723f1cbc4a108540ca478 (patch)
treeb000007d340472914167dfaea9f27037f76ab8a8 /drivers/gpu/drm/i915/intel_hdmi.c
parent3e6e63952f6f7a42c40751cd88295fd297b80a84 (diff)
drm/i915: break intel_infoframe_flags into _enable and _frequency
This will allow us to disable an infoframe without changing its frequency. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_hdmi.c')
-rw-r--r--drivers/gpu/drm/i915/intel_hdmi.c32
1 files changed, 26 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
index 952eaf777ac5..661fed48c5b9 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@ -94,16 +94,33 @@ static u32 intel_infoframe_index(struct dip_infoframe *frame)
94 return flags; 94 return flags;
95} 95}
96 96
97static u32 intel_infoframe_flags(struct dip_infoframe *frame) 97static u32 intel_infoframe_enable(struct dip_infoframe *frame)
98{ 98{
99 u32 flags = 0; 99 u32 flags = 0;
100 100
101 switch (frame->type) { 101 switch (frame->type) {
102 case DIP_TYPE_AVI: 102 case DIP_TYPE_AVI:
103 flags |= VIDEO_DIP_ENABLE_AVI | VIDEO_DIP_FREQ_VSYNC; 103 flags |= VIDEO_DIP_ENABLE_AVI;
104 break; 104 break;
105 case DIP_TYPE_SPD: 105 case DIP_TYPE_SPD:
106 flags |= VIDEO_DIP_ENABLE_SPD | VIDEO_DIP_FREQ_VSYNC; 106 flags |= VIDEO_DIP_ENABLE_SPD;
107 break;
108 default:
109 DRM_DEBUG_DRIVER("unknown info frame type %d\n", frame->type);
110 break;
111 }
112
113 return flags;
114}
115
116static u32 intel_infoframe_frequency(struct dip_infoframe *frame)
117{
118 u32 flags = 0;
119
120 switch (frame->type) {
121 case DIP_TYPE_AVI:
122 case DIP_TYPE_SPD:
123 flags |= VIDEO_DIP_FREQ_VSYNC;
107 break; 124 break;
108 default: 125 default:
109 DRM_DEBUG_DRIVER("unknown info frame type %d\n", frame->type); 126 DRM_DEBUG_DRIVER("unknown info frame type %d\n", frame->type);
@@ -145,7 +162,8 @@ static void i9xx_write_infoframe(struct drm_encoder *encoder,
145 data++; 162 data++;
146 } 163 }
147 164
148 val |= intel_infoframe_flags(frame); 165 val |= intel_infoframe_enable(frame);
166 val |= intel_infoframe_frequency(frame);
149 167
150 I915_WRITE(VIDEO_DIP_CTL, val); 168 I915_WRITE(VIDEO_DIP_CTL, val);
151} 169}
@@ -176,7 +194,8 @@ static void ironlake_write_infoframe(struct drm_encoder *encoder,
176 data++; 194 data++;
177 } 195 }
178 196
179 val |= intel_infoframe_flags(frame); 197 val |= intel_infoframe_enable(frame);
198 val |= intel_infoframe_frequency(frame);
180 199
181 I915_WRITE(reg, val); 200 I915_WRITE(reg, val);
182} 201}
@@ -207,7 +226,8 @@ static void vlv_write_infoframe(struct drm_encoder *encoder,
207 data++; 226 data++;
208 } 227 }
209 228
210 val |= intel_infoframe_flags(frame); 229 val |= intel_infoframe_enable(frame);
230 val |= intel_infoframe_frequency(frame);
211 231
212 I915_WRITE(reg, val); 232 I915_WRITE(reg, val);
213} 233}