summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandr Shadchin <Alexandr.Shadchin@gmail.com>2011-08-26 18:54:01 +0600
committerAlexandr Shadchin <Alexandr.Shadchin@gmail.com>2011-09-29 23:05:35 +0600
commit38bd1e123d959e0a13514ec415afc8bfb5a170f2 (patch)
tree935830433650e46ec9e13a97d8f1d063faf5ad15
parentf015351c73bb24ce4172911c3e95d67922de42ab (diff)
bsd: Replacement screenFd on consoleFd because they are equivalent
Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Tested-by: Matthieu Herrb <matthieu.herrb@laas.fr>
-rw-r--r--hw/xfree86/common/xf86Globals.c1
-rw-r--r--hw/xfree86/common/xf86Privstr.h2
-rw-r--r--hw/xfree86/os-support/bsd/alpha_video.c2
-rw-r--r--hw/xfree86/os-support/bsd/arm_video.c6
-rw-r--r--hw/xfree86/os-support/bsd/bsd_init.c13
-rw-r--r--hw/xfree86/os-support/bsd/i386_video.c2
-rw-r--r--hw/xfree86/os-support/bsd/ppc_video.c4
-rw-r--r--hw/xfree86/os-support/bsd/sparc64_video.c2
8 files changed, 9 insertions, 23 deletions
diff --git a/hw/xfree86/common/xf86Globals.c b/hw/xfree86/common/xf86Globals.c
index 93533ec80..9a42bb990 100644
--- a/hw/xfree86/common/xf86Globals.c
+++ b/hw/xfree86/common/xf86Globals.c
@@ -111,7 +111,6 @@ xf86InfoRec xf86Info = {
.caughtSignal = FALSE,
.currentScreen = NULL,
#ifdef CSRG_BASED
- .screenFd = -1,
.consType = -1,
#endif
.allowMouseOpenFail = FALSE,
diff --git a/hw/xfree86/common/xf86Privstr.h b/hw/xfree86/common/xf86Privstr.h
index 14cd56a26..feab5c161 100644
--- a/hw/xfree86/common/xf86Privstr.h
+++ b/hw/xfree86/common/xf86Privstr.h
@@ -76,8 +76,6 @@ typedef struct {
/* graphics part */
ScreenPtr currentScreen;
#if defined(CSRG_BASED) || defined(__FreeBSD_kernel__)
- int screenFd; /* fd for memory mapped access to
- * vga card */
int consType; /* Which console driver? */
#endif
diff --git a/hw/xfree86/os-support/bsd/alpha_video.c b/hw/xfree86/os-support/bsd/alpha_video.c
index bb3a5cb47..15eb2a422 100644
--- a/hw/xfree86/os-support/bsd/alpha_video.c
+++ b/hw/xfree86/os-support/bsd/alpha_video.c
@@ -340,7 +340,7 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
base = mmap(0, Size,
(flags & VIDMEM_READONLY) ?
PROT_READ : (PROT_READ | PROT_WRITE),
- MAP_FLAGS, xf86Info.screenFd,
+ MAP_FLAGS, xf86Info.consoleFd,
(unsigned long)Base + BUS_BASE);
if (base == MAP_FAILED)
{
diff --git a/hw/xfree86/os-support/bsd/arm_video.c b/hw/xfree86/os-support/bsd/arm_video.c
index 482d53fc3..eb631a7f3 100644
--- a/hw/xfree86/os-support/bsd/arm_video.c
+++ b/hw/xfree86/os-support/bsd/arm_video.c
@@ -213,7 +213,7 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
base = mmap(0, Size,
(flags & VIDMEM_READONLY) ?
PROT_READ : (PROT_READ | PROT_WRITE),
- MAP_FLAGS, xf86Info.screenFd,
+ MAP_FLAGS, xf86Info.consoleFd,
(unsigned long)Base - 0xA0000);
if (base == MAP_FAILED)
{
@@ -306,7 +306,7 @@ checkMapInfo(Bool warn, int Region)
if(!memAccP->Checked)
{
- if(ioctl(xf86Info.screenFd, memAccP->ioctl, &(memAccP->memInfo)) == -1)
+ if(ioctl(xf86Info.consoleFd, memAccP->ioctl, &(memAccP->memInfo)) == -1)
{
if(warn)
{
@@ -360,7 +360,7 @@ xf86MapInfoMap(struct memAccess *memInfoP, pointer Base, unsigned long Size)
Size,
PROT_READ | PROT_WRITE,
MAP_SHARED,
- xf86Info.screenFd,
+ xf86Info.consoleFd,
(unsigned long)mapInfoP->u.map_info_mmap.map_offset))
== (pointer)-1)
{
diff --git a/hw/xfree86/os-support/bsd/bsd_init.c b/hw/xfree86/os-support/bsd/bsd_init.c
index 837a2f4d1..f9d546f28 100644
--- a/hw/xfree86/os-support/bsd/bsd_init.c
+++ b/hw/xfree86/os-support/bsd/bsd_init.c
@@ -211,7 +211,6 @@ xf86OpenConsole()
fclose(stdin);
#endif
xf86Info.consoleFd = fd;
- xf86Info.screenFd = fd;
switch (xf86Info.consType)
{
@@ -688,22 +687,12 @@ xf86CloseConsole()
case WSCONS:
{
int mode = WSDISPLAYIO_MODE_EMUL;
- ioctl(xf86Info.screenFd, WSDISPLAYIO_SMODE, &mode);
+ ioctl(xf86Info.consoleFd, WSDISPLAYIO_SMODE, &mode);
break;
}
#endif
}
- if (xf86Info.screenFd != xf86Info.consoleFd)
- {
- close(xf86Info.screenFd);
- close(xf86Info.consoleFd);
- if ((xf86Info.consoleFd = open("/dev/console",O_RDONLY,0)) <0)
- {
- xf86FatalError("xf86CloseConsole: Cannot open /dev/console (%s)",
- strerror(errno));
- }
- }
close(xf86Info.consoleFd);
if (devConsoleFd >= 0)
close(devConsoleFd);
diff --git a/hw/xfree86/os-support/bsd/i386_video.c b/hw/xfree86/os-support/bsd/i386_video.c
index 7aef07901..525bfb607 100644
--- a/hw/xfree86/os-support/bsd/i386_video.c
+++ b/hw/xfree86/os-support/bsd/i386_video.c
@@ -258,7 +258,7 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
base = mmap(0, Size,
(flags & VIDMEM_READONLY) ?
PROT_READ : (PROT_READ | PROT_WRITE),
- MAP_FLAGS, xf86Info.screenFd,
+ MAP_FLAGS, xf86Info.consoleFd,
(unsigned long)Base - 0xA0000
);
if (base == MAP_FAILED)
diff --git a/hw/xfree86/os-support/bsd/ppc_video.c b/hw/xfree86/os-support/bsd/ppc_video.c
index 7e3fcdb2c..aeaf18305 100644
--- a/hw/xfree86/os-support/bsd/ppc_video.c
+++ b/hw/xfree86/os-support/bsd/ppc_video.c
@@ -73,7 +73,7 @@ volatile unsigned char *ioBase = MAP_FAILED;
static pointer
ppcMapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
{
- int fd = xf86Info.screenFd;
+ int fd = xf86Info.consoleFd;
pointer base;
#ifdef DEBUG
xf86MsgVerb(X_INFO, 3, "mapVidMem %lx, %lx, fd = %d",
@@ -125,7 +125,7 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
Bool xf86EnableIO()
{
- int fd = xf86Info.screenFd;
+ int fd = xf86Info.consoleFd;
xf86MsgVerb(X_WARNING, 3, "xf86EnableIO %d\n", fd);
if (ioBase == MAP_FAILED)
diff --git a/hw/xfree86/os-support/bsd/sparc64_video.c b/hw/xfree86/os-support/bsd/sparc64_video.c
index c838792b5..a2a30c9d7 100644
--- a/hw/xfree86/os-support/bsd/sparc64_video.c
+++ b/hw/xfree86/os-support/bsd/sparc64_video.c
@@ -58,7 +58,7 @@ static pointer
sparc64MapVidMem(int ScreenNum, unsigned long Base, unsigned long Size,
int flags)
{
- int fd = xf86Info.screenFd;
+ int fd = xf86Info.consoleFd;
pointer base;
#ifdef DEBUG