xserver: Branch 'master' - 15 commits

Keith Packard keithp at kemper.freedesktop.org
Wed Mar 9 14:19:16 PST 2011


 Xext/panoramiX.c                       |   10 -
 Xext/panoramiXsrv.h                    |   12 -
 Xext/xvdix.h                           |   12 -
 Xext/xvmain.c                          |   14 --
 Xext/xvmc.c                            |    6 
 Xi/exglobals.h                         |    2 
 Xi/extinit.c                           |    2 
 dix/Makefile.am                        |    1 
 dix/deprecated.c                       |  165 --------------------------
 exa/exa.h                              |    2 
 exa/exa_classic.c                      |    4 
 exa/exa_driver.c                       |    6 
 exa/exa_migration_mixed.c              |    4 
 exa/exa_mixed.c                        |    4 
 exa/exa_priv.h                         |    6 
 fb/fb.h                                |    4 
 fb/fb24_32.c                           |    2 
 fb/fbpixmap.c                          |   10 -
 glx/glapi.c                            |  205 ---------------------------------
 glx/glapi.h                            |   22 ---
 glx/glthread.c                         |  162 --------------------------
 glx/glthread.h                         |   69 -----------
 hw/dmx/dmxpixmap.c                     |    5 
 hw/dmx/dmxpixmap.h                     |    2 
 hw/xfree86/common/xf86Config.c         |    4 
 hw/xfree86/common/xf86VGAarbiter.c     |    4 
 hw/xfree86/common/xf86VGAarbiterPriv.h |    2 
 hw/xfree86/vbe/vbe.c                   |    2 
 hw/xfree86/xaa/xaaInit.c               |   10 -
 hw/xnest/Pixmap.c                      |    5 
 hw/xnest/XNPixmap.h                    |    2 
 hw/xwin/win.h                          |    2 
 hw/xwin/winpixmap.c                    |    7 -
 include/dix.h                          |   31 ----
 include/misc.h                         |    2 
 include/pixmapstr.h                    |    1 
 include/resource.h                     |   29 ----
 include/scrnintstr.h                   |    2 
 render/render.c                        |    2 
 39 files changed, 77 insertions(+), 759 deletions(-)

New commits:
commit a19771e4337d1c4600550314bbc42a1495a023ff
Author: Erkki Seppälä <erkki.seppala at vincit.fi>
Date:   Tue Mar 8 13:29:41 2011 -0500

    xfree86/common: Remove a configScreen leak when conf_screen is NULL
    
    configScreen used a dynamically allocated buffer for XF86ConfScreenRec
    when conf_screen argument was NULL. This pointer was never stored
    anywhere, nor was it released, so this patch makes the function use
    automatically allocated storage in that situation.
    
    [ajax: minor grammar fix]
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Reviewed-by: Rami Ylimäki <rami.ylimaki at vincit.fi>
    Signed-off-by: Erkki Seppälä <erkki.seppala at vincit.fi>

diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 9602e89..5312ca6 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -1787,9 +1787,11 @@ configScreen(confScreenPtr screenp, XF86ConfScreenPtr conf_screen, int scrnum,
     XF86ConfDisplayPtr dispptr;
     XF86ConfAdaptorLinkPtr conf_adaptor;
     Bool defaultMonitor = FALSE;
+    XF86ConfScreenRec local_conf_screen;
 
     if (!conf_screen) {
-        conf_screen = xnfcalloc(1, sizeof(XF86ConfScreenRec));
+        memset(&local_conf_screen, 0, sizeof(local_conf_screen));
+        conf_screen = &local_conf_screen;
         conf_screen->scrn_identifier = "Default Screen Section";
         xf86Msg(X_DEFAULT, "No screen section available. Using defaults.\n");
     }
commit b73ebe65cd071a063417ac9c38513a6742e32428
Author: Adam Jackson <ajax at redhat.com>
Date:   Wed Mar 2 12:12:35 2011 -0500

    glx: Remove unused _glapi_get_proc_name
    
    Reviewed-by: Julien Cristau <jcristau at debian.org>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/glx/glapi.c b/glx/glapi.c
index fde5d76..209ae50 100644
--- a/glx/glapi.c
+++ b/glx/glapi.c
@@ -426,26 +426,6 @@ get_static_proc_address(const char *funcName)
 
 #endif /* !defined(XFree86Server) && !defined(XGLServer) */
 
-
-
-/**
- * Return the name of the function at the given offset in the dispatch
- * table.  For debugging only.
- */
-static const char *
-get_static_proc_name( GLuint offset )
-{
-   GLuint i;
-   for (i = 0; static_functions[i].Name_offset >= 0; i++) {
-      if (static_functions[i].Offset == offset) {
-	 return gl_string_table + static_functions[i].Name_offset;
-      }
-   }
-   return NULL;
-}
-
-
-
 /**********************************************************************
  * Extension function management.
  */
@@ -860,35 +840,6 @@ _glapi_get_proc_address(const char *funcName)
    return (entry == NULL) ? NULL : entry->dispatch_stub;
 }
 
-
-
-/**
- * Return the name of the function at the given dispatch offset.
- * This is only intended for debugging.
- */
-const char *
-_glapi_get_proc_name(GLuint offset)
-{
-   GLuint i;
-   const char * n;
-
-   /* search built-in functions */
-   n = get_static_proc_name(offset);
-   if ( n != NULL ) {
-      return n;
-   }
-
-   /* search added extension functions */
-   for (i = 0; i < NumExtEntryPoints; i++) {
-      if (ExtEntryTable[i].dispatch_offset == offset) {
-         return ExtEntryTable[i].name;
-      }
-   }
-   return NULL;
-}
-
-
-
 /**
  * Return size of dispatch table struct as number of functions (or
  * slots).
diff --git a/glx/glapi.h b/glx/glapi.h
index 9911e50..80b53aa 100644
--- a/glx/glapi.h
+++ b/glx/glapi.h
@@ -146,7 +146,4 @@ _glapi_add_dispatch( const char * const * function_names,
 extern _glapi_proc
 _glapi_get_proc_address(const char *funcName);
 
-extern const char *
-_glapi_get_proc_name(GLuint offset);
-
 #endif
commit 4377288abdbaac8506d8643b440c300ba03182fe
Author: Adam Jackson <ajax at redhat.com>
Date:   Wed Mar 2 11:52:27 2011 -0500

    glx: Simplify _glapi_check_multithread
    
    We can guarantee that the X server does not call DRI driver services
    from multiple threads, so _glapi_check_multithread need never do
    anything special.  As a result, ThreadSafe is always false, so remove it
    and simplify expressions where it appeared to match.
    
    Reviewed-by: Julien Cristau <jcristau at debian.org>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/glx/glapi.c b/glx/glapi.c
index 42bf6c1..fde5d76 100644
--- a/glx/glapi.c
+++ b/glx/glapi.c
@@ -175,12 +175,6 @@ static GLint NoOpUnused(void)
  * static dispatch functions access these variables via \c _glapi_get_dispatch
  * and \c _glapi_get_context.
  *
- * There is a race condition in setting \c _glapi_Dispatch to \c NULL.  It is
- * possible for the original thread to be setting it at the same instant a new
- * thread, perhaps running on a different processor, is clearing it.  Because
- * of that, \c ThreadSafe, which can only ever be changed to \c GL_TRUE, is
- * used to determine whether or not the application is multithreaded.
- * 
  * In the TLS case, the variables \c _glapi_Dispatch and \c _glapi_Context are
  * hardcoded to \c NULL.  Instead the TLS variables \c _glapi_tls_Dispatch and
  * \c _glapi_tls_Context are used.  Having \c _glapi_Dispatch and
@@ -204,7 +198,6 @@ PUBLIC const void *_glapi_Context = NULL;
 
 #if defined(THREADS)
 
-static GLboolean ThreadSafe = GL_FALSE;  /**< In thread-safe mode? */
 _glthread_TSD _gl_DispatchTSD;           /**< Per-thread dispatch pointer */
 static _glthread_TSD ContextTSD;         /**< Per-thread context pointer */
 
@@ -243,37 +236,14 @@ str_dup(const char *str)
 }
 
 
-
-/**
- * We should call this periodically from a function such as glXMakeCurrent
- * in order to test if multiple threads are being used.
+/*
+ * xserver's gl is not multithreaded, we promise.
  */
 PUBLIC void
 _glapi_check_multithread(void)
 {
-#if defined(THREADS) && !defined(GLX_USE_TLS)
-   if (!ThreadSafe) {
-      static unsigned long knownID;
-      static GLboolean firstCall = GL_TRUE;
-      if (firstCall) {
-         knownID = _glthread_GetID();
-         firstCall = GL_FALSE;
-      }
-      else if (knownID != _glthread_GetID()) {
-         ThreadSafe = GL_TRUE;
-         _glapi_set_dispatch(NULL);
-         _glapi_set_context(NULL);
-      }
-   }
-   else if (!_glapi_get_dispatch()) {
-      /* make sure that this thread's dispatch pointer isn't null */
-      _glapi_set_dispatch(NULL);
-   }
-#endif
 }
 
