summaryrefslogtreecommitdiffstats
path: root/tools/ddcprobe/ddcxinfos.c
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>1999-11-15 13:02:13 +0000
committerPascal Rigaux <pixel@mandriva.com>1999-11-15 13:02:13 +0000
commit510378574d4d0a97bae46ab21fdf76395b2af1a8 (patch)
treec4f5ef419e9f539bbfaace4990bdf332a097f1a2 /tools/ddcprobe/ddcxinfos.c
parent45c48c55488e62177a3d6a2eb6928a716daf1213 (diff)
downloaddrakx-510378574d4d0a97bae46ab21fdf76395b2af1a8.tar
drakx-510378574d4d0a97bae46ab21fdf76395b2af1a8.tar.gz
drakx-510378574d4d0a97bae46ab21fdf76395b2af1a8.tar.bz2
drakx-510378574d4d0a97bae46ab21fdf76395b2af1a8.tar.xz
drakx-510378574d4d0a97bae46ab21fdf76395b2af1a8.zip
no_comment
Diffstat (limited to 'tools/ddcprobe/ddcxinfos.c')
-rw-r--r--tools/ddcprobe/ddcxinfos.c66
1 files changed, 66 insertions, 0 deletions
diff --git a/tools/ddcprobe/ddcxinfos.c b/tools/ddcprobe/ddcxinfos.c
new file mode 100644
index 000000000..439bdc75b
--- /dev/null
+++ b/tools/ddcprobe/ddcxinfos.c
@@ -0,0 +1,66 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+#include "vbe.h"
+#include "vesamode.h"
+#ident "$Id$"
+
+#define SQR(x) ((x) * (x))
+
+int main(int argc, char **argv)
+{
+ int i, j;
+ u_int16_t *mode_list;
+ unsigned char hmin, hmax, vmin, vmax;
+ struct vbe_info *vbe_info;
+ struct vbe_edid1_info *edid;
+ struct vbe_modeline *modelines;
+
+
+ if ((vbe_info = vbe_get_vbe_info()) == NULL) return 1;
+
+ printf("%dKB of video ram\n", vbe_info->memory_size * 64);
+
+ /* List supported standard modes. */
+ for (mode_list = vbe_info->mode_list.list; *mode_list != 0xffff; mode_list++)
+ for (i = 0; known_vesa_modes[i].x; i++)
+ if (known_vesa_modes[i].number == *mode_list)
+ printf("%d %d %d\n",
+ known_vesa_modes[i].colors,
+ known_vesa_modes[i].x,
+ known_vesa_modes[i].y
+ );
+ printf("\n");
+
+ if ((edid = vbe_get_edid_info()) == NULL) return 0;
+ if (edid->version == 255 && edid->revision == 255) return 0;
+
+ vbe_get_edid_ranges(edid, &hmin, &hmax, &vmin, &vmax);
+ modelines = vbe_get_edid_modelines(edid);
+
+ printf(hmin ? "%d-%d\n" : "\n", hmin, hmax);
+ printf(vmin ? "%d-%d\n" : "\n", vmin, vmax);
+
+ {
+ double size = sqrt(SQR(edid->max_size_horizontal) +
+ SQR(edid->max_size_vertical)) / 2.54;
+ printf(size ? "%3.2f inches monitor (truly %3.2f')\n" : "\n", size * 1.08, size);
+ }
+
+ for(j=0; modelines && (modelines[j].refresh != 0); j++){
+ printf("# %dx%d, %1.1f%sHz",
+ modelines[j].width,
+ modelines[j].height,
+ modelines[j].refresh,
+ modelines[j].interlaced?"i":""
+ );
+ if(modelines[j].modeline) {
+ printf("; hfreq=%f, vfreq=%f\n%s\n",
+ modelines[j].hfreq,
+ modelines[j].vfreq,
+ modelines[j].modeline);
+ } else printf("\n");
+ }
+ return 0;
+}