|
|
1.1 root 1: #include <X11/Intrinsic.h>
2: #include <X11/Shell.h>
3: #include <X11/StringDefs.h>
4: #include <X11/Xatom.h>
5: #include <X11/Xaw/Form.h>
6: #include <X11/Xaw/Scrollbar.h>
7: #include <X11/Xaw/Label.h>
8: #include <X11/Xaw/Command.h>
9: #include <X11/Xaw/AsciiText.h>
10: #include <X11/Xaw/Box.h>
11: #include <X11/Xaw/Toggle.h>
12: #include <X11/Xmu/StdSel.h>
13: #include <X11/Xmd.h>
14: #include <X11/extensions/xf86vmode.h>
15: #include <stdlib.h>
16: #include <stdio.h>
17: #include <sys/fcntl.h>
18: #include <sys/mman.h>
19:
20:
21: XF86VidModeGetVideo(dis, screen, addr, width, bank, ram)
22: Display *dis;
23: int screen;
24: char **addr;
25: int *width, *bank, *ram;
26: {
27: int offset, fd;
28: int pid, status;
29:
30: XF86VidModeGetVideoLL(dis, screen , &offset, width, bank, ram);
31:
32:
33: if ((fd = open("/dev/mem", O_RDWR)) < 0)
34: {
35: fprintf(stderr, "XF86VidModeGetVideo: failed to open /dev/mem (%s)\n",
36: strerror(errno));
37: exit (0);
38: }
39:
40: /* This requirers linux-0.99.pl10 or above */
41: *addr = (void *)mmap(NULL, *bank, PROT_READ|PROT_WRITE,
42: MAP_SHARED, fd, (off_t)offset);
43: if (pid = fork()) {
44: Display *disp;
45: waitpid(pid, &status, 0);
46: disp = XOpenDisplay(NULL);
47: XF86VidModeDirectVideo(disp, screen, False);
48: XAutoRepeatOn(dis);
49: XSync(disp,False);
50: _exit(0);
51: }
52: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.