-
-
 /**
  * Set the current context pointer for this thread.
  * The context pointer is an opaque type which should be cast to
@@ -287,7 +257,7 @@ _glapi_set_context(void *context)
    _glapi_tls_Context = context;
 #elif defined(THREADS)
    _glthread_SetTSD(&ContextTSD, context);
-   _glapi_Context = (ThreadSafe) ? NULL : context;
+   _glapi_Context = context;
 #else
    _glapi_Context = context;
 #endif
@@ -305,13 +275,6 @@ _glapi_get_context(void)
 {
 #if defined(GLX_USE_TLS)
    return _glapi_tls_Context;
-#elif defined(THREADS)
-   if (ThreadSafe) {
-      return _glthread_GetTSD(&ContextTSD);
-   }
-   else {
-      return _glapi_Context;
-   }
 #else
    return _glapi_Context;
 #endif
@@ -341,7 +304,7 @@ _glapi_set_dispatch(struct _glapi_table *dispatch)
    _glapi_tls_Dispatch = dispatch;
 #elif defined(THREADS)
    _glthread_SetTSD(&_gl_DispatchTSD, (void *) dispatch);
-   _glapi_Dispatch = (ThreadSafe) ? NULL : dispatch;
+   _glapi_Dispatch = dispatch;
 #else /*THREADS*/
    _glapi_Dispatch = dispatch;
 #endif /*THREADS*/
@@ -358,10 +321,6 @@ _glapi_get_dispatch(void)
    struct _glapi_table * api;
 #if defined(GLX_USE_TLS)
    api = _glapi_tls_Dispatch;
-#elif defined(THREADS)
-   api = (ThreadSafe)
-     ? (struct _glapi_table *) _glthread_GetTSD(&_gl_DispatchTSD)
-     : _glapi_Dispatch;
 #else
    api = _glapi_Dispatch;
 #endif
commit d5e8bb2150ce9d8a4132d61f76621a2c7a7f0acf
Author: Adam Jackson <ajax at redhat.com>
Date:   Wed Mar 2 11:26:05 2011 -0500

    glx: unifdef BEOS_THREADS
    
    We don't support BeOS, so, no.
    
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/glx/glthread.c b/glx/glthread.c
index a2d95b5..5da7e43 100644
--- a/glx/glthread.c
+++ b/glx/glthread.c
@@ -179,49 +179,8 @@ _glthread_SetTSD(_glthread_TSD *tsd, void *ptr)
 
 #endif /* WIN32_THREADS */
 
-/*
- * BeOS threads
- */
-#ifdef BEOS_THREADS
-
-unsigned long
-_glthread_GetID(void)
-{
-   return (unsigned long) find_thread(NULL);
-}
-
-void
-_glthread_InitTSD(_glthread_TSD *tsd)
-{
-   tsd->key = tls_allocate();
-   tsd->initMagic = INIT_MAGIC;
-}
-
-void *
-_glthread_GetTSD(_glthread_TSD *tsd)
-{
-   if (tsd->initMagic != (int) INIT_MAGIC) {
-      _glthread_InitTSD(tsd);
-   }
-   return tls_get(tsd->key);
-}
-
-void
-_glthread_SetTSD(_glthread_TSD *tsd, void *ptr)
-{
-   if (tsd->initMagic != (int) INIT_MAGIC) {
-      _glthread_InitTSD(tsd);
-   }
-   tls_set(tsd->key, ptr);
-}
-
-#endif /* BEOS_THREADS */
-
-
-
 #else  /* THREADS */
 
-
 /*
  * no-op functions
  */
diff --git a/glx/glthread.h b/glx/glthread.h
index 782a2a3..28793fc 100644
--- a/glx/glthread.h
+++ b/glx/glthread.h
@@ -68,7 +68,7 @@
 #define _glapi_Dispatch _mglapi_Dispatch
 #endif
 
-#if (defined(PTHREADS) || defined(WIN32_THREADS) || defined(BEOS_THREADS)) \
+#if (defined(PTHREADS) || defined(WIN32_THREADS)) \
     && !defined(THREADS)
 # define THREADS
 #endif
commit 3692ff0b35e774a6f6cbedf634d53c4df2e53a24
Author: Adam Jackson <ajax at redhat.com>
Date:   Wed Mar 2 11:22:45 2011 -0500

    glx: unifdef USE_XTHREADS
    
    xthreads is an ancient wrapper around a half dozen or so common thread
    APIs, including pthreads.  Just use pthreads directly if you have it; if
    you don't, get with the times.
    
    Reviewed-by: Julien Cristau <jcristau at debian.org>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/glx/glthread.c b/glx/glthread.c
index 2d76a49..a2d95b5 100644
--- a/glx/glthread.c
+++ b/glx/glthread.c
@@ -179,57 +179,6 @@ _glthread_SetTSD(_glthread_TSD *tsd, void *ptr)
 
 #endif /* WIN32_THREADS */
 
-
-
-/*
- * XFree86 has its own thread wrapper, Xthreads.h
- * We wrap it again for GL.
- */
-#ifdef USE_XTHREADS
-
-_X_EXPORT unsigned long
-_glthread_GetID(void)
-{
-   return (unsigned long) xthread_self();
-}
-
-
-void
-_glthread_InitTSD(_glthread_TSD *tsd)
-{
-   if (xthread_key_create(&tsd->key, NULL) != 0) {
-      perror(INIT_TSD_ERROR);
-      exit(-1);
-   }
-   tsd->initMagic = INIT_MAGIC;
-}
-
-
-void *
-_glthread_GetTSD(_glthread_TSD *tsd)
-{
-   void *ptr;
-   if (tsd->initMagic != INIT_MAGIC) {
-      _glthread_InitTSD(tsd);
-   }
-   xthread_get_specific(tsd->key, &ptr);
-   return ptr;
-}
-
-
-void
-_glthread_SetTSD(_glthread_TSD *tsd, void *ptr)
-{
-   if (tsd->initMagic != INIT_MAGIC) {
-      _glthread_InitTSD(tsd);
-   }
-   xthread_set_specific(tsd->key, ptr);
-}
-
-#endif /* XTHREAD */
-
-
-
 /*
  * BeOS threads
  */
diff --git a/glx/glthread.h b/glx/glthread.h
index e7e2385..782a2a3 100644
--- a/glx/glthread.h
+++ b/glx/glthread.h
@@ -68,8 +68,7 @@
 #define _glapi_Dispatch _mglapi_Dispatch
 #endif
 
-#if (defined(PTHREADS) || \
-     defined(WIN32_THREADS) || defined(USE_XTHREADS) || defined(BEOS_THREADS)) \
+#if (defined(PTHREADS) || defined(WIN32_THREADS) || defined(BEOS_THREADS)) \
     && !defined(THREADS)
 # define THREADS
 #endif
@@ -154,49 +153,6 @@ typedef CRITICAL_SECTION _glthread_Mutex;
 
 #endif /* WIN32_THREADS */
 
-
-
-
-/*
- * XFree86 has its own thread wrapper, Xthreads.h
- * We wrap it again for GL.
- */
-#ifdef USE_XTHREADS
-#include <X11/Xthreads.h>
-
-typedef struct {
-   xthread_key_t key;
-   int initMagic;
-} _glthread_TSD;
-
-typedef xthread_t _glthread_Thread;
-
-typedef xmutex_rec _glthread_Mutex;
-
-#ifdef XMUTEX_INITIALIZER
-#define _glthread_DECLARE_STATIC_MUTEX(name) \
-   static _glthread_Mutex name = XMUTEX_INITIALIZER
-#else
-#define _glthread_DECLARE_STATIC_MUTEX(name) \
-   static _glthread_Mutex name
-#endif
-
-#define _glthread_INIT_MUTEX(name) \
-   xmutex_init(&(name))
-
-#define _glthread_DESTROY_MUTEX(name) \
-   xmutex_clear(&(name))
-
-#define _glthread_LOCK_MUTEX(name) \
-   (void) xmutex_lock(&(name))
-
-#define _glthread_UNLOCK_MUTEX(name) \
-   (void) xmutex_unlock(&(name))
-
-#endif /* USE_XTHREADS */
-
-
-
 /*
  * BeOS threads. R5.x required.
  */
commit 2371b44f9eb9181ec2c081ce66befee51d18bf6e
Author: Adam Jackson <ajax at redhat.com>
Date:   Wed Mar 2 11:17:07 2011 -0500

    glx: unifdef SOLARIS_THREADS
    
    Solaris 7 and older are not supported; Solaris 8 and later have (and
    use) pthreads.
    
    Acked-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/glx/glthread.c b/glx/glthread.c
index 8b9f618..2d76a49 100644
--- a/glx/glthread.c
+++ b/glx/glthread.c
@@ -114,76 +114,6 @@ _glthread_SetTSD(_glthread_TSD *tsd, void *ptr)
 
 #endif /* PTHREADS */
 
