summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCsillag Kristof <csillag.kristof@united-consult.hu>2009-10-09 18:00:09 -0400
committerAlex Deucher <alexdeucher@gmail.com>2009-10-09 18:00:09 -0400
commitf4407962cd7b272e0860319f11f6a6583ef226c2 (patch)
treea63eec94d7ce054c8128f38002a5184c8f51b0ca /src
parentde55995e82c3875f70b6394fff440d695d062113 (diff)
Fix some issues with CustomEDID support
- Fixes a memory allocation problem introduced with the previous version of the CustomEDID patch (now in GIT), and - Enhances the syntax of the CustomEDID option so that I can force digital output, even if the EDID was acquired over an analog link.
Diffstat (limited to 'src')
-rw-r--r--src/radeon_output.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/src/radeon_output.c b/src/radeon_output.c
index 75f63b73..04290881 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -228,12 +228,14 @@ RADEONGetHardCodedEDIDFromFile(xf86OutputPtr output)
radeon_output->custom_mon = NULL;
if (EDIDlist != NULL) {
- unsigned char edid[128];
+ unsigned char* edid = xnfcalloc(128, 1);
char *name = output->name;
char *outputEDID = strstr(EDIDlist, name);
if (outputEDID != NULL) {
char *end;
+ char *colon;
+ char *command = NULL;
int fd;
outputEDID += strlen(name) + 1;
@@ -241,6 +243,12 @@ RADEONGetHardCodedEDIDFromFile(xf86OutputPtr output)
if (end != NULL)
*end = 0;
+ colon = strstr(outputEDID, ":");
+ if (colon != NULL) {
+ *colon = 0;
+ command = colon + 1;
+ }
+
fd = open (outputEDID, O_RDONLY);
if (fd >= 0) {
read(fd, edid, 128);
@@ -251,6 +259,27 @@ RADEONGetHardCodedEDIDFromFile(xf86OutputPtr output)
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"Successfully read Custom EDID data for output %s from %s.\n",
name, outputEDID);
+ if (command != NULL) {
+ if (!strcmp(command, "digital")) {
+ struct edid_version *v = &radeon_output->custom_mon->ver;
+ struct disp_features *r = &radeon_output->custom_mon->features;
+ r->input_type = 1;
+ if (v->revision == 2 || v->revision == 3) {
+ // Nothing to do
+ } else if (v->revision >= 4) {
+ r->input_interface = 1; // Using DVI by default
+ r->input_bpc = 2; // 8 bits per channes by default
+ }
+ radeon_output->custom_mon->rawData[0x14] |= 0x80;
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "Forcing digital output for output %s.\n", name);
+ } else {
+ xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
+ "Unknown custom EDID command: '%s'.\n",
+ command);
+ }
+ }
+
} else {
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
"Custom EDID data for %s read from %s was invalid.\n",