[Intel-gfx] [PATCH] SDVO: set monitor DPMS state

Zhenyu Wang zhenyu.z.wang at intel.com
Tue Nov 11 04:56:15 CET 2008


Use specific SDVO monitor power state setting command
for monitor DPMS besides encoder power state.

Test with DVI on my chrontel ADD2 card seems working.
People with more SDVO type devices, please help to test this.

Thanks.

---
 src/i830_sdvo.c |   35 +++++++++++++++++++++++++++++++++++
 1 files changed, 35 insertions(+), 0 deletions(-)

diff --git a/src/i830_sdvo.c b/src/i830_sdvo.c
index 4a424de..dc50653 100644
--- a/src/i830_sdvo.c
+++ b/src/i830_sdvo.c
@@ -485,6 +485,34 @@ i830_sdvo_set_encoder_power_state(xf86OutputPtr output, int mode)
     return (status == SDVO_CMD_STATUS_SUCCESS);
 }
 
+static Bool
+i830_sdvo_set_monitor_power_state(xf86OutputPtr output, int mode)
+{
+    uint8_t status;
+    uint8_t state;
+
+    switch (mode) {
+    case DPMSModeOn:
+	state = SDVO_DISPLAY_STATE_ON;
+	break;
+    case DPMSModeStandby:
+	state = SDVO_DISPLAY_STATE_STANDBY;
+	break;
+    case DPMSModeSuspend:
+	state = SDVO_DISPLAY_STATE_SUSPEND;
+	break;
+    case DPMSModeOff:
+	state = SDVO_DISPLAY_STATE_OFF;
+	break;
+    }
+
+    i830_sdvo_write_cmd(output, SDVO_CMD_SET_DISPLAY_POWER_STATE, &state,
+			sizeof(state));
+    status = i830_sdvo_read_response(output, NULL, 0);
+
+    return (status == SDVO_CMD_STATUS_SUCCESS);
+}
+
 /**
  * Returns the pixel clock range limits of the current target input in kHz.
  */
@@ -1130,7 +1158,11 @@ i830_sdvo_dpms(xf86OutputPtr output, int mode)
     uint32_t  temp;
 
     if (mode != DPMSModeOn) {
+	i830_sdvo_set_target_output(output, dev_priv->controlled_output);
+	i830_sdvo_set_monitor_power_state(output, mode);
+
 	i830_sdvo_set_active_outputs(output, 0);
+
 	if (0)
 	    i830_sdvo_set_encoder_power_state(output, mode);
 
@@ -1163,6 +1195,9 @@ i830_sdvo_dpms(xf86OutputPtr output, int mode)
 	if (0)
 	    i830_sdvo_set_encoder_power_state(output, mode);
 	i830_sdvo_set_active_outputs(output, dev_priv->controlled_output);
+
+	i830_sdvo_set_target_output(output, dev_priv->controlled_output);
+	i830_sdvo_set_monitor_power_state(output, mode);
     }
 }
 
-- 
1.5.6.5




More information about the Intel-gfx mailing list