Check for the PENDING message when reading the attached

displays. Ensures the command has completed before continuing.

(probably need to check PENDING in other SDVO calls too)
This commit is contained in:
Alan Hourihane 2007-04-17 16:30:17 +01:00
parent ab5bdee8a6
commit ac9181c014
2 changed files with 15 additions and 4 deletions

View File

@ -1074,12 +1074,19 @@ i830_sdvo_detect(xf86OutputPtr output)
{
CARD8 response[2];
CARD8 status;
CARD8 retry = 50;
i830_sdvo_write_cmd(output, SDVO_CMD_GET_ATTACHED_DISPLAYS, NULL, 0);
status = i830_sdvo_read_response(output, &response, 2);
if (status != SDVO_CMD_STATUS_SUCCESS)
return XF86OutputStatusUnknown;
while (retry--) {
status = i830_sdvo_read_response(output, &response, 2);
if (status == SDVO_CMD_STATUS_SUCCESS)
break;
if (status != SDVO_CMD_STATUS_PENDING)
return XF86OutputStatusUnknown;
}
if (response[0] != 0 || response[1] != 0)
return XF86OutputStatusConnected;

View File

@ -38,7 +38,11 @@
#define SDVO_OUTPUT_SCART0 (1 << 5)
#define SDVO_OUTPUT_LVDS0 (1 << 6)
#define SDVO_OUTPUT_TMDS1 (1 << 8)
#define SDVO_OUTPUT_RGB1 (1 << 13)
#define SDVO_OUTPUT_RGB1 (1 << 9)
#define SDVO_OUTPUT_CVBS1 (1 << 10)
#define SDVO_OUTPUT_SVID1 (1 << 11)
#define SDVO_OUTPUT_YPRPB1 (1 << 12)
#define SDVO_OUTPUT_SCART1 (1 << 13)
#define SDVO_OUTPUT_LVDS1 (1 << 14)
#define SDVO_OUTPUT_LAST (14)