From 409f9fd4e3839c8c82cc5db974e7aa37b0eae9f0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ville=20Syrj=C3=A4l=C3=A4?= Date: Thu, 22 Mar 2012 15:25:43 +0200 Subject: [PATCH] HACK: gfx: Adjust HDMI hdisplay/vdisplay values MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The HDMI code doesn't follow the KMS desing correctly, hence the values stored in the mode structure are incorrect. Adjust the "user" mode hdisplay/vdisplay and their crtc counterparts to match the framebuffer size. This "fixes" vblank counter comparisons for HDMI, thus fixing page flip completion detection, and this also allows the overlay to be clipped "correctly". This makes assumptions on how the panel fitter willl be programmed. Based on a cursory examination of the HDMI code, it will only work as long as the IPIL_TIMING_SCALE_ASPECT scaling mode is selected. Signed-off-by: Ville Syrjälä Signed-off-by: Artem Bityutskiy --- .../mrst/drv/otm_hdmi/os/android/android_hdmi.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/staging/mrst/drv/otm_hdmi/os/android/android_hdmi.c b/drivers/staging/mrst/drv/otm_hdmi/os/android/android_hdmi.c index 9057958..0ab960f 100644 --- a/drivers/staging/mrst/drv/otm_hdmi/os/android/android_hdmi.c +++ b/drivers/staging/mrst/drv/otm_hdmi/os/android/android_hdmi.c @@ -1384,6 +1384,7 @@ void android_hdmi_enc_mode_set(struct drm_encoder *encoder, struct drm_display_mode *adjusted_mode) { struct drm_device *dev; + struct drm_crtc *crtc; struct android_hdmi_priv *hdmi_priv; struct drm_psb_private *dev_priv; #ifdef CONFIG_SND_INTELMID_HDMI_AUDIO @@ -1399,6 +1400,7 @@ void android_hdmi_enc_mode_set(struct drm_encoder *encoder, /* get handles for required data */ dev = encoder->dev; + crtc = encoder->crtc; dev_priv = dev->dev_private; hdmi_priv = dev_priv->hdmi_priv; #ifdef CONFIG_SND_INTELMID_HDMI_AUDIO @@ -1409,16 +1411,14 @@ void android_hdmi_enc_mode_set(struct drm_encoder *encoder, __android_hdmi_drm_mode_to_otm_timing(&otm_adjusted_mode, adjusted_mode); - /* FIXME: After the mode sets, the adjusted_mode values will be - * copied to crtc->hwmode. crtc->hwmode will be used while playing - * video, to config overlay about the clip region. As the current - * video mode is clone for HDMI, HDMI crtc also need to present - * the local display dimensions for overlay clip, as the same FB - * is used between local and HDMI. This should eventually - * go away with HDMI extended video implementation. + /* + * FIXME HDMI driver doesn't follow kms design correctly. + * Fudge the user mode {hdisplay,vdisplay} to avoid failing + * sanity checks, and fudge the crtc_{hdisplay,vdisplay} to + * fix overlay clipping. */ - adjusted_mode->crtc_hdisplay = OTM_HDMI_MDFLD_MIPI_NATIVE_HDISPLAY; - adjusted_mode->crtc_vdisplay = OTM_HDMI_MDFLD_MIPI_NATIVE_VDISPLAY; + crtc->mode.hdisplay = crtc->mode.crtc_hdisplay = crtc->fb->width; + crtc->mode.vdisplay = crtc->mode.crtc_vdisplay = crtc->fb->height; if (otm_hdmi_enc_mode_set(hdmi_priv->context, &otm_mode, &otm_adjusted_mode)) { -- 2.7.4