From f90761b06eaa5fa44fe85289e54eed5f47eff3b9 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Wed, 7 Jun 2006 13:58:24 -0400 Subject: [PATCH 1/8] Add a token for EDID-supplied modes. --- hw/xfree86/common/xf86str.h | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/xfree86/common/xf86str.h b/hw/xfree86/common/xf86str.h index 590bf4cd0..25e3a20bb 100644 --- a/hw/xfree86/common/xf86str.h +++ b/hw/xfree86/common/xf86str.h @@ -127,6 +127,7 @@ typedef enum { /* built-in mode - configure CRTC and clock */ # define M_T_DEFAULT 0x10 /* (VESA) default modes */ # define M_T_USERDEF 0x20 /* One of the modes from the config file */ +# define M_T_EDID 0x40 /* Mode from the EDID info from the monitor */ /* Video mode */ typedef struct _DisplayModeRec { From 21ebcfd7027b2a6182d4065e56a2ef814f5181ae Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Wed, 7 Jun 2006 14:17:31 -0400 Subject: [PATCH 2/8] Demolish now-unused loader functions. --- hw/xfree86/loader/loader.c | 163 ------------------------------------- hw/xfree86/loader/loader.h | 7 -- 2 files changed, 170 deletions(-) diff --git a/hw/xfree86/loader/loader.c b/hw/xfree86/loader/loader.c index 49546ec81..05df28103 100644 --- a/hw/xfree86/loader/loader.c +++ b/hw/xfree86/loader/loader.c @@ -367,169 +367,6 @@ _GetModuleType(int fd, long offset) return LD_ELFDLOBJECT; } -static int offsetbias = 0; /* offset into archive */ - -/* - * _LoaderFileToMem() loads the contents of a file into memory using - * the most efficient method for a platform. - */ -void * -_LoaderFileToMem(int fd, unsigned long offset, int size, char *label) -{ -#ifdef UseMMAP - unsigned long ret; - -# ifdef MmapPageAlign - unsigned long pagesize; - unsigned long new_size; - unsigned long new_off; - unsigned long new_off_bias; -# endif -# define MMAP_PROT (PROT_READ|PROT_WRITE|PROT_EXEC) - -# ifdef DEBUGMEM - ErrorF("_LoaderFileToMem(%d,%u(%u),%d,%s)", fd, offset, offsetbias, size, - label); -# endif -# ifdef MmapPageAlign - pagesize = getpagesize(); - new_size = (size + pagesize - 1) / pagesize; - new_size *= pagesize; - new_off = (offset + offsetbias) / pagesize; - new_off *= pagesize; - new_off_bias = (offset + offsetbias) - new_off; - if ((new_off_bias + size) > new_size) - new_size += pagesize; - ret = (unsigned long)mmap(0, new_size, MMAP_PROT, MAP_PRIVATE -# ifdef __amd64__ - | MAP_32BIT -# endif - , fd, new_off); - if (ret == -1) - FatalError("mmap() failed: %s\n", strerror(errno)); - return (void *)(ret + new_off_bias); -# else - ret = (unsigned long)mmap(0, size, MMAP_PROT, MAP_PRIVATE -# ifdef __amd64__ - | MAP_32BIT -# endif - , fd, offset + offsetbias); - if (ret == -1) - FatalError("mmap() failed: %s\n", strerror(errno)); - return (void *)ret; -# endif -#else - char *ptr; - -# ifdef DEBUGMEM - ErrorF("_LoaderFileToMem(%d,%u(%u),%d,%s)", fd, offset, offsetbias, size, - label); -# endif - - if (size == 0) { -# ifdef DEBUGMEM - ErrorF("=NULL\n", ptr); -# endif - return NULL; - } -# ifndef __UNIXOS2__ - if ((ptr = xf86loadercalloc(size, 1)) == NULL) - FatalError("_LoaderFileToMem() malloc failed\n"); -# else - if ((ptr = os2ldcalloc(size, 1)) == NULL) - FatalError("_LoaderFileToMem() malloc failed\n"); -# endif -# if defined(linux) && defined(__ia64__) - { - unsigned long page_size = getpagesize(); - unsigned long round; - - round = (unsigned long)ptr & (page_size - 1); - mprotect(ptr - round, - (size + round + page_size - 1) & ~(page_size - 1), - PROT_READ | PROT_WRITE | PROT_EXEC); - } -# endif - - if (lseek(fd, offset + offsetbias, SEEK_SET) < 0) - FatalError("\n_LoaderFileToMem() lseek() failed: %s\n", - strerror(errno)); - - if (read(fd, ptr, size) != size) - FatalError("\n_LoaderFileToMem() read() failed: %s\n", - strerror(errno)); - -# if (defined(linux) || defined(__NetBSD__) || defined(__OpenBSD__) \ - || defined(__FreeBSD__)) && defined(__powerpc__) - /* - * Keep the instruction cache in sync with changes in the - * main memory. - */ - { - int i; - - for (i = 0; i < size; i += 16) - ppc_flush_icache(ptr + i); - ppc_flush_icache(ptr + size - 1); - } -# endif - -# ifdef DEBUGMEM - ErrorF("=%lx\n", ptr); -# endif - - return (void *)ptr; -#endif -} - -/* - * _LoaderFreeFileMem() free the memory in which a file was loaded. - */ -void -_LoaderFreeFileMem(void *addr, int size) -{ -#if defined (UseMMAP) && defined (MmapPageAlign) - unsigned long pagesize = getpagesize(); - memType i_addr = (memType) addr; - unsigned long new_size; -#endif -#ifdef DEBUGMEM - ErrorF("_LoaderFreeFileMem(%x,%d)\n", addr, size); -#endif -#ifdef UseMMAP -# if defined (MmapPageAlign) - i_addr /= pagesize; - i_addr *= pagesize; - new_size = (size + pagesize - 1) / pagesize; - new_size *= pagesize; - if (((memType) addr - i_addr + size) > new_size) - new_size += pagesize; - munmap((void *)i_addr, new_size); -# else - munmap((void *)addr, size); -# endif -#else - if (size == 0) - return; - - xf86loaderfree(addr); -#endif - - return; -} - -int -_LoaderFileRead(int fd, unsigned int offset, void *buf, int size) -{ - if (lseek(fd, offset + offsetbias, SEEK_SET) < 0) - FatalError("_LoaderFileRead() lseek() failed: %s\n", strerror(errno)); - - if (read(fd, buf, size) != size) - FatalError("_LoaderFileRead() read() failed: %s\n", strerror(errno)); - - return size; -} - static loaderPtr listHead = (loaderPtr) 0; static loaderPtr diff --git a/hw/xfree86/loader/loader.h b/hw/xfree86/loader/loader.h index 63e6715fa..193adddda 100644 --- a/hw/xfree86/loader/loader.h +++ b/hw/xfree86/loader/loader.h @@ -235,13 +235,6 @@ int _LoaderAddressToSection(const unsigned long, const char **, int LoaderOpen(const char *, const char *, int, int *, int *, int *, int); int LoaderHandleOpen(int); -/* - * File interface functions - */ -void *_LoaderFileToMem(int fd, unsigned long offset, int size, char *label); -void _LoaderFreeFileMem(void *addr, int size); -int _LoaderFileRead(int fd, unsigned int offset, void *addr, int size); - /* * object to name lookup routines */ From e3c11f66516521959127b9ab8fd88cc4c954f5bb Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 7 Jun 2006 12:05:01 -0700 Subject: [PATCH 3/8] Added first cut at a .gitignore file to make using git easier. --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..051d1bd50 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +Makefile +Makefile.in +.deps From e5b72bd9c6fb06640a5de4031be0dc9b04b4b215 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 7 Jun 2006 12:05:39 -0700 Subject: [PATCH 4/8] Remove 3 compiler warnings in the Xext/xevie.c file --- Xext/xevie.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Xext/xevie.c b/Xext/xevie.c index a468affcc..ccc12371a 100644 --- a/Xext/xevie.c +++ b/Xext/xevie.c @@ -104,7 +104,7 @@ typedef struct { } xevieKeycQueueRec, *xevieKeycQueuePtr; #define KEYC_QUEUE_SIZE 100 -xevieKeycQueueRec keycq[KEYC_QUEUE_SIZE] = {0, NULL}; +xevieKeycQueueRec keycq[KEYC_QUEUE_SIZE] = {{0, NULL}}; static int keycqHead = 0, keycqTail = 0; static int ProcDispatch (ClientPtr), SProcDispatch (ClientPtr); @@ -165,7 +165,6 @@ void ResetProc (ExtensionEntry *extEntry) static int ProcQueryVersion (register ClientPtr client) { - REQUEST (xXevieQueryVersionReq); xXevieQueryVersionReply rep; REQUEST_SIZE_MATCH (xXevieQueryVersionReq); @@ -181,7 +180,6 @@ int ProcQueryVersion (register ClientPtr client) static int ProcStart (register ClientPtr client) { - REQUEST (xXevieStartReq); xXevieStartReply rep; REQUEST_SIZE_MATCH (xXevieStartReq); From 101ae616962c355388722e05ab8413eb5f5c3402 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 7 Jun 2006 12:06:22 -0700 Subject: [PATCH 5/8] Add PanoramiXExtensionDisabledHack to globals.h as it was missing. --- Xext/panoramiX.c | 1 - include/globals.h | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c index d1e726804..5d533a464 100644 --- a/Xext/panoramiX.c +++ b/Xext/panoramiX.c @@ -1049,7 +1049,6 @@ ProcXineramaIsActive(ClientPtr client) { /* The following hack fools clients into thinking that Xinerama * is disabled even though it is not. */ - extern Bool PanoramiXExtensionDisabledHack; rep.state = !noPanoramiXExtension && !PanoramiXExtensionDisabledHack; } #else diff --git a/include/globals.h b/include/globals.h index 95e11fe70..d396d19c8 100644 --- a/include/globals.h +++ b/include/globals.h @@ -50,6 +50,7 @@ extern Bool PanoramiXMapped; extern Bool PanoramiXVisibilityNotifySent; extern Bool PanoramiXWindowExposureSent; extern Bool PanoramiXOneExposeRequest; +extern Bool PanoramiXExtensionDisabledHack; #endif #ifdef BIGREQS From 8f5aa38abf1158a789b5528df9d98826342e30cf Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 7 Jun 2006 12:33:44 -0700 Subject: [PATCH 6/8] fix compiler warning about XKB_IN_SERVER redefinition --- dix/devices.c | 2 ++ dix/dispatch.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/dix/devices.c b/dix/devices.c index ef1bdf354..c7d3494e8 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -66,7 +66,9 @@ SOFTWARE. #include "cursorstr.h" #include "dixstruct.h" #include "site.h" +#ifndef XKB_IN_SERVER #define XKB_IN_SERVER +#endif #ifdef XKB #include #endif diff --git a/dix/dispatch.c b/dix/dispatch.c index c8ee8d610..04e2ba11f 100644 --- a/dix/dispatch.c +++ b/dix/dispatch.c @@ -115,7 +115,9 @@ int ProcInitialConnection(); #include #endif #ifdef XKB +#ifndef XKB_IN_SERVER #define XKB_IN_SERVER +#endif #include "inputstr.h" #include #endif From 36d786e9f051c5c95c1cc8c098c84e118ed3cc85 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 7 Jun 2006 12:47:50 -0700 Subject: [PATCH 7/8] add more files to .gitignore --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 051d1bd50..cacc3c5d5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ Makefile Makefile.in .deps +.libs +*.lo +*.la +*.o From cc465800ddca5fb6c9ec09fdfa8f1f05359cf396 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 7 Jun 2006 14:03:35 -0700 Subject: [PATCH 8/8] Fix compiler warnings about SetVendorRelease and SetVendorString --- hw/dmx/dmxinit.c | 3 --- include/dix.h | 6 ++++++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/hw/dmx/dmxinit.c b/hw/dmx/dmxinit.c index ddc4d2b04..e7f04df16 100644 --- a/hw/dmx/dmxinit.c +++ b/hw/dmx/dmxinit.c @@ -78,9 +78,6 @@ extern void GlxSetVisualConfigs( ); #endif /* GLXEXT */ -extern void SetVendorRelease(int release); /* in dix/main.c */ -extern void SetVendorString(char *string); /* in dix/main.c */ - /* Global variables available to all Xserver/hw/dmx routines. */ int dmxNumScreens; DMXScreenInfo *dmxScreens; diff --git a/include/dix.h b/include/dix.h index 1687f751a..9fc5b07b3 100644 --- a/include/dix.h +++ b/include/dix.h @@ -516,6 +516,12 @@ extern void FreeAllAtoms(void); extern void InitAtoms(void); +/* main.c */ + +extern void SetVendorRelease(int release); + +extern void SetVendorString(char *string); + /* events.c */ extern void SetMaskForEvent(