summaryrefslogtreecommitdiff
path: root/src/radeon_output.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/radeon_output.c')
-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 75f63b7..0429088 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",