From d6d450e12448e610869cdbaae4efddea81461536 Mon Sep 17 00:00:00 2001 From: Rudolf Cornelissen Date: Sat, 15 Oct 2005 09:52:13 +0000 Subject: [PATCH] added TVout DPMS function: at this time only completely disables output when non-TVout mode is selected. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14391 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../nvidia/engine/nv_brooktreetv.c | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/src/add-ons/accelerants/nvidia/engine/nv_brooktreetv.c b/src/add-ons/accelerants/nvidia/engine/nv_brooktreetv.c index 6dbc88a8c8..4ba93b6bd4 100644 --- a/src/add-ons/accelerants/nvidia/engine/nv_brooktreetv.c +++ b/src/add-ons/accelerants/nvidia/engine/nv_brooktreetv.c @@ -1211,6 +1211,48 @@ static uint8 BT_read_monstat(uint8* monstat) return stat; }//end BT_read_monstat. +static uint8 BT_dpms(bool display) +{ + uint8 stat; + + uint8 buffer[3]; + + LOG(4,("Brooktree: setting DPMS: ")); + + /* reset status */ + i2c_flag_error (-1); + + /* shutdown all analog electronics... */ + buffer[0] = si->ps.tv_encoder.adress + WR; + /* select first TV config register to write */ + buffer[1] = 0xba; + if (display) + { + /* enable all DACs */ + buffer[2] = 0x00; + LOG(4,("display on\n")); + } + else + { + /* shutdown all DACs */ + buffer[2] = 0x10; + LOG(4,("display off\n")); + } + + i2c_bstart(si->ps.tv_encoder.bus); + i2c_writebuffer(si->ps.tv_encoder.bus, buffer, 3); + i2c_bstop(si->ps.tv_encoder.bus); + /* log on errors */ + stat = i2c_flag_error(0); + if (stat) + { + LOG(4,("Brooktree: I2C errors occurred while setting DPMS\n")); + return stat; + } + + return stat; +}//end BT_dpms. + static uint8 BT_killclk_blackout(void) { uint8 stat; @@ -1291,6 +1333,9 @@ static uint8 BT_killclk_blackout(void) return stat; } + /* shutdown all analog electronics */ + stat = BT_dpms(false); + return stat; }//end BT_killclk_blackout.