diff options
author | Alex Deucher <alex@botch2.com> | 2007-08-05 14:41:57 -0400 |
---|---|---|
committer | Alex Deucher <alex@botch2.com> | 2007-08-05 14:41:57 -0400 |
commit | 1fc2a1120e7c05938e2bd72d3c7837ecff8bc9da (patch) | |
tree | 86f6fdf80cd42890fc437602777e9b20c535788c | |
parent | 7d8eb3751d74bd8a1fb9fa2d2fcb9c4c895f6ba4 (diff) |
RADEON: switch DVI-I monitor type attribute to string
-rw-r--r-- | src/radeon_output.c | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/src/radeon_output.c b/src/radeon_output.c index 9ac7d43d..8a355568 100644 --- a/src/radeon_output.c +++ b/src/radeon_output.c @@ -1188,22 +1188,20 @@ radeon_create_resources(xf86OutputPtr output) if (radeon_output->type == OUTPUT_DVI) { if ((info->IsAtomBios && radeon_output->ConnectorType == CONNECTOR_DVI_I_ATOM) || (!info->IsAtomBios && radeon_output->ConnectorType == CONNECTOR_DVI_I)) { - monitor_type_atom = MAKE_ATOM("MONITORTYPE"); + monitor_type_atom = MAKE_ATOM("monitor_type"); - range[0] = DVI_AUTO; - range[1] = DVI_ANALOG; err = RRConfigureOutputProperty(output->randr_output, monitor_type_atom, - FALSE, TRUE, FALSE, 2, range); + FALSE, FALSE, FALSE, 0, NULL); if (err != 0) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "RRConfigureOutputProperty error, %d\n", err); } /* Set the current value of the backlight property */ radeon_output->DVIType = DVI_AUTO; - data = DVI_AUTO; + s = "auto"; err = RRChangeOutputProperty(output->randr_output, monitor_type_atom, - XA_INTEGER, 32, PropModeReplace, 1, &data, - FALSE, TRUE); + XA_STRING, 8, PropModeReplace, strlen(s), (pointer)s, + FALSE, FALSE); if (err != 0) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "RRChangeOutputProperty error, %d\n", err); @@ -1258,17 +1256,21 @@ radeon_set_property(xf86OutputPtr output, Atom property, return FALSE; } } else if (property == monitor_type_atom) { - if (value->type != XA_INTEGER || - value->format != 32 || - value->size != 1) { + const char *s; + if (value->type != XA_STRING || value->format != 8) return FALSE; + s = (char*)value->data; + if (value->size == strlen("auto") && !strncmp("auto", s, strlen("auto"))) { + radeon_output->DVIType = DVI_AUTO; + return TRUE; + } else if (value->size == strlen("analog") && !strncmp("analog", s, strlen("analog"))) { + radeon_output->DVIType = DVI_ANALOG; + return TRUE; + } else if (value->size == strlen("digital") && !strncmp("digital", s, strlen("digital"))) { + radeon_output->DVIType = DVI_DIGITAL; + return TRUE; } - - val = *(INT32 *)value->data; - if (val < DVI_AUTO || val > DVI_ANALOG) - return FALSE; - - radeon_output->DVIType = val; + return FALSE; } return TRUE; |