[Intel-gfx] [PATCH] SDVO: fix usage for SET_TV_FORMAT and GET_SDTV_RESOLUTION_SUPPORT command

Zhenyu Wang zhenyu.z.wang at intel.com
Fri Feb 13 07:05:37 CET 2009


They both needs parameters.
---
 src/i830_sdvo.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/i830_sdvo.c b/src/i830_sdvo.c
index 9cce316..5c2a4b1 100644
--- a/src/i830_sdvo.c
+++ b/src/i830_sdvo.c
@@ -1635,9 +1635,13 @@ i830_sdvo_check_tv_format(xf86OutputPtr output)
 		   SDVO_NAME(dev_priv));
 
 	format.ntsc_m = TRUE;
-	i830_sdvo_write_cmd(output, SDVO_CMD_SET_TV_FORMAT, NULL, 0);
+	i830_sdvo_write_cmd(output, SDVO_CMD_SET_TV_FORMAT, &format,
+		sizeof(format));
 	status = i830_sdvo_read_response(output, NULL, 0);
+	if (status != SDVO_CMD_STATUS_SUCCESS)
+	    return;
     }
+    memcpy(&dev_priv->tv_format, &format, sizeof(format));
 }
 
 static DisplayModePtr
@@ -1647,6 +1651,7 @@ i830_sdvo_get_tv_modes(xf86OutputPtr output)
     struct i830_sdvo_priv *dev_priv = intel_output->dev_priv;
     DisplayModePtr modes = NULL;
     struct i830_sdvo_sdtv_resolution_reply *res = &dev_priv->sdtv_resolutions;
+    struct i830_sdvo_sdtv_resolution_request tv_res;
     uint8_t status;
     float refresh = 60; /* XXX */
 
@@ -1654,7 +1659,10 @@ i830_sdvo_get_tv_modes(xf86OutputPtr output)
 
     /* Read the list of supported input resolutions for the selected TV format.
      */
-    i830_sdvo_write_cmd(output, SDVO_CMD_GET_SDTV_RESOLUTION_SUPPORT, NULL, 0);
+    memset(&tv_res, 0, sizeof(tv_res));
+    memcpy(&tv_res, &dev_priv->tv_format, sizeof(tv_res));
+    i830_sdvo_write_cmd(output, SDVO_CMD_GET_SDTV_RESOLUTION_SUPPORT,
+	    &tv_res, sizeof(tv_res));
     status = i830_sdvo_read_response(output, res, sizeof(*res));
     if (status != SDVO_CMD_STATUS_SUCCESS)
 	return NULL;
-- 
1.5.6.5




More information about the Intel-gfx mailing list