#include #include #include int main(int argc, char *argv[], char *arge[]) { Bool retval; int dot_clock; XF86VidModeModeLine mode_line; double rate; Display *display; display = XOpenDisplay(NULL); retval = XF86VidModeGetModeLine(display, 0, &dot_clock, &mode_line); printf("dot_clock: %d\n", dot_clock); printf(" hdisplay: %d\n", mode_line.hdisplay); printf(" hsyncstart: %d\n", mode_line.hsyncstart); printf(" hsyncend: %d\n", mode_line.hsyncend); printf(" htotal: %d\n", mode_line.htotal); printf(" vdisplay: %d\n", mode_line.vdisplay); printf(" vsyncstart: %d\n", mode_line.vsyncstart); printf(" vsyncend: %d\n", mode_line.vsyncend); printf(" vtotal: %d\n", mode_line.vtotal); printf(" flags: %x\n", mode_line.flags); printf(" privsize: %d\n", mode_line.privsize); rate = (double)((double)(dot_clock * 1000.0) / (double)(mode_line.htotal * mode_line.vtotal)); printf("rate: %f\n", rate); return(0); }