[haiku-commits] r42829 - haiku/trunk/src/add-ons/accelerants/radeon_hd

  • From: kallisti5@xxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 12 Oct 2011 21:36:47 +0200 (CEST)

Author: kallisti5
Date: 2011-10-12 21:36:47 +0200 (Wed, 12 Oct 2011)
New Revision: 42829
Changeset: https://dev.haiku-os.org/changeset/42829

Modified:
   haiku/trunk/src/add-ons/accelerants/radeon_hd/accelerant.cpp
   haiku/trunk/src/add-ons/accelerants/radeon_hd/accelerant.h
   haiku/trunk/src/add-ons/accelerants/radeon_hd/hooks.cpp
   haiku/trunk/src/add-ons/accelerants/radeon_hd/mode.cpp
   haiku/trunk/src/add-ons/accelerants/radeon_hd/mode.h
Log:
* add *very* preliminary dpms support
  we will need to query the card dpms state
  for each monitor at a later date


Modified: haiku/trunk/src/add-ons/accelerants/radeon_hd/accelerant.cpp
===================================================================
--- haiku/trunk/src/add-ons/accelerants/radeon_hd/accelerant.cpp        
2011-10-12 17:24:15 UTC (rev 42828)
+++ haiku/trunk/src/add-ons/accelerants/radeon_hd/accelerant.cpp        
2011-10-12 19:36:47 UTC (rev 42829)
@@ -146,6 +146,9 @@
        gInfo->is_clone = isClone;
        gInfo->device = device;
 
+       gInfo->dpms_mode = B_DPMS_ON;
+               // initial state
+
        // get basic info from driver
 
        radeon_get_private_data data;

Modified: haiku/trunk/src/add-ons/accelerants/radeon_hd/accelerant.h
===================================================================
--- haiku/trunk/src/add-ons/accelerants/radeon_hd/accelerant.h  2011-10-12 
17:24:15 UTC (rev 42828)
+++ haiku/trunk/src/add-ons/accelerants/radeon_hd/accelerant.h  2011-10-12 
19:36:47 UTC (rev 42829)
@@ -56,6 +56,8 @@
 
        gpu_mc_info             *mc_info;               // used for last known 
mc state
 
+       volatile uint32 dpms_mode;              // current driver dpms mode
+
        // LVDS panel mode passed from the bios/startup.
        display_mode    lvds_panel_mode;
 };

Modified: haiku/trunk/src/add-ons/accelerants/radeon_hd/hooks.cpp
===================================================================
--- haiku/trunk/src/add-ons/accelerants/radeon_hd/hooks.cpp     2011-10-12 
17:24:15 UTC (rev 42828)
+++ haiku/trunk/src/add-ons/accelerants/radeon_hd/hooks.cpp     2011-10-12 
19:36:47 UTC (rev 42829)
@@ -35,12 +35,10 @@
                */
 
                /* DPMS */
-               /*
                case B_DPMS_CAPABILITIES:
                        return (void*)radeon_dpms_capabilities;
                case B_DPMS_MODE:
                        return (void*)radeon_dpms_mode;
-               */
                case B_SET_DPMS_MODE:
                        return (void*)radeon_dpms_set;
 

Modified: haiku/trunk/src/add-ons/accelerants/radeon_hd/mode.cpp
===================================================================
--- haiku/trunk/src/add-ons/accelerants/radeon_hd/mode.cpp      2011-10-12 
17:24:15 UTC (rev 42828)
+++ haiku/trunk/src/add-ons/accelerants/radeon_hd/mode.cpp      2011-10-12 
19:36:47 UTC (rev 42829)
@@ -97,6 +97,23 @@
 }
 
 
+uint32
+radeon_dpms_capabilities(void)
+{
+       // These should be pretty universally supported on Radeon HD cards
+       return B_DPMS_ON | B_DPMS_STAND_BY | B_DPMS_SUSPEND | B_DPMS_OFF;
+}
+
+
+uint32
+radeon_dpms_mode(void)
+{
+       // TODO : this really isn't a good long-term solution
+       // we may need to look at the encoder dpms scratch registers
+       return gInfo->dpms_mode;
+}
+
+
 void
 radeon_dpms_set(int mode)
 {
@@ -128,6 +145,7 @@
                        }
                        break;
        }
+       gInfo->dpms_mode = mode;
 }
 
 

Modified: haiku/trunk/src/add-ons/accelerants/radeon_hd/mode.h
===================================================================
--- haiku/trunk/src/add-ons/accelerants/radeon_hd/mode.h        2011-10-12 
17:24:15 UTC (rev 42828)
+++ haiku/trunk/src/add-ons/accelerants/radeon_hd/mode.h        2011-10-12 
19:36:47 UTC (rev 42829)
@@ -29,6 +29,8 @@
 status_t create_mode_list(void);
 bool is_mode_supported(display_mode* mode);
 status_t is_mode_sane(display_mode *mode);
+uint32 radeon_dpms_capabilities(void);
+uint32 radeon_dpms_mode(void);
 void radeon_dpms_set(int mode);
 
 


Other related posts:

  • » [haiku-commits] r42829 - haiku/trunk/src/add-ons/accelerants/radeon_hd - kallisti5