drm/i915: make DBLCLK modes work
authorPaulo Zanoni <paulo.r.zanoni@intel.com>
Fri, 13 Apr 2012 19:31:41 +0000 (16:31 -0300)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 3 May 2012 09:25:22 +0000 (11:25 +0200)
They require an AVI InfoFrame with a proper Pixel Repetition field.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45729
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_drv.h
drivers/gpu/drm/i915/intel_hdmi.c

index 3205a774ec4ba6d4bb649c243dbd4de504f66b63..d9ffe381c72344e3b0e0090c2f4984dd1c4f4b44 100644 (file)
@@ -234,6 +234,8 @@ struct cxsr_latency {
 #define DIP_TYPE_AVI    0x82
 #define DIP_VERSION_AVI 0x2
 #define DIP_LEN_AVI     13
+#define DIP_AVI_PR_1    0
+#define DIP_AVI_PR_2    1
 
 #define DIP_TYPE_SPD   0x83
 #define DIP_VERSION_SPD        0x1
index 7de2d3b85b328cd9ff2d04d7419cea37edd550ce..8d2501704182f076e3168c05f545d4b6054fb585 100644 (file)
@@ -220,7 +220,8 @@ static void intel_set_infoframe(struct drm_encoder *encoder,
        intel_hdmi->write_infoframe(encoder, frame);
 }
 
-static void intel_hdmi_set_avi_infoframe(struct drm_encoder *encoder)
+static void intel_hdmi_set_avi_infoframe(struct drm_encoder *encoder,
+                                        struct drm_display_mode *adjusted_mode)
 {
        struct dip_infoframe avi_if = {
                .type = DIP_TYPE_AVI,
@@ -228,6 +229,9 @@ static void intel_hdmi_set_avi_infoframe(struct drm_encoder *encoder)
                .len = DIP_LEN_AVI,
        };
 
+       if (adjusted_mode->flags & DRM_MODE_FLAG_DBLCLK)
+               avi_if.body.avi.YQ_CN_PR |= DIP_AVI_PR_2;
+
        intel_set_infoframe(encoder, &avi_if);
 }
 
@@ -290,7 +294,7 @@ static void intel_hdmi_mode_set(struct drm_encoder *encoder,
        I915_WRITE(intel_hdmi->sdvox_reg, sdvox);
        POSTING_READ(intel_hdmi->sdvox_reg);
 
-       intel_hdmi_set_avi_infoframe(encoder);
+       intel_hdmi_set_avi_infoframe(encoder, adjusted_mode);
        intel_hdmi_set_spd_infoframe(encoder);
 }