UBUNTU: SAUCE: drm/i915/pch: Fix integer math bugs in panel fitting
[linux-flexiantxendom0-natty.git] / drivers / gpu / drm / i915 / intel_panel.c
index f8f86e5..db8733e 100644 (file)
@@ -83,11 +83,15 @@ intel_pch_panel_fitting(struct drm_device *dev,
                        u32 scaled_height = mode->hdisplay * adjusted_mode->vdisplay;
                        if (scaled_width > scaled_height) { /* pillar */
                                width = scaled_height / mode->vdisplay;
+                               if (width & 1)
+                                       width++;
                                x = (adjusted_mode->hdisplay - width + 1) / 2;
                                y = 0;
                                height = adjusted_mode->vdisplay;
                        } else if (scaled_width < scaled_height) { /* letter */
                                height = scaled_width / mode->hdisplay;
+                               if (height & 1)
+                                       height++;
                                y = (adjusted_mode->vdisplay - height + 1) / 2;
                                x = 0;
                                width = adjusted_mode->hdisplay;