提交 fa193ff7 编写于 作者: P Paulo Zanoni 提交者: Daniel Vetter

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: NPaulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: NEugeni Dodonov <eugeni.dodonov@intel.com>
Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
上级 3e6e6395
...@@ -94,16 +94,33 @@ static u32 intel_infoframe_index(struct dip_infoframe *frame) ...@@ -94,16 +94,33 @@ static u32 intel_infoframe_index(struct dip_infoframe *frame)
return flags; return flags;
} }
static u32 intel_infoframe_flags(struct dip_infoframe *frame) static u32 intel_infoframe_enable(struct dip_infoframe *frame)
{ {
u32 flags = 0; u32 flags = 0;
switch (frame->type) { switch (frame->type) {
case DIP_TYPE_AVI: case DIP_TYPE_AVI:
flags |= VIDEO_DIP_ENABLE_AVI | VIDEO_DIP_FREQ_VSYNC; flags |= VIDEO_DIP_ENABLE_AVI;
break; break;
case DIP_TYPE_SPD: case DIP_TYPE_SPD:
flags |= VIDEO_DIP_ENABLE_SPD | VIDEO_DIP_FREQ_VSYNC; flags |= VIDEO_DIP_ENABLE_SPD;
break;
default:
DRM_DEBUG_DRIVER("unknown info frame type %d\n", frame->type);
break;
}
return flags;
}
static u32 intel_infoframe_frequency(struct dip_infoframe *frame)
{
u32 flags = 0;
switch (frame->type) {
case DIP_TYPE_AVI:
case DIP_TYPE_SPD:
flags |= VIDEO_DIP_FREQ_VSYNC;
break; break;
default: default:
DRM_DEBUG_DRIVER("unknown info frame type %d\n", frame->type); 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,7 +162,8 @@ static void i9xx_write_infoframe(struct drm_encoder *encoder,
data++; data++;
} }
val |= intel_infoframe_flags(frame); val |= intel_infoframe_enable(frame);
val |= intel_infoframe_frequency(frame);
I915_WRITE(VIDEO_DIP_CTL, val); I915_WRITE(VIDEO_DIP_CTL, val);
} }
...@@ -176,7 +194,8 @@ static void ironlake_write_infoframe(struct drm_encoder *encoder, ...@@ -176,7 +194,8 @@ static void ironlake_write_infoframe(struct drm_encoder *encoder,
data++; data++;
} }
val |= intel_infoframe_flags(frame); val |= intel_infoframe_enable(frame);
val |= intel_infoframe_frequency(frame);
I915_WRITE(reg, val); I915_WRITE(reg, val);
} }
...@@ -207,7 +226,8 @@ static void vlv_write_infoframe(struct drm_encoder *encoder, ...@@ -207,7 +226,8 @@ static void vlv_write_infoframe(struct drm_encoder *encoder,
data++; data++;
} }
val |= intel_infoframe_flags(frame); val |= intel_infoframe_enable(frame);
val |= intel_infoframe_frequency(frame);
I915_WRITE(reg, val); I915_WRITE(reg, val);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册