summaryrefslogtreecommitdiffstats
path: root/ddcprobe/vbe.c
diff options
context:
space:
mode:
authornsdahya1 <nsdahya1>1999-07-19 15:13:06 +0000
committernsdahya1 <nsdahya1>1999-07-19 15:13:06 +0000
commit9dd1df3dafde07c0b52983fd9f07b56ddc2350e1 (patch)
tree798558fa74a347fa5fc0a55f7b797cc5e24e2cd4 /ddcprobe/vbe.c
parentc53c2f0c7be8f65083b8ab542e7554c65ea1e0a7 (diff)
downloadanaconda-9dd1df3dafde07c0b52983fd9f07b56ddc2350e1.tar.gz
anaconda-9dd1df3dafde07c0b52983fd9f07b56ddc2350e1.tar.xz
anaconda-9dd1df3dafde07c0b52983fd9f07b56ddc2350e1.zip
updates for updated structure fields
Diffstat (limited to 'ddcprobe/vbe.c')
-rw-r--r--ddcprobe/vbe.c70
1 files changed, 39 insertions, 31 deletions
diff --git a/ddcprobe/vbe.c b/ddcprobe/vbe.c
index 6f4a2d7c2..23bec4fd8 100644
--- a/ddcprobe/vbe.c
+++ b/ddcprobe/vbe.c
@@ -314,15 +314,21 @@ struct vbe_modeline *vbe_get_edid_modelines()
return NULL;
}
- for(i = 0; i < 8; i++) {
- if(edid->established_timings1 & (1 << i)) {
- modeline_count++;
- }
- if(edid->established_timings2 & (1 << i)) {
+ memcpy(buf, &edid->established_timings,
+ sizeof(edid->established_timings));
+ for(i = 0; i < (8 * sizeof(edid->established_timings)); i++) {
+ if(buf[i / 8] & (1 << (i % 8))) {
modeline_count++;
}
- if((edid->standard_timing[i].xresolution >= 2) ||
- (edid->standard_timing[i].vfreq >= 2)) {
+ }
+
+ /* Count the number of standard timings. */
+ for(i = 0; i < 8; i++) {
+ int x, v;
+ x = edid->standard_timing[i].xresolution;
+ v = edid->standard_timing[i].vfreq;
+ if(((edid->standard_timing[i].xresolution & 0x01) != x) &&
+ ((edid->standard_timing[i].vfreq & 0x01) != v)) {
modeline_count++;
}
}
@@ -336,98 +342,98 @@ struct vbe_modeline *vbe_get_edid_modelines()
modeline_count = 0;
/* Fill out established timings. */
- if(edid->established_timings1&VBE_EDID_ESTABLISHED_TIMING1_720x400_70) {
+ if(edid->established_timings.timing_720x400_70) {
ret[modeline_count].width = 720;
ret[modeline_count].height = 400;
ret[modeline_count].refresh = 70;
modeline_count++;
}
- if(edid->established_timings1&VBE_EDID_ESTABLISHED_TIMING1_720x400_88) {
+ if(edid->established_timings.timing_720x400_88) {
ret[modeline_count].width = 720;
ret[modeline_count].height = 400;
ret[modeline_count].refresh = 88;
modeline_count++;
}
- if(edid->established_timings1&VBE_EDID_ESTABLISHED_TIMING1_640x480_60) {
+ if(edid->established_timings.timing_640x480_60) {
ret[modeline_count].width = 640;
ret[modeline_count].height = 480;
ret[modeline_count].refresh = 60;
modeline_count++;
}
- if(edid->established_timings1&VBE_EDID_ESTABLISHED_TIMING1_640x480_67) {
+ if(edid->established_timings.timing_640x480_67) {
ret[modeline_count].width = 640;
ret[modeline_count].height = 480;
ret[modeline_count].refresh = 67;
modeline_count++;
}
- if(edid->established_timings1&VBE_EDID_ESTABLISHED_TIMING1_640x480_72) {
+ if(edid->established_timings.timing_640x480_72) {
ret[modeline_count].width = 640;
ret[modeline_count].height = 480;
ret[modeline_count].refresh = 72;
modeline_count++;
}
- if(edid->established_timings1&VBE_EDID_ESTABLISHED_TIMING1_640x480_75) {
+ if(edid->established_timings.timing_640x480_75) {
ret[modeline_count].width = 640;
ret[modeline_count].height = 480;
ret[modeline_count].refresh = 75;
modeline_count++;
}
- if(edid->established_timings1&VBE_EDID_ESTABLISHED_TIMING1_800x600_56) {
+ if(edid->established_timings.timing_800x600_56) {
ret[modeline_count].width = 800;
ret[modeline_count].height = 600;
ret[modeline_count].refresh = 56;
modeline_count++;
}
- if(edid->established_timings1&VBE_EDID_ESTABLISHED_TIMING1_800x600_60) {
+ if(edid->established_timings.timing_800x600_60) {
ret[modeline_count].width = 800;
ret[modeline_count].height = 600;
ret[modeline_count].refresh = 60;
modeline_count++;
}
- if(edid->established_timings1&VBE_EDID_ESTABLISHED_TIMING2_800x600_72) {
+ if(edid->established_timings.timing_800x600_72) {
ret[modeline_count].width = 800;
ret[modeline_count].height = 600;
ret[modeline_count].refresh = 72;
modeline_count++;
}
- if(edid->established_timings1&VBE_EDID_ESTABLISHED_TIMING2_800x600_75) {
+ if(edid->established_timings.timing_800x600_75) {
ret[modeline_count].width = 800;
ret[modeline_count].height = 600;
ret[modeline_count].refresh = 75;
modeline_count++;
}
- if(edid->established_timings1&VBE_EDID_ESTABLISHED_TIMING2_832x624_75) {
+ if(edid->established_timings.timing_832x624_75) {
ret[modeline_count].width = 832;
ret[modeline_count].height = 624;
ret[modeline_count].refresh = 75;
modeline_count++;
}
- if(edid->established_timings1&VBE_EDID_ESTABLISHED_TIMING2_1024x768_87i) {
+ if(edid->established_timings.timing_1024x768_87i) {
ret[modeline_count].width = 1024;
ret[modeline_count].height = 768;
ret[modeline_count].refresh = 87;
ret[modeline_count].interlaced = 1;
modeline_count++;
}
- if(edid->established_timings1&VBE_EDID_ESTABLISHED_TIMING2_1024x768_60){
+ if(edid->established_timings.timing_1024x768_60){
ret[modeline_count].width = 1024;
ret[modeline_count].height = 768;
ret[modeline_count].refresh = 60;
modeline_count++;
}
- if(edid->established_timings1&VBE_EDID_ESTABLISHED_TIMING2_1024x768_70){
+ if(edid->established_timings.timing_1024x768_70){
ret[modeline_count].width = 1024;
ret[modeline_count].height = 768;
ret[modeline_count].refresh = 70;
modeline_count++;
}
- if(edid->established_timings1&VBE_EDID_ESTABLISHED_TIMING2_1024x768_75){
+ if(edid->established_timings.timing_1024x768_75){
ret[modeline_count].width = 1024;
ret[modeline_count].height = 768;
ret[modeline_count].refresh = 75;
modeline_count++;
}
- if(edid->established_timings1&VBE_EDID_ESTABLISHED_TIMING2_1280x1024_75) {
+ if(edid->established_timings.timing_1280x1024_75) {
ret[modeline_count].width = 1280;
ret[modeline_count].height = 1024;
ret[modeline_count].refresh = 75;
@@ -437,20 +443,22 @@ struct vbe_modeline *vbe_get_edid_modelines()
/* Add in standard timings. */
for(i = 0; i < 8; i++) {
float aspect = 1;
- int x;
- if((edid->standard_timing[i].xresolution >= 2) ||
- (edid->standard_timing[i].vfreq >= 2)) {
- switch(edid->standard_timing[i].vfreq >> 6) {
- case 1: aspect = 0.7500; break;
- case 2: aspect = 0.8000; break;
- case 3: aspect = 0.5625; break;
+ int x, v;
+ x = edid->standard_timing[i].xresolution;
+ v = edid->standard_timing[i].vfreq;
+ if(((edid->standard_timing[i].xresolution & 0x01) != x) &&
+ ((edid->standard_timing[i].vfreq & 0x01) != v)) {
+ switch(edid->standard_timing[i].aspect) {
+ case aspect_75: aspect = 0.7500; break;
+ case aspect_8: aspect = 0.8000; break;
+ case aspect_5625: aspect = 0.5625; break;
default: aspect = 1; break;
}
x = (edid->standard_timing[i].xresolution + 31) * 8;
ret[modeline_count].width = x;
ret[modeline_count].height = x * aspect;
ret[modeline_count].refresh =
- (edid->standard_timing[i].vfreq & 0x1f) + 60;
+ edid->standard_timing[i].vfreq + 60;
modeline_count++;
}
}