diff options
author | Paulo Zanoni <paulo.r.zanoni@intel.com> | 2012-05-14 16:12:50 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-05-20 11:51:51 -0400 |
commit | ed517fbbbd3a01692a667ac18b4a413695513428 (patch) | |
tree | b0811d6ff10f9bffe405f3d5ad4ae56a5eff49d7 /drivers/gpu/drm/i915/intel_hdmi.c | |
parent | 81014b9d0b55fb0b48f26cd2a943359750d532db (diff) |
drm/i915: small hdmi coding style cleanups
- Changed the coding style of auxiliary infoframe functions to make
them smaller
- Fixed the column alignment of some function definitions
- Remove definition of "struct drm_crtc" in some places as they're
used only to retrieve "struct intel_crtc"
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.c | 44 |
1 files changed, 13 insertions, 31 deletions
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c index 03b3524a6ba2..cd5d9a9bdedc 100644 --- a/drivers/gpu/drm/i915/intel_hdmi.c +++ b/drivers/gpu/drm/i915/intel_hdmi.c | |||
@@ -65,40 +65,28 @@ void intel_dip_infoframe_csum(struct dip_infoframe *frame) | |||
65 | 65 | ||
66 | static u32 g4x_infoframe_index(struct dip_infoframe *frame) | 66 | static u32 g4x_infoframe_index(struct dip_infoframe *frame) |
67 | { | 67 | { |
68 | u32 flags = 0; | ||
69 | |||
70 | switch (frame->type) { | 68 | switch (frame->type) { |
71 | case DIP_TYPE_AVI: | 69 | case DIP_TYPE_AVI: |
72 | flags |= VIDEO_DIP_SELECT_AVI; | 70 | return VIDEO_DIP_SELECT_AVI; |
73 | break; | ||
74 | case DIP_TYPE_SPD: | 71 | case DIP_TYPE_SPD: |
75 | flags |= VIDEO_DIP_SELECT_SPD; | 72 | return VIDEO_DIP_SELECT_SPD; |
76 | break; | ||
77 | default: | 73 | default: |
78 | DRM_DEBUG_DRIVER("unknown info frame type %d\n", frame->type); | 74 | DRM_DEBUG_DRIVER("unknown info frame type %d\n", frame->type); |
79 | break; | 75 | return 0; |
80 | } | 76 | } |
81 | |||
82 | return flags; | ||
83 | } | 77 | } |
84 | 78 | ||
85 | static u32 g4x_infoframe_enable(struct dip_infoframe *frame) | 79 | static u32 g4x_infoframe_enable(struct dip_infoframe *frame) |
86 | { | 80 | { |
87 | u32 flags = 0; | ||
88 | |||
89 | switch (frame->type) { | 81 | switch (frame->type) { |
90 | case DIP_TYPE_AVI: | 82 | case DIP_TYPE_AVI: |
91 | flags |= VIDEO_DIP_ENABLE_AVI; | 83 | return VIDEO_DIP_ENABLE_AVI; |
92 | break; | ||
93 | case DIP_TYPE_SPD: | 84 | case DIP_TYPE_SPD: |
94 | flags |= VIDEO_DIP_ENABLE_SPD; | 85 | return VIDEO_DIP_ENABLE_SPD; |
95 | break; | ||
96 | default: | 86 | default: |
97 | DRM_DEBUG_DRIVER("unknown info frame type %d\n", frame->type); | 87 | DRM_DEBUG_DRIVER("unknown info frame type %d\n", frame->type); |
98 | break; | 88 | return 0; |
99 | } | 89 | } |
100 | |||
101 | return flags; | ||
102 | } | 90 | } |
103 | 91 | ||
104 | static void g4x_write_infoframe(struct drm_encoder *encoder, | 92 | static void g4x_write_infoframe(struct drm_encoder *encoder, |
@@ -111,8 +99,6 @@ static void g4x_write_infoframe(struct drm_encoder *encoder, | |||
111 | u32 val = I915_READ(VIDEO_DIP_CTL); | 99 | u32 val = I915_READ(VIDEO_DIP_CTL); |
112 | unsigned i, len = DIP_HEADER_SIZE + frame->len; | 100 | unsigned i, len = DIP_HEADER_SIZE + frame->len; |
113 | 101 | ||
114 | |||
115 | /* XXX first guess at handling video port, is this corrent? */ | ||
116 | val &= ~VIDEO_DIP_PORT_MASK; | 102 | val &= ~VIDEO_DIP_PORT_MASK; |
117 | if (intel_hdmi->sdvox_reg == SDVOB) | 103 | if (intel_hdmi->sdvox_reg == SDVOB) |
118 | val |= VIDEO_DIP_PORT_B; | 104 | val |= VIDEO_DIP_PORT_B; |
@@ -147,8 +133,7 @@ static void ibx_write_infoframe(struct drm_encoder *encoder, | |||
147 | uint32_t *data = (uint32_t *)frame; | 133 | uint32_t *data = (uint32_t *)frame; |
148 | struct drm_device *dev = encoder->dev; | 134 | struct drm_device *dev = encoder->dev; |
149 | struct drm_i915_private *dev_priv = dev->dev_private; | 135 | struct drm_i915_private *dev_priv = dev->dev_private; |
150 | struct drm_crtc *crtc = encoder->crtc; | 136 | struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc); |
151 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | ||
152 | struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder); | 137 | struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder); |
153 | int reg = TVIDEO_DIP_CTL(intel_crtc->pipe); | 138 | int reg = TVIDEO_DIP_CTL(intel_crtc->pipe); |
154 | unsigned i, len = DIP_HEADER_SIZE + frame->len; | 139 | unsigned i, len = DIP_HEADER_SIZE + frame->len; |
@@ -197,8 +182,7 @@ static void cpt_write_infoframe(struct drm_encoder *encoder, | |||
197 | uint32_t *data = (uint32_t *)frame; | 182 | uint32_t *data = (uint32_t *)frame; |
198 | struct drm_device *dev = encoder->dev; | 183 | struct drm_device *dev = encoder->dev; |
199 | struct drm_i915_private *dev_priv = dev->dev_private; | 184 | struct drm_i915_private *dev_priv = dev->dev_private; |
200 | struct drm_crtc *crtc = encoder->crtc; | 185 | struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc); |
201 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | ||
202 | int reg = TVIDEO_DIP_CTL(intel_crtc->pipe); | 186 | int reg = TVIDEO_DIP_CTL(intel_crtc->pipe); |
203 | unsigned i, len = DIP_HEADER_SIZE + frame->len; | 187 | unsigned i, len = DIP_HEADER_SIZE + frame->len; |
204 | u32 val = I915_READ(reg); | 188 | u32 val = I915_READ(reg); |
@@ -237,8 +221,7 @@ static void vlv_write_infoframe(struct drm_encoder *encoder, | |||
237 | uint32_t *data = (uint32_t *)frame; | 221 | uint32_t *data = (uint32_t *)frame; |
238 | struct drm_device *dev = encoder->dev; | 222 | struct drm_device *dev = encoder->dev; |
239 | struct drm_i915_private *dev_priv = dev->dev_private; | 223 | struct drm_i915_private *dev_priv = dev->dev_private; |
240 | struct drm_crtc *crtc = encoder->crtc; | 224 | struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc); |
241 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | ||
242 | int reg = VLV_TVIDEO_DIP_CTL(intel_crtc->pipe); | 225 | int reg = VLV_TVIDEO_DIP_CTL(intel_crtc->pipe); |
243 | unsigned i, len = DIP_HEADER_SIZE + frame->len; | 226 | unsigned i, len = DIP_HEADER_SIZE + frame->len; |
244 | u32 val = I915_READ(reg); | 227 | u32 val = I915_READ(reg); |
@@ -266,7 +249,7 @@ static void vlv_write_infoframe(struct drm_encoder *encoder, | |||
266 | } | 249 | } |
267 | 250 | ||
268 | static void hsw_write_infoframe(struct drm_encoder *encoder, | 251 | static void hsw_write_infoframe(struct drm_encoder *encoder, |
269 | struct dip_infoframe *frame) | 252 | struct dip_infoframe *frame) |
270 | { | 253 | { |
271 | /* Not implemented yet, so avoid doing anything at all. | 254 | /* Not implemented yet, so avoid doing anything at all. |
272 | * This is the placeholder for Paulo Zanoni's infoframe writing patch | 255 | * This is the placeholder for Paulo Zanoni's infoframe writing patch |
@@ -325,8 +308,7 @@ static void intel_hdmi_mode_set(struct drm_encoder *encoder, | |||
325 | { | 308 | { |
326 | struct drm_device *dev = encoder->dev; | 309 | struct drm_device *dev = encoder->dev; |
327 | struct drm_i915_private *dev_priv = dev->dev_private; | 310 | struct drm_i915_private *dev_priv = dev->dev_private; |
328 | struct drm_crtc *crtc = encoder->crtc; | 311 | struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc); |
329 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | ||
330 | struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder); | 312 | struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder); |
331 | u32 sdvox; | 313 | u32 sdvox; |
332 | 314 | ||
@@ -500,8 +482,8 @@ intel_hdmi_detect_audio(struct drm_connector *connector) | |||
500 | 482 | ||
501 | static int | 483 | static int |
502 | intel_hdmi_set_property(struct drm_connector *connector, | 484 | intel_hdmi_set_property(struct drm_connector *connector, |
503 | struct drm_property *property, | 485 | struct drm_property *property, |
504 | uint64_t val) | 486 | uint64_t val) |
505 | { | 487 | { |
506 | struct intel_hdmi *intel_hdmi = intel_attached_hdmi(connector); | 488 | struct intel_hdmi *intel_hdmi = intel_attached_hdmi(connector); |
507 | struct drm_i915_private *dev_priv = connector->dev->dev_private; | 489 | struct drm_i915_private *dev_priv = connector->dev->dev_private; |