-
-
-/*
- * Solaris/Unix International Threads -- Use only if POSIX threads
- *   aren't available on your Unix platform.  Solaris 2.[34] are examples
- *   of platforms where this is the case.  Be sure to use -mt and/or
- *   -D_REENTRANT when compiling.
- */
-#ifdef SOLARIS_THREADS
-#define USE_LOCK_FOR_KEY	/* undef this to try a version without
-				   lock for the global key... */
-
-_X_EXPORT unsigned long
-_glthread_GetID(void)
-{
-   OsAbort();   /* XXX not implemented yet */
-   return (unsigned long) 0;
-}
-
-
-void
-_glthread_InitTSD(_glthread_TSD *tsd)
-{
-   if ((errno = mutex_init(&tsd->keylock, 0, NULL)) != 0 ||
-      (errno = thr_keycreate(&(tsd->key), free)) != 0) {
-      perror(INIT_TSD_ERROR);
-      exit(-1);
-   }
-   tsd->initMagic = INIT_MAGIC;
-}
-
-
-void *
-_glthread_GetTSD(_glthread_TSD *tsd)
-{
-   void* ret;
-   if (tsd->initMagic != INIT_MAGIC) {
-      _glthread_InitTSD(tsd);
-   }
-#ifdef USE_LOCK_FOR_KEY
-   mutex_lock(&tsd->keylock);
-   thr_getspecific(tsd->key, &ret);
-   mutex_unlock(&tsd->keylock);
-#else
-   if ((errno = thr_getspecific(tsd->key, &ret)) != 0) {
-      perror(GET_TSD_ERROR);
-      exit(-1);
-   }
-#endif
-   return ret;
-}
-
-
-void
-_glthread_SetTSD(_glthread_TSD *tsd, void *ptr)
-{
-   if (tsd->initMagic != INIT_MAGIC) {
-      _glthread_InitTSD(tsd);
-   }
-   if ((errno = thr_setspecific(tsd->key, ptr)) != 0) {
-      perror(SET_TSD_ERROR);
-      exit(-1);
-   }
-}
-
-#undef USE_LOCK_FOR_KEY
-#endif /* SOLARIS_THREADS */
-
-
-
 /*
  * Win32 Threads.  The only available option for Windows 95/NT.
  * Be sure that you compile using the Multithreaded runtime, otherwise
diff --git a/glx/glthread.h b/glx/glthread.h
index e2765ce..e7e2385 100644
--- a/glx/glthread.h
+++ b/glx/glthread.h
@@ -68,9 +68,7 @@
 #define _glapi_Dispatch _mglapi_Dispatch
 #endif
 
-
-
-#if (defined(PTHREADS) || defined(SOLARIS_THREADS) ||\
+#if (defined(PTHREADS) || \
      defined(WIN32_THREADS) || defined(USE_XTHREADS) || defined(BEOS_THREADS)) \
     && !defined(THREADS)
 # define THREADS
@@ -127,27 +125,6 @@ typedef pthread_mutex_t _glthread_Mutex;
  * Be sure to compile with -mt on the Solaris compilers, or
  * use -D_REENTRANT if using gcc.
  */
-#ifdef SOLARIS_THREADS
-#include <thread.h>
-
-typedef struct {
-   thread_key_t key;
-   mutex_t      keylock;
-   int          initMagic;
-} _glthread_TSD;
-
-typedef thread_t _glthread_Thread;
-
-typedef mutex_t _glthread_Mutex;
-
-/* XXX need to really implement mutex-related macros */
-#define _glthread_DECLARE_STATIC_MUTEX(name)  static _glthread_Mutex name = 0
-#define _glthread_INIT_MUTEX(name)  (void) name
-#define _glthread_DESTROY_MUTEX(name) (void) name
-#define _glthread_LOCK_MUTEX(name)  (void) name
-#define _glthread_UNLOCK_MUTEX(name)  (void) name
-
-#endif /* SOLARIS_THREADS */
 
 
 
commit a5fdd1aa06c7c8ecefeafafc4a778fc816ad41a4
Author: Adam Jackson <ajax at redhat.com>
Date:   Wed Mar 2 10:20:02 2011 -0500

    glx: Remove unused _glapi_get_proc_offset and friends
    
    Reviewed-by: Julien Cristau <jcristau at debian.org>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/glx/glapi.c b/glx/glapi.c
index d6a568e..42bf6c1 100644
--- a/glx/glapi.c
+++ b/glx/glapi.c
@@ -336,11 +336,6 @@ _glapi_set_dispatch(struct _glapi_table *dispatch)
       /* use the no-op functions */
       dispatch = (struct _glapi_table *) __glapi_noop_table;
    }
-#ifdef DEBUG
-   else {
-      _glapi_check_table(dispatch);
-   }
-#endif
 
 #if defined(GLX_USE_TLS)
    _glapi_tls_Dispatch = dispatch;
@@ -867,26 +862,6 @@ _glapi_add_dispatch( const char * const * function_names,
    return offset;
 }
 
