Add framebuffer device command line switch for Xfbdev
This commit is contained in:
parent
2fb7b8795a
commit
fd609956f2
|
@ -38,11 +38,17 @@ fbdevInitialize (KdCardInfo *card, FbdevPriv *priv)
|
||||||
{
|
{
|
||||||
int k;
|
int k;
|
||||||
unsigned long off;
|
unsigned long off;
|
||||||
if ((priv->fd = open("/dev/fb0", O_RDWR)) < 0 && \
|
|
||||||
(priv->fd = open("/dev/fb/0", O_RDWR)) < 0) {
|
if (fbdevDevicePath == NULL)
|
||||||
perror("Error opening /dev/fb0");
|
fbdevDevicePath = "/dev/fb0";
|
||||||
return FALSE;
|
|
||||||
}
|
if ((priv->fd = open(fbdevDevicePath, O_RDWR)) < 0)
|
||||||
|
{
|
||||||
|
ErrorF("Error opening framebuffer %s: %s\n",
|
||||||
|
fbdevDevicePath, strerror(errno));
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/* quiet valgrind */
|
/* quiet valgrind */
|
||||||
memset (&priv->fix, '\0', sizeof (priv->fix));
|
memset (&priv->fix, '\0', sizeof (priv->fix));
|
||||||
if ((k=ioctl(priv->fd, FBIOGET_FSCREENINFO, &priv->fix)) < 0) {
|
if ((k=ioctl(priv->fd, FBIOGET_FSCREENINFO, &priv->fix)) < 0) {
|
||||||
|
|
|
@ -53,6 +53,7 @@ typedef struct _fbdevScrPriv {
|
||||||
} FbdevScrPriv;
|
} FbdevScrPriv;
|
||||||
|
|
||||||
extern KdCardFuncs fbdevFuncs;
|
extern KdCardFuncs fbdevFuncs;
|
||||||
|
extern char* fbdevDevicePath;
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
fbdevInitialize (KdCardInfo *card, FbdevPriv *priv);
|
fbdevInitialize (KdCardInfo *card, FbdevPriv *priv);
|
||||||
|
|
|
@ -54,17 +54,30 @@ InitInput (int argc, char **argv)
|
||||||
void
|
void
|
||||||
ddxUseMsg (void)
|
ddxUseMsg (void)
|
||||||
{
|
{
|
||||||
KdUseMsg();
|
KdUseMsg();
|
||||||
|
ErrorF("\nXfbdev Device Usage:\n");
|
||||||
|
ErrorF("-fb path Framebuffer device to use. Defaults to /dev/fb0\n");
|
||||||
|
ErrorF("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ddxProcessArgument (int argc, char **argv, int i)
|
ddxProcessArgument (int argc, char **argv, int i)
|
||||||
{
|
{
|
||||||
return KdProcessArgument (argc, argv, i);
|
if (!strcmp (argv[i], "-fb"))
|
||||||
|
{
|
||||||
|
if (i+1 < argc)
|
||||||
|
{
|
||||||
|
fbdevDevicePath = argv[i+1];
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
UseMsg();
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
return KdProcessArgument (argc, argv, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char *fbdevDevicePath = NULL;
|
||||||
|
|
||||||
KdCardFuncs fbdevFuncs = {
|
KdCardFuncs fbdevFuncs = {
|
||||||
fbdevCardInit, /* cardinit */
|
fbdevCardInit, /* cardinit */
|
||||||
fbdevScreenInit, /* scrinit */
|
fbdevScreenInit, /* scrinit */
|
||||||
|
|
Loading…
Reference in New Issue