From 8fcbae95c7869054e27c6b65efaa07139fe5f020 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Thu, 18 Dec 2008 21:01:18 +0000 Subject: [PATCH] Applied patch by Gerald Zajac: * Fix for a problem of the ProSavage chip when VESA ran 32 bit before. * Better error codes in SetDisplayMode(). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28816 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/accelerants/s3/mode.cpp | 6 +++--- src/add-ons/accelerants/s3/savage_mode.cpp | 8 ++++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/add-ons/accelerants/s3/mode.cpp b/src/add-ons/accelerants/s3/mode.cpp index 669d44028f..5d10c95056 100644 --- a/src/add-ons/accelerants/s3/mode.cpp +++ b/src/add-ons/accelerants/s3/mode.cpp @@ -332,10 +332,10 @@ SetDisplayMode(display_mode* pMode) uint32 maxPixelClock; if ( ! gInfo.GetColorSpaceParams(mode.space, mode.bpp, maxPixelClock)) - return B_ERROR; + return B_BAD_VALUE; if (ProposeDisplayMode(&mode, pMode, pMode) != B_OK) - return B_ERROR; + return B_BAD_VALUE; // Note that for some Savage chips, accelerated drawing is badly messed up // when the display width is 1400 because 1400 is not evenly divisible by 32. @@ -357,7 +357,7 @@ SetDisplayMode(display_mode* pMode) // Is there enough frame buffer memory for this mode? if ( ! IsThereEnoughFBMemory(&mode, mode.bpp)) - return B_ERROR; + return B_NO_MEMORY; TRACE("Set display mode: %dx%d virtual size: %dx%d color depth: %d bpp\n", mode.timing.h_display, mode.timing.v_display, diff --git a/src/add-ons/accelerants/s3/savage_mode.cpp b/src/add-ons/accelerants/s3/savage_mode.cpp index af95e9917b..742e67cce8 100644 --- a/src/add-ons/accelerants/s3/savage_mode.cpp +++ b/src/add-ons/accelerants/s3/savage_mode.cpp @@ -525,10 +525,14 @@ Savage_WriteMode(const DisplayModeEx& mode, const SavageRegRec& regRec) WriteCrtcReg(0x67, regRec.CR67 & ~0x0e); // no STREAMS yet old and new // Set register SR19 to zero so that the ProSavage chips will start up - // when booting under BeOS using the default boot screen. + // when booting under BeOS using the default boot screen, and set register + // CR5F to zero so that the ProSavage chips will start up when Haiku boot + // screen had a depth of 32 bits/pixel - if (si.chipType == S3_PROSAVAGE || si.chipType == S3_TWISTER) + if (si.chipType == S3_PROSAVAGE || si.chipType == S3_TWISTER) { WriteSeqReg(0x19, 0); + WriteCrtcReg(0x5f, 0); + } // Clear bit 3 in SR30 so that Savage MX chip will startup. If bit 3 is // not cleared, it will startup only if booting under BeOS using the