diff options
Diffstat (limited to 'xorg-server/hw/xfree86/os-support/linux')
-rw-r--r-- | xorg-server/hw/xfree86/os-support/linux/Makefile.in | 21 | ||||
-rw-r--r-- | xorg-server/hw/xfree86/os-support/linux/lnx.h | 46 | ||||
-rw-r--r-- | xorg-server/hw/xfree86/os-support/linux/lnx_font.c | 285 |
3 files changed, 13 insertions, 339 deletions
diff --git a/xorg-server/hw/xfree86/os-support/linux/Makefile.in b/xorg-server/hw/xfree86/os-support/linux/Makefile.in index 0dc41eded..ebb05ccc9 100644 --- a/xorg-server/hw/xfree86/os-support/linux/Makefile.in +++ b/xorg-server/hw/xfree86/os-support/linux/Makefile.in @@ -160,6 +160,7 @@ DGA_LIBS = @DGA_LIBS@ DIX_CFLAGS = @DIX_CFLAGS@ DIX_LIB = @DIX_LIB@ DLLTOOL = @DLLTOOL@ +DLOPEN_LIBS = @DLOPEN_LIBS@ DMXEXAMPLES_DEP_CFLAGS = @DMXEXAMPLES_DEP_CFLAGS@ DMXEXAMPLES_DEP_LIBS = @DMXEXAMPLES_DEP_LIBS@ DMXMODULES_CFLAGS = @DMXMODULES_CFLAGS@ @@ -190,6 +191,13 @@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILE_MAN_DIR = @FILE_MAN_DIR@ FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ +FONT100DPIDIR = @FONT100DPIDIR@ +FONT75DPIDIR = @FONT75DPIDIR@ +FONTMISCDIR = @FONTMISCDIR@ +FONTOTFDIR = @FONTOTFDIR@ +FONTROOTDIR = @FONTROOTDIR@ +FONTTTFDIR = @FONTTTFDIR@ +FONTTYPE1DIR = @FONTTYPE1DIR@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ @@ -200,6 +208,7 @@ GREP = @GREP@ HAL_CFLAGS = @HAL_CFLAGS@ HAL_LIBS = @HAL_LIBS@ INSTALL = @INSTALL@ +INSTALL_CMD = @INSTALL_CMD@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -249,6 +258,8 @@ OBJCFLAGS = @OBJCFLAGS@ OBJCLINK = @OBJCLINK@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ +OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ +OPENSSL_LIBS = @OPENSSL_LIBS@ OS_LIB = @OS_LIB@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ @@ -273,6 +284,8 @@ RAWCPPFLAGS = @RAWCPPFLAGS@ SED = @SED@ SERVER_MISC_CONFIG_PATH = @SERVER_MISC_CONFIG_PATH@ SET_MAKE = @SET_MAKE@ +SHA1_CFLAGS = @SHA1_CFLAGS@ +SHA1_LIBS = @SHA1_LIBS@ SHELL = @SHELL@ SOLARIS_ASM_CFLAGS = @SOLARIS_ASM_CFLAGS@ SOLARIS_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ @@ -363,7 +376,6 @@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ -distcleancheck_listfiles = @distcleancheck_listfiles@ docdir = @docdir@ driverdir = @driverdir@ dvidir = @dvidir@ @@ -426,14 +438,7 @@ liblinux_la_SOURCES = lnx_init.c lnx_video.c \ AM_CFLAGS = -DUSESTDRES -DHAVE_SYSV_IPC $(DIX_CFLAGS) $(XORG_CFLAGS) $(PLATFORM_DEFINES) INCLUDES = $(XORG_INCS) $(PLATFORM_INCLUDES) $(LIBDRM_CFLAGS) - -# FIXME: These need to be added to the build -LNX_EXTRA_SRCS = \ - lnx_font.c - EXTRA_DIST = \ - $(LNX_EXTRA_SRCS) \ - lnx.h \ $(srcdir)/../shared/xf86Axp.h @LINUX_ALPHA_TRUE@liblinux_la_LIBADD = liblinuxev56.la diff --git a/xorg-server/hw/xfree86/os-support/linux/lnx.h b/xorg-server/hw/xfree86/os-support/linux/lnx.h deleted file mode 100644 index 33363dd3d..000000000 --- a/xorg-server/hw/xfree86/os-support/linux/lnx.h +++ /dev/null @@ -1,46 +0,0 @@ - -#ifdef HAVE_XORG_CONFIG_H -#include <xorg-config.h> -#endif - -#ifndef LNX_H_ -# ifdef __alpha__ -extern unsigned long _bus_base __P ((void)) __attribute__ ((const)); -extern unsigned long _bus_base_sparse __P ((void)) __attribute__ ((const)); -extern int iopl __P ((int __level)); - -/* new pciconfig_iobase syscall added in 2.2.15 and 2.3.99 */ -# include <linux/unistd.h> -extern long (*_iobase)(unsigned, int, int, int); - -/* - * _iobase deals with the case the __NR_pciconfig_iobase is either undefined - * or unsupported by the kernel, but we need to make sure that the `which' - * argument symbols are defined. - */ -# ifndef IOBASE_HOSE -# define IOBASE_HOSE 0 -# endif -# ifndef IOBASE_SPARSE_MEM -# define IOBASE_SPARSE_MEM 1 -# endif -# ifndef IOBASE_DENSE_MEM -# define IOBASE_DENSE_MEM 2 -# endif -# ifndef IOBASE_SPARSE_IO -# define IOBASE_SPARSE_IO 3 -# endif -# ifndef IOBASE_DENSE_IO -# define IOBASE_DENSE_IO 4 -# endif -# ifndef IOBASE_ROOT_BUS -# define IOBASE_ROOT_BUS 5 -# endif -# ifndef IOBASE_FROM_HOSE -# define IOBASE_FROM_HOSE 0x10000 -# endif -# endif /* __alpha__ */ - -#define LNX_H_ - -#endif diff --git a/xorg-server/hw/xfree86/os-support/linux/lnx_font.c b/xorg-server/hw/xfree86/os-support/linux/lnx_font.c deleted file mode 100644 index d6fc283c0..000000000 --- a/xorg-server/hw/xfree86/os-support/linux/lnx_font.c +++ /dev/null @@ -1,285 +0,0 @@ -/* - * Copyright 2004, Egbert Eich - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * EGBERT EICH BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON- - * NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of Egbert Eich shall not - * be used in advertising or otherwise to promote the sale, use or other deal- - *ings in this Software without prior written authorization from Egbert Eich. - * - */ -#ifdef HAVE_XORG_CONFIG_H -#include <xorg-config.h> -#endif - -#include <X11/X.h> -#include <X11/Xmd.h> - -#include "compiler.h" - -#include "xf86.h" -#include "xf86Priv.h" -#include "xf86_OSlib.h" -#include "lnx.h" - -#include <sys/stat.h> -#include <string.h> -#include <errno.h> - -struct { - int width; - int height; - int charcount; - unsigned char *data; -} lnxfont = { 0, 0, 0, NULL }; - - -static Bool -getfont(int *width, int *height, - int *charcount, unsigned char *data) -{ - struct console_font_op op; - struct consolefontdesc ds; - int result; - - op.op = KD_FONT_OP_GET; - op.width = *width; - op.height = *height; - op.charcount = *charcount; - op.data = data; - op.flags = 0; - - SYSCALL(result = ioctl(xf86Info.consoleFd, KDFONTOP, &op)); - DebugF("Console font read: h: %i count: %i\n",op.height,op.charcount); - - if (!result) { - - *width = op.width; - *height = op.height; - *charcount = op.charcount; - - return TRUE; - } - - if (errno != ENOSYS && errno != EINVAL) - return FALSE; - - /* GIO_FONTX fallback */ - ds.charcount = *charcount; - ds.charheight = *height; - ds.chardata = (char *)data; - *width = 8; - - SYSCALL(result = ioctl(xf86Info.consoleFd, GIO_FONTX, &ds)); - - if (!result) { - - *charcount = ds.charcount; - *height = ds.charheight; - - return TRUE; - } - - if (errno != ENOSYS && errno != EINVAL) - return FALSE; - - /* GIO_FONT fallback */ - if (*charcount < 256) - return FALSE; - - SYSCALL(result = ioctl(xf86Info.consoleFd, GIO_FONT, data)); - - if (!result) { - *height = 0; - *charcount = 512; - return TRUE; - } - - return FALSE; - -} - -#define VERSION_LEN 31 - -Bool -lnx_savefont(void) -{ - unsigned char *fontdata; -#if CHECK_OS_VERSION - char kernel_version[VERSION_LEN + 1]; - int k_major, k_minor, k_release; -#endif - int size; - int fd; - int width = 32, height = 32, charcount = 2048; - - DebugF("SAVE font\n"); - -#if CHECK_OS_VERSION - /* Check if the kernel has full support for this */ - if ((fd = open ("/proc/sys/kernel/osrelease",O_RDONLY)) == -1) { - close (fd); - return TRUE; - } - size = read(fd, kernel_version, VERSION_LEN); - close (fd); - - if (size < 0) - return TRUE; - - size = sscanf(kernel_version, "%d.%d.%d",&k_major,&k_minor,&k_release); - if (size < 3 - || (k_major < 2) - || ((k_major == 2) - && ((k_minor < 6) - || ( k_minor == 6 - && k_release < 11)))) - return TRUE; -#endif - - /* if we are in fbdev mode we don't bother saving fonts */ - if ((fd = open ("/dev/fb0",O_RDWR)) != -1) { - close (fd); - return TRUE; - } - - if (!getfont(&width, &height, &charcount, NULL)) { - xf86Msg(X_WARNING, - "lnx_savefont: cannot obtain font info\n"); - goto error; - } else if (charcount == 2048) { - xf86Msg(X_WARNING, "lnx_savefont: " - "kernel bug: kernel doesn't report font info\n"); - return FALSE; - } - - size = bits_to_bytes(width) * 32 * charcount; - fontdata = (unsigned char *)xnfalloc(size); - if (!fontdata) { - xf86Msg(X_WARNING, - "lnx_savefont: cannot allocate memory to save font\n"); - goto error; - } - - if (!getfont(&width, &height, &charcount, fontdata)) { - xf86Msg(X_WARNING,"lnx_savefont: cannot read font data\n"); - goto error; - } - lnxfont.width = width; - lnxfont.height = height; - lnxfont.charcount = charcount; - lnxfont.data = fontdata; - - return TRUE; - - error: - return FALSE; -} - -static Bool -setfont(int width, int height, - int charcount, unsigned char *data) -{ - struct console_font_op op; - struct consolefontdesc ds; - int result; - - op.op = KD_FONT_OP_SET; - op.flags = 0; - op.charcount = charcount; - op.width = width; - op.height = height; - op.data = data; - - SYSCALL(result = ioctl(xf86Info.consoleFd, KDFONTOP, &op)); - - if (!result) - return TRUE; - - if (errno != ENOSYS && errno != EINVAL) - return FALSE; - - /* PIO_FONTX fallback */ - if (width != 8) - return FALSE; - - ds.charcount = charcount; - ds.chardata = (char *)data; - ds.charheight = height; - SYSCALL(result = ioctl(xf86Info.consoleFd, PIO_FONTX, &ds)); - - if (!result) - return TRUE; - - if (errno != ENOSYS && errno != EINVAL) - return FALSE; - - /* PIO_FONT fallback */ - SYSCALL(result = ioctl(xf86Info.consoleFd, PIO_FONT, data)); - - if (!result) - return TRUE; - - return FALSE; -} - -Bool -lnx_restorefont(void) -{ - if (lnxfont.data == NULL) - return FALSE; - DebugF("RESTORE font\n"); -#if 0 - /* must wack the height to make the kernel reprogram the VGA registers */ - if (!setfont(lnxfont.width, lnxfont.height + 1, lnxfont.charcount, - lnxfont.data)) { - xf86Msg(X_WARNING,"lnx_fontretore: cannot write font data\n"); - return FALSE; - } -#endif - if (!setfont(lnxfont.width, lnxfont.height, lnxfont.charcount, - lnxfont.data)) { - xf86Msg(X_WARNING,"lnx_restorefont: cannot write font data\n"); - return FALSE; - } - - return TRUE; -} - -Bool -lnx_switchaway(void) -{ - Bool ret; - - /* temporarily switch to text mode */ - ioctl(xf86Info.consoleFd, KDSETMODE, KD_TEXT); - ret = lnx_restorefont(); - ioctl(xf86Info.consoleFd, KDSETMODE, KD_GRAPHICS); - return ret; -} - -void -lnx_freefontdata(void) -{ - if (lnxfont.data == NULL) - return; - - xfree(lnxfont.data); - lnxfont.data = NULL; - lnxfont.width = lnxfont.height = lnxfont.charcount = 0; -} |