-
-/**
- * Return offset of entrypoint for named function within dispatch table.
- */
-PUBLIC GLint
-_glapi_get_proc_offset(const char *funcName)
-{
-   /* search extension functions first */
-   GLuint i;
-   for (i = 0; i < NumExtEntryPoints; i++) {
-      if (strcmp(ExtEntryTable[i].name, funcName) == 0) {
-         return ExtEntryTable[i].dispatch_offset;
-      }
-   }
-   /* search static functions */
-   return get_static_proc_offset(funcName);
-}
-
-
-
 /**
  * Return pointer to the named function.  If the function name isn't found
  * in the name of static functions, try generating a new API entrypoint on
@@ -965,88 +940,6 @@ _glapi_get_dispatch_table_size(void)
    return DISPATCH_TABLE_SIZE;
 }
 
-
-
-/**
- * Make sure there are no NULL pointers in the given dispatch table.
- * Intended for debugging purposes.
- */
-void
-_glapi_check_table(const struct _glapi_table *table)
-{
-#ifdef DEBUG
-   const GLuint entries = _glapi_get_dispatch_table_size();
-   const void **tab = (const void **) table;
-   GLuint i;
-   for (i = 1; i < entries; i++) {
-      assert(tab[i]);
-   }
-
-   /* Do some spot checks to be sure that the dispatch table
-    * slots are assigned correctly.
-    */
-   {
-      GLuint BeginOffset = _glapi_get_proc_offset("glBegin");
-      char *BeginFunc = (char*) &table->Begin;
-      GLuint offset = (BeginFunc - (char *) table) / sizeof(void *);
-      assert(BeginOffset == _gloffset_Begin);
-      assert(BeginOffset == offset);
-   }
-   {
-      GLuint viewportOffset = _glapi_get_proc_offset("glViewport");
-      char *viewportFunc = (char*) &table->Viewport;
-      GLuint offset = (viewportFunc - (char *) table) / sizeof(void *);
-      assert(viewportOffset == _gloffset_Viewport);
-      assert(viewportOffset == offset);
-   }
-   {
-      GLuint VertexPointerOffset = _glapi_get_proc_offset("glVertexPointer");
-      char *VertexPointerFunc = (char*) &table->VertexPointer;
-      GLuint offset = (VertexPointerFunc - (char *) table) / sizeof(void *);
-      assert(VertexPointerOffset == _gloffset_VertexPointer);
-      assert(VertexPointerOffset == offset);
-   }
-   {
-      GLuint ResetMinMaxOffset = _glapi_get_proc_offset("glResetMinmax");
-      char *ResetMinMaxFunc = (char*) &table->ResetMinmax;
-      GLuint offset = (ResetMinMaxFunc - (char *) table) / sizeof(void *);
-      assert(ResetMinMaxOffset == _gloffset_ResetMinmax);
-      assert(ResetMinMaxOffset == offset);
-   }
-   {
-      GLuint blendColorOffset = _glapi_get_proc_offset("glBlendColor");
-      char *blendColorFunc = (char*) &table->BlendColor;
-      GLuint offset = (blendColorFunc - (char *) table) / sizeof(void *);
-      assert(blendColorOffset == _gloffset_BlendColor);
-      assert(blendColorOffset == offset);
-   }
-   {
-      GLuint secondaryColor3fOffset = _glapi_get_proc_offset("glSecondaryColor3fEXT");
-      char *secondaryColor3fFunc = (char*) &table->SecondaryColor3fEXT;
-      GLuint offset = (secondaryColor3fFunc - (char *) table) / sizeof(void *);
-      assert(secondaryColor3fOffset == _gloffset_SecondaryColor3fEXT);
-      assert(secondaryColor3fOffset == offset);
-   }
-   {
-      GLuint pointParameterivOffset = _glapi_get_proc_offset("glPointParameterivNV");
-      char *pointParameterivFunc = (char*) &table->PointParameterivNV;
-      GLuint offset = (pointParameterivFunc - (char *) table) / sizeof(void *);
-      assert(pointParameterivOffset == _gloffset_PointParameterivNV);
-      assert(pointParameterivOffset == offset);
-   }
-   {
-      GLuint setFenceOffset = _glapi_get_proc_offset("glSetFenceNV");
-      char *setFenceFunc = (char*) &table->SetFenceNV;
-      GLuint offset = (setFenceFunc - (char *) table) / sizeof(void *);
-      assert(setFenceOffset == _gloffset_SetFenceNV);
-      assert(setFenceOffset == offset);
-   }
-#else
-   (void) table;
-#endif
-}
-
-
 #if defined(PTHREADS) || defined(GLX_USE_TLS)
 /**
  * Perform platform-specific GL API entry-point fixups.
diff --git a/glx/glapi.h b/glx/glapi.h
index 8f2cf66..9911e50 100644
--- a/glx/glapi.h
+++ b/glx/glapi.h
@@ -115,57 +115,38 @@ _glapi_set_warning_func(_glapi_warning_func func);
 extern void
 _glapi_check_multithread(void);
 
-
 extern void
 _glapi_set_context(void *context);
 
-
 extern void *
 _glapi_get_context(void);
 
-
 extern void
 _glapi_set_dispatch(struct _glapi_table *dispatch);
 
-
 extern struct _glapi_table *
 _glapi_get_dispatch(void);
 
-
 extern int
 _glapi_begin_dispatch_override(struct _glapi_table *override);
 
-
 extern void
 _glapi_end_dispatch_override(int layer);
 
-
 struct _glapi_table *
 _glapi_get_override_dispatch(int layer);
 
-
 extern GLuint
 _glapi_get_dispatch_table_size(void);
 
-
-extern void
-_glapi_check_table(const struct _glapi_table *table);
-
-
 extern int
 _glapi_add_dispatch( const char * const * function_names,
 		     const char * parameter_signature );
 
-extern GLint
-_glapi_get_proc_offset(const char *funcName);
-
-
 extern _glapi_proc
 _glapi_get_proc_address(const char *funcName);
 
-
 extern const char *
 _glapi_get_proc_name(GLuint offset);
 
-
 #endif
commit 2cb3dc020cbec1ba64848dac532b3bb2d84d0635
Author: Adam Jackson <ajax at redhat.com>
Date:   Mon Feb 28 17:11:35 2011 -0500

    xi: Use RESTYPE consistently
    
    No functional change
    
    Reviewed-by: Soren Sandmann <ssp at redhat.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/Xi/exglobals.h b/Xi/exglobals.h
index f755707..8c5a42e 100644
--- a/Xi/exglobals.h
+++ b/Xi/exglobals.h
@@ -76,7 +76,7 @@ extern int ChangeDeviceNotify;
 extern int DevicePresenceNotify;
 extern int DevicePropertyNotify;
 
-extern int RT_INPUTCLIENT;
+extern RESTYPE RT_INPUTCLIENT;
 
 extern DevPrivateKeyRec XIClientPrivateKeyRec;
 #define XIClientPrivateKey (&XIClientPrivateKeyRec)
diff --git a/Xi/extinit.c b/Xi/extinit.c
index 82df7eb..46d3459 100644
--- a/Xi/extinit.c
+++ b/Xi/extinit.c
@@ -358,7 +358,7 @@ int ChangeDeviceNotify;
 int DevicePresenceNotify;
 int DevicePropertyNotify;
 
-int RT_INPUTCLIENT;
+RESTYPE RT_INPUTCLIENT;
 
 /*****************************************************************
  *
commit 2413702aa0b488f1a4f828a017d5b508c4f219f1
Author: Adam Jackson <ajax at redhat.com>
Date:   Mon Feb 28 16:54:17 2011 -0500

    xvmc: Use RESTYPE consistently
    
    Also mark these static since they're not used externally.
    
    Reviewed-by: Soren Sandmann <ssp at redhat.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/Xext/xvmc.c b/Xext/xvmc.c
index 8fbdfae..4d29941 100644
--- a/Xext/xvmc.c
+++ b/Xext/xvmc.c
@@ -42,9 +42,9 @@ unsigned long XvMCGeneration = 0;
 int XvMCReqCode;
 int XvMCEventBase;
 
-unsigned long XvMCRTContext;
-unsigned long XvMCRTSurface;
-unsigned long XvMCRTSubpicture;
+static RESTYPE XvMCRTContext;
+static RESTYPE XvMCRTSurface;
+static RESTYPE XvMCRTSubpicture;
 
 typedef struct {
    int num_adaptors;
commit cd58924d294de2abddbd2f03c2db021894fe9759
Author: Adam Jackson <ajax at redhat.com>
Date:   Mon Feb 28 16:28:26 2011 -0500

    xinerama: Use RESTYPE consistently
    
    No functional change
    
    Reviewed-by: Soren Sandmann <ssp at redhat.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c
index e6334bd..391346a 100644
--- a/Xext/panoramiX.c
+++ b/Xext/panoramiX.c
@@ -83,11 +83,11 @@ static DepthPtr		PanoramiXDepths;
 static int		PanoramiXNumVisuals;
 static VisualPtr	PanoramiXVisuals;
 
-unsigned long XRC_DRAWABLE;
-unsigned long XRT_WINDOW;
-unsigned long XRT_PIXMAP;
-unsigned long XRT_GC;
-unsigned long XRT_COLORMAP;
+RESTYPE XRC_DRAWABLE;
+RESTYPE XRT_WINDOW;
+RESTYPE XRT_PIXMAP;
+RESTYPE XRT_GC;
+RESTYPE XRT_COLORMAP;
 
 static Bool VisualsEqual(VisualPtr, ScreenPtr, VisualPtr);
 XineramaVisualsEqualProcPtr XineramaVisualsEqualPtr = &VisualsEqual;
diff --git a/Xext/panoramiXsrv.h b/Xext/panoramiXsrv.h
index b0a5a6e..9751feb 100644
--- a/Xext/panoramiXsrv.h
+++ b/Xext/panoramiXsrv.h
@@ -21,12 +21,12 @@ extern _X_EXPORT int XineramaDeleteResource(pointer, XID);
 
 extern _X_EXPORT void XineramaReinitData(ScreenPtr);
 
-extern _X_EXPORT unsigned long XRC_DRAWABLE;
-extern _X_EXPORT unsigned long XRT_WINDOW;
-extern _X_EXPORT unsigned long XRT_PIXMAP;
-extern _X_EXPORT unsigned long XRT_GC;
-extern _X_EXPORT unsigned long XRT_COLORMAP;
-extern _X_EXPORT unsigned long XRT_PICTURE;
+extern _X_EXPORT RESTYPE XRC_DRAWABLE;
+extern _X_EXPORT RESTYPE XRT_WINDOW;
+extern _X_EXPORT RESTYPE XRT_PIXMAP;
+extern _X_EXPORT RESTYPE XRT_GC;
+extern _X_EXPORT RESTYPE XRT_COLORMAP;
+extern _X_EXPORT RESTYPE XRT_PICTURE;
 
 /*
  * Drivers are allowed to wrap this function.  Each wrapper can decide that the
diff --git a/render/render.c b/render/render.c
index 7029558..fbb2968 100644
--- a/render/render.c
+++ b/render/render.c
@@ -239,7 +239,7 @@ RenderClientCallback (CallbackListPtr	*list,
 }
 
 #ifdef PANORAMIX
-unsigned long	XRT_PICTURE;
+RESTYPE	XRT_PICTURE;
 #endif
 
 void
commit 9a6a9971b03381b7c44257284edecdfa0135957f
Author: Adam Jackson <ajax at redhat.com>
Date:   Mon Feb 28 16:25:23 2011 -0500

    xv: Use RESTYPE where appropriate
    
    No functional change.
    
    Reviewed-by: Soren Sandmann <ssp at redhat.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/Xext/xvdix.h b/Xext/xvdix.h
index a210615..e9c22bf 100644
--- a/Xext/xvdix.h
+++ b/Xext/xvdix.h
@@ -64,12 +64,12 @@ extern _X_EXPORT int XvReqCode;
 extern _X_EXPORT int XvEventBase;
 extern _X_EXPORT int XvErrorBase;
 
-extern _X_EXPORT unsigned long XvRTPort;
-extern _X_EXPORT unsigned long XvRTEncoding;
-extern _X_EXPORT unsigned long XvRTGrab;
-extern _X_EXPORT unsigned long XvRTVideoNotify;
-extern _X_EXPORT unsigned long XvRTVideoNotifyList;
-extern _X_EXPORT unsigned long XvRTPortNotify;
+extern _X_EXPORT RESTYPE XvRTPort;
+extern _X_EXPORT RESTYPE XvRTEncoding;
+extern _X_EXPORT RESTYPE XvRTGrab;
+extern _X_EXPORT RESTYPE XvRTVideoNotify;
+extern _X_EXPORT RESTYPE XvRTVideoNotifyList;
+extern _X_EXPORT RESTYPE XvRTPortNotify;
 #endif
 
 typedef struct {
diff --git a/Xext/xvmain.c b/Xext/xvmain.c
index 12b4c51..cd6f097 100644
--- a/Xext/xvmain.c
+++ b/Xext/xvmain.c
@@ -115,14 +115,12 @@ int XvReqCode;
 int XvEventBase;
 int XvErrorBase;
 
-unsigned long XvRTPort;
-unsigned long XvRTEncoding;
-unsigned long XvRTGrab;
-unsigned long XvRTVideoNotify;
-unsigned long XvRTVideoNotifyList;
-unsigned long XvRTPortNotify;
-
-
+RESTYPE XvRTPort;
+RESTYPE XvRTEncoding;
+RESTYPE XvRTGrab;
+RESTYPE XvRTVideoNotify;
+RESTYPE XvRTVideoNotifyList;
+RESTYPE XvRTPortNotify;
 
 /* EXTERNAL */
 
