* Make sure that the bytes per scanline is always a multiple of 64. This fixes

1680x1050 with 16 bit on i865+ (still need to check the restrictions of
  older chips).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31277 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2009-06-27 18:07:37 +00:00
parent e455799925
commit 10f01c97ec
1 changed files with 9 additions and 4 deletions

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2006-2008, Haiku, Inc. All Rights Reserved. * Copyright 2006-2009, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
* *
* Support for i915 chipset and up based on the X driver, * Support for i915 chipset and up based on the X driver,
@ -281,7 +281,7 @@ compute_pll_divisors(const display_mode &current, pll_divisors& divisors,
== LVDS_CLKB_POWER_UP) == LVDS_CLKB_POWER_UP)
divisors.post2 = LVDS_POST2_RATE_FAST; divisors.post2 = LVDS_POST2_RATE_FAST;
else else
divisors.post2 = LVDS_POST2_RATE_SLOW; divisors.post2 = LVDS_POST2_RATE_SLOW;
} else { } else {
if (current.timing.pixel_clock < limits.min_post2_frequency) { if (current.timing.pixel_clock < limits.min_post2_frequency) {
// slow DAC timing // slow DAC timing
@ -341,7 +341,7 @@ save_lvds_mode(void)
{ {
// dump currently programmed mode. // dump currently programmed mode.
display_mode biosMode; display_mode biosMode;
uint32 pll = read32(INTEL_DISPLAY_B_PLL); uint32 pll = read32(INTEL_DISPLAY_B_PLL);
uint32 pllDivisor = read32(INTEL_DISPLAY_B_PLL_DIVISOR_0); uint32 pllDivisor = read32(INTEL_DISPLAY_B_PLL_DIVISOR_0);
@ -475,6 +475,11 @@ get_color_space_format(const display_mode &mode, uint32 &colorMode,
} }
bytesPerRow = mode.virtual_width * bytesPerPixel; bytesPerRow = mode.virtual_width * bytesPerPixel;
// Make sure bytesPerRow is a multiple of 64
// TODO: check if the older chips have the same restriction!
if ((bytesPerRow & 63) != 0)
bytesPerRow = (bytesPerRow + 63) & ~63;
} }
@ -702,7 +707,7 @@ if (first) {
read32(INTEL_DISPLAY_B_PIPE_CONTROL) | DISPLAY_PIPE_ENABLED); read32(INTEL_DISPLAY_B_PIPE_CONTROL) | DISPLAY_PIPE_ENABLED);
read32(INTEL_DISPLAY_B_PIPE_CONTROL); read32(INTEL_DISPLAY_B_PIPE_CONTROL);
} }
if (gInfo->head_mode & HEAD_MODE_A_ANALOG) { if (gInfo->head_mode & HEAD_MODE_A_ANALOG) {
pll_divisors divisors; pll_divisors divisors;
compute_pll_divisors(target, divisors,false); compute_pll_divisors(target, divisors,false);