From dd665ef198f6a6a97e6fad6542848add2bf70e54 Mon Sep 17 00:00:00 2001 From: Rudolf Cornelissen Date: Tue, 9 May 2006 10:19:06 +0000 Subject: [PATCH] added MAVEN DPMS programming for singlehead cards with that chip. Bumped version to 0.30 BTW, TVout still not working correctly though. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17386 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../accelerants/matrox/SetDisplayMode.c | 20 +++++++++++++++++-- .../accelerants/matrox/engine/mga_general.c | 6 +++++- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/src/add-ons/accelerants/matrox/SetDisplayMode.c b/src/add-ons/accelerants/matrox/SetDisplayMode.c index b1f1939b52..05fd147ffb 100644 --- a/src/add-ons/accelerants/matrox/SetDisplayMode.c +++ b/src/add-ons/accelerants/matrox/SetDisplayMode.c @@ -75,7 +75,15 @@ status_t SET_DISPLAY_MODE(display_mode *mode_to_set) /* then turn off screen(s) */ gx00_crtc_dpms(false, false, false); - if (si->ps.secondary_head) g400_crtc2_dpms(false, false, false); + if (si->ps.secondary_head) + { + g400_crtc2_dpms(false, false, false); + } + else + { + /* on singlehead cards with TVout program the MAVEN as well */ + if (si->ps.tvout) gx00_maven_dpms(false, false, false); + } /*where in framebuffer the screen is (should this be dependant on previous MOVEDISPLAY?)*/ startadd = (uint8*)si->fbc.frame_buffer - (uint8*)si->framebuffer; @@ -636,10 +644,12 @@ status_t SET_DPMS_MODE(uint32 dpms_flags) } else /* singlehead */ { - switch(dpms_flags) + switch(dpms_flags) { case B_DPMS_ON: /* H: on, V: on */ gx00_crtc_dpms(true, true, true); + /* on singlehead cards with TVout program the MAVEN as well */ + if (si->dm.flags & TV_BITS) gx00_maven_dpms(true, true, true); break; case B_DPMS_STAND_BY: if (si->settings.greensync) @@ -651,6 +661,8 @@ status_t SET_DPMS_MODE(uint32 dpms_flags) { gx00_crtc_dpms(false, false, true); } + /* on singlehead cards with TVout program the MAVEN as well */ + if (si->dm.flags & TV_BITS) gx00_maven_dpms(false, false, true); break; case B_DPMS_SUSPEND: if (si->settings.greensync) @@ -662,6 +674,8 @@ status_t SET_DPMS_MODE(uint32 dpms_flags) { gx00_crtc_dpms(false, true, false); } + /* on singlehead cards with TVout program the MAVEN as well */ + if (si->dm.flags & TV_BITS) gx00_maven_dpms(false, true, false); break; case B_DPMS_OFF: /* H: off, V: off, display off */ if (si->settings.greensync) @@ -673,6 +687,8 @@ status_t SET_DPMS_MODE(uint32 dpms_flags) { gx00_crtc_dpms(false, false, false); } + /* on singlehead cards with TVout program the MAVEN as well */ + if (si->dm.flags & TV_BITS) gx00_maven_dpms(false, false, false); break; default: LOG(8,("SET: Invalid DPMS settings (SH) 0x%08x\n", dpms_flags)); diff --git a/src/add-ons/accelerants/matrox/engine/mga_general.c b/src/add-ons/accelerants/matrox/engine/mga_general.c index b140a6f332..ba95f8096c 100644 --- a/src/add-ons/accelerants/matrox/engine/mga_general.c +++ b/src/add-ons/accelerants/matrox/engine/mga_general.c @@ -1,7 +1,7 @@ /* Authors: Mark Watson 12/1999, Apsed, - Rudolf Cornelissen 10/2002-1/2006 + Rudolf Cornelissen 10/2002-5/2006 */ #define MODULE_BIT 0x00008000 @@ -311,6 +311,8 @@ status_t g100_general_powerup() LOG(2,("INIT: PLL/LUT/DAC powerup\n")); /* turn off both displays and the hardcursor (also disables transfers) */ gx00_crtc_dpms(false, false, false); + /* on singlehead cards with TVout program the MAVEN as well */ + if (si->ps.tvout) gx00_maven_dpms(false, false, false); gx00_crtc_cursor_hide(); /* G100 SGRAM and SDRAM use external pix and dac refs, do *not* activate internals! * (this would create electrical shortcuts, @@ -411,6 +413,8 @@ status_t g200_general_powerup() LOG(2,("INIT: PLL/LUT/DAC powerup\n")); /* turn off both displays and the hardcursor (also disables transfers) */ gx00_crtc_dpms(false, false, false); + /* on singlehead cards with TVout program the MAVEN as well */ + if (si->ps.tvout) gx00_maven_dpms(false, false, false); gx00_crtc_cursor_hide(); /* G200 SGRAM and SDRAM use external pix and dac refs, do *not* activate internals! * (this would create electrical shortcuts,