commit fddfd026a0e4a8190dc01fb0f38af4b2c29b63a3
Author: Adam Jackson <ajax at redhat.com>
Date:   Mon Feb 28 13:01:15 2011 -0500

    dix: Remove PIXEL typedef
    
    Doesn't appear to be used anywhere.
    
    Reviewed-by: Soren Sandmann <ssp at redhat.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/include/misc.h b/include/misc.h
index 62d813e..0717db6 100644
--- a/include/misc.h
+++ b/include/misc.h
@@ -91,10 +91,8 @@ OF THIS SOFTWARE.
 #define EXTENSION_EVENT_BASE 64
 #define EXTENSION_BASE 128
 
-typedef unsigned long PIXEL;
 typedef unsigned long ATOM;
 
-
 #ifndef TRUE
 #define TRUE 1
 #define FALSE 0
commit 82a8677d9175732a61df4116a396b76a7704efb4
Author: Adam Jackson <ajax at redhat.com>
Date:   Thu Jan 20 22:49:32 2011 -0500

    dix: Remove deprecated.c
    
    No more internal users, this can be dropped now.
    
    Reviewed-by: Soren Sandmann <ssp at redhat.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/dix/Makefile.am b/dix/Makefile.am
index 59e512b..5435546 100644
--- a/dix/Makefile.am
+++ b/dix/Makefile.am
@@ -10,7 +10,6 @@ libdix_la_SOURCES = 	\
 	atom.c		\
 	colormap.c	\
 	cursor.c	\
-	deprecated.c	\
 	devices.c	\
 	dispatch.c	\
 	dispatch.h	\
diff --git a/dix/deprecated.c b/dix/deprecated.c
deleted file mode 100644
index f05588e..0000000
--- a/dix/deprecated.c
+++ /dev/null
@@ -1,165 +0,0 @@
-/***********************************************************
-
-Copyright 1987, 1998  The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-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 THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
-                        All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its 
-documentation for any purpose and without fee is hereby granted, 
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in 
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.  
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include "dix.h"
-#include "misc.h"
-#include "dixstruct.h"
-
-/*
- * These are deprecated compatibility functions and will be marked as such
- * and removed soon!
- *
- * Please use the noted replacements instead.
- */
-
-/* replaced by dixLookupWindow */
-WindowPtr
-SecurityLookupWindow(XID id, ClientPtr client, Mask access_mode)
-{
-    WindowPtr pWin;
-    static int warn = 1;
-    dixLookupWindow(&pWin, id, client, access_mode);
-    if (warn > 0 && warn--)
-	ErrorF("Warning: LookupWindow()/SecurityLookupWindow() "
-	       "are deprecated.  Please convert your driver/module "
-	       "to use dixLookupWindow().\n");
-    return pWin;
-}
-
-/* replaced by dixLookupWindow */
-WindowPtr
-LookupWindow(XID id, ClientPtr client)
-{
-    return SecurityLookupWindow(id, client, DixUnknownAccess);
-}
-
-/* replaced by dixLookupDrawable */
-pointer
-SecurityLookupDrawable(XID id, ClientPtr client, Mask access_mode)
-{
-    DrawablePtr pDraw;
-    static int warn = 1;
-    dixLookupDrawable(&pDraw, id, client, M_DRAWABLE, access_mode);
-    if (warn > 0 && warn--)
-	ErrorF("Warning: LookupDrawable()/SecurityLookupDrawable() "
-	       "are deprecated.  Please convert your driver/module "
-	       "to use dixLookupDrawable().\n");
-    return pDraw;
-}
-
-/* replaced by dixLookupDrawable */
-pointer
-LookupDrawable(XID id, ClientPtr client)
-{
-    return SecurityLookupDrawable(id, client, DixUnknownAccess);
-}
-
-/* replaced by dixLookupClient */
-ClientPtr
-LookupClient(XID id, ClientPtr client)
-{
-    ClientPtr pClient;
-    static int warn = 1;
-    dixLookupClient(&pClient, id, client, DixUnknownAccess);
-    if (warn > 0 && warn--)
-	ErrorF("Warning: LookupClient() is deprecated.  Please convert your "
-	       "driver/module to use dixLookupClient().\n");
-    return pClient;
-}
-
-/* replaced by dixLookupResourceByType */
-pointer
-SecurityLookupIDByType(ClientPtr client, XID id, RESTYPE rtype,
-		       Mask access_mode)
-{
-    pointer retval;
-    static int warn = 1;
-    dixLookupResourceByType(&retval, id, rtype, client, access_mode);
-    if (warn > 0 && warn--)
-	ErrorF("Warning: LookupIDByType()/SecurityLookupIDByType() "
-	       "are deprecated.  Please convert your driver/module "
-	       "to use dixLookupResourceByType().\n");
-    return retval;
-}
-
-pointer
-SecurityLookupIDByClass(ClientPtr client, XID id, RESTYPE classes,
-			Mask access_mode)
-{
-    pointer retval;
-    static int warn = 1;
-    dixLookupResourceByClass(&retval, id, classes, client, access_mode);
-    if (warn > 0 && warn--)
-	ErrorF("Warning: LookupIDByClass()/SecurityLookupIDByClass() "
-	       "are deprecated.  Please convert your driver/module "
-	       "to use dixLookupResourceByClass().\n");
-    return retval;
-}
-
-/* replaced by dixLookupResourceByType */
-pointer
-LookupIDByType(XID id, RESTYPE rtype)
-{
-    pointer val;
-    dixLookupResourceByType(&val, id, rtype, NullClient, DixUnknownAccess);
-    return val;
-}
-
-/* replaced by dixLookupResourceByClass */
-pointer
-LookupIDByClass(XID id, RESTYPE classes)
-{
-    pointer val;
-    dixLookupResourceByClass(&val, id, classes, NullClient, DixUnknownAccess);
-    return val;
-}
-
-/* end deprecated functions */
diff --git a/include/dix.h b/include/dix.h
index 3f99098..c201e3a 100644
--- a/include/dix.h
+++ b/include/dix.h
@@ -576,35 +576,4 @@ extern _X_HIDDEN void CopyKeyClass(DeviceIntPtr device, DeviceIntPtr master);
 extern _X_HIDDEN int CorePointerProc(DeviceIntPtr dev, int what);
 extern _X_HIDDEN int CoreKeyboardProc(DeviceIntPtr dev, int what);
 
-
-/*
- * These are deprecated compatibility functions and will be removed soon!
- * Please use the noted replacements instead.
- */
-/* replaced by dixLookupWindow */
-extern _X_EXPORT WindowPtr SecurityLookupWindow(
-    XID id,
-    ClientPtr client,
-    Mask access_mode);
-/* replaced by dixLookupWindow */
-extern _X_EXPORT WindowPtr LookupWindow(
-    XID id,
-    ClientPtr client);
-
-/* replaced by dixLookupDrawable */
-extern _X_EXPORT pointer SecurityLookupDrawable(
-    XID id,
-    ClientPtr client,
-    Mask access_mode);
-
-/* replaced by dixLookupDrawable */
-extern _X_EXPORT pointer LookupDrawable(
-    XID id,
-    ClientPtr client);
-
-/* replaced by dixLookupClient */
-extern _X_EXPORT ClientPtr LookupClient(
-    XID id,
-    ClientPtr client);
-
 #endif /* DIX_H */
diff --git a/include/resource.h b/include/resource.h
index 080061f..763aa99 100644
--- a/include/resource.h
+++ b/include/resource.h
@@ -251,34 +251,5 @@ extern _X_EXPORT unsigned int GetXIDList(
 extern _X_EXPORT RESTYPE lastResourceType;
 extern _X_EXPORT RESTYPE TypeMask;
 
-/*
- * These are deprecated compatibility functions and will be removed soon!
- * Please use the noted replacements instead.
- */
-
-/* replaced by dixLookupResourceByType */
-extern _X_EXPORT pointer SecurityLookupIDByType(
-    ClientPtr client,
-    XID id,
-    RESTYPE rtype,
-    Mask access_mode) _X_DEPRECATED;
-
-/* replaced by dixLookupResourceByClass */
-extern _X_EXPORT pointer SecurityLookupIDByClass(
-    ClientPtr client,
-    XID id,
-    RESTYPE classes,
-    Mask access_mode) _X_DEPRECATED;
-
-/* replaced by dixLookupResourceByType */
-extern _X_EXPORT pointer LookupIDByType(
-    XID id,
-    RESTYPE rtype) _X_DEPRECATED;
-
-/* replaced by dixLookupResourceByClass */
-extern _X_EXPORT pointer LookupIDByClass(
-    XID id,
-    RESTYPE classes) _X_DEPRECATED;
-
 #endif /* RESOURCE_H */
 
commit 1564c82417d201de5b9a5ec5e7aa4ef14c45fbad
Author: Adam Jackson <ajax at redhat.com>
Date:   Thu Jan 20 18:37:45 2011 -0500

    dix: Remove usage_hint from pixmaps, store it in ->drawable.class
    
    The class field was unused for pixmaps, and we don't have enough classes
    to justify a whole uint32 anyway.
    
    Reviewed-by: Soren Sandmann <ssp at redhat.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/exa/exa.h b/exa/exa.h
index 8c93d15..6de6300 100644
--- a/exa/exa.h
+++ b/exa/exa.h
@@ -712,7 +712,7 @@ typedef struct _ExaDriver {
      * driver MUST fill out new_fb_pitch with valid pitch of pixmap
      */
     void *(*CreatePixmap2)(ScreenPtr pScreen, int width, int height,
-			   int depth, int usage_hint, int bitsPerPixel,
+			   int depth, int class, int bitsPerPixel,
 			   int *new_fb_pitch);
     /** @} */
 } ExaDriverRec, *ExaDriverPtr;
diff --git a/exa/exa_classic.c b/exa/exa_classic.c
index 169ce3a..640b26a 100644
--- a/exa/exa_classic.c
+++ b/exa/exa_classic.c
@@ -54,7 +54,7 @@ ExaGetPixmapAddress(PixmapPtr p)
  */
 PixmapPtr
 exaCreatePixmap_classic(ScreenPtr pScreen, int w, int h, int depth,
-		unsigned usage_hint)
+		unsigned class)
 {
     PixmapPtr pPixmap;
     ExaPixmapPrivPtr	pExaPixmap;
@@ -66,7 +66,7 @@ exaCreatePixmap_classic(ScreenPtr pScreen, int w, int h, int depth,
 	return NullPixmap;
 
     swap(pExaScr, pScreen, CreatePixmap);
-    pPixmap = pScreen->CreatePixmap (pScreen, w, h, depth, usage_hint);
+    pPixmap = pScreen->CreatePixmap (pScreen, w, h, depth, class);
     swap(pExaScr, pScreen, CreatePixmap);
 
     if (!pPixmap)
diff --git a/exa/exa_driver.c b/exa/exa_driver.c
index b9903d1..4d2a1a5 100644
--- a/exa/exa_driver.c
+++ b/exa/exa_driver.c
@@ -48,7 +48,7 @@ ExaGetPixmapAddress(PixmapPtr p)
  */
 PixmapPtr
 exaCreatePixmap_driver(ScreenPtr pScreen, int w, int h, int depth,
-		unsigned usage_hint)
+		unsigned class)
 {
     PixmapPtr pPixmap;
     ExaPixmapPrivPtr	pExaPixmap;
@@ -60,7 +60,7 @@ exaCreatePixmap_driver(ScreenPtr pScreen, int w, int h, int depth,
 	return NullPixmap;
 
     swap(pExaScr, pScreen, CreatePixmap);
-    pPixmap = pScreen->CreatePixmap(pScreen, 0, 0, depth, usage_hint);
+    pPixmap = pScreen->CreatePixmap(pScreen, 0, 0, depth, class);
     swap(pExaScr, pScreen, CreatePixmap);
 
     if (!pPixmap)
@@ -78,7 +78,7 @@ exaCreatePixmap_driver(ScreenPtr pScreen, int w, int h, int depth,
 
     if (pExaScr->info->CreatePixmap2) {
 	int new_pitch = 0;
-	pExaPixmap->driverPriv = pExaScr->info->CreatePixmap2(pScreen, w, h, depth, usage_hint, bpp, &new_pitch);
+	pExaPixmap->driverPriv = pExaScr->info->CreatePixmap2(pScreen, w, h, depth, class, bpp, &new_pitch);
 	paddedWidth = pExaPixmap->fb_pitch = new_pitch;
     }
     else {
diff --git a/exa/exa_migration_mixed.c b/exa/exa_migration_mixed.c
index fb47151..a563357 100644
--- a/exa/exa_migration_mixed.c
+++ b/exa/exa_migration_mixed.c
@@ -39,7 +39,7 @@ exaCreateDriverPixmap_mixed(PixmapPtr pPixmap)
     ExaPixmapPriv(pPixmap);
     int w = pPixmap->drawable.width, h = pPixmap->drawable.height;
     int depth = pPixmap->drawable.depth, bpp = pPixmap->drawable.bitsPerPixel;
-    int usage_hint = pPixmap->usage_hint;
+    int class = pPixmap->drawable.class;
     int paddedWidth = pExaPixmap->sys_pitch;
 
     /* Already done. */
@@ -55,7 +55,7 @@ exaCreateDriverPixmap_mixed(PixmapPtr pPixmap)
 
     if (pExaScr->info->CreatePixmap2) {
 	int new_pitch = 0;
-        pExaPixmap->driverPriv = pExaScr->info->CreatePixmap2(pScreen, w, h, depth, usage_hint, bpp, &new_pitch);
+        pExaPixmap->driverPriv = pExaScr->info->CreatePixmap2(pScreen, w, h, depth, class, bpp, &new_pitch);
 	paddedWidth = pExaPixmap->fb_pitch = new_pitch;
     } else {
 	if (paddedWidth < pExaPixmap->fb_pitch)
diff --git a/exa/exa_mixed.c b/exa/exa_mixed.c
index fd1afb2..24fce76 100644
--- a/exa/exa_mixed.c
+++ b/exa/exa_mixed.c
@@ -47,7 +47,7 @@ ExaGetPixmapAddress(PixmapPtr p)
  */
 PixmapPtr
 exaCreatePixmap_mixed(ScreenPtr pScreen, int w, int h, int depth,
-		unsigned usage_hint)
+		unsigned class)
 {
     PixmapPtr pPixmap;
     ExaPixmapPrivPtr	pExaPixmap;
@@ -59,7 +59,7 @@ exaCreatePixmap_mixed(ScreenPtr pScreen, int w, int h, int depth,
 	return NullPixmap;
 
     swap(pExaScr, pScreen, CreatePixmap);
-    pPixmap = pScreen->CreatePixmap(pScreen, 0, 0, depth, usage_hint);
+    pPixmap = pScreen->CreatePixmap(pScreen, 0, 0, depth, class);
     swap(pExaScr, pScreen, CreatePixmap);
 
     if (!pPixmap)
diff --git a/exa/exa_priv.h b/exa/exa_priv.h
index e5d90d4..1f6dede 100644
--- a/exa/exa_priv.h
+++ b/exa/exa_priv.h
@@ -588,7 +588,7 @@ extern const GCFuncs exaGCFuncs;
 /* exa_classic.c */
 PixmapPtr
 exaCreatePixmap_classic(ScreenPtr pScreen, int w, int h, int depth,
-		unsigned usage_hint);
+		unsigned class);
 
 Bool
 exaModifyPixmapHeader_classic(PixmapPtr pPixmap, int width, int height, int depth,
@@ -603,7 +603,7 @@ exaPixmapHasGpuCopy_classic(PixmapPtr pPixmap);
 /* exa_driver.c */
 PixmapPtr
 exaCreatePixmap_driver(ScreenPtr pScreen, int w, int h, int depth,
-		unsigned usage_hint);
+		unsigned class);
 
 Bool
 exaModifyPixmapHeader_driver(PixmapPtr pPixmap, int width, int height, int depth,
@@ -618,7 +618,7 @@ exaPixmapHasGpuCopy_driver(PixmapPtr pPixmap);
 /* exa_mixed.c */
 PixmapPtr
 exaCreatePixmap_mixed(ScreenPtr pScreen, int w, int h, int depth,
-		unsigned usage_hint);
+		unsigned class);
 
 Bool
 exaModifyPixmapHeader_mixed(PixmapPtr pPixmap, int width, int height, int depth,
diff --git a/fb/fb.h b/fb/fb.h
index 021a940..d905219 100644
--- a/fb/fb.h
+++ b/fb/fb.h
@@ -1625,11 +1625,11 @@ fbPictureInit (ScreenPtr pScreen,
 
 extern _X_EXPORT PixmapPtr
 fbCreatePixmapBpp (ScreenPtr pScreen, int width, int height, int depth, int bpp,
-		   unsigned usage_hint);
+		   unsigned class);
 
 extern _X_EXPORT PixmapPtr
 fbCreatePixmap (ScreenPtr pScreen, int width, int height, int depth,
-		unsigned usage_hint);
+		unsigned class);
 
 extern _X_EXPORT Bool
 fbDestroyPixmap (PixmapPtr pPixmap);
diff --git a/fb/fb24_32.c b/fb/fb24_32.c
index 2e600ed..e24f394 100644
--- a/fb/fb24_32.c
+++ b/fb/fb24_32.c
@@ -546,7 +546,7 @@ fb24_32ReformatTile(PixmapPtr pOldTile, int bitsPerPixel)
     pNewTile = pScreen->CreatePixmap(pScreen, pOldTile->drawable.width,
 				     pOldTile->drawable.height,
 				     pOldTile->drawable.depth,
-				     pOldTile->usage_hint);
+				     pOldTile->drawable.class);
     if (!pNewTile)
 	return 0;
     fbGetDrawable (&pOldTile->drawable, 
diff --git a/fb/fbpixmap.c b/fb/fbpixmap.c
index 41b12ce..232de82 100644
--- a/fb/fbpixmap.c
+++ b/fb/fbpixmap.c
@@ -30,7 +30,7 @@
 
 PixmapPtr
 fbCreatePixmapBpp (ScreenPtr pScreen, int width, int height, int depth, int bpp,
-		   unsigned usage_hint)
+		   unsigned class)
 {
     PixmapPtr	pPixmap;
     size_t	datasize;
@@ -54,7 +54,7 @@ fbCreatePixmapBpp (ScreenPtr pScreen, int width, int height, int depth, int bpp,
     if (!pPixmap)
 	return NullPixmap;
     pPixmap->drawable.type = DRAWABLE_PIXMAP;
-    pPixmap->drawable.class = 0;
+    pPixmap->drawable.class = class;
     pPixmap->drawable.pScreen = pScreen;
     pPixmap->drawable.depth = depth;
     pPixmap->drawable.bitsPerPixel = bpp;
@@ -78,14 +78,12 @@ fbCreatePixmapBpp (ScreenPtr pScreen, int width, int height, int depth, int bpp,
     pPixmap->screen_y = 0;
 #endif
 
-    pPixmap->usage_hint = usage_hint;
-
     return pPixmap;
 }
 
 PixmapPtr
 fbCreatePixmap (ScreenPtr pScreen, int width, int height, int depth,
-		unsigned usage_hint)
+		unsigned class)
 {
     int	bpp;
     bpp = BitsPerPixel (depth);
@@ -93,7 +91,7 @@ fbCreatePixmap (ScreenPtr pScreen, int width, int height, int depth,
     if (bpp == 32 && depth <= 24)
 	bpp = fbGetScreenPrivate(pScreen)->pix32bpp;
 #endif
-    return fbCreatePixmapBpp (pScreen, width, height, depth, bpp, usage_hint);
+    return fbCreatePixmapBpp (pScreen, width, height, depth, bpp, class);
 }
 
 Bool
diff --git a/hw/dmx/dmxpixmap.c b/hw/dmx/dmxpixmap.c
index 81b7115..a167364 100644
--- a/hw/dmx/dmxpixmap.c
+++ b/hw/dmx/dmxpixmap.c
@@ -82,7 +82,7 @@ void dmxBECreatePixmap(PixmapPtr pPixmap)
 /** Create a pixmap for \a pScreen with the specified \a width, \a
  *  height, and \a depth. */
 PixmapPtr dmxCreatePixmap(ScreenPtr pScreen, int width, int height, int depth,
-			  unsigned usage_hint)
+			  unsigned class)
 {
     DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
     PixmapPtr      pPixmap;
@@ -104,7 +104,7 @@ PixmapPtr dmxCreatePixmap(ScreenPtr pScreen, int width, int height, int depth,
 	return NullPixmap;
 
     pPixmap->drawable.type = DRAWABLE_PIXMAP;
-    pPixmap->drawable.class = 0;
+    pPixmap->drawable.class = class;
     pPixmap->drawable.pScreen = pScreen;
     pPixmap->drawable.depth = depth;
     pPixmap->drawable.bitsPerPixel = bpp;
@@ -116,7 +116,6 @@ PixmapPtr dmxCreatePixmap(ScreenPtr pScreen, int width, int height, int depth,
     pPixmap->drawable.height = height;
     pPixmap->devKind = PixmapBytePad(width, bpp);
     pPixmap->refcnt = 1;
-    pPixmap->usage_hint = usage_hint;
 
     pPixPriv = DMX_GET_PIXMAP_PRIV(pPixmap);
     pPixPriv->pixmap = (Pixmap)0;
diff --git a/hw/dmx/dmxpixmap.h b/hw/dmx/dmxpixmap.h
index 59da788..4b4a8b2 100644
--- a/hw/dmx/dmxpixmap.h
+++ b/hw/dmx/dmxpixmap.h
@@ -50,7 +50,7 @@ extern Bool      dmxInitPixmap(ScreenPtr pScreen);
 
 extern PixmapPtr dmxCreatePixmap(ScreenPtr pScreen,
 				 int width, int height, int depth,
-				 unsigned usage_hint);
+				 unsigned class);
 extern Bool      dmxDestroyPixmap(PixmapPtr pPixmap);
 extern RegionPtr dmxBitmapToRegion(PixmapPtr pPixmap);
 
diff --git a/hw/xfree86/common/xf86VGAarbiter.c b/hw/xfree86/common/xf86VGAarbiter.c
index 215e845..c5ebb27 100644
--- a/hw/xfree86/common/xf86VGAarbiter.c
+++ b/hw/xfree86/common/xf86VGAarbiter.c
@@ -369,13 +369,13 @@ VGAarbiterClearToBackground (
 }
 
 static PixmapPtr
-VGAarbiterCreatePixmap(ScreenPtr pScreen, int w, int h, int depth, unsigned usage_hint)
+VGAarbiterCreatePixmap(ScreenPtr pScreen, int w, int h, int depth, unsigned class)
 {
     PixmapPtr pPix;
 
     SCREEN_PROLOG ( CreatePixmap);
     VGAGet(pScreen);
-    pPix = (*pScreen->CreatePixmap) (pScreen, w, h, depth, usage_hint);
+    pPix = (*pScreen->CreatePixmap) (pScreen, w, h, depth, class);
     VGAPut();
     SCREEN_EPILOG (CreatePixmap, VGAarbiterCreatePixmap);
 
diff --git a/hw/xfree86/common/xf86VGAarbiterPriv.h b/hw/xfree86/common/xf86VGAarbiterPriv.h
index 848e45d..e1ac20f 100644
--- a/hw/xfree86/common/xf86VGAarbiterPriv.h
+++ b/hw/xfree86/common/xf86VGAarbiterPriv.h
@@ -155,7 +155,7 @@ static void VGAarbiterCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg,
 static void VGAarbiterClearToBackground (WindowPtr pWin, int x, int y, int w,
     int h, Bool generateExposures);
 static PixmapPtr VGAarbiterCreatePixmap(ScreenPtr pScreen, int w, int h,
-    int depth, unsigned int usage_hint);
+    int depth, unsigned int class);
 static Bool  VGAarbiterCreateGC(GCPtr pGC);
 static Bool VGAarbiterSaveScreen(ScreenPtr pScreen, Bool unblank);
 static void VGAarbiterStoreColors (ColormapPtr pmap, int ndef, xColorItem
diff --git a/hw/xfree86/xaa/xaaInit.c b/hw/xfree86/xaa/xaaInit.c
index 11443a6..dcbd5ab 100644
--- a/hw/xfree86/xaa/xaaInit.c
+++ b/hw/xfree86/xaa/xaaInit.c
@@ -34,7 +34,7 @@ static void XAAGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h,
 static void XAAGetSpans(DrawablePtr pDrawable, int wMax, DDXPointPtr ppt,
 			int *pwidth, int nspans, char *pdstStart);
 static PixmapPtr XAACreatePixmap(ScreenPtr pScreen, int w, int h, int depth,
-				 unsigned usage_hint);
+				 unsigned class);
 static Bool XAADestroyPixmap(PixmapPtr pPixmap);
 static Bool XAAEnterVT (int index, int flags);
 static void XAALeaveVT (int index, int flags);
@@ -331,7 +331,7 @@ XAAInitializeOffscreenDepths (ScreenPtr pScreen)
 }
 
 static PixmapPtr 
-XAACreatePixmap(ScreenPtr pScreen, int w, int h, int depth, unsigned usage_hint)
+XAACreatePixmap(ScreenPtr pScreen, int w, int h, int depth, unsigned class)
 {
     XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
     ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
@@ -346,7 +346,7 @@ XAACreatePixmap(ScreenPtr pScreen, int w, int h, int depth, unsigned usage_hint)
 	XAAInitializeOffscreenDepths (pScreen);
 
     if(pScrn->vtSema &&
-	(usage_hint != CREATE_PIXMAP_USAGE_GLYPH_PICTURE) &&
+	(class != CREATE_PIXMAP_USAGE_GLYPH_PICTURE) &&
 	(infoRec->offscreenDepths & (1 << (depth - 1))) &&
 	(size >= MIN_OFFPIX_SIZE) && !SwitchedOut &&
 	(!infoRec->maxOffPixWidth || (w <= infoRec->maxOffPixWidth)) &&
@@ -379,7 +379,7 @@ XAACreatePixmap(ScreenPtr pScreen, int w, int h, int depth, unsigned usage_hint)
 	}
 
 	XAA_SCREEN_PROLOGUE (pScreen, CreatePixmap);
-	pPix = (*pScreen->CreatePixmap) (pScreen, 0, 0, depth, usage_hint);
+	pPix = (*pScreen->CreatePixmap) (pScreen, 0, 0, depth, class);
 	XAA_SCREEN_EPILOGUE (pScreen, CreatePixmap, XAACreatePixmap);
 
 	if (!pPix) {
@@ -411,7 +411,7 @@ XAACreatePixmap(ScreenPtr pScreen, int w, int h, int depth, unsigned usage_hint)
     }
 BAILOUT:
     XAA_SCREEN_PROLOGUE (pScreen, CreatePixmap);
-    pPix = (*pScreen->CreatePixmap) (pScreen, w, h, depth, usage_hint);
+    pPix = (*pScreen->CreatePixmap) (pScreen, w, h, depth, class);
     XAA_SCREEN_EPILOGUE (pScreen, CreatePixmap, XAACreatePixmap);
 
     if(pPix) {
diff --git a/hw/xnest/Pixmap.c b/hw/xnest/Pixmap.c
index 3a92ffd..c901db1 100644
--- a/hw/xnest/Pixmap.c
+++ b/hw/xnest/Pixmap.c
@@ -37,7 +37,7 @@ DevPrivateKeyRec xnestPixmapPrivateKeyRec;
 
 PixmapPtr
 xnestCreatePixmap(ScreenPtr pScreen, int width, int height, int depth,
-		  unsigned usage_hint)
+		  unsigned class)
 {
   PixmapPtr pPixmap;
 
@@ -45,7 +45,7 @@ xnestCreatePixmap(ScreenPtr pScreen, int width, int height, int depth,
   if (!pPixmap)
     return NullPixmap;
   pPixmap->drawable.type = DRAWABLE_PIXMAP;
-  pPixmap->drawable.class = 0;
+  pPixmap->drawable.class = class;
   pPixmap->drawable.depth = depth;
   pPixmap->drawable.bitsPerPixel = depth;
   pPixmap->drawable.id = 0;
@@ -57,7 +57,6 @@ xnestCreatePixmap(ScreenPtr pScreen, int width, int height, int depth,
   pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
   pPixmap->refcnt = 1;
   pPixmap->devKind = PixmapBytePad(width, depth);
-  pPixmap->usage_hint = usage_hint;
   if (width && height)
       xnestPixmapPriv(pPixmap)->pixmap = 
 	  XCreatePixmap(xnestDisplay, 
diff --git a/hw/xnest/XNPixmap.h b/hw/xnest/XNPixmap.h
index aa671ed..638a43a 100644
--- a/hw/xnest/XNPixmap.h
+++ b/hw/xnest/XNPixmap.h
@@ -30,7 +30,7 @@ typedef struct {
 #define xnestSharePixmap(pPixmap) ((pPixmap)->refcnt++)
 
 PixmapPtr xnestCreatePixmap(ScreenPtr pScreen, int width, int height,
-			    int depth, unsigned usage_hint);
+			    int depth, unsigned class);
 Bool xnestDestroyPixmap(PixmapPtr pPixmap);
 RegionPtr xnestPixmapToRegion(PixmapPtr pPixmap);
 
diff --git a/hw/xwin/win.h b/hw/xwin/win.h
index 3f40fdb..606645f 100644
--- a/hw/xwin/win.h
+++ b/hw/xwin/win.h
@@ -1069,7 +1069,7 @@ winSetEngineFunctionsPrimaryDD (ScreenPtr pScreen);
 
 PixmapPtr
 winCreatePixmapNativeGDI (ScreenPtr pScreen, int width, int height, int depth,
-			  unsigned usage_hint);
+			  unsigned class);
 
 Bool
 winDestroyPixmapNativeGDI (PixmapPtr pPixmap);
diff --git a/hw/xwin/winpixmap.c b/hw/xwin/winpixmap.c
index 8bd8e34..62717f3 100644
--- a/hw/xwin/winpixmap.c
+++ b/hw/xwin/winpixmap.c
@@ -57,7 +57,7 @@ winCopyRotatePixmapNativeGDI (PixmapPtr psrcPix, PixmapPtr *ppdstPix,
 PixmapPtr
 winCreatePixmapNativeGDI (ScreenPtr pScreen,
 			  int iWidth, int iHeight,
-			  int iDepth, unsigned usage_hint)
+			  int iDepth, unsigned class)
 {
   winPrivPixmapPtr	pPixmapPriv = NULL;
   PixmapPtr		pPixmap = NULL;
@@ -72,13 +72,13 @@ winCreatePixmapNativeGDI (ScreenPtr pScreen,
 
 #if CYGDEBUG
   winDebug ("winCreatePixmap () - w %d h %d d %d uh %d bw %d\n",
-	  iWidth, iHeight, iDepth, usage_hint,
+	  iWidth, iHeight, iDepth, class,
 	  PixmapBytePad (iWidth, iDepth));
 #endif
 
   /* Setup pixmap values */
   pPixmap->drawable.type = DRAWABLE_PIXMAP;
-  pPixmap->drawable.class = 0;
+  pPixmap->drawable.class = class;
   pPixmap->drawable.pScreen = pScreen;
   pPixmap->drawable.depth = iDepth;
   pPixmap->drawable.bitsPerPixel = BitsPerPixel (iDepth);
@@ -91,7 +91,6 @@ winCreatePixmapNativeGDI (ScreenPtr pScreen,
   pPixmap->devKind = 0;
   pPixmap->refcnt = 1;
   pPixmap->devPrivate.ptr = NULL;
-  pPixmap->usage_hint = usage_hint;
 
   /* Pixmap privates are allocated by AllocatePixmap */
   pPixmapPriv = winGetPixmapPriv (pPixmap);
diff --git a/include/pixmapstr.h b/include/pixmapstr.h
index 702faf0..542c381 100644
--- a/include/pixmapstr.h
+++ b/include/pixmapstr.h
@@ -80,7 +80,6 @@ typedef struct _Pixmap {
     short		screen_x;
     short		screen_y;
 #endif
-    unsigned		usage_hint; /* see CREATE_PIXMAP_USAGE_* */
 } PixmapRec;
 
 #endif /* PIXMAPSTRUCT_H */
diff --git a/include/scrnintstr.h b/include/scrnintstr.h
index a9357e8..302a561 100644
--- a/include/scrnintstr.h
+++ b/include/scrnintstr.h
@@ -208,7 +208,7 @@ typedef    PixmapPtr (* CreatePixmapProcPtr)(
 	int /*width*/,
 	int /*height*/,
 	int /*depth*/,
-	unsigned /*usage_hint*/);
+	unsigned /*class*/);
 
 typedef    Bool (* DestroyPixmapProcPtr)(
 	PixmapPtr /*pPixmap*/);
commit d8caa782009abf4dc17b945e325e83fda299a534
Author: Adam Jackson <ajax at redhat.com>
Date:   Thu Feb 24 16:06:34 2011 -0500

    vbe: Fix malloc size bug
    
    v2: Slightly more obvious sizing math.
    
    ==14882== Invalid write of size 2
    ==14882==    at 0x6750267: VBEGetVBEInfo (vbe.c:400)
    ==14882==    by 0x6142064: ??? (in /usr/lib64/xorg/modules/drivers/vesa_drv.so)
    ==14882==    by 0x471895: InitOutput (xf86Init.c:519)
    ==14882==    by 0x422778: main (main.c:205)
    ==14882==  Address 0x4f32fa8 is 72 bytes inside a block of size 73 alloc'd
    ==14882==    at 0x4A0640D: malloc (vg_replace_malloc.c:236)
    ==14882==    by 0x675024B: VBEGetVBEInfo (vbe.c:398)
    ==14882==    by 0x6142064: ??? (in /usr/lib64/xorg/modules/drivers/vesa_drv.so)
    ==14882==    by 0x471895: InitOutput (xf86Init.c:519)
    ==14882==    by 0x422778: main (main.c:205)
    
    Reviewed-by: Mark Kettenis <kettenis at openbsd.org>
    Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/xfree86/vbe/vbe.c b/hw/xfree86/vbe/vbe.c
index bcda5ec..04132d9 100644
--- a/hw/xfree86/vbe/vbe.c
+++ b/hw/xfree86/vbe/vbe.c
@@ -395,7 +395,7 @@ VBEGetVBEInfo(vbeInfoPtr pVbe)
     i = 0;
     while (modes[i] != 0xffff)
 	i++;
-    block->VideoModePtr = malloc(sizeof(CARD16) * i + 1);
+    block->VideoModePtr = malloc(sizeof(CARD16) * (i + 1));
     memcpy(block->VideoModePtr, modes, sizeof(CARD16) * i);
     block->VideoModePtr[i] = 0xffff;
 


More information about the xorg-commit mailing list