diff --git a/src/i830_lvds.c b/src/i830_lvds.c index 064810f..8af4965 100644 --- a/src/i830_lvds.c +++ b/src/i830_lvds.c @@ -672,6 +672,8 @@ i830_lvds_mode_fixup(xf86OutputPtr output, DisplayModePtr mode, desired_ratio = (float)mode->HDisplay / (float)mode->VDisplay; + ErrorF("native ratio: %f, desired ratio: %f\n", panel_ratio, desired_ratio); + /* * Enable automatic panel scaling for non-native modes so that they fill * the screen. Should be enabled before the pipe is enabled, according to @@ -747,6 +749,10 @@ i830_lvds_mode_fixup(xf86OutputPtr output, DisplayModePtr mode, if (panel_ratio > desired_ratio) { /* Pillar */ unsigned long scaled_width = (float)mode->HDisplay * vert_scale; + ErrorF("pillarbox scaling\n"); + + ErrorF("scaled_width: %ld\n", scaled_width); + horiz_ratio = vert_ratio; pfit_control |= VERT_AUTO_SCALE | VERT_INTERP_BILINEAR | HORIZ_INTERP_BILINEAR; @@ -758,6 +764,9 @@ i830_lvds_mode_fixup(xf86OutputPtr output, DisplayModePtr mode, if (mode->HDisplay & 1) /* odd resolutions */ right_border++; + ErrorF("left border %d, right border %d\n", left_border, + right_border); + adjusted_mode->CrtcHDisplay = scaled_width; adjusted_mode->CrtcHBlankStart = scaled_width + right_border - 1; @@ -765,11 +774,23 @@ i830_lvds_mode_fixup(xf86OutputPtr output, DisplayModePtr mode, left_border - 1; adjusted_mode->CrtcHSyncStart = adjusted_mode->CrtcHBlankStart; adjusted_mode->CrtcHSyncEnd = adjusted_mode->CrtcHBlankEnd; + + ErrorF("mapping %dx%d to %dx%d\n", + mode->HDisplay, mode->VDisplay, + adjusted_mode->HDisplay, adjusted_mode->VDisplay); + + ErrorF("CRTC timings: %d %d %d %d %d\n", + adjusted_mode->CrtcHDisplay, adjusted_mode->CrtcHBlankStart, + adjusted_mode->CrtcHBlankEnd, adjusted_mode->CrtcHSyncStart, + adjusted_mode->CrtcHSyncEnd); + border = 1; } else if (panel_ratio < desired_ratio) { /* Letter */ unsigned long scaled_height = (float)mode->VDisplay * horiz_scale; + ErrorF("letterbox scaling\n"); + vert_ratio = horiz_ratio; pfit_control |= HORIZ_AUTO_SCALE | VERT_INTERP_BILINEAR | HORIZ_INTERP_BILINEAR; @@ -801,6 +822,8 @@ i830_lvds_mode_fixup(xf86OutputPtr output, DisplayModePtr mode, PFIT_VERT_SCALE_MASK) | ((horiz_bits << PFIT_HORIZ_SCALE_SHIFT) & PFIT_HORIZ_SCALE_MASK)); + ErrorF("pfit ratios: vertical 0x%08x, horizontal 0x%08x\n", + vert_bits, horiz_bits); } break; case FULL: