summaryrefslogtreecommitdiffstats
path: root/meta-extras/packages/xorg-xserver/xserver-kdrive-xomap/xfbdev-fb-opt.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-extras/packages/xorg-xserver/xserver-kdrive-xomap/xfbdev-fb-opt.patch')
-rw-r--r--meta-extras/packages/xorg-xserver/xserver-kdrive-xomap/xfbdev-fb-opt.patch82
1 files changed, 82 insertions, 0 deletions
diff --git a/meta-extras/packages/xorg-xserver/xserver-kdrive-xomap/xfbdev-fb-opt.patch b/meta-extras/packages/xorg-xserver/xserver-kdrive-xomap/xfbdev-fb-opt.patch
new file mode 100644
index 0000000000..a8f002ea2a
--- /dev/null
+++ b/meta-extras/packages/xorg-xserver/xserver-kdrive-xomap/xfbdev-fb-opt.patch
@@ -0,0 +1,82 @@
1---
2 hw/kdrive/fbdev/fbdev.c | 17 ++++++++++++-----
3 hw/kdrive/fbdev/fbdev.h | 1 +
4 hw/kdrive/fbdev/fbinit.c | 20 ++++++++++++++++----
5 3 files changed, 29 insertions(+), 9 deletions(-)
6
7--- xorg-server-X11R7.1-1.1.0.orig/hw/kdrive/fbdev/fbdev.c
8+++ xorg-server-X11R7.1-1.1.0/hw/kdrive/fbdev/fbdev.c
9@@ -33,16 +33,23 @@
10
11 extern int KdTsPhyScreen;
12
13+char *fbdevDevicePath = NULL;
14 Bool
15 fbdevInitialize (KdCardInfo *card, FbdevPriv *priv)
16 {
17 int k;
18 unsigned long off;
19- if ((priv->fd = open("/dev/fb0", O_RDWR)) < 0 && \
20- (priv->fd = open("/dev/fb/0", O_RDWR)) < 0) {
21- perror("Error opening /dev/fb0");
22- return FALSE;
23- }
24+
25+ if (fbdevDevicePath == NULL)
26+ fbdevDevicePath = "/dev/fb0";
27+
28+ if ((priv->fd = open(fbdevDevicePath, O_RDWR)) < 0)
29+ {
30+ ErrorF("Error opening framebuffer %s: %s\n",
31+ fbdevDevicePath, strerror(errno));
32+ return FALSE;
33+ }
34+
35 /* quiet valgrind */
36 memset (&priv->fix, '\0', sizeof (priv->fix));
37 if ((k=ioctl(priv->fd, FBIOGET_FSCREENINFO, &priv->fix)) < 0) {
38--- xorg-server-X11R7.1-1.1.0.orig/hw/kdrive/fbdev/fbdev.h
39+++ xorg-server-X11R7.1-1.1.0/hw/kdrive/fbdev/fbdev.h
40@@ -53,6 +53,7 @@ typedef struct _fbdevScrPriv {
41 } FbdevScrPriv;
42
43 extern KdCardFuncs fbdevFuncs;
44+extern char* fbdevDevicePath;
45
46 Bool
47 fbdevInitialize (KdCardInfo *card, FbdevPriv *priv);
48--- xorg-server-X11R7.1-1.1.0.orig/hw/kdrive/fbdev/fbinit.c
49+++ xorg-server-X11R7.1-1.1.0/hw/kdrive/fbdev/fbinit.c
50@@ -59,16 +59,28 @@ InitInput (int argc, char **argv)
51 void
52 ddxUseMsg (void)
53 {
54- KdUseMsg();
55+ KdUseMsg();
56+ ErrorF("\nXfbdev Device Usage:\n");
57+ ErrorF("-fb path Framebuffer device to use. Defaults to /dev/fb0\n");
58+ ErrorF("\n");
59 }
60
61 int
62 ddxProcessArgument (int argc, char **argv, int i)
63 {
64- return KdProcessArgument (argc, argv, i);
65-}
66-
67+ if (!strcmp (argv[i], "-fb"))
68+ {
69+ if (i+1 < argc)
70+ {
71+ fbdevDevicePath = argv[i+1];
72+ return 2;
73+ }
74+ UseMsg();
75+ exit(1);
76+ }
77
78+ return KdProcessArgument (argc, argv, i);
79+}
80
81 KdCardFuncs fbdevFuncs = {
82 fbdevCardInit, /* cardinit */