summaryrefslogtreecommitdiffstats
path: root/tools/ddcprobe/ddcxinfos.c
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2005-02-28 23:06:31 +0000
committerPascal Rigaux <pixel@mandriva.com>2005-02-28 23:06:31 +0000
commitb32fd10dd6fc1292d78a3a6a6cb87e1ad904f142 (patch)
tree3de51de387129c058de30ba6b769989e53c61ad3 /tools/ddcprobe/ddcxinfos.c
parent1f2d53396dd61b3ee999db70f1b373dd015d0b73 (diff)
downloaddrakx-backup-do-not-use-b32fd10dd6fc1292d78a3a6a6cb87e1ad904f142.tar
drakx-backup-do-not-use-b32fd10dd6fc1292d78a3a6a6cb87e1ad904f142.tar.gz
drakx-backup-do-not-use-b32fd10dd6fc1292d78a3a6a6cb87e1ad904f142.tar.bz2
drakx-backup-do-not-use-b32fd10dd6fc1292d78a3a6a6cb87e1ad904f142.tar.xz
drakx-backup-do-not-use-b32fd10dd6fc1292d78a3a6a6cb87e1ad904f142.zip
- remove ddcxinfos, replaced by monitor-edid (which is in a separate package)
- add many resolutions (they are structured by aspect ratio for next move) - put the "Monitor preferred modeline" from EDID in xorg.conf - for this ModeLine must be exported from the monitor section - specifying a VendorName|ModelName in auto_inst is valid, don't overwrite it with edid probe - the strange /dev/zero needed (?) by ddcxinfos is no more needed - field {size} is now {diagonal_size}, and is no more "corrected" - add @CVT_ratios and @CVT_vfreqs (unused at the moment) - Getopt::Long is needed by monitor-parse-edid
Diffstat (limited to 'tools/ddcprobe/ddcxinfos.c')
-rw-r--r--tools/ddcprobe/ddcxinfos.c125
1 files changed, 0 insertions, 125 deletions
diff --git a/tools/ddcprobe/ddcxinfos.c b/tools/ddcprobe/ddcxinfos.c
deleted file mode 100644
index 930f4e1a3..000000000
--- a/tools/ddcprobe/ddcxinfos.c
+++ /dev/null
@@ -1,125 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-#include <sys/mman.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <stdarg.h>
-#include "vbe.h"
-#include "vesamode.h"
-#include "xbox.h"
-
-#ifdef HAVE_VBE
-#include "int10/vbios.h"
-#else
-#define InitInt10(PCI_CONFIG) 0
-#define FreeInt10() /**/
-#endif
-
-#ident "$Id$"
-
-#define SQR(x) ((x) * (x))
-
-void log_err(char *format, ...)
-{
- va_list args;
- va_start(args, format);
- vfprintf(stderr, format, args);
- va_end(args);
-}
-
-int main(void)
-{
- int i, j;
- unsigned char hmin, hmax, vmin, vmax;
- struct vbe_info vbe_info_static;
- struct vbe_info *vbe_info = &vbe_info_static;
- struct vbe_edid1_info edid_static;
- struct vbe_edid1_info *edid = &edid_static;
- struct vbe_modeline *modelines;
- int pci_config_type = 0;
-
- /* Determine PCI configuration type */
- pci_config_type = 1;
-
- /* Get VBE information */
-#ifdef HAVE_VBE
- if (box_is_xbox() == 1) {
- if (get_fb_info(vbe_info) == 0)
- return 1;
- } else {
-#endif
- /* Initialize Int10 */
- if (InitInt10(pci_config_type)) return 1;
- if (vbe_get_vbe_info(vbe_info) == 0) {
- FreeInt10();
- return 1;
- }
-#ifdef HAVE_VBE
- }
-#endif
- printf("%dKB of video ram\n", vbe_info->memory_size / 1024);
-
- /* List supported standard modes */
-#ifdef HAVE_VBE
- for (j = 0; j < vbe_info->modes; j++)
- for (i = 0; known_vesa_modes[i].x; i++)
- if (known_vesa_modes[i].number == vbe_info->mode_list[j])
- printf("%d %d %d\n",
- known_vesa_modes[i].colors,
- known_vesa_modes[i].x,
- known_vesa_modes[i].y
- );
- /* optimal on a TV, just return canned values */
- if (box_is_xbox() == 1)
- printf("%d %d %d\n", 16777216, 640, 480);
-#endif
- printf("\n");
-
- /* Get EDID information */
- if (vbe_get_edid_info(edid) == 0) {
- FreeInt10();
- return 0;
- }
- FreeInt10();
-
- if (edid->manufacturer_name.p == 0 || edid->product_code == 0) 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);
-
- if (hmin > hmax || vmin > vmax) return 0;
-
- printf(hmin ? "%d-%d kHz HorizSync\n" : "\n", hmin, hmax);
- printf(vmin ? "%d-%d Hz VertRefresh\n" : "\n", vmin, vmax);
-
- if (edid->max_size_horizontal != 127 && edid->max_size_vertical != 127) {
- char manufacturer[4];
- double size = sqrt(SQR(edid->max_size_horizontal) +
- SQR(edid->max_size_vertical)) / 2.54;
- manufacturer[0] = edid->manufacturer_name.u.char1 + 'A' - 1;
- manufacturer[1] = edid->manufacturer_name.u.char2 + 'A' - 1;
- manufacturer[2] = edid->manufacturer_name.u.char3 + 'A' - 1;
- manufacturer[3] = '\0';
- printf(size ? "%3.2f inches monitor (truly %3.2f') EISA ID=%s%04x\n" : "\n", size * 1.08, size, manufacturer, edid->product_code);
- }
-
- 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;
-}