Blame SOURCES/0003-Link-in-the-compat-driver-various-renamings.patch

28add0
diff -up xf86-video-qxl-20130514/src/compat/compat-lookup3.c.compat2 xf86-video-qxl-20130514/src/compat/compat-lookup3.c
28add0
--- xf86-video-qxl-20130514/src/compat/compat-lookup3.c.compat2	2013-07-03 14:19:39.007334520 +1000
28add0
+++ xf86-video-qxl-20130514/src/compat/compat-lookup3.c	2013-07-03 14:19:56.102748510 +1000
28add0
@@ -3,17 +3,17 @@
28add0
 lookup3.c, by Bob Jenkins, May 2006, Public Domain.
28add0
 
28add0
 These are functions for producing 32-bit hashes for hash table lookup.
28add0
-hashword(), hashlittle(), hashlittle2(), hashbig(), mix(), and final() 
28add0
+compat_hashword(), compat_hashlittle(), compat_hashlittle2(), compat_hashbig(), mix(), and final() 
28add0
 are externally useful functions.  Routines to test the hash are included 
28add0
 if SELF_TEST is defined.  You can use this free for any purpose.  It's in
28add0
 the public domain.  It has no warranty.
28add0
 
28add0
-You probably want to use hashlittle().  hashlittle() and hashbig()
28add0
-hash byte arrays.  hashlittle() is is faster than hashbig() on
28add0
+You probably want to use compat_hashlittle().  compat_hashlittle() and compat_hashbig()
28add0
+hash byte arrays.  compat_hashlittle() is is faster than compat_hashbig() on
28add0
 little-endian machines.  Intel and AMD are little-endian machines.
28add0
-On second thought, you probably want hashlittle2(), which is identical to
28add0
-hashlittle() except it returns two 32-bit hashes for the price of one.  
28add0
-You could implement hashbig2() if you wanted but I haven't bothered here.
28add0
+On second thought, you probably want compat_hashlittle2(), which is identical to
28add0
+compat_hashlittle() except it returns two 32-bit hashes for the price of one.  
28add0
+You could implement compat_hashbig2() if you wanted but I haven't bothered here.
28add0
 
28add0
 If you want to find a hash of, say, exactly 7 integers, do
28add0
   a = i1;  b = i2;  c = i3;
28add0
@@ -23,9 +23,9 @@ If you want to find a hash of, say, exac
28add0
   a += i7;
28add0
   final(a,b,c);
28add0
 then use c as the hash value.  If you have a variable length array of
28add0
-4-byte integers to hash, use hashword().  If you have a byte array (like
28add0
-a character string), use hashlittle().  If you have several byte arrays, or
28add0
-a mix of things, see the comments above hashlittle().  
28add0
+4-byte integers to hash, use compat_hashword().  If you have a byte array (like
28add0
+a character string), use compat_hashlittle().  If you have several byte arrays, or
28add0
+a mix of things, see the comments above compat_hashlittle().  
28add0
 
28add0
 Why is this so big?  I read 12 bytes at a time into 3 4-byte integers, 
28add0
 then mix those integers.  This is fast (you can do a lot more thorough
28add0
@@ -161,14 +161,14 @@ and these came close:
28add0
  -- that the key be an array of uint32_t's, and
28add0
  -- that the length be the number of uint32_t's in the key
28add0
 
28add0
- The function hashword() is identical to hashlittle() on little-endian
28add0
- machines, and identical to hashbig() on big-endian machines,
28add0
+ The function compat_hashword() is identical to compat_hashlittle() on little-endian
28add0
+ machines, and identical to compat_hashbig() on big-endian machines,
28add0
  except that the length has to be measured in uint32_ts rather than in
28add0
- bytes.  hashlittle() is more complicated than hashword() only because
28add0
- hashlittle() has to dance around fitting the key bytes into registers.
28add0
+ bytes.  compat_hashlittle() is more complicated than compat_hashword() only because
28add0
+ compat_hashlittle() has to dance around fitting the key bytes into registers.
28add0
 --------------------------------------------------------------------
28add0
 */
28add0
-uint32_t hashword(
28add0
+uint32_t compat_hashword(
28add0
     const uint32_t *k,                   /* the key, an array of uint32_t values */
28add0
     size_t          length,               /* the length of the key, in uint32_ts */
28add0
     uint32_t        initval)         /* the previous hash, or an arbitrary value */
28add0
@@ -206,13 +206,13 @@ uint32_t hashword(
28add0
 
28add0
 /*
28add0
 --------------------------------------------------------------------
28add0
-hashword2() -- same as hashword(), but take two seeds and return two
28add0
+compat_hashword2() -- same as compat_hashword(), but take two seeds and return two
28add0
 32-bit values.  pc and pb must both be nonnull, and *pc and *pb must
28add0
 both be initialized with seeds.  If you pass in (*pb)==0, the output 
28add0
-(*pc) will be the same as the return value from hashword().
28add0
+(*pc) will be the same as the return value from compat_hashword().
28add0
 --------------------------------------------------------------------
28add0
 */
28add0
-void hashword2 (
28add0
+void compat_hashword2 (
28add0
 const uint32_t *k,                   /* the key, an array of uint32_t values */
28add0
 size_t          length,               /* the length of the key, in uint32_ts */
28add0
 uint32_t       *pc,                      /* IN: seed OUT: primary hash value */
28add0
@@ -252,7 +252,7 @@ uint32_t       *pb)               /* IN:
28add0
 
28add0
 /*
28add0
 -------------------------------------------------------------------------------
28add0
-hashlittle() -- hash a variable-length key into a 32-bit value
28add0
+compat_hashlittle() -- hash a variable-length key into a 32-bit value
28add0
   k       : the key (the unaligned variable-length array of bytes)
28add0
   length  : the length of the key, counting by bytes
28add0
   initval : can be any 4-byte value
28add0
@@ -267,7 +267,7 @@ use a bitmask.  For example, if you need
28add0
 In which case, the hash table should have hashsize(10) elements.
28add0
 
28add0
 If you are hashing n strings (uint8_t **)k, do it like this:
28add0
-  for (i=0, h=0; i
28add0
+  for (i=0, h=0; i
28add0
 
28add0
 By Bob Jenkins, 2006.  bob_jenkins@burtleburtle.net.  You may use this
28add0
 code any way you wish, private, educational, or commercial.  It's free.
28add0
@@ -277,7 +277,7 @@ acceptable.  Do NOT use for cryptographi
28add0
 -------------------------------------------------------------------------------
28add0
 */
28add0
 
28add0
-uint32_t hashlittle( const void *key, size_t length, uint32_t initval)
28add0
+uint32_t compat_hashlittle( const void *key, size_t length, uint32_t initval)
28add0
 {
28add0
   uint32_t a,b,c;                                          /* internal state */
28add0
   union { const void *ptr; size_t i; } u;     /* needed for Mac Powerbook G4 */
28add0
@@ -450,16 +450,16 @@ uint32_t hashlittle( const void *key, si
28add0
 
28add0
 
28add0
 /*
28add0
- * hashlittle2: return 2 32-bit hash values
28add0
+ * compat_hashlittle2: return 2 32-bit hash values
28add0
  *
28add0
- * This is identical to hashlittle(), except it returns two 32-bit hash
28add0
+ * This is identical to compat_hashlittle(), except it returns two 32-bit hash
28add0
  * values instead of just one.  This is good enough for hash table
28add0
  * lookup with 2^^64 buckets, or if you want a second hash if you're not
28add0
  * happy with the first, or if you want a probably-unique 64-bit ID for
28add0
  * the key.  *pc is better mixed than *pb, so use *pc first.  If you want
28add0
  * a 64-bit value do something like "*pc + (((uint64_t)*pb)<<32)".
28add0
  */
28add0
-void hashlittle2( 
28add0
+void compat_hashlittle2( 
28add0
   const void *key,       /* the key to hash */
28add0
   size_t      length,    /* length of the key */
28add0
   uint32_t   *pc,        /* IN: primary initval, OUT: primary hash */
28add0
@@ -638,12 +638,12 @@ void hashlittle2(
28add0
 
28add0
 
28add0
 /*
28add0
- * hashbig():
28add0
- * This is the same as hashword() on big-endian machines.  It is different
28add0
- * from hashlittle() on all machines.  hashbig() takes advantage of
28add0
+ * compat_hashbig():
28add0
+ * This is the same as compat_hashword() on big-endian machines.  It is different
28add0
+ * from compat_hashlittle() on all machines.  compat_hashbig() takes advantage of
28add0
  * big-endian byte ordering. 
28add0
  */
28add0
-uint32_t hashbig( const void *key, size_t length, uint32_t initval)
28add0
+uint32_t compat_hashbig( const void *key, size_t length, uint32_t initval)
28add0
 {
28add0
   uint32_t a,b,c;
28add0
   union { const void *ptr; size_t i; } u; /* to cast key to (size_t) happily */
28add0
diff -up xf86-video-qxl-20130514/src/compat/compat-lookup3.h.compat2 xf86-video-qxl-20130514/src/compat/compat-lookup3.h
28add0
--- xf86-video-qxl-20130514/src/compat/compat-lookup3.h.compat2	2013-07-03 14:19:39.007334520 +1000
28add0
+++ xf86-video-qxl-20130514/src/compat/compat-lookup3.h	2013-07-03 14:19:56.102748510 +1000
28add0
@@ -21,6 +21,6 @@ typedef UINT8 uint8_t;
28add0
 
28add0
 #endif
28add0
 
28add0
-uint32_t hashlittle( const void *key, size_t length, uint32_t initval);
28add0
+uint32_t compat_hashlittle( const void *key, size_t length, uint32_t initval);
28add0
 
28add0
 #endif
28add0
diff -up xf86-video-qxl-20130514/src/compat/compat-qxl_cursor.c.compat2 xf86-video-qxl-20130514/src/compat/compat-qxl_cursor.c
28add0
--- xf86-video-qxl-20130514/src/compat/compat-qxl_cursor.c.compat2	2013-07-03 14:19:39.008334544 +1000
28add0
+++ xf86-video-qxl-20130514/src/compat/compat-qxl_cursor.c	2013-07-03 14:19:56.103748552 +1000
28add0
@@ -25,25 +25,25 @@
28add0
 #include <cursorstr.h>
28add0
 
28add0
 static void
28add0
-push_cursor (qxl_screen_t *qxl, struct qxl_cursor_cmd *cursor)
28add0
+push_cursor (compat_qxl_screen_t *compat_qxl, struct compat_qxl_cursor_cmd *cursor)
28add0
 {
28add0
-    struct qxl_command cmd;
28add0
+    struct compat_qxl_command cmd;
28add0
 
28add0
-    /* See comment on push_command() in qxl_driver.c */
28add0
-    if (qxl->rom->mode != ~0)
28add0
+    /* See comment on push_command() in compat_qxl_driver.c */
28add0
+    if (compat_qxl->rom->mode != ~0)
28add0
     {
28add0
         cmd.type = QXL_CMD_CURSOR;
28add0
-        cmd.data = physical_address (qxl, cursor);
28add0
+        cmd.data = physical_address (compat_qxl, cursor);
28add0
       
28add0
-        qxl_ring_push (qxl->cursor_ring, &cmd);
28add0
+        compat_qxl_ring_push (compat_qxl->cursor_ring, &cmd);
28add0
     }
28add0
 }
28add0
 
28add0
-static struct qxl_cursor_cmd *
28add0
-qxl_alloc_cursor_cmd(qxl_screen_t *qxl)
28add0
+static struct compat_qxl_cursor_cmd *
28add0
+compat_qxl_alloc_cursor_cmd(compat_qxl_screen_t *compat_qxl)
28add0
 {
28add0
-    struct qxl_cursor_cmd *cmd =
28add0
-	qxl_allocnf (qxl, sizeof(struct qxl_cursor_cmd));
28add0
+    struct compat_qxl_cursor_cmd *cmd =
28add0
+	compat_qxl_allocnf (compat_qxl, sizeof(struct compat_qxl_cursor_cmd));
28add0
 
28add0
     cmd->release_info.id = pointer_to_u64 (cmd) | 1;
28add0
     
28add0
@@ -51,43 +51,43 @@ qxl_alloc_cursor_cmd(qxl_screen_t *qxl)
28add0
 }
28add0
 
28add0
 static void
28add0
-qxl_set_cursor_position(ScrnInfoPtr pScrn, int x, int y)
28add0
+compat_qxl_set_cursor_position(ScrnInfoPtr pScrn, int x, int y)
28add0
 {
28add0
-    qxl_screen_t *qxl = pScrn->driverPrivate;
28add0
-    struct qxl_cursor_cmd *cmd = qxl_alloc_cursor_cmd(qxl);
28add0
+    compat_qxl_screen_t *compat_qxl = pScrn->driverPrivate;
28add0
+    struct compat_qxl_cursor_cmd *cmd = compat_qxl_alloc_cursor_cmd(compat_qxl);
28add0
 
28add0
-    qxl->cur_x = x;
28add0
-    qxl->cur_y = y;
28add0
+    compat_qxl->cur_x = x;
28add0
+    compat_qxl->cur_y = y;
28add0
     
28add0
     cmd->type = QXL_CURSOR_MOVE;
28add0
-    cmd->u.position.x = qxl->cur_x + qxl->hot_x;
28add0
-    cmd->u.position.y = qxl->cur_y + qxl->hot_y;
28add0
+    cmd->u.position.x = compat_qxl->cur_x + compat_qxl->hot_x;
28add0
+    cmd->u.position.y = compat_qxl->cur_y + compat_qxl->hot_y;
28add0
 
28add0
-    push_cursor(qxl, cmd);
28add0
+    push_cursor(compat_qxl, cmd);
28add0
 }
28add0
 
28add0
 static void
28add0
-qxl_load_cursor_image(ScrnInfoPtr pScrn, unsigned char *bits)
28add0
+compat_qxl_load_cursor_image(ScrnInfoPtr pScrn, unsigned char *bits)
28add0
 {
28add0
 }
28add0
 
28add0
 static void
28add0
-qxl_set_cursor_colors(ScrnInfoPtr pScrn, int bg, int fg)
28add0
+compat_qxl_set_cursor_colors(ScrnInfoPtr pScrn, int bg, int fg)
28add0
 {
28add0
     /* Should not be called since UseHWCursor returned FALSE */
28add0
 }
28add0
 
28add0
 static void
28add0
-qxl_load_cursor_argb (ScrnInfoPtr pScrn, CursorPtr pCurs)
28add0
+compat_qxl_load_cursor_argb (ScrnInfoPtr pScrn, CursorPtr pCurs)
28add0
 {
28add0
-    qxl_screen_t *qxl = pScrn->driverPrivate;
28add0
+    compat_qxl_screen_t *compat_qxl = pScrn->driverPrivate;
28add0
     int w = pCurs->bits->width;
28add0
     int h = pCurs->bits->height;
28add0
     int size = w * h * sizeof (CARD32);
28add0
 
28add0
-    struct qxl_cursor_cmd *cmd = qxl_alloc_cursor_cmd (qxl);
28add0
-    struct qxl_cursor *cursor =
28add0
-	qxl_allocnf(qxl, sizeof(struct qxl_cursor) + size);
28add0
+    struct compat_qxl_cursor_cmd *cmd = compat_qxl_alloc_cursor_cmd (compat_qxl);
28add0
+    struct compat_qxl_cursor *cursor =
28add0
+	compat_qxl_allocnf(compat_qxl, sizeof(struct compat_qxl_cursor) + size);
28add0
 
28add0
     cursor->header.unique = 0;
28add0
     cursor->header.type = CURSOR_TYPE_ALPHA;
28add0
@@ -121,20 +121,20 @@ qxl_load_cursor_argb (ScrnInfoPtr pScrn,
28add0
     }
28add0
 #endif
28add0
 
28add0
-    qxl->hot_x = pCurs->bits->xhot;
28add0
-    qxl->hot_y = pCurs->bits->yhot;
28add0
+    compat_qxl->hot_x = pCurs->bits->xhot;
28add0
+    compat_qxl->hot_y = pCurs->bits->yhot;
28add0
     
28add0
     cmd->type = QXL_CURSOR_SET;
28add0
-    cmd->u.set.position.x = qxl->cur_x + qxl->hot_x;
28add0
-    cmd->u.set.position.y = qxl->cur_y + qxl->hot_y;
28add0
-    cmd->u.set.shape = physical_address (qxl, cursor);
28add0
+    cmd->u.set.position.x = compat_qxl->cur_x + compat_qxl->hot_x;
28add0
+    cmd->u.set.position.y = compat_qxl->cur_y + compat_qxl->hot_y;
28add0
+    cmd->u.set.shape = physical_address (compat_qxl, cursor);
28add0
     cmd->u.set.visible = TRUE;
28add0
 
28add0
-    push_cursor(qxl, cmd);
28add0
+    push_cursor(compat_qxl, cmd);
28add0
 }    
28add0
 
28add0
 static Bool
28add0
-qxl_use_hw_cursor (ScreenPtr pScrn, CursorPtr pCurs)
28add0
+compat_qxl_use_hw_cursor (ScreenPtr pScrn, CursorPtr pCurs)
28add0
 {
28add0
     /* Old-school bitmap cursors are not
28add0
      * hardware accelerated for now.
28add0
@@ -143,36 +143,36 @@ qxl_use_hw_cursor (ScreenPtr pScrn, Curs
28add0
 }
28add0
 
28add0
 static Bool
28add0
-qxl_use_hw_cursorARGB (ScreenPtr pScrn, CursorPtr pCurs)
28add0
+compat_qxl_use_hw_cursorARGB (ScreenPtr pScrn, CursorPtr pCurs)
28add0
 {
28add0
     return TRUE;
28add0
 }
28add0
 
28add0
 static void
28add0
-qxl_hide_cursor(ScrnInfoPtr pScrn)
28add0
+compat_qxl_hide_cursor(ScrnInfoPtr pScrn)
28add0
 {
28add0
-    qxl_screen_t *qxl = pScrn->driverPrivate;
28add0
-    struct qxl_cursor_cmd *cursor = qxl_alloc_cursor_cmd(qxl);
28add0
+    compat_qxl_screen_t *compat_qxl = pScrn->driverPrivate;
28add0
+    struct compat_qxl_cursor_cmd *cursor = compat_qxl_alloc_cursor_cmd(compat_qxl);
28add0
 
28add0
     cursor->type = QXL_CURSOR_HIDE;
28add0
 
28add0
-    push_cursor(qxl, cursor);
28add0
+    push_cursor(compat_qxl, cursor);
28add0
 }
28add0
 
28add0
 static void
28add0
-qxl_show_cursor(ScrnInfoPtr pScrn)
28add0
+compat_qxl_show_cursor(ScrnInfoPtr pScrn)
28add0
 {
28add0
     /*
28add0
      * slightly hacky, but there's no QXL_CURSOR_SHOW.  Could maybe do
28add0
      * QXL_CURSOR_SET?
28add0
      */
28add0
-    qxl_screen_t *qxl = pScrn->driverPrivate;
28add0
+    compat_qxl_screen_t *compat_qxl = pScrn->driverPrivate;
28add0
 
28add0
-    qxl_set_cursor_position(pScrn, qxl->cur_x, qxl->cur_y);
28add0
+    compat_qxl_set_cursor_position(pScrn, compat_qxl->cur_x, compat_qxl->cur_y);
28add0
 }
28add0
 
28add0
 hidden void
28add0
-qxl_cursor_init(ScreenPtr pScreen)
28add0
+compat_qxl_cursor_init(ScreenPtr pScreen)
28add0
 {
28add0
     xf86CursorInfoPtr cursor;
28add0
 
28add0
@@ -182,14 +182,14 @@ qxl_cursor_init(ScreenPtr pScreen)
28add0
 
28add0
     cursor->MaxWidth = cursor->MaxHeight = 64;
28add0
     /* cursor->Flags; */
28add0
-    cursor->SetCursorPosition = qxl_set_cursor_position;
28add0
-    cursor->LoadCursorARGB = qxl_load_cursor_argb;
28add0
-    cursor->UseHWCursor = qxl_use_hw_cursor;
28add0
-    cursor->UseHWCursorARGB = qxl_use_hw_cursorARGB;
28add0
-    cursor->LoadCursorImage = qxl_load_cursor_image;
28add0
-    cursor->SetCursorColors = qxl_set_cursor_colors;
28add0
-    cursor->HideCursor = qxl_hide_cursor;
28add0
-    cursor->ShowCursor = qxl_show_cursor;
28add0
+    cursor->SetCursorPosition = compat_qxl_set_cursor_position;
28add0
+    cursor->LoadCursorARGB = compat_qxl_load_cursor_argb;
28add0
+    cursor->UseHWCursor = compat_qxl_use_hw_cursor;
28add0
+    cursor->UseHWCursorARGB = compat_qxl_use_hw_cursorARGB;
28add0
+    cursor->LoadCursorImage = compat_qxl_load_cursor_image;
28add0
+    cursor->SetCursorColors = compat_qxl_set_cursor_colors;
28add0
+    cursor->HideCursor = compat_qxl_hide_cursor;
28add0
+    cursor->ShowCursor = compat_qxl_show_cursor;
28add0
 
28add0
     if (!xf86InitCursor(pScreen, cursor))
28add0
 	xfree(cursor);
28add0
diff -up xf86-video-qxl-20130514/src/compat/compat-qxl_driver.c.compat2 xf86-video-qxl-20130514/src/compat/compat-qxl_driver.c
28add0
--- xf86-video-qxl-20130514/src/compat/compat-qxl_driver.c.compat2	2013-07-03 14:19:39.009334569 +1000
28add0
+++ xf86-video-qxl-20130514/src/compat/compat-qxl_driver.c	2013-07-03 14:19:56.103748552 +1000
28add0
@@ -20,10 +20,10 @@
28add0
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28add0
  */
28add0
 
28add0
-/** \file qxl_driver.c
28add0
+/** \file compat_qxl_driver.c
28add0
  * \author Adam Jackson <ajax@redhat.com>
28add0
  *
28add0
- * This is qxl, a driver for the Qumranet paravirtualized graphics device
28add0
+ * This is compat_qxl, a driver for the Qumranet paravirtualized graphics device
28add0
  * in qemu.
28add0
  */
28add0
 
28add0
@@ -39,12 +39,12 @@
28add0
 #define CHECK_POINT()
28add0
 
28add0
 static int
28add0
-garbage_collect (qxl_screen_t *qxl)
28add0
+garbage_collect (compat_qxl_screen_t *compat_qxl)
28add0
 {
28add0
     uint64_t id;
28add0
     int i = 0;
28add0
     
28add0
-    while (qxl_ring_pop (qxl->release_ring, &id))
28add0
+    while (compat_qxl_ring_pop (compat_qxl->release_ring, &id))
28add0
     {
28add0
 	while (id)
28add0
 	{
28add0
@@ -54,9 +54,9 @@ garbage_collect (qxl_screen_t *qxl)
28add0
 	     */
28add0
 #define POINTER_MASK ((1 << 2) - 1)
28add0
 	    
28add0
-	    union qxl_release_info *info = u64_to_pointer (id & ~POINTER_MASK);
28add0
-	    struct qxl_cursor_cmd *cmd = (struct qxl_cursor_cmd *)info;
28add0
-	    struct qxl_drawable *drawable = (struct qxl_drawable *)info;
28add0
+	    union compat_qxl_release_info *info = u64_to_pointer (id & ~POINTER_MASK);
28add0
+	    struct compat_qxl_cursor_cmd *cmd = (struct compat_qxl_cursor_cmd *)info;
28add0
+	    struct compat_qxl_drawable *drawable = (struct compat_qxl_drawable *)info;
28add0
 	    int is_cursor = FALSE;
28add0
 
28add0
 	    if ((id & POINTER_MASK) == 1)
28add0
@@ -64,22 +64,22 @@ garbage_collect (qxl_screen_t *qxl)
28add0
 
28add0
 	    if (is_cursor && cmd->type == QXL_CURSOR_SET)
28add0
 	    {
28add0
-		struct qxl_cursor *cursor = (void *)virtual_address (
28add0
-		    qxl, u64_to_pointer (cmd->u.set.shape));
28add0
+		struct compat_qxl_cursor *cursor = (void *)virtual_address (
28add0
+		    compat_qxl, u64_to_pointer (cmd->u.set.shape));
28add0
 
28add0
-		qxl_free (qxl->mem, cursor);
28add0
+		compat_qxl_free (compat_qxl->mem, cursor);
28add0
 	    }
28add0
 	    else if (!is_cursor && drawable->type == QXL_DRAW_COPY)
28add0
 	    {
28add0
-		struct qxl_image *image = virtual_address (
28add0
-		    qxl, u64_to_pointer (drawable->u.copy.src_bitmap));
28add0
+		struct compat_qxl_image *image = virtual_address (
28add0
+		    compat_qxl, u64_to_pointer (drawable->u.copy.src_bitmap));
28add0
 
28add0
-		qxl_image_destroy (qxl, image);
28add0
+		compat_qxl_image_destroy (compat_qxl, image);
28add0
 	    }
28add0
 	    
28add0
 	    id = info->next;
28add0
 	    
28add0
-	    qxl_free (qxl->mem, info);
28add0
+	    compat_qxl_free (compat_qxl->mem, info);
28add0
 	}
28add0
     }
28add0
 
28add0
@@ -87,7 +87,7 @@ garbage_collect (qxl_screen_t *qxl)
28add0
 }
28add0
 
28add0
 static void
28add0
-qxl_usleep (int useconds)
28add0
+compat_qxl_usleep (int useconds)
28add0
 {
28add0
     struct timespec t;
28add0
 
28add0
@@ -102,35 +102,35 @@ qxl_usleep (int useconds)
28add0
 
28add0
 #if 0
28add0
 static void
28add0
-push_update_area (qxl_screen_t *qxl, const struct qxl_rect *area)
28add0
+push_update_area (compat_qxl_screen_t *compat_qxl, const struct compat_qxl_rect *area)
28add0
 {
28add0
-    struct qxl_update_cmd *update = qxl_allocnf (qxl, sizeof *update);
28add0
-    struct qxl_command cmd;
28add0
+    struct compat_qxl_update_cmd *update = compat_qxl_allocnf (compat_qxl, sizeof *update);
28add0
+    struct compat_qxl_command cmd;
28add0
 
28add0
     update->release_info.id = (uint64_t)update;
28add0
     update->area = *area;
28add0
     update->update_id = 0;
28add0
 
28add0
     cmd.type = QXL_CMD_UDPATE;
28add0
-    cmd.data = physical_address (qxl, update);
28add0
+    cmd.data = physical_address (compat_qxl, update);
28add0
 
28add0
-    qxl_ring_push (qxl->command_ring, &cmd);
28add0
+    compat_qxl_ring_push (compat_qxl->command_ring, &cmd);
28add0
 }
28add0
 #endif
28add0
 
28add0
 void *
28add0
-qxl_allocnf (qxl_screen_t *qxl, unsigned long size)
28add0
+compat_qxl_allocnf (compat_qxl_screen_t *compat_qxl, unsigned long size)
28add0
 {
28add0
     void *result;
28add0
     int n_attempts = 0;
28add0
     static int nth_oom = 1;
28add0
 
28add0
-    garbage_collect (qxl);
28add0
+    garbage_collect (compat_qxl);
28add0
     
28add0
-    while (!(result = qxl_alloc (qxl->mem, size)))
28add0
+    while (!(result = compat_qxl_alloc (compat_qxl->mem, size)))
28add0
     {
28add0
-	struct qxl_ram_header *ram_header = (void *)((unsigned long)qxl->ram +
28add0
-						     qxl->rom->ram_header_offset);
28add0
+	struct compat_qxl_ram_header *ram_header = (void *)((unsigned long)compat_qxl->ram +
28add0
+						     compat_qxl->rom->ram_header_offset);
28add0
 	
28add0
 	/* Rather than go out of memory, we simply tell the
28add0
 	 * device to dump everything
28add0
@@ -140,21 +140,21 @@ qxl_allocnf (qxl_screen_t *qxl, unsigned
28add0
 	ram_header->update_area.left = 0;
28add0
 	ram_header->update_area.right = 800;
28add0
 	
28add0
-	outb (qxl->io_base + QXL_IO_UPDATE_AREA, 0);
28add0
+	outb (compat_qxl->io_base + QXL_IO_UPDATE_AREA, 0);
28add0
 	
28add0
  	ErrorF ("eliminated memory (%d)\n", nth_oom++);
28add0
 
28add0
-	outb (qxl->io_base + QXL_IO_NOTIFY_OOM, 0);
28add0
+	outb (compat_qxl->io_base + QXL_IO_NOTIFY_OOM, 0);
28add0
 
28add0
-	qxl_usleep (10000);
28add0
+	compat_qxl_usleep (10000);
28add0
 	
28add0
-	if (garbage_collect (qxl))
28add0
+	if (garbage_collect (compat_qxl))
28add0
 	{
28add0
 	    n_attempts = 0;
28add0
 	}
28add0
 	else if (++n_attempts == 1000)
28add0
 	{
28add0
-	    qxl_mem_dump_stats (qxl->mem, "Out of mem - stats\n");
28add0
+	    compat_qxl_mem_dump_stats (compat_qxl->mem, "Out of mem - stats\n");
28add0
 	    
28add0
 	    fprintf (stderr, "Out of memory\n");
28add0
 	    exit (1);
28add0
@@ -165,127 +165,127 @@ qxl_allocnf (qxl_screen_t *qxl, unsigned
28add0
 }
28add0
 
28add0
 static Bool
28add0
-qxl_blank_screen(ScreenPtr pScreen, int mode)
28add0
+compat_qxl_blank_screen(ScreenPtr pScreen, int mode)
28add0
 {
28add0
     return TRUE;
28add0
 }
28add0
 
28add0
 static void
28add0
-qxl_unmap_memory(qxl_screen_t *qxl, int scrnIndex)
28add0
+compat_qxl_unmap_memory(compat_qxl_screen_t *compat_qxl, int scrnIndex)
28add0
 {
28add0
 #ifdef XSERVER_LIBPCIACCESS
28add0
-    if (qxl->ram)
28add0
-	pci_device_unmap_range(qxl->pci, qxl->ram, qxl->pci->regions[0].size);
28add0
-    if (qxl->vram)
28add0
-	pci_device_unmap_range(qxl->pci, qxl->vram, qxl->pci->regions[1].size);
28add0
-    if (qxl->rom)
28add0
-	pci_device_unmap_range(qxl->pci, qxl->rom, qxl->pci->regions[2].size);
28add0
+    if (compat_qxl->ram)
28add0
+	pci_device_unmap_range(compat_qxl->pci, compat_qxl->ram, compat_qxl->pci->regions[0].size);
28add0
+    if (compat_qxl->vram)
28add0
+	pci_device_unmap_range(compat_qxl->pci, compat_qxl->vram, compat_qxl->pci->regions[1].size);
28add0
+    if (compat_qxl->rom)
28add0
+	pci_device_unmap_range(compat_qxl->pci, compat_qxl->rom, compat_qxl->pci->regions[2].size);
28add0
 #else
28add0
-    if (qxl->ram)
28add0
-	xf86UnMapVidMem(scrnIndex, qxl->ram, (1 << qxl->pci->size[0]));
28add0
-    if (qxl->vram)
28add0
-	xf86UnMapVidMem(scrnIndex, qxl->vram, (1 << qxl->pci->size[1]));
28add0
-    if (qxl->rom)
28add0
-	xf86UnMapVidMem(scrnIndex, qxl->rom, (1 << qxl->pci->size[2]));
28add0
+    if (compat_qxl->ram)
28add0
+	xf86UnMapVidMem(scrnIndex, compat_qxl->ram, (1 << compat_qxl->pci->size[0]));
28add0
+    if (compat_qxl->vram)
28add0
+	xf86UnMapVidMem(scrnIndex, compat_qxl->vram, (1 << compat_qxl->pci->size[1]));
28add0
+    if (compat_qxl->rom)
28add0
+	xf86UnMapVidMem(scrnIndex, compat_qxl->rom, (1 << compat_qxl->pci->size[2]));
28add0
 #endif
28add0
 
28add0
-    qxl->ram = qxl->ram_physical = qxl->vram = qxl->rom = NULL;
28add0
+    compat_qxl->ram = compat_qxl->ram_physical = compat_qxl->vram = compat_qxl->rom = NULL;
28add0
 
28add0
-    qxl->num_modes = 0;
28add0
-    qxl->modes = NULL;
28add0
+    compat_qxl->num_modes = 0;
28add0
+    compat_qxl->modes = NULL;
28add0
 }
28add0
 
28add0
 static Bool
28add0
-qxl_map_memory(qxl_screen_t *qxl, int scrnIndex)
28add0
+compat_qxl_map_memory(compat_qxl_screen_t *compat_qxl, int scrnIndex)
28add0
 {
28add0
 #ifdef XSERVER_LIBPCIACCESS
28add0
-    pci_device_map_range(qxl->pci, qxl->pci->regions[0].base_addr, 
28add0
-			 qxl->pci->regions[0].size,
28add0
+    pci_device_map_range(compat_qxl->pci, compat_qxl->pci->regions[0].base_addr, 
28add0
+			 compat_qxl->pci->regions[0].size,
28add0
 			 PCI_DEV_MAP_FLAG_WRITABLE | PCI_DEV_MAP_FLAG_WRITE_COMBINE,
28add0
-			 &qxl->ram);
28add0
-    qxl->ram_physical = u64_to_pointer (qxl->pci->regions[0].base_addr);
28add0
+			 &compat_qxl->ram);
28add0
+    compat_qxl->ram_physical = u64_to_pointer (compat_qxl->pci->regions[0].base_addr);
28add0
 
28add0
-    pci_device_map_range(qxl->pci, qxl->pci->regions[1].base_addr, 
28add0
-			 qxl->pci->regions[1].size,
28add0
+    pci_device_map_range(compat_qxl->pci, compat_qxl->pci->regions[1].base_addr, 
28add0
+			 compat_qxl->pci->regions[1].size,
28add0
 			 PCI_DEV_MAP_FLAG_WRITABLE,
28add0
-			 &qxl->vram);
28add0
+			 &compat_qxl->vram);
28add0
 
28add0
-    pci_device_map_range(qxl->pci, qxl->pci->regions[2].base_addr, 
28add0
-			 qxl->pci->regions[2].size, 0,
28add0
-			 (void **)&qxl->rom);
28add0
+    pci_device_map_range(compat_qxl->pci, compat_qxl->pci->regions[2].base_addr, 
28add0
+			 compat_qxl->pci->regions[2].size, 0,
28add0
+			 (void **)&compat_qxl->rom);
28add0
 
28add0
-    qxl->io_base = qxl->pci->regions[3].base_addr;
28add0
+    compat_qxl->io_base = compat_qxl->pci->regions[3].base_addr;
28add0
 #else
28add0
-    qxl->ram = xf86MapPciMem(scrnIndex, VIDMEM_FRAMEBUFFER,
28add0
-			     qxl->pci_tag, qxl->pci->memBase[0],
28add0
-			     (1 << qxl->pci->size[0]));
28add0
-    qxl->ram_physical = (void *)qxl->pci->memBase[0];
28add0
-    
28add0
-    qxl->vram = xf86MapPciMem(scrnIndex, VIDMEM_MMIO | VIDMEM_MMIO_32BIT,
28add0
-			      qxl->pci_tag, qxl->pci->memBase[1],
28add0
-			      (1 << qxl->pci->size[1]));
28add0
-    
28add0
-    qxl->rom = xf86MapPciMem(scrnIndex, VIDMEM_MMIO | VIDMEM_MMIO_32BIT,
28add0
-			     qxl->pci_tag, qxl->pci->memBase[2],
28add0
-			     (1 << qxl->pci->size[2]));
28add0
+    compat_qxl->ram = xf86MapPciMem(scrnIndex, VIDMEM_FRAMEBUFFER,
28add0
+			     compat_qxl->pci_tag, compat_qxl->pci->memBase[0],
28add0
+			     (1 << compat_qxl->pci->size[0]));
28add0
+    compat_qxl->ram_physical = (void *)compat_qxl->pci->memBase[0];
28add0
+    
28add0
+    compat_qxl->vram = xf86MapPciMem(scrnIndex, VIDMEM_MMIO | VIDMEM_MMIO_32BIT,
28add0
+			      compat_qxl->pci_tag, compat_qxl->pci->memBase[1],
28add0
+			      (1 << compat_qxl->pci->size[1]));
28add0
+    
28add0
+    compat_qxl->rom = xf86MapPciMem(scrnIndex, VIDMEM_MMIO | VIDMEM_MMIO_32BIT,
28add0
+			     compat_qxl->pci_tag, compat_qxl->pci->memBase[2],
28add0
+			     (1 << compat_qxl->pci->size[2]));
28add0
     
28add0
-    qxl->io_base = qxl->pci->ioBase[3];
28add0
+    compat_qxl->io_base = compat_qxl->pci->ioBase[3];
28add0
 #endif
28add0
-    if (!qxl->ram || !qxl->vram || !qxl->rom)
28add0
+    if (!compat_qxl->ram || !compat_qxl->vram || !compat_qxl->rom)
28add0
 	return FALSE;
28add0
 
28add0
     xf86DrvMsg(scrnIndex, X_INFO, "ram at %p; vram at %p; rom at %p\n",
28add0
-	       qxl->ram, qxl->vram, qxl->rom);
28add0
+	       compat_qxl->ram, compat_qxl->vram, compat_qxl->rom);
28add0
 
28add0
-    qxl->num_modes = *(uint32_t *)((uint8_t *)qxl->rom + qxl->rom->modes_offset);
28add0
-    qxl->modes = (struct qxl_mode *)(((uint8_t *)qxl->rom) + qxl->rom->modes_offset + 4);
28add0
+    compat_qxl->num_modes = *(uint32_t *)((uint8_t *)compat_qxl->rom + compat_qxl->rom->modes_offset);
28add0
+    compat_qxl->modes = (struct compat_qxl_mode *)(((uint8_t *)compat_qxl->rom) + compat_qxl->rom->modes_offset + 4);
28add0
 
28add0
     return TRUE;
28add0
 }
28add0
 
28add0
 static void
28add0
-qxl_save_state(ScrnInfoPtr pScrn)
28add0
+compat_qxl_save_state(ScrnInfoPtr pScrn)
28add0
 {
28add0
-    qxl_screen_t *qxl = pScrn->driverPrivate;
28add0
+    compat_qxl_screen_t *compat_qxl = pScrn->driverPrivate;
28add0
 
28add0
-    vgaHWSaveFonts(pScrn, &qxl->vgaRegs);
28add0
+    vgaHWSaveFonts(pScrn, &compat_qxl->vgaRegs);
28add0
 }
28add0
 
28add0
 static void
28add0
-qxl_restore_state(ScrnInfoPtr pScrn)
28add0
+compat_qxl_restore_state(ScrnInfoPtr pScrn)
28add0
 {
28add0
-    qxl_screen_t *qxl = pScrn->driverPrivate;
28add0
+    compat_qxl_screen_t *compat_qxl = pScrn->driverPrivate;
28add0
 
28add0
-    vgaHWRestoreFonts(pScrn, &qxl->vgaRegs);
28add0
+    vgaHWRestoreFonts(pScrn, &compat_qxl->vgaRegs);
28add0
 }
28add0
 
28add0
 static Bool
28add0
-qxl_close_screen(int scrnIndex, ScreenPtr pScreen)
28add0
+compat_qxl_close_screen(int scrnIndex, ScreenPtr pScreen)
28add0
 {
28add0
     ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
28add0
-    qxl_screen_t *qxl = pScrn->driverPrivate;
28add0
+    compat_qxl_screen_t *compat_qxl = pScrn->driverPrivate;
28add0
 
28add0
     if (pScrn->vtSema) {
28add0
-        qxl_restore_state(pScrn);
28add0
-	qxl_unmap_memory(qxl, scrnIndex);
28add0
+        compat_qxl_restore_state(pScrn);
28add0
+	compat_qxl_unmap_memory(compat_qxl, scrnIndex);
28add0
     }
28add0
     pScrn->vtSema = FALSE;
28add0
 
28add0
-    xfree(qxl->fb);
28add0
+    xfree(compat_qxl->fb);
28add0
 
28add0
-    pScreen->CreateScreenResources = qxl->create_screen_resources;
28add0
-    pScreen->CloseScreen = qxl->close_screen;
28add0
+    pScreen->CreateScreenResources = compat_qxl->create_screen_resources;
28add0
+    pScreen->CloseScreen = compat_qxl->close_screen;
28add0
 
28add0
     return pScreen->CloseScreen(scrnIndex, pScreen);
28add0
 }
28add0
 
28add0
 static Bool
28add0
-qxl_switch_mode(int scrnIndex, DisplayModePtr p, int flags)
28add0
+compat_qxl_switch_mode(int scrnIndex, DisplayModePtr p, int flags)
28add0
 {
28add0
-    qxl_screen_t *qxl = xf86Screens[scrnIndex]->driverPrivate;
28add0
+    compat_qxl_screen_t *compat_qxl = xf86Screens[scrnIndex]->driverPrivate;
28add0
     int mode_index = (int)(unsigned long)p->Private;
28add0
-    struct qxl_mode *m = qxl->modes + mode_index;
28add0
-    ScreenPtr pScreen = qxl->pScrn->pScreen;
28add0
+    struct compat_qxl_mode *m = compat_qxl->modes + mode_index;
28add0
+    ScreenPtr pScreen = compat_qxl->pScrn->pScreen;
28add0
 
28add0
     if (!m)
28add0
 	return FALSE;
28add0
@@ -294,11 +294,11 @@ qxl_switch_mode(int scrnIndex, DisplayMo
28add0
     xf86DrvMsg (scrnIndex, X_INFO, "Setting mode %d (%d x %d) (%d x %d) %p\n",
28add0
 		m->id, m->x_res, m->y_res, p->HDisplay, p->VDisplay, p);
28add0
 
28add0
-    outb(qxl->io_base + QXL_IO_RESET, 0);
28add0
+    outb(compat_qxl->io_base + QXL_IO_RESET, 0);
28add0
     
28add0
-    outb(qxl->io_base + QXL_IO_SET_MODE, m->id);
28add0
+    outb(compat_qxl->io_base + QXL_IO_SET_MODE, m->id);
28add0
 
28add0
-    qxl->bytes_per_pixel = (qxl->pScrn->bitsPerPixel + 7) / 8;
28add0
+    compat_qxl->bytes_per_pixel = (compat_qxl->pScrn->bitsPerPixel + 7) / 8;
28add0
 
28add0
     /* If this happens out of ScreenInit, we won't have a screen yet. In that
28add0
      * case createScreenResources will make things right.
28add0
@@ -313,15 +313,15 @@ qxl_switch_mode(int scrnIndex, DisplayMo
28add0
 		pPixmap,
28add0
 		m->x_res, m->y_res,
28add0
 		-1, -1,
28add0
-		qxl->pScrn->displayWidth * qxl->bytes_per_pixel,
28add0
+		compat_qxl->pScrn->displayWidth * compat_qxl->bytes_per_pixel,
28add0
 		NULL);
28add0
 	}
28add0
     }
28add0
     
28add0
-    if (qxl->mem)
28add0
+    if (compat_qxl->mem)
28add0
     {
28add0
-	qxl_mem_free_all (qxl->mem);
28add0
-	qxl_drop_image_cache (qxl);
28add0
+	compat_qxl_mem_free_all (compat_qxl->mem);
28add0
+	compat_qxl_drop_image_cache (compat_qxl);
28add0
     }
28add0
 
28add0
     
28add0
@@ -329,9 +329,9 @@ qxl_switch_mode(int scrnIndex, DisplayMo
28add0
 }
28add0
 
28add0
 static void
28add0
-push_drawable (qxl_screen_t *qxl, struct qxl_drawable *drawable)
28add0
+push_drawable (compat_qxl_screen_t *compat_qxl, struct compat_qxl_drawable *drawable)
28add0
 {
28add0
-    struct qxl_command cmd;
28add0
+    struct compat_qxl_command cmd;
28add0
 
28add0
     /* When someone runs "init 3", the device will be 
28add0
      * switched into VGA mode and there is nothing we
28add0
@@ -345,25 +345,25 @@ push_drawable (qxl_screen_t *qxl, struct
28add0
      * The author of the QXL device is opposed to this
28add0
      * for reasons I don't understand.
28add0
      */
28add0
-    if (qxl->rom->mode != ~0)
28add0
+    if (compat_qxl->rom->mode != ~0)
28add0
     {
28add0
 	cmd.type = QXL_CMD_DRAW;
28add0
-	cmd.data = physical_address (qxl, drawable);
28add0
+	cmd.data = physical_address (compat_qxl, drawable);
28add0
 	    
28add0
-	qxl_ring_push (qxl->command_ring, &cmd);
28add0
+	compat_qxl_ring_push (compat_qxl->command_ring, &cmd);
28add0
     }
28add0
 }
28add0
 
28add0
-static struct qxl_drawable *
28add0
-make_drawable (qxl_screen_t *qxl, uint8_t type,
28add0
-	       const struct qxl_rect *rect
28add0
+static struct compat_qxl_drawable *
28add0
+make_drawable (compat_qxl_screen_t *compat_qxl, uint8_t type,
28add0
+	       const struct compat_qxl_rect *rect
28add0
 	       /* , pRegion clip */)
28add0
 {
28add0
-    struct qxl_drawable *drawable;
28add0
+    struct compat_qxl_drawable *drawable;
28add0
 
28add0
     CHECK_POINT();
28add0
     
28add0
-    drawable = qxl_allocnf (qxl, sizeof *drawable);
28add0
+    drawable = compat_qxl_allocnf (compat_qxl, sizeof *drawable);
28add0
 
28add0
     CHECK_POINT();
28add0
 
28add0
@@ -383,7 +383,7 @@ make_drawable (qxl_screen_t *qxl, uint8_
28add0
     if (rect)
28add0
 	drawable->bbox = *rect;
28add0
 
28add0
-    drawable->mm_time = qxl->rom->mm_clock;
28add0
+    drawable->mm_time = compat_qxl->rom->mm_clock;
28add0
 
28add0
     CHECK_POINT();
28add0
     
28add0
@@ -405,7 +405,7 @@ enum ROPDescriptor {
28add0
 };
28add0
 
28add0
 static void
28add0
-undamage_box (qxl_screen_t *qxl, const struct qxl_rect *rect)
28add0
+undamage_box (compat_qxl_screen_t *compat_qxl, const struct compat_qxl_rect *rect)
28add0
 {
28add0
     RegionRec region;
28add0
     BoxRec box;
28add0
@@ -415,27 +415,27 @@ undamage_box (qxl_screen_t *qxl, const s
28add0
     box.x2 = rect->right;
28add0
     box.y2 = rect->bottom;
28add0
 
28add0
-    REGION_INIT (qxl->pScrn->pScreen, &region, &box, 0);
28add0
+    REGION_INIT (compat_qxl->pScrn->pScreen, &region, &box, 0);
28add0
 
28add0
-    REGION_SUBTRACT (qxl->pScrn->pScreen, &(qxl->pending_copy), &(qxl->pending_copy), &region);
28add0
+    REGION_SUBTRACT (compat_qxl->pScrn->pScreen, &(compat_qxl->pending_copy), &(compat_qxl->pending_copy), &region);
28add0
 
28add0
-    REGION_EMPTY (qxl->pScrn->pScreen, &(qxl->pending_copy));
28add0
+    REGION_EMPTY (compat_qxl->pScrn->pScreen, &(compat_qxl->pending_copy));
28add0
 }
28add0
 
28add0
 static void
28add0
-clear_pending_damage (qxl_screen_t *qxl)
28add0
+clear_pending_damage (compat_qxl_screen_t *compat_qxl)
28add0
 {
28add0
-    REGION_EMPTY (qxl->pScrn->pScreen, &(qxl->pending_copy));
28add0
+    REGION_EMPTY (compat_qxl->pScrn->pScreen, &(compat_qxl->pending_copy));
28add0
 }
28add0
 
28add0
 static void
28add0
-submit_fill (qxl_screen_t *qxl, const struct qxl_rect *rect, uint32_t color)
28add0
+submit_fill (compat_qxl_screen_t *compat_qxl, const struct compat_qxl_rect *rect, uint32_t color)
28add0
 {
28add0
-    struct qxl_drawable *drawable;
28add0
+    struct compat_qxl_drawable *drawable;
28add0
 
28add0
     CHECK_POINT();
28add0
     
28add0
-    drawable = make_drawable (qxl, QXL_DRAW_FILL, rect);
28add0
+    drawable = make_drawable (compat_qxl, QXL_DRAW_FILL, rect);
28add0
 
28add0
     CHECK_POINT();
28add0
 
28add0
@@ -447,13 +447,13 @@ submit_fill (qxl_screen_t *qxl, const st
28add0
     drawable->u.fill.mask.pos.y = 0;
28add0
     drawable->u.fill.mask.bitmap = 0;
28add0
 
28add0
-    push_drawable (qxl, drawable);
28add0
+    push_drawable (compat_qxl, drawable);
28add0
 
28add0
-    undamage_box (qxl, rect);
28add0
+    undamage_box (compat_qxl, rect);
28add0
 }
28add0
 
28add0
 static void
28add0
-translate_rect (struct qxl_rect *rect)
28add0
+translate_rect (struct compat_qxl_rect *rect)
28add0
 {
28add0
     rect->right -= rect->left;
28add0
     rect->bottom -= rect->top;
28add0
@@ -461,10 +461,10 @@ translate_rect (struct qxl_rect *rect)
28add0
 }
28add0
 
28add0
 static void
28add0
-submit_copy (qxl_screen_t *qxl, const struct qxl_rect *rect)
28add0
+submit_copy (compat_qxl_screen_t *compat_qxl, const struct compat_qxl_rect *rect)
28add0
 {
28add0
-    struct qxl_drawable *drawable;
28add0
-    ScrnInfoPtr pScrn = qxl->pScrn;
28add0
+    struct compat_qxl_drawable *drawable;
28add0
+    ScrnInfoPtr pScrn = compat_qxl->pScrn;
28add0
 
28add0
     if (rect->left == rect->right ||
28add0
 	rect->top == rect->bottom)
28add0
@@ -473,13 +473,13 @@ submit_copy (qxl_screen_t *qxl, const st
28add0
 	return ;
28add0
     }
28add0
     
28add0
-    drawable = make_drawable (qxl, QXL_DRAW_COPY, rect);
28add0
+    drawable = make_drawable (compat_qxl, QXL_DRAW_COPY, rect);
28add0
 
28add0
     drawable->u.copy.src_bitmap = physical_address (
28add0
-	qxl, qxl_image_create (qxl, qxl->fb, rect->left, rect->top,
28add0
+	compat_qxl, compat_qxl_image_create (compat_qxl, compat_qxl->fb, rect->left, rect->top,
28add0
 			       rect->right - rect->left,
28add0
 			       rect->bottom - rect->top,
28add0
-			       pScrn->displayWidth * qxl->bytes_per_pixel));
28add0
+			       pScrn->displayWidth * compat_qxl->bytes_per_pixel));
28add0
     drawable->u.copy.src_area = *rect;
28add0
     translate_rect (&drawable->u.copy.src_area);
28add0
     drawable->u.copy.rop_descriptor = ROPD_OP_PUT;
28add0
@@ -489,7 +489,7 @@ submit_copy (qxl_screen_t *qxl, const st
28add0
     drawable->u.copy.mask.pos.y = 0;
28add0
     drawable->u.copy.mask.bitmap = 0;
28add0
 
28add0
-    push_drawable (qxl, drawable);
28add0
+    push_drawable (compat_qxl, drawable);
28add0
 }
28add0
 
28add0
 static void
28add0
@@ -511,87 +511,87 @@ print_region (const char *header, Region
28add0
 }
28add0
 
28add0
 static void
28add0
-accept_damage (qxl_screen_t *qxl)
28add0
+accept_damage (compat_qxl_screen_t *compat_qxl)
28add0
 {
28add0
-    REGION_UNION (qxl->pScrn->pScreen, &(qxl->to_be_sent), &(qxl->to_be_sent), 
28add0
-		  &(qxl->pending_copy));
28add0
+    REGION_UNION (compat_qxl->pScrn->pScreen, &(compat_qxl->to_be_sent), &(compat_qxl->to_be_sent), 
28add0
+		  &(compat_qxl->pending_copy));
28add0
 
28add0
-    REGION_EMPTY (qxl->pScrn->pScreen, &(qxl->pending_copy));
28add0
+    REGION_EMPTY (compat_qxl->pScrn->pScreen, &(compat_qxl->pending_copy));
28add0
 }
28add0
 
28add0
 static void
28add0
-qxl_send_copies (qxl_screen_t *qxl)
28add0
+compat_qxl_send_copies (compat_qxl_screen_t *compat_qxl)
28add0
 {
28add0
     BoxPtr pBox;
28add0
     int nbox;
28add0
 
28add0
-    nbox = REGION_NUM_RECTS (&qxl->to_be_sent);
28add0
-    pBox = REGION_RECTS (&qxl->to_be_sent);
28add0
+    nbox = REGION_NUM_RECTS (&compat_qxl->to_be_sent);
28add0
+    pBox = REGION_RECTS (&compat_qxl->to_be_sent);
28add0
 
28add0
-/*      if (REGION_NUM_RECTS (&qxl->to_be_sent) > 0)  */
28add0
-/*        	print_region ("send bits", &qxl->to_be_sent); */
28add0
+/*      if (REGION_NUM_RECTS (&compat_qxl->to_be_sent) > 0)  */
28add0
+/*        	print_region ("send bits", &compat_qxl->to_be_sent); */
28add0
     
28add0
     while (nbox--)
28add0
     {
28add0
-	struct qxl_rect qrect;
28add0
+	struct compat_qxl_rect qrect;
28add0
 
28add0
 	qrect.top = pBox->y1;
28add0
 	qrect.left = pBox->x1;
28add0
 	qrect.bottom = pBox->y2;
28add0
 	qrect.right = pBox->x2;
28add0
 	
28add0
-	submit_copy (qxl, &qrect);
28add0
+	submit_copy (compat_qxl, &qrect);
28add0
 
28add0
 	pBox++;
28add0
     }
28add0
 
28add0
-    REGION_EMPTY(qxl->pScrn->pScreen, &qxl->to_be_sent);
28add0
+    REGION_EMPTY(compat_qxl->pScrn->pScreen, &compat_qxl->to_be_sent);
28add0
 }
28add0
 
28add0
 static void
28add0
-paint_shadow (qxl_screen_t *qxl)
28add0
+paint_shadow (compat_qxl_screen_t *compat_qxl)
28add0
 {
28add0
-    struct qxl_rect qrect;
28add0
+    struct compat_qxl_rect qrect;
28add0
 
28add0
     qrect.top = 0;
28add0
     qrect.bottom = 1200;
28add0
     qrect.left = 0;
28add0
     qrect.right = 1600;
28add0
 
28add0
-    submit_copy (qxl, &qrect);
28add0
+    submit_copy (compat_qxl, &qrect);
28add0
 }
28add0
 
28add0
 static void
28add0
-qxl_sanity_check (qxl_screen_t *qxl)
28add0
+compat_qxl_sanity_check (compat_qxl_screen_t *compat_qxl)
28add0
 {
28add0
     /* read the mode back from the rom */
28add0
-    if (!qxl->rom || !qxl->pScrn)
28add0
+    if (!compat_qxl->rom || !compat_qxl->pScrn)
28add0
 	return;
28add0
 
28add0
-    if (qxl->rom->mode == ~0) 
28add0
+    if (compat_qxl->rom->mode == ~0) 
28add0
     {
28add0
  	ErrorF("QXL device jumped back to VGA mode - resetting mode\n");
28add0
- 	qxl_switch_mode(qxl->pScrn->scrnIndex, qxl->pScrn->currentMode, 0);
28add0
+ 	compat_qxl_switch_mode(compat_qxl->pScrn->scrnIndex, compat_qxl->pScrn->currentMode, 0);
28add0
     }
28add0
 }
28add0
 
28add0
 static void
28add0
-qxl_block_handler (pointer data, OSTimePtr pTimeout, pointer pRead)
28add0
+compat_qxl_block_handler (pointer data, OSTimePtr pTimeout, pointer pRead)
28add0
 {
28add0
-    qxl_screen_t *qxl = (qxl_screen_t *) data;
28add0
+    compat_qxl_screen_t *compat_qxl = (compat_qxl_screen_t *) data;
28add0
 
28add0
-    if (!qxl->pScrn->vtSema)
28add0
+    if (!compat_qxl->pScrn->vtSema)
28add0
         return;
28add0
 
28add0
-    qxl_sanity_check(qxl);
28add0
+    compat_qxl_sanity_check(compat_qxl);
28add0
 
28add0
-    accept_damage (qxl);
28add0
+    accept_damage (compat_qxl);
28add0
 
28add0
-    qxl_send_copies (qxl);
28add0
+    compat_qxl_send_copies (compat_qxl);
28add0
 }
28add0
 
28add0
 static void
28add0
-qxl_wakeup_handler (pointer data, int i, pointer LastSelectMask)
28add0
+compat_qxl_wakeup_handler (pointer data, int i, pointer LastSelectMask)
28add0
 {
28add0
 }
28add0
 
28add0
@@ -612,59 +612,59 @@ qxl_wakeup_handler (pointer data, int i,
28add0
  * damage, that must first be unioned onto to_be_sent, and then the new
28add0
  * damage must be stored in pending_copy.
28add0
  * 
28add0
- * The qxl_screen_t struct contains two regions, "pending_copy" and 
28add0
+ * The compat_qxl_screen_t struct contains two regions, "pending_copy" and 
28add0
  * "to_be_sent". 
28add0
  *
28add0
  * Pending copy is 
28add0
  * 
28add0
  */
28add0
 static void
28add0
-qxl_on_damage (DamagePtr pDamage, RegionPtr pRegion, pointer closure)
28add0
+compat_qxl_on_damage (DamagePtr pDamage, RegionPtr pRegion, pointer closure)
28add0
 {
28add0
-    qxl_screen_t *qxl = closure;
28add0
+    compat_qxl_screen_t *compat_qxl = closure;
28add0
 
28add0
 /*     print_region ("damage", pRegion); */
28add0
     
28add0
 /*     print_region ("on_damage ", pRegion); */
28add0
 
28add0
-    accept_damage (qxl);
28add0
+    accept_damage (compat_qxl);
28add0
 
28add0
-/*     print_region ("accepting, qxl->to_be_sent is now", &qxl->to_be_sent); */
28add0
+/*     print_region ("accepting, compat_qxl->to_be_sent is now", &compat_qxl->to_be_sent); */
28add0
 
28add0
-    REGION_COPY (qxl->pScrn->pScreen, &(qxl->pending_copy), pRegion);
28add0
+    REGION_COPY (compat_qxl->pScrn->pScreen, &(compat_qxl->pending_copy), pRegion);
28add0
 }
28add0
 
28add0
 
28add0
 static Bool
28add0
-qxl_create_screen_resources(ScreenPtr pScreen)
28add0
+compat_qxl_create_screen_resources(ScreenPtr pScreen)
28add0
 {
28add0
     ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
28add0
-    qxl_screen_t *qxl = pScrn->driverPrivate;
28add0
+    compat_qxl_screen_t *compat_qxl = pScrn->driverPrivate;
28add0
     Bool ret;
28add0
     PixmapPtr pPixmap;
28add0
 
28add0
-    pScreen->CreateScreenResources = qxl->create_screen_resources;
28add0
+    pScreen->CreateScreenResources = compat_qxl->create_screen_resources;
28add0
     ret = pScreen->CreateScreenResources (pScreen);
28add0
-    pScreen->CreateScreenResources = qxl_create_screen_resources;
28add0
+    pScreen->CreateScreenResources = compat_qxl_create_screen_resources;
28add0
 
28add0
     if (!ret)
28add0
 	return FALSE;
28add0
 
28add0
-    qxl->damage = DamageCreate (qxl_on_damage, NULL,
28add0
+    compat_qxl->damage = DamageCreate (compat_qxl_on_damage, NULL,
28add0
 			        DamageReportRawRegion,
28add0
-				TRUE, pScreen, qxl);
28add0
+				TRUE, pScreen, compat_qxl);
28add0
 
28add0
 
28add0
     pPixmap = pScreen->GetScreenPixmap(pScreen);
28add0
 
28add0
-    if (!RegisterBlockAndWakeupHandlers(qxl_block_handler, qxl_wakeup_handler, qxl))
28add0
+    if (!RegisterBlockAndWakeupHandlers(compat_qxl_block_handler, compat_qxl_wakeup_handler, compat_qxl))
28add0
 	return FALSE;
28add0
 
28add0
-    REGION_INIT (pScreen, &(qxl->pending_copy), NullBox, 0);
28add0
+    REGION_INIT (pScreen, &(compat_qxl->pending_copy), NullBox, 0);
28add0
 
28add0
-    REGION_INIT (pScreen, &(qxl->to_be_sent), NullBox, 0);
28add0
+    REGION_INIT (pScreen, &(compat_qxl->to_be_sent), NullBox, 0);
28add0
  
28add0
-    DamageRegister (&pPixmap->drawable, qxl->damage);
28add0
+    DamageRegister (&pPixmap->drawable, compat_qxl->damage);
28add0
     return TRUE;
28add0
 }
28add0
 
28add0
@@ -686,13 +686,13 @@ get_window_pixmap (DrawablePtr pDrawable
28add0
 }
28add0
 
28add0
 static void
28add0
-qxl_poly_fill_rect (DrawablePtr pDrawable,
28add0
+compat_qxl_poly_fill_rect (DrawablePtr pDrawable,
28add0
 		 GCPtr	     pGC,
28add0
 		 int	     nrect,
28add0
 		 xRectangle *prect)
28add0
 {
28add0
     ScrnInfoPtr pScrn = xf86Screens[pDrawable->pScreen->myNum];
28add0
-    qxl_screen_t *qxl = pScrn->driverPrivate;
28add0
+    compat_qxl_screen_t *compat_qxl = pScrn->driverPrivate;
28add0
     PixmapPtr pPixmap;
28add0
     int xoff, yoff;
28add0
 
28add0
@@ -714,14 +714,14 @@ qxl_poly_fill_rect (DrawablePtr pDrawabl
28add0
 
28add0
 	while (nbox--)
28add0
 	{
28add0
-	    struct qxl_rect qrect;
28add0
+	    struct compat_qxl_rect qrect;
28add0
 
28add0
 	    qrect.left = pBox->x1;
28add0
 	    qrect.right = pBox->x2;
28add0
 	    qrect.top = pBox->y1;
28add0
 	    qrect.bottom = pBox->y2;
28add0
 
28add0
-	    submit_fill (qxl, &qrect, pGC->fgPixel);
28add0
+	    submit_fill (compat_qxl, &qrect, pGC->fgPixel);
28add0
 
28add0
 	    pBox++;
28add0
 	}
28add0
@@ -733,7 +733,7 @@ qxl_poly_fill_rect (DrawablePtr pDrawabl
28add0
 }
28add0
 
28add0
 static void
28add0
-qxl_copy_n_to_n (DrawablePtr    pSrcDrawable,
28add0
+compat_qxl_copy_n_to_n (DrawablePtr    pSrcDrawable,
28add0
 		 DrawablePtr    pDstDrawable,
28add0
 		 GCPtr	        pGC,
28add0
 		 BoxPtr	        pbox,
28add0
@@ -747,7 +747,7 @@ qxl_copy_n_to_n (DrawablePtr    pSrcDraw
28add0
 {
28add0
     ScreenPtr pScreen = pSrcDrawable->pScreen;
28add0
     ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
28add0
-    qxl_screen_t *qxl = pScrn->driverPrivate;
28add0
+    compat_qxl_screen_t *compat_qxl = pScrn->driverPrivate;
28add0
     int src_xoff, src_yoff;
28add0
     int dst_xoff, dst_yoff;
28add0
     PixmapPtr pSrcPixmap, pDstPixmap;
28add0
@@ -776,7 +776,7 @@ qxl_copy_n_to_n (DrawablePtr    pSrcDraw
28add0
 	if (n)
28add0
 	{
28add0
 /* 	    ErrorF ("Clearing pending damage\n"); */
28add0
-	    clear_pending_damage (qxl);
28add0
+	    clear_pending_damage (compat_qxl);
28add0
 	    
28add0
 	    /* We have to do this because the copy will cause the damage
28add0
 	     * to be sent to move.
28add0
@@ -786,13 +786,13 @@ qxl_copy_n_to_n (DrawablePtr    pSrcDraw
28add0
 	     * complex, and the performance win is unlikely to be
28add0
 	     * very big.
28add0
 	     */
28add0
-	    qxl_send_copies (qxl);
28add0
+	    compat_qxl_send_copies (compat_qxl);
28add0
 	}
28add0
     
28add0
 	while (n--)
28add0
 	{
28add0
-	    struct qxl_drawable *drawable;
28add0
-	    struct qxl_rect qrect;
28add0
+	    struct compat_qxl_drawable *drawable;
28add0
+	    struct compat_qxl_rect qrect;
28add0
 	    
28add0
 	    qrect.top = b->y1;
28add0
 	    qrect.bottom = b->y2;
28add0
@@ -803,19 +803,19 @@ qxl_copy_n_to_n (DrawablePtr    pSrcDraw
28add0
 /* 		    b->x1, b->y1, b->x2, b->y2, */
28add0
 /* 		    dx, dy, dst_xoff, dst_yoff); */
28add0
 	    
28add0
-	    drawable = make_drawable (qxl, QXL_COPY_BITS, &qrect);
28add0
+	    drawable = make_drawable (compat_qxl, QXL_COPY_BITS, &qrect);
28add0
 	    drawable->u.copy_bits.src_pos.x = b->x1 + dx;
28add0
 	    drawable->u.copy_bits.src_pos.y = b->y1 + dy;
28add0
 
28add0
-	    push_drawable (qxl, drawable);
28add0
+	    push_drawable (compat_qxl, drawable);
28add0
 
28add0
 #if 0
28add0
 	    if (closure)
28add0
-		qxl_usleep (1000000);
28add0
+		compat_qxl_usleep (1000000);
28add0
 #endif
28add0
 	    
28add0
 #if 0
28add0
-	    submit_fill (qxl, &qrect, rand());
28add0
+	    submit_fill (compat_qxl, &qrect, rand());
28add0
 #endif
28add0
 
28add0
 	    b++;
28add0
@@ -828,7 +828,7 @@ qxl_copy_n_to_n (DrawablePtr    pSrcDraw
28add0
 }
28add0
 
28add0
 static RegionPtr
28add0
-qxl_copy_area(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC,
28add0
+compat_qxl_copy_area(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC,
28add0
 	    int srcx, int srcy, int width, int height, int dstx, int dsty)
28add0
 {
28add0
     if (pSrcDrawable->type == DRAWABLE_WINDOW &&
28add0
@@ -841,7 +841,7 @@ qxl_copy_area(DrawablePtr pSrcDrawable,
28add0
 
28add0
 	res = fbDoCopy (pSrcDrawable, pDstDrawable, pGC,
28add0
 			srcx, srcy, width, height, dstx, dsty,
28add0
-			qxl_copy_n_to_n, 0, NULL);
28add0
+			compat_qxl_copy_n_to_n, 0, NULL);
28add0
 
28add0
 	return res;
28add0
     }
28add0
@@ -856,11 +856,11 @@ qxl_copy_area(DrawablePtr pSrcDrawable,
28add0
 }
28add0
 
28add0
 static void
28add0
-qxl_fill_region_solid (DrawablePtr pDrawable, RegionPtr pRegion, Pixel pixel)
28add0
+compat_qxl_fill_region_solid (DrawablePtr pDrawable, RegionPtr pRegion, Pixel pixel)
28add0
 {
28add0
     ScreenPtr pScreen = pDrawable->pScreen;
28add0
     ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
28add0
-    qxl_screen_t *qxl = pScrn->driverPrivate;
28add0
+    compat_qxl_screen_t *compat_qxl = pScrn->driverPrivate;
28add0
     PixmapPtr pPixmap;
28add0
     int xoff, yoff;
28add0
 
28add0
@@ -871,14 +871,14 @@ qxl_fill_region_solid (DrawablePtr pDraw
28add0
 
28add0
 	while (nbox--)
28add0
 	{
28add0
-	    struct qxl_rect qrect;
28add0
+	    struct compat_qxl_rect qrect;
28add0
 
28add0
 	    qrect.left = pBox->x1;
28add0
 	    qrect.right = pBox->x2;
28add0
 	    qrect.top = pBox->y1;
28add0
 	    qrect.bottom = pBox->y2;
28add0
 
28add0
-	    submit_fill (qxl, &qrect, pixel);
28add0
+	    submit_fill (compat_qxl, &qrect, pixel);
28add0
 
28add0
 	    pBox++;
28add0
 	}
28add0
@@ -889,7 +889,7 @@ qxl_fill_region_solid (DrawablePtr pDraw
28add0
 }
28add0
 
28add0
 static void
28add0
-qxl_copy_window (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
28add0
+compat_qxl_copy_window (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
28add0
 {
28add0
     RegionRec rgnDst;
28add0
     int dx, dy;
28add0
@@ -905,7 +905,7 @@ qxl_copy_window (WindowPtr pWin, DDXPoin
28add0
 
28add0
     fbCopyRegion (&pWin->drawable, &pWin->drawable,
28add0
 		  NULL, 
28add0
-		  &rgnDst, dx, dy, qxl_copy_n_to_n, 0, NULL);
28add0
+		  &rgnDst, dx, dy, compat_qxl_copy_n_to_n, 0, NULL);
28add0
 
28add0
     REGION_UNINIT (pScreen, &rgnDst);
28add0
 
28add0
@@ -915,7 +915,7 @@ qxl_copy_window (WindowPtr pWin, DDXPoin
28add0
 }
28add0
 
28add0
 static int
28add0
-qxl_create_gc (GCPtr pGC)
28add0
+compat_qxl_create_gc (GCPtr pGC)
28add0
 {
28add0
     static GCOps ops;
28add0
     static int initialized;
28add0
@@ -926,8 +926,8 @@ qxl_create_gc (GCPtr pGC)
28add0
     if (!initialized)
28add0
     {
28add0
 	ops = *pGC->ops;
28add0
-	ops.PolyFillRect = qxl_poly_fill_rect;
28add0
-	ops.CopyArea = qxl_copy_area;
28add0
+	ops.PolyFillRect = compat_qxl_poly_fill_rect;
28add0
+	ops.CopyArea = compat_qxl_copy_area;
28add0
 
28add0
 	initialized = TRUE;
28add0
     }
28add0
@@ -937,26 +937,26 @@ qxl_create_gc (GCPtr pGC)
28add0
 }
28add0
 
28add0
 static Bool
28add0
-qxl_screen_init(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
28add0
+compat_qxl_screen_init(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
28add0
 {
28add0
     ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
28add0
-    qxl_screen_t *qxl = pScrn->driverPrivate;
28add0
-    struct qxl_rom *rom;
28add0
-    struct qxl_ram_header *ram_header;
28add0
+    compat_qxl_screen_t *compat_qxl = pScrn->driverPrivate;
28add0
+    struct compat_qxl_rom *rom;
28add0
+    struct compat_qxl_ram_header *ram_header;
28add0
     VisualPtr visual;
28add0
 
28add0
     CHECK_POINT();
28add0
 
28add0
-    qxl->pScrn = pScrn;
28add0
+    compat_qxl->pScrn = pScrn;
28add0
     
28add0
-    if (!qxl_map_memory(qxl, scrnIndex))
28add0
+    if (!compat_qxl_map_memory(compat_qxl, scrnIndex))
28add0
 	return FALSE;
28add0
 
28add0
-    rom = qxl->rom;
28add0
-    ram_header = (void *)((unsigned long)qxl->ram + (unsigned long)qxl->rom->ram_header_offset);
28add0
+    rom = compat_qxl->rom;
28add0
+    ram_header = (void *)((unsigned long)compat_qxl->ram + (unsigned long)compat_qxl->rom->ram_header_offset);
28add0
 
28add0
-    qxl_save_state(pScrn);
28add0
-    qxl_blank_screen(pScreen, SCREEN_SAVER_ON);
28add0
+    compat_qxl_save_state(pScrn);
28add0
+    compat_qxl_blank_screen(pScreen, SCREEN_SAVER_ON);
28add0
     
28add0
     miClearVisualTypes();
28add0
     if (!miSetVisualTypes(pScrn->depth, miGetDefaultVisualMask(pScrn->depth),
28add0
@@ -968,14 +968,14 @@ qxl_screen_init(int scrnIndex, ScreenPtr
28add0
     /* Note we do this before setting pScrn->virtualY to match our current
28add0
        mode, so as to allocate a buffer large enough for the largest mode.
28add0
        FIXME: add support for resizing the framebuffer on modeset. */
28add0
-    qxl->fb = xcalloc(pScrn->virtualY * pScrn->displayWidth, 4);
28add0
-    if (!qxl->fb)
28add0
+    compat_qxl->fb = xcalloc(pScrn->virtualY * pScrn->displayWidth, 4);
28add0
+    if (!compat_qxl->fb)
28add0
 	goto out;
28add0
 
28add0
     pScrn->virtualX = pScrn->currentMode->HDisplay;
28add0
     pScrn->virtualY = pScrn->currentMode->VDisplay;
28add0
     
28add0
-    if (!fbScreenInit(pScreen, qxl->fb,
28add0
+    if (!fbScreenInit(pScreen, compat_qxl->fb,
28add0
 		      pScrn->currentMode->HDisplay,
28add0
 		      pScrn->currentMode->VDisplay,
28add0
 		      pScrn->xDpi, pScrn->yDpi, pScrn->displayWidth,
28add0
@@ -1001,59 +1001,59 @@ qxl_screen_init(int scrnIndex, ScreenPtr
28add0
     
28add0
     fbPictureInit(pScreen, 0, 0);
28add0
 
28add0
-    qxl->create_screen_resources = pScreen->CreateScreenResources;
28add0
-    pScreen->CreateScreenResources = qxl_create_screen_resources;
28add0
+    compat_qxl->create_screen_resources = pScreen->CreateScreenResources;
28add0
+    pScreen->CreateScreenResources = compat_qxl_create_screen_resources;
28add0
 
28add0
     /* Set up resources */
28add0
-    qxl->mem = qxl_mem_create ((void *)((unsigned long)qxl->ram + (unsigned long)rom->pages_offset),
28add0
+    compat_qxl->mem = compat_qxl_mem_create ((void *)((unsigned long)compat_qxl->ram + (unsigned long)rom->pages_offset),
28add0
 			       rom->num_io_pages * getpagesize());
28add0
-    qxl->io_pages = (void *)((unsigned long)qxl->ram + (unsigned long)rom->pages_offset);
28add0
-    qxl->io_pages_physical = (void *)((unsigned long)qxl->ram_physical + (unsigned long)rom->pages_offset);
28add0
+    compat_qxl->io_pages = (void *)((unsigned long)compat_qxl->ram + (unsigned long)rom->pages_offset);
28add0
+    compat_qxl->io_pages_physical = (void *)((unsigned long)compat_qxl->ram_physical + (unsigned long)rom->pages_offset);
28add0
 
28add0
-    qxl->command_ring = qxl_ring_create (&(ram_header->cmd_ring_hdr),
28add0
-					 sizeof (struct qxl_command),
28add0
-					 32, qxl->io_base + QXL_IO_NOTIFY_CMD);
28add0
-    qxl->cursor_ring = qxl_ring_create (&(ram_header->cursor_ring_hdr),
28add0
-					sizeof (struct qxl_command),
28add0
-					32, qxl->io_base + QXL_IO_NOTIFY_CURSOR);
28add0
-    qxl->release_ring = qxl_ring_create (&(ram_header->release_ring_hdr),
28add0
+    compat_qxl->command_ring = compat_qxl_ring_create (&(ram_header->cmd_ring_hdr),
28add0
+					 sizeof (struct compat_qxl_command),
28add0
+					 32, compat_qxl->io_base + QXL_IO_NOTIFY_CMD);
28add0
+    compat_qxl->cursor_ring = compat_qxl_ring_create (&(ram_header->cursor_ring_hdr),
28add0
+					sizeof (struct compat_qxl_command),
28add0
+					32, compat_qxl->io_base + QXL_IO_NOTIFY_CURSOR);
28add0
+    compat_qxl->release_ring = compat_qxl_ring_create (&(ram_header->release_ring_hdr),
28add0
 					 sizeof (uint64_t),
28add0
 					 8, 0);
28add0
 					 
28add0
     /* xf86DPMSInit(pScreen, xf86DPMSSet, 0); */
28add0
 
28add0
 #if 0 /* XV accel */
28add0
-    qxlInitVideo(pScreen);
28add0
+    compat_qxlInitVideo(pScreen);
28add0
 #endif
28add0
 
28add0
-    pScreen->SaveScreen = qxl_blank_screen;
28add0
-    qxl->close_screen = pScreen->CloseScreen;
28add0
-    pScreen->CloseScreen = qxl_close_screen;
28add0
+    pScreen->SaveScreen = compat_qxl_blank_screen;
28add0
+    compat_qxl->close_screen = pScreen->CloseScreen;
28add0
+    pScreen->CloseScreen = compat_qxl_close_screen;
28add0
 
28add0
-    qxl->create_gc = pScreen->CreateGC;
28add0
-    pScreen->CreateGC = qxl_create_gc;
28add0
+    compat_qxl->create_gc = pScreen->CreateGC;
28add0
+    pScreen->CreateGC = compat_qxl_create_gc;
28add0
 
28add0
 #if 0
28add0
-    qxl->paint_window_background = pScreen->PaintWindowBackground;
28add0
-    qxl->paint_window_border = pScreen->PaintWindowBorder;
28add0
+    compat_qxl->paint_window_background = pScreen->PaintWindowBackground;
28add0
+    compat_qxl->paint_window_border = pScreen->PaintWindowBorder;
28add0
 #endif
28add0
-    qxl->copy_window = pScreen->CopyWindow;
28add0
+    compat_qxl->copy_window = pScreen->CopyWindow;
28add0
 #if 0
28add0
-    pScreen->PaintWindowBackground = qxl_paint_window;
28add0
-    pScreen->PaintWindowBorder = qxl_paint_window;
28add0
+    pScreen->PaintWindowBackground = compat_qxl_paint_window;
28add0
+    pScreen->PaintWindowBorder = compat_qxl_paint_window;
28add0
 #endif
28add0
-    pScreen->CopyWindow = qxl_copy_window;
28add0
+    pScreen->CopyWindow = compat_qxl_copy_window;
28add0
 
28add0
     miDCInitialize(pScreen, xf86GetPointerScreenFuncs());
28add0
 
28add0
     if (!miCreateDefColormap(pScreen))
28add0
 	goto out;
28add0
 
28add0
-    qxl_cursor_init (pScreen);
28add0
+    compat_qxl_cursor_init (pScreen);
28add0
     
28add0
     CHECK_POINT();
28add0
 
28add0
-    qxl_switch_mode(scrnIndex, pScrn->currentMode, 0);
28add0
+    compat_qxl_switch_mode(scrnIndex, pScrn->currentMode, 0);
28add0
 
28add0
     CHECK_POINT();
28add0
     
28add0
@@ -1064,26 +1064,26 @@ out:
28add0
 }
28add0
 
28add0
 static Bool
28add0
-qxl_enter_vt(int scrnIndex, int flags)
28add0
+compat_qxl_enter_vt(int scrnIndex, int flags)
28add0
 {
28add0
     ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
28add0
 
28add0
-    qxl_save_state(pScrn);
28add0
-    qxl_switch_mode(scrnIndex, pScrn->currentMode, 0);
28add0
+    compat_qxl_save_state(pScrn);
28add0
+    compat_qxl_switch_mode(scrnIndex, pScrn->currentMode, 0);
28add0
 
28add0
     return TRUE;
28add0
 }
28add0
 
28add0
 static void
28add0
-qxl_leave_vt(int scrnIndex, int flags)
28add0
+compat_qxl_leave_vt(int scrnIndex, int flags)
28add0
 {
28add0
     ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
28add0
 
28add0
-    qxl_restore_state(pScrn);
28add0
+    compat_qxl_restore_state(pScrn);
28add0
 }
28add0
 
28add0
 static Bool
28add0
-qxl_color_setup(ScrnInfoPtr pScrn)
28add0
+compat_qxl_color_setup(ScrnInfoPtr pScrn)
28add0
 {
28add0
     int scrnIndex = pScrn->scrnIndex;
28add0
     Gamma gzeros = { 0.0, 0.0, 0.0 };
28add0
@@ -1113,13 +1113,13 @@ qxl_color_setup(ScrnInfoPtr pScrn)
28add0
 }
28add0
 
28add0
 static void
28add0
-print_modes (qxl_screen_t *qxl, int scrnIndex)
28add0
+print_modes (compat_qxl_screen_t *compat_qxl, int scrnIndex)
28add0
 {
28add0
     int i;
28add0
 
28add0
-    for (i = 0; i < qxl->num_modes; ++i)
28add0
+    for (i = 0; i < compat_qxl->num_modes; ++i)
28add0
     {
28add0
-	struct qxl_mode *m = qxl->modes + i;
28add0
+	struct compat_qxl_mode *m = compat_qxl->modes + i;
28add0
 
28add0
 	xf86DrvMsg (scrnIndex, X_INFO,
28add0
 		    "%d: %dx%d, %d bits, stride %d, %dmm x %dmm, orientation %d\n",
28add0
@@ -1129,11 +1129,11 @@ print_modes (qxl_screen_t *qxl, int scrn
28add0
 }
28add0
 
28add0
 static Bool
28add0
-qxl_check_device(ScrnInfoPtr pScrn, qxl_screen_t *qxl)
28add0
+compat_qxl_check_device(ScrnInfoPtr pScrn, compat_qxl_screen_t *compat_qxl)
28add0
 {
28add0
     int scrnIndex = pScrn->scrnIndex;
28add0
-    struct qxl_rom *rom = qxl->rom;
28add0
-    struct qxl_ram_header *ram_header = (void *)((unsigned long)qxl->ram + rom->ram_header_offset);
28add0
+    struct compat_qxl_rom *rom = compat_qxl->rom;
28add0
+    struct compat_qxl_ram_header *ram_header = (void *)((unsigned long)compat_qxl->ram + rom->ram_header_offset);
28add0
 
28add0
     CHECK_POINT();
28add0
     
28add0
@@ -1170,24 +1170,24 @@ qxl_check_device(ScrnInfoPtr pScrn, qxl_
28add0
     xf86DrvMsg(scrnIndex, X_INFO, "Correct RAM signature %x\n", 
28add0
 	       ram_header->magic);
28add0
 
28add0
-    qxl->draw_area_offset = rom->draw_area_offset;
28add0
-    qxl->draw_area_size = rom->draw_area_size;
28add0
+    compat_qxl->draw_area_offset = rom->draw_area_offset;
28add0
+    compat_qxl->draw_area_size = rom->draw_area_size;
28add0
     pScrn->videoRam = rom->draw_area_size / 1024;
28add0
     
28add0
     return TRUE;
28add0
 }
28add0
 
28add0
 static int
28add0
-qxl_find_native_mode(ScrnInfoPtr pScrn, DisplayModePtr p)
28add0
+compat_qxl_find_native_mode(ScrnInfoPtr pScrn, DisplayModePtr p)
28add0
 {
28add0
     int i;
28add0
-    qxl_screen_t *qxl = pScrn->driverPrivate;
28add0
+    compat_qxl_screen_t *compat_qxl = pScrn->driverPrivate;
28add0
 
28add0
     CHECK_POINT();
28add0
     
28add0
-    for (i = 0; i < qxl->num_modes; i++) 
28add0
+    for (i = 0; i < compat_qxl->num_modes; i++) 
28add0
     {
28add0
-	struct qxl_mode *m = qxl->modes + i;
28add0
+	struct compat_qxl_mode *m = compat_qxl->modes + i;
28add0
 
28add0
 	if (m->x_res == p->HDisplay &&
28add0
 	    m->y_res == p->VDisplay &&
28add0
@@ -1212,20 +1212,20 @@ qxl_find_native_mode(ScrnInfoPtr pScrn,
28add0
 }
28add0
 
28add0
 static ModeStatus
28add0
-qxl_valid_mode(int scrn, DisplayModePtr p, Bool flag, int pass)
28add0
+compat_qxl_valid_mode(int scrn, DisplayModePtr p, Bool flag, int pass)
28add0
 {
28add0
     ScrnInfoPtr pScrn = xf86Screens[scrn];
28add0
-    qxl_screen_t *qxl = pScrn->driverPrivate;
28add0
+    compat_qxl_screen_t *compat_qxl = pScrn->driverPrivate;
28add0
     int bpp = pScrn->bitsPerPixel;
28add0
     int mode_idx;
28add0
 
28add0
     /* FIXME: I don't think this is necessary now that we report the
28add0
      * correct amount of video ram?
28add0
      */
28add0
-    if (p->HDisplay * p->VDisplay * (bpp/8) > qxl->draw_area_size)
28add0
+    if (p->HDisplay * p->VDisplay * (bpp/8) > compat_qxl->draw_area_size)
28add0
 	return MODE_MEM;
28add0
 
28add0
-    mode_idx = qxl_find_native_mode (pScrn, p);
28add0
+    mode_idx = compat_qxl_find_native_mode (pScrn, p);
28add0
     if (mode_idx == -1)
28add0
 	return MODE_NOMODE;
28add0
 
28add0
@@ -1234,7 +1234,7 @@ qxl_valid_mode(int scrn, DisplayModePtr
28add0
     return MODE_OK;
28add0
 }
28add0
 
28add0
-static void qxl_add_mode(ScrnInfoPtr pScrn, int width, int height, int type)
28add0
+static void compat_qxl_add_mode(ScrnInfoPtr pScrn, int width, int height, int type)
28add0
 {
28add0
     DisplayModePtr mode;
28add0
 
28add0
@@ -1263,10 +1263,10 @@ static void qxl_add_mode(ScrnInfoPtr pSc
28add0
 }
28add0
 
28add0
 static Bool
28add0
-qxl_pre_init(ScrnInfoPtr pScrn, int flags)
28add0
+compat_qxl_pre_init(ScrnInfoPtr pScrn, int flags)
28add0
 {
28add0
     int i, scrnIndex = pScrn->scrnIndex;
28add0
-    qxl_screen_t *qxl = NULL;
28add0
+    compat_qxl_screen_t *compat_qxl = NULL;
28add0
     ClockRangePtr clockRanges = NULL;
28add0
     int *linePitches = NULL;
28add0
     DisplayModePtr mode;
28add0
@@ -1281,27 +1281,27 @@ qxl_pre_init(ScrnInfoPtr pScrn, int flag
28add0
     }
28add0
 
28add0
     if (!pScrn->driverPrivate)
28add0
-	pScrn->driverPrivate = xnfcalloc(sizeof(qxl_screen_t), 1);
28add0
-    qxl = pScrn->driverPrivate;
28add0
+	pScrn->driverPrivate = xnfcalloc(sizeof(compat_qxl_screen_t), 1);
28add0
+    compat_qxl = pScrn->driverPrivate;
28add0
     
28add0
-    qxl->entity = xf86GetEntityInfo(pScrn->entityList[0]);
28add0
-    qxl->pci = xf86GetPciInfoForEntity(qxl->entity->index);
28add0
+    compat_qxl->entity = xf86GetEntityInfo(pScrn->entityList[0]);
28add0
+    compat_qxl->pci = xf86GetPciInfoForEntity(compat_qxl->entity->index);
28add0
 #ifndef XSERVER_LIBPCIACCESS
28add0
-    qxl->pci_tag = pciTag(qxl->pci->bus, qxl->pci->device, qxl->pci->func);
28add0
+    compat_qxl->pci_tag = pciTag(compat_qxl->pci->bus, compat_qxl->pci->device, compat_qxl->pci->func);
28add0
 #endif
28add0
 
28add0
     pScrn->monitor = pScrn->confScreen->monitor;
28add0
 
28add0
-    if (!qxl_color_setup(pScrn))
28add0
+    if (!compat_qxl_color_setup(pScrn))
28add0
 	goto out;
28add0
 
28add0
     /* option parsing and card differentiation */
28add0
     xf86CollectOptions(pScrn, NULL);
28add0
     
28add0
-    if (!qxl_map_memory(qxl, scrnIndex))
28add0
+    if (!compat_qxl_map_memory(compat_qxl, scrnIndex))
28add0
 	goto out;
28add0
 
28add0
-    if (!qxl_check_device(pScrn, qxl))
28add0
+    if (!compat_qxl_check_device(pScrn, compat_qxl))
28add0
 	goto out;
28add0
 
28add0
     /* ddc stuff here */
28add0
@@ -1328,22 +1328,22 @@ qxl_pre_init(ScrnInfoPtr pScrn, int flag
28add0
     }
28add0
 
28add0
     /* Add any modes not in xorg's default mode list */
28add0
-    for (i = 0; i < qxl->num_modes; i++)
28add0
-        if (qxl->modes[i].orientation == 0) {
28add0
-            qxl_add_mode(pScrn, qxl->modes[i].x_res, qxl->modes[i].y_res,
28add0
+    for (i = 0; i < compat_qxl->num_modes; i++)
28add0
+        if (compat_qxl->modes[i].orientation == 0) {
28add0
+            compat_qxl_add_mode(pScrn, compat_qxl->modes[i].x_res, compat_qxl->modes[i].y_res,
28add0
                          M_T_DRIVER);
28add0
-            if (qxl->modes[i].x_res > max_x)
28add0
-                max_x = qxl->modes[i].x_res;
28add0
-            if (qxl->modes[i].y_res > max_y)
28add0
-                max_y = qxl->modes[i].y_res;
28add0
+            if (compat_qxl->modes[i].x_res > max_x)
28add0
+                max_x = compat_qxl->modes[i].x_res;
28add0
+            if (compat_qxl->modes[i].y_res > max_y)
28add0
+                max_y = compat_qxl->modes[i].y_res;
28add0
         }
28add0
 
28add0
     if (pScrn->display->virtualX == 0 && pScrn->display->virtualY == 0) {
28add0
         /* It is possible for the largest x + largest y size combined leading
28add0
            to a virtual size which will not fit into the framebuffer when this
28add0
            happens we prefer max width and make height as large as possible */
28add0
-        if (max_x * max_y * (pScrn->bitsPerPixel / 8) > qxl->draw_area_size)
28add0
-            pScrn->display->virtualY = qxl->draw_area_size /
28add0
+        if (max_x * max_y * (pScrn->bitsPerPixel / 8) > compat_qxl->draw_area_size)
28add0
+            pScrn->display->virtualY = compat_qxl->draw_area_size /
28add0
                                        (max_x * (pScrn->bitsPerPixel / 8));
28add0
         else
28add0
             pScrn->display->virtualY = max_y;
28add0
@@ -1381,14 +1381,14 @@ qxl_pre_init(ScrnInfoPtr pScrn, int flag
28add0
 	goto out;
28add0
     }
28add0
 
28add0
-    print_modes (qxl, scrnIndex);
28add0
+    print_modes (compat_qxl, scrnIndex);
28add0
 
28add0
     /* VGA hardware initialisation */
28add0
     if (!vgaHWGetHWRec(pScrn))
28add0
         return FALSE;
28add0
 
28add0
     /* hate */
28add0
-    qxl_unmap_memory(qxl, scrnIndex);
28add0
+    compat_qxl_unmap_memory(compat_qxl, scrnIndex);
28add0
 
28add0
     CHECK_POINT();
28add0
     
28add0
@@ -1398,19 +1398,19 @@ qxl_pre_init(ScrnInfoPtr pScrn, int flag
28add0
 out:
28add0
     if (clockRanges)
28add0
 	xfree(clockRanges);
28add0
-    if (qxl)
28add0
-	xfree(qxl);
28add0
+    if (compat_qxl)
28add0
+	xfree(compat_qxl);
28add0
 
28add0
     return FALSE;
28add0
 }
28add0
 
28add0
 #ifdef XSERVER_LIBPCIACCESS
28add0
-enum qxl_class
28add0
+enum compat_qxl_class
28add0
 {
28add0
     CHIP_QXL_1,
28add0
 };
28add0
 
28add0
-static const struct pci_id_match qxl_device_match[] = {
28add0
+static const struct pci_id_match compat_qxl_device_match[] = {
28add0
     {
28add0
 	PCI_VENDOR_RED_HAT, PCI_CHIP_QXL_0100, PCI_MATCH_ANY, PCI_MATCH_ANY,
28add0
 	0x00030000, 0x00ffffff, CHIP_QXL_1
28add0
@@ -1420,14 +1420,14 @@ static const struct pci_id_match qxl_dev
28add0
 };
28add0
 #endif
28add0
 
28add0
-static SymTabRec qxlChips[] =
28add0
+static SymTabRec compat_qxlChips[] =
28add0
 {
28add0
     { PCI_CHIP_QXL_0100,	"QXL 1", },
28add0
     { -1, NULL }
28add0
 };
28add0
 
28add0
 #ifndef XSERVER_LIBPCIACCESS
28add0
-static PciChipsets qxlPciChips[] =
28add0
+static PciChipsets compat_qxlPciChips[] =
28add0
 {
28add0
     { PCI_CHIP_QXL_0100,    PCI_CHIP_QXL_0100,	RES_SHARED_VGA },
28add0
     { -1, -1, RES_UNDEFINED }
28add0
@@ -1435,20 +1435,20 @@ static PciChipsets qxlPciChips[] =
28add0
 #endif
28add0
 
28add0
 static void
28add0
-qxl_identify(int flags)
28add0
+compat_qxl_identify(int flags)
28add0
 {
28add0
-    xf86PrintChipsets("qxl", "Driver for QXL virtual graphics", qxlChips);
28add0
+    xf86PrintChipsets("compat_qxl", "Driver for QXL virtual graphics", compat_qxlChips);
28add0
 }
28add0
 
28add0
-static void
28add0
-qxl_init_scrn(ScrnInfoPtr pScrn)
28add0
+void
28add0
+compat_init_scrn(ScrnInfoPtr pScrn)
28add0
 {
28add0
     pScrn->driverVersion    = 0;
28add0
-    pScrn->driverName	    = pScrn->name = "qxl";
28add0
-    pScrn->PreInit	    = qxl_pre_init;
28add0
-    pScrn->ScreenInit	    = qxl_screen_init;
28add0
-    pScrn->SwitchMode	    = qxl_switch_mode;
28add0
-    pScrn->ValidMode	    = qxl_valid_mode;
28add0
-    pScrn->EnterVT	    = qxl_enter_vt;
28add0
-    pScrn->LeaveVT	    = qxl_leave_vt;
28add0
+    pScrn->driverName	    = pScrn->name = "compat_qxl";
28add0
+    pScrn->PreInit	    = compat_qxl_pre_init;
28add0
+    pScrn->ScreenInit	    = compat_qxl_screen_init;
28add0
+    pScrn->SwitchMode	    = compat_qxl_switch_mode;
28add0
+    pScrn->ValidMode	    = compat_qxl_valid_mode;
28add0
+    pScrn->EnterVT	    = compat_qxl_enter_vt;
28add0
+    pScrn->LeaveVT	    = compat_qxl_leave_vt;
28add0
 }
28add0
diff -up xf86-video-qxl-20130514/src/compat/compat-qxl.h.compat2 xf86-video-qxl-20130514/src/compat/compat-qxl.h
28add0
--- xf86-video-qxl-20130514/src/compat/compat-qxl.h.compat2	2013-07-03 14:19:39.009334569 +1000
28add0
+++ xf86-video-qxl-20130514/src/compat/compat-qxl.h	2013-07-03 14:19:56.102748510 +1000
28add0
@@ -43,8 +43,8 @@
28add0
 
28add0
 #define hidden _X_HIDDEN
28add0
 
28add0
-#define QXL_NAME		"qxl"
28add0
-#define QXL_DRIVER_NAME		"qxl"
28add0
+#define QXL_NAME		"compat_qxl"
28add0
+#define QXL_DRIVER_NAME		"compat_qxl"
28add0
 #define PCI_VENDOR_RED_HAT	0x1b36
28add0
 
28add0
 #define PCI_CHIP_QXL_0100	0x0100
28add0
@@ -63,7 +63,7 @@ enum {
28add0
     QXL_IO_LOG,
28add0
 };
28add0
 
28add0
-struct qxl_mode {
28add0
+struct compat_qxl_mode {
28add0
     uint32_t id;
28add0
     uint32_t x_res;
28add0
     uint32_t y_res;
28add0
@@ -81,39 +81,39 @@ typedef enum
28add0
     QXL_CMD_UPDATE,
28add0
     QXL_CMD_CURSOR,
28add0
     QXL_CMD_MESSAGE
28add0
-} qxl_command_type;
28add0
+} compat_qxl_command_type;
28add0
 
28add0
-struct qxl_command {
28add0
+struct compat_qxl_command {
28add0
     uint64_t data;
28add0
     uint32_t type;
28add0
     uint32_t pad;
28add0
 };
28add0
 
28add0
-struct qxl_rect {
28add0
+struct compat_qxl_rect {
28add0
     uint32_t top;
28add0
     uint32_t left;
28add0
     uint32_t bottom;
28add0
     uint32_t right;
28add0
 };
28add0
 
28add0
-union qxl_release_info {
28add0
+union compat_qxl_release_info {
28add0
     uint64_t id;
28add0
     uint64_t next;
28add0
 };
28add0
 
28add0
-struct qxl_clip {
28add0
+struct compat_qxl_clip {
28add0
     uint32_t type;
28add0
     uint64_t address;
28add0
 };
28add0
 
28add0
-struct qxl_point {
28add0
+struct compat_qxl_point {
28add0
     int x;
28add0
     int y;
28add0
 };
28add0
 
28add0
-struct qxl_pattern {
28add0
+struct compat_qxl_pattern {
28add0
     uint64_t pat;
28add0
-    struct qxl_point pos;
28add0
+    struct compat_qxl_point pos;
28add0
 };
28add0
 
28add0
 typedef enum
28add0
@@ -121,19 +121,19 @@ typedef enum
28add0
     QXL_BRUSH_TYPE_NONE,
28add0
     QXL_BRUSH_TYPE_SOLID,
28add0
     QXL_BRUSH_TYPE_PATTERN
28add0
-} qxl_brush_type;
28add0
+} compat_qxl_brush_type;
28add0
 
28add0
-struct qxl_brush {
28add0
+struct compat_qxl_brush {
28add0
     uint32_t type;
28add0
     union {
28add0
 	uint32_t color;
28add0
-	struct qxl_pattern pattern;
28add0
+	struct compat_qxl_pattern pattern;
28add0
     } u;
28add0
 };
28add0
 
28add0
-struct qxl_mask {
28add0
+struct compat_qxl_mask {
28add0
     unsigned char flags;
28add0
-    struct qxl_point pos;
28add0
+    struct compat_qxl_point pos;
28add0
     uint64_t bitmap;
28add0
 };
28add0
 
28add0
@@ -145,13 +145,13 @@ typedef enum {
28add0
     QXL_IMAGE_TYPE_LZ_RGB,
28add0
     QXL_IMAGE_TYPE_GLZ_RGB,
28add0
     QXL_IMAGE_TYPE_FROM_CACHE,
28add0
-} qxl_image_type;
28add0
+} compat_qxl_image_type;
28add0
 
28add0
 typedef enum {
28add0
     QXL_IMAGE_CACHE = (1 << 0)
28add0
-} qxl_image_flags;
28add0
+} compat_qxl_image_flags;
28add0
 
28add0
-struct qxl_image_descriptor
28add0
+struct compat_qxl_image_descriptor
28add0
 {
28add0
     uint64_t id;
28add0
     uint8_t type;
28add0
@@ -160,7 +160,7 @@ struct qxl_image_descriptor
28add0
     uint32_t height;
28add0
 };
28add0
 
28add0
-struct qxl_data_chunk {
28add0
+struct compat_qxl_data_chunk {
28add0
     uint32_t data_size;
28add0
     uint64_t prev_chunk;
28add0
     uint64_t next_chunk;
28add0
@@ -179,90 +179,90 @@ typedef enum
28add0
     QXL_BITMAP_FMT_24BIT,
28add0
     QXL_BITMAP_FMT_32BIT,
28add0
     QXL_BITMAP_FMT_RGBA,
28add0
-} qxl_bitmap_format;
28add0
+} compat_qxl_bitmap_format;
28add0
 
28add0
 typedef enum {
28add0
     QXL_BITMAP_PAL_CACHE_ME = (1 << 0),
28add0
     QXL_BITMAP_PAL_FROM_CACHE = (1 << 1),
28add0
     QXL_BITMAP_TOP_DOWN = (1 << 2),
28add0
-} qxl_bitmap_flags;
28add0
+} compat_qxl_bitmap_flags;
28add0
 
28add0
-struct qxl_bitmap {
28add0
+struct compat_qxl_bitmap {
28add0
     uint8_t format;
28add0
     uint8_t flags;		
28add0
     uint32_t x;			/* actually width */
28add0
     uint32_t y;			/* actually height */
28add0
     uint32_t stride;		/* in bytes */
28add0
     uint64_t palette;		/* Can be NULL */
28add0
-    uint64_t data;		/* A qxl_data_chunk that actually contains the data */
28add0
+    uint64_t data;		/* A compat_qxl_data_chunk that actually contains the data */
28add0
 };
28add0
 
28add0
-struct qxl_image {
28add0
-    struct qxl_image_descriptor descriptor;
28add0
+struct compat_qxl_image {
28add0
+    struct compat_qxl_image_descriptor descriptor;
28add0
     union
28add0
     {
28add0
-	struct qxl_bitmap bitmap;
28add0
+	struct compat_qxl_bitmap bitmap;
28add0
     } u;
28add0
 };
28add0
 
28add0
-struct qxl_fill {
28add0
-    struct qxl_brush brush;
28add0
+struct compat_qxl_fill {
28add0
+    struct compat_qxl_brush brush;
28add0
     unsigned short rop_descriptor;
28add0
-    struct qxl_mask mask;
28add0
+    struct compat_qxl_mask mask;
28add0
 };
28add0
 
28add0
-struct qxl_opaque {
28add0
+struct compat_qxl_opaque {
28add0
     uint64_t src_bitmap;
28add0
-    struct qxl_rect src_area;
28add0
-    struct qxl_brush brush;
28add0
+    struct compat_qxl_rect src_area;
28add0
+    struct compat_qxl_brush brush;
28add0
     unsigned short rop_descriptor;
28add0
     unsigned char scale_mode;
28add0
-    struct qxl_mask mask;
28add0
+    struct compat_qxl_mask mask;
28add0
 };
28add0
 
28add0
-struct qxl_copy {
28add0
+struct compat_qxl_copy {
28add0
     uint64_t src_bitmap;
28add0
-    struct qxl_rect src_area;
28add0
+    struct compat_qxl_rect src_area;
28add0
     unsigned short rop_descriptor;
28add0
     unsigned char scale_mode;
28add0
-    struct qxl_mask mask;
28add0
+    struct compat_qxl_mask mask;
28add0
 };
28add0
 
28add0
-struct qxl_transparent {
28add0
+struct compat_qxl_transparent {
28add0
     uint64_t src_bitmap;
28add0
-    struct qxl_rect src_area;
28add0
+    struct compat_qxl_rect src_area;
28add0
     uint32_t src_color;
28add0
     uint32_t true_color;
28add0
 };
28add0
 
28add0
-struct qxl_alpha_blend {
28add0
+struct compat_qxl_alpha_blend {
28add0
     unsigned char alpha;
28add0
     uint64_t src_bitmap;
28add0
-    struct qxl_rect src_area;
28add0
+    struct compat_qxl_rect src_area;
28add0
 };
28add0
 
28add0
-struct qxl_copy_bits {
28add0
-    struct qxl_point src_pos;
28add0
+struct compat_qxl_copy_bits {
28add0
+    struct compat_qxl_point src_pos;
28add0
 };
28add0
 
28add0
-struct qxl_blend { /* same as copy */
28add0
+struct compat_qxl_blend { /* same as copy */
28add0
     uint64_t src_bitmap;
28add0
-    struct qxl_rect src_area;
28add0
+    struct compat_qxl_rect src_area;
28add0
     unsigned short rop_descriptor;
28add0
     unsigned char scale_mode;
28add0
-    struct qxl_mask mask;
28add0
+    struct compat_qxl_mask mask;
28add0
 };
28add0
 
28add0
-struct qxl_rop3 {
28add0
+struct compat_qxl_rop3 {
28add0
     uint64_t src_bitmap;
28add0
-    struct qxl_rect src_area;
28add0
-    struct qxl_brush brush;
28add0
+    struct compat_qxl_rect src_area;
28add0
+    struct compat_qxl_brush brush;
28add0
     unsigned char rop3;
28add0
     unsigned char scale_mode;
28add0
-    struct qxl_mask mask;
28add0
+    struct compat_qxl_mask mask;
28add0
 };
28add0
 
28add0
-struct qxl_line_attr {
28add0
+struct compat_qxl_line_attr {
28add0
     unsigned char flags;
28add0
     unsigned char join_style;
28add0
     unsigned char end_style;
28add0
@@ -272,33 +272,33 @@ struct qxl_line_attr {
28add0
     uint64_t style;
28add0
 };
28add0
 
28add0
-struct qxl_stroke {
28add0
+struct compat_qxl_stroke {
28add0
     uint64_t path;
28add0
-    struct qxl_line_attr attr;
28add0
-    struct qxl_brush brush;
28add0
+    struct compat_qxl_line_attr attr;
28add0
+    struct compat_qxl_brush brush;
28add0
     unsigned short fore_mode;
28add0
     unsigned short back_mode;
28add0
 };
28add0
 
28add0
-struct qxl_text {
28add0
+struct compat_qxl_text {
28add0
     uint64_t str;
28add0
-    struct qxl_rect back_area;
28add0
-    struct qxl_brush fore_brush;
28add0
-    struct qxl_brush back_brush;
28add0
+    struct compat_qxl_rect back_area;
28add0
+    struct compat_qxl_brush fore_brush;
28add0
+    struct compat_qxl_brush back_brush;
28add0
     unsigned short fore_mode;
28add0
     unsigned short back_mode;
28add0
 };
28add0
 
28add0
-struct qxl_blackness {
28add0
-    struct qxl_mask mask;
28add0
+struct compat_qxl_blackness {
28add0
+    struct compat_qxl_mask mask;
28add0
 };
28add0
 
28add0
-struct qxl_inverse {
28add0
-    struct qxl_mask mask;
28add0
+struct compat_qxl_inverse {
28add0
+    struct compat_qxl_mask mask;
28add0
 };
28add0
 
28add0
-struct qxl_whiteness {
28add0
-    struct qxl_mask mask;
28add0
+struct compat_qxl_whiteness {
28add0
+    struct compat_qxl_mask mask;
28add0
 };
28add0
 
28add0
 /* Effects */
28add0
@@ -312,14 +312,14 @@ typedef enum
28add0
     QXL_EFFECT_NOP_ON_DUP,
28add0
     QXL_EFFECT_NOP,
28add0
     QXL_EFFECT_OPAQUE_BRUSH
28add0
-} qxl_effect_type;
28add0
+} compat_qxl_effect_type;
28add0
 
28add0
 typedef enum
28add0
 {
28add0
     QXL_CLIP_TYPE_NONE,
28add0
     QXL_CLIP_TYPE_RECTS,
28add0
     QXL_CLIP_TYPE_PATH,
28add0
-} qxl_clip_type;
28add0
+} compat_qxl_clip_type;
28add0
 
28add0
 typedef enum {
28add0
     QXL_DRAW_NOP,
28add0
@@ -336,41 +336,41 @@ typedef enum {
28add0
     QXL_DRAW_TEXT,
28add0
     QXL_DRAW_TRANSPARENT,
28add0
     QXL_DRAW_ALPHA_BLEND,
28add0
-} qxl_draw_type;
28add0
+} compat_qxl_draw_type;
28add0
 
28add0
-struct qxl_drawable {
28add0
-    union qxl_release_info release_info;
28add0
+struct compat_qxl_drawable {
28add0
+    union compat_qxl_release_info release_info;
28add0
     unsigned char effect;
28add0
     unsigned char type;
28add0
     unsigned short bitmap_offset;
28add0
-    struct qxl_rect bitmap_area;
28add0
-    struct qxl_rect bbox;
28add0
-    struct qxl_clip clip;
28add0
+    struct compat_qxl_rect bitmap_area;
28add0
+    struct compat_qxl_rect bbox;
28add0
+    struct compat_qxl_clip clip;
28add0
     uint32_t mm_time;
28add0
     union {
28add0
-	struct qxl_fill fill;
28add0
-	struct qxl_opaque opaque;
28add0
-	struct qxl_copy copy;
28add0
-	struct qxl_transparent transparent;
28add0
-	struct qxl_alpha_blend alpha_blend;
28add0
-	struct qxl_copy_bits copy_bits;
28add0
-	struct qxl_blend blend;
28add0
-	struct qxl_rop3 rop3;
28add0
-	struct qxl_stroke stroke;
28add0
-	struct qxl_text text;
28add0
-	struct qxl_blackness blackness;
28add0
-	struct qxl_inverse inverse;
28add0
-	struct qxl_whiteness whiteness;
28add0
+	struct compat_qxl_fill fill;
28add0
+	struct compat_qxl_opaque opaque;
28add0
+	struct compat_qxl_copy copy;
28add0
+	struct compat_qxl_transparent transparent;
28add0
+	struct compat_qxl_alpha_blend alpha_blend;
28add0
+	struct compat_qxl_copy_bits copy_bits;
28add0
+	struct compat_qxl_blend blend;
28add0
+	struct compat_qxl_rop3 rop3;
28add0
+	struct compat_qxl_stroke stroke;
28add0
+	struct compat_qxl_text text;
28add0
+	struct compat_qxl_blackness blackness;
28add0
+	struct compat_qxl_inverse inverse;
28add0
+	struct compat_qxl_whiteness whiteness;
28add0
     } u;
28add0
 };
28add0
 
28add0
-struct qxl_update_cmd {
28add0
-    union qxl_release_info release_info;
28add0
-    struct qxl_rect area;
28add0
+struct compat_qxl_update_cmd {
28add0
+    union compat_qxl_release_info release_info;
28add0
+    struct compat_qxl_rect area;
28add0
     uint32_t update_id;
28add0
 };
28add0
 
28add0
-struct qxl_point16 {
28add0
+struct compat_qxl_point16 {
28add0
     int16_t x;
28add0
     int16_t y;
28add0
 };
28add0
@@ -394,7 +394,7 @@ enum {
28add0
     CURSOR_TYPE_COLOR32,
28add0
 };
28add0
 
28add0
-struct qxl_cursor_header {
28add0
+struct compat_qxl_cursor_header {
28add0
     uint64_t unique;
28add0
     uint16_t type;
28add0
     uint16_t width;
28add0
@@ -403,19 +403,19 @@ struct qxl_cursor_header {
28add0
     uint16_t hot_spot_y;
28add0
 };
28add0
 
28add0
-struct qxl_cursor
28add0
+struct compat_qxl_cursor
28add0
 {
28add0
-    struct qxl_cursor_header header;
28add0
+    struct compat_qxl_cursor_header header;
28add0
     uint32_t data_size;
28add0
-    struct qxl_data_chunk chunk;
28add0
+    struct compat_qxl_data_chunk chunk;
28add0
 };
28add0
 
28add0
-struct qxl_cursor_cmd {
28add0
-    union qxl_release_info release_info;
28add0
+struct compat_qxl_cursor_cmd {
28add0
+    union compat_qxl_release_info release_info;
28add0
     uint8_t type;
28add0
     union {
28add0
 	struct {
28add0
-	    struct qxl_point16 position;
28add0
+	    struct compat_qxl_point16 position;
28add0
 	    unsigned char visible;
28add0
 	    uint64_t shape;
28add0
 	} set;
28add0
@@ -423,12 +423,12 @@ struct qxl_cursor_cmd {
28add0
 	    uint16_t length;
28add0
 	    uint16_t frequency;
28add0
 	} trail;
28add0
-	struct qxl_point16 position;
28add0
+	struct compat_qxl_point16 position;
28add0
     } u;
28add0
     uint8_t device_data[QXL_CURSOR_DEVICE_DATA_SIZE];
28add0
 };
28add0
 
28add0
-struct qxl_rom {
28add0
+struct compat_qxl_rom {
28add0
     uint32_t magic;
28add0
     uint32_t id;
28add0
     uint32_t update_id;
28add0
@@ -444,7 +444,7 @@ struct qxl_rom {
28add0
     uint32_t mm_clock;
28add0
 };
28add0
 
28add0
-struct qxl_ring_header {
28add0
+struct compat_qxl_ring_header {
28add0
     uint32_t num_items;
28add0
     uint32_t prod;
28add0
     uint32_t notify_on_prod;
28add0
@@ -454,38 +454,38 @@ struct qxl_ring_header {
28add0
 
28add0
 #define QXL_LOG_BUF_SIZE 4096
28add0
 
28add0
-struct qxl_ram_header {
28add0
+struct compat_qxl_ram_header {
28add0
     uint32_t magic;
28add0
     uint32_t int_pending;
28add0
     uint32_t int_mask;
28add0
     unsigned char log_buf[QXL_LOG_BUF_SIZE];
28add0
-    struct qxl_ring_header  cmd_ring_hdr;
28add0
-    struct qxl_command	    cmd_ring[32];
28add0
-    struct qxl_ring_header  cursor_ring_hdr;
28add0
-    struct qxl_command	    cursor_ring[32];
28add0
-    struct qxl_ring_header  release_ring_hdr;
28add0
+    struct compat_qxl_ring_header  cmd_ring_hdr;
28add0
+    struct compat_qxl_command	    cmd_ring[32];
28add0
+    struct compat_qxl_ring_header  cursor_ring_hdr;
28add0
+    struct compat_qxl_command	    cursor_ring[32];
28add0
+    struct compat_qxl_ring_header  release_ring_hdr;
28add0
     uint64_t		    release_ring[8];
28add0
-    struct qxl_rect	    update_area;
28add0
+    struct compat_qxl_rect	    update_area;
28add0
 };
28add0
 
28add0
 #pragma pack(pop)
28add0
 
28add0
-typedef struct _qxl_screen_t qxl_screen_t;
28add0
+typedef struct _compat_qxl_screen_t compat_qxl_screen_t;
28add0
 
28add0
-struct _qxl_screen_t
28add0
+struct _compat_qxl_screen_t
28add0
 {
28add0
     /* These are the names QXL uses */
28add0
     void *			ram;	/* Video RAM */
28add0
     void *			ram_physical;
28add0
     void *			vram;	/* Command RAM */
28add0
-    struct qxl_rom *		rom;    /* Parameter RAM */
28add0
+    struct compat_qxl_rom *		rom;    /* Parameter RAM */
28add0
     
28add0
-    struct qxl_ring *		command_ring;
28add0
-    struct qxl_ring *		cursor_ring;
28add0
-    struct qxl_ring *		release_ring;
28add0
+    struct compat_qxl_ring *		command_ring;
28add0
+    struct compat_qxl_ring *		cursor_ring;
28add0
+    struct compat_qxl_ring *		release_ring;
28add0
     
28add0
     int				num_modes;
28add0
-    struct qxl_mode *		modes;
28add0
+    struct compat_qxl_mode *		modes;
28add0
     int				io_base;
28add0
     int				draw_area_offset;
28add0
     int				draw_area_size;
28add0
@@ -493,7 +493,7 @@ struct _qxl_screen_t
28add0
     void *			fb;
28add0
     int				bytes_per_pixel;
28add0
 
28add0
-    struct qxl_mem *		mem;	/* Context for qxl_alloc/free */
28add0
+    struct compat_qxl_mem *		mem;	/* Context for compat_qxl_alloc/free */
28add0
     
28add0
     EntityInfoPtr		entity;
28add0
 
28add0
@@ -530,15 +530,15 @@ struct _qxl_screen_t
28add0
 };
28add0
 
28add0
 static inline uint64_t
28add0
-physical_address (qxl_screen_t *qxl, void *virtual)
28add0
+physical_address (compat_qxl_screen_t *compat_qxl, void *virtual)
28add0
 {
28add0
-    return (uint64_t) ((unsigned long)virtual + (((unsigned long)qxl->ram_physical - (unsigned long)qxl->ram)));
28add0
+    return (uint64_t) ((unsigned long)virtual + (((unsigned long)compat_qxl->ram_physical - (unsigned long)compat_qxl->ram)));
28add0
 }
28add0
 
28add0
 static inline void *
28add0
-virtual_address (qxl_screen_t *qxl, void *physical)
28add0
+virtual_address (compat_qxl_screen_t *compat_qxl, void *physical)
28add0
 {
28add0
-    return (void *) ((unsigned long)physical + ((unsigned long)qxl->ram - (unsigned long)qxl->ram_physical));
28add0
+    return (void *) ((unsigned long)physical + ((unsigned long)compat_qxl->ram - (unsigned long)compat_qxl->ram_physical));
28add0
 }
28add0
 
28add0
 static inline void *
28add0
@@ -553,58 +553,58 @@ pointer_to_u64 (void *p)
28add0
     return (uint64_t)(unsigned long)p;
28add0
 }
28add0
 
28add0
-struct qxl_ring;
28add0
+struct compat_qxl_ring;
28add0
 
28add0
 /*
28add0
  * HW cursor
28add0
  */
28add0
-void              qxl_cursor_init        (ScreenPtr               pScreen);
28add0
+void              compat_qxl_cursor_init        (ScreenPtr               pScreen);
28add0
 
28add0
 
28add0
 
28add0
 /*
28add0
  * Rings
28add0
  */
28add0
-struct qxl_ring * qxl_ring_create      (struct qxl_ring_header *header,
28add0
+struct compat_qxl_ring * compat_qxl_ring_create      (struct compat_qxl_ring_header *header,
28add0
 					int                     element_size,
28add0
 					int                     n_elements,
28add0
 					int                     prod_notify);
28add0
-void              qxl_ring_push        (struct qxl_ring        *ring,
28add0
+void              compat_qxl_ring_push        (struct compat_qxl_ring        *ring,
28add0
 					const void             *element);
28add0
-Bool              qxl_ring_pop         (struct qxl_ring        *ring,
28add0
+Bool              compat_qxl_ring_pop         (struct compat_qxl_ring        *ring,
28add0
 					void                   *element);
28add0
-void              qxl_ring_wait_idle   (struct qxl_ring        *ring);
28add0
+void              compat_qxl_ring_wait_idle   (struct compat_qxl_ring        *ring);
28add0
 
28add0
 
28add0
 
28add0
 /*
28add0
  * Images
28add0
  */
28add0
-struct qxl_image *qxl_image_create     (qxl_screen_t           *qxl,
28add0
+struct compat_qxl_image *compat_qxl_image_create     (compat_qxl_screen_t           *compat_qxl,
28add0
 					const uint8_t          *data,
28add0
 					int                     x,
28add0
 					int                     y,
28add0
 					int                     width,
28add0
 					int                     height,
28add0
 					int                     stride);
28add0
-void              qxl_image_destroy    (qxl_screen_t           *qxl,
28add0
-					struct qxl_image       *image);
28add0
-void		  qxl_drop_image_cache (qxl_screen_t	       *qxl);
28add0
+void              compat_qxl_image_destroy    (compat_qxl_screen_t           *compat_qxl,
28add0
+					struct compat_qxl_image       *image);
28add0
+void		  compat_qxl_drop_image_cache (compat_qxl_screen_t	       *compat_qxl);
28add0
 
28add0
 
28add0
 /*
28add0
  * Malloc
28add0
  */
28add0
-struct qxl_mem *  qxl_mem_create       (void                   *base,
28add0
+struct compat_qxl_mem *  compat_qxl_mem_create       (void                   *base,
28add0
 					unsigned long           n_bytes);
28add0
-void              qxl_mem_dump_stats   (struct qxl_mem         *mem,
28add0
+void              compat_qxl_mem_dump_stats   (struct compat_qxl_mem         *mem,
28add0
 					const char             *header);
28add0
-void *            qxl_alloc            (struct qxl_mem         *mem,
28add0
+void *            compat_qxl_alloc            (struct compat_qxl_mem         *mem,
28add0
 					unsigned long           n_bytes);
28add0
-void              qxl_free             (struct qxl_mem         *mem,
28add0
+void              compat_qxl_free             (struct compat_qxl_mem         *mem,
28add0
 					void                   *d);
28add0
-void              qxl_mem_free_all     (struct qxl_mem         *mem);
28add0
-void *            qxl_allocnf          (qxl_screen_t           *qxl,
28add0
+void              compat_qxl_mem_free_all     (struct compat_qxl_mem         *mem);
28add0
+void *            compat_qxl_allocnf          (compat_qxl_screen_t           *compat_qxl,
28add0
 					unsigned long           size);
28add0
 
28add0
 
28add0
diff -up xf86-video-qxl-20130514/src/compat/compat-qxl_image.c.compat2 xf86-video-qxl-20130514/src/compat/compat-qxl_image.c
28add0
--- xf86-video-qxl-20130514/src/compat/compat-qxl_image.c.compat2	2013-07-03 14:19:39.010334593 +1000
28add0
+++ xf86-video-qxl-20130514/src/compat/compat-qxl_image.c	2013-07-03 14:19:56.103748552 +1000
28add0
@@ -8,7 +8,7 @@ typedef struct image_info_t image_info_t
28add0
 
28add0
 struct image_info_t
28add0
 {
28add0
-    struct qxl_image *image;
28add0
+    struct compat_qxl_image *image;
28add0
     int ref_count;
28add0
     image_info_t *next;
28add0
 };
28add0
@@ -33,7 +33,7 @@ hash_and_copy (const uint8_t *src, int s
28add0
 	if (dest)
28add0
 	    memcpy (dest_line, src_line, n_bytes);
28add0
 
28add0
-	hash = hashlittle (src_line, n_bytes, hash);
28add0
+	hash = compat_hashlittle (src_line, n_bytes, hash);
28add0
     }
28add0
 
28add0
     return hash;
28add0
@@ -48,7 +48,7 @@ lookup_image_info (unsigned int hash,
28add0
 
28add0
     while (info)
28add0
     {
28add0
-	struct qxl_image *image = info->image;
28add0
+	struct compat_qxl_image *image = info->image;
28add0
 
28add0
 	if (image->descriptor.id == hash		&&
28add0
 	    image->descriptor.width == width		&&
28add0
@@ -95,17 +95,17 @@ remove_image_info (image_info_t *info)
28add0
     free (info);
28add0
 }
28add0
 
28add0
-struct qxl_image *
28add0
-qxl_image_create (qxl_screen_t *qxl, const uint8_t *data,
28add0
+struct compat_qxl_image *
28add0
+compat_qxl_image_create (compat_qxl_screen_t *compat_qxl, const uint8_t *data,
28add0
 		  int x, int y, int width, int height,
28add0
 		  int stride)
28add0
 {
28add0
     unsigned int hash;
28add0
     image_info_t *info;
28add0
 
28add0
-    data += y * stride + x * qxl->bytes_per_pixel;
28add0
+    data += y * stride + x * compat_qxl->bytes_per_pixel;
28add0
 
28add0
-    hash = hash_and_copy (data, stride, NULL, -1, qxl->bytes_per_pixel, width, height);
28add0
+    hash = hash_and_copy (data, stride, NULL, -1, compat_qxl->bytes_per_pixel, width, height);
28add0
 
28add0
     info = lookup_image_info (hash, width, height);
28add0
     if (info)
28add0
@@ -120,11 +120,11 @@ qxl_image_create (qxl_screen_t *qxl, con
28add0
 
28add0
 	for (i = 0; i < height; ++i)
28add0
 	{
28add0
-	    struct qxl_data_chunk *chunk;
28add0
+	    struct compat_qxl_data_chunk *chunk;
28add0
 	    const uint8_t *src_line = data + i * stride;
28add0
 	    uint32_t *dest_line;
28add0
 		
28add0
-	    chunk = virtual_address (qxl, u64_to_pointer (info->image->u.bitmap.data));
28add0
+	    chunk = virtual_address (compat_qxl, u64_to_pointer (info->image->u.bitmap.data));
28add0
 	    
28add0
 	    dest_line = (uint32_t *)chunk->data + width * i;
28add0
 
28add0
@@ -147,9 +147,9 @@ qxl_image_create (qxl_screen_t *qxl, con
28add0
     }
28add0
     else
28add0
     {
28add0
-	struct qxl_image *image;
28add0
-	struct qxl_data_chunk *chunk;
28add0
-	int dest_stride = width * qxl->bytes_per_pixel;
28add0
+	struct compat_qxl_image *image;
28add0
+	struct compat_qxl_data_chunk *chunk;
28add0
+	int dest_stride = width * compat_qxl->bytes_per_pixel;
28add0
 	image_info_t *info;
28add0
 
28add0
 #if 0
28add0
@@ -159,7 +159,7 @@ qxl_image_create (qxl_screen_t *qxl, con
28add0
 	/* Chunk */
28add0
 	
28add0
 	/* FIXME: Check integer overflow */
28add0
-	chunk = qxl_allocnf (qxl, sizeof *chunk + height * dest_stride);
28add0
+	chunk = compat_qxl_allocnf (compat_qxl, sizeof *chunk + height * dest_stride);
28add0
 	
28add0
 	chunk->data_size = height * dest_stride;
28add0
 	chunk->prev_chunk = 0;
28add0
@@ -167,10 +167,10 @@ qxl_image_create (qxl_screen_t *qxl, con
28add0
 	
28add0
 	hash_and_copy (data, stride,
28add0
 		       chunk->data, dest_stride,
28add0
-		       qxl->bytes_per_pixel, width, height);
28add0
+		       compat_qxl->bytes_per_pixel, width, height);
28add0
 
28add0
 	/* Image */
28add0
-	image = qxl_allocnf (qxl, sizeof *image);
28add0
+	image = compat_qxl_allocnf (compat_qxl, sizeof *image);
28add0
 
28add0
 	image->descriptor.id = 0;
28add0
 	image->descriptor.type = QXL_IMAGE_TYPE_BITMAP;
28add0
@@ -179,7 +179,7 @@ qxl_image_create (qxl_screen_t *qxl, con
28add0
 	image->descriptor.width = width;
28add0
 	image->descriptor.height = height;
28add0
 
28add0
-	if (qxl->bytes_per_pixel == 2)
28add0
+	if (compat_qxl->bytes_per_pixel == 2)
28add0
 	{
28add0
 	    image->u.bitmap.format = QXL_BITMAP_FMT_16BIT;
28add0
 	}
28add0
@@ -191,9 +191,9 @@ qxl_image_create (qxl_screen_t *qxl, con
28add0
 	image->u.bitmap.flags = QXL_BITMAP_TOP_DOWN;
28add0
 	image->u.bitmap.x = width;
28add0
 	image->u.bitmap.y = height;
28add0
-	image->u.bitmap.stride = width * qxl->bytes_per_pixel;
28add0
+	image->u.bitmap.stride = width * compat_qxl->bytes_per_pixel;
28add0
 	image->u.bitmap.palette = 0;
28add0
-	image->u.bitmap.data = physical_address (qxl, chunk);
28add0
+	image->u.bitmap.data = physical_address (compat_qxl, chunk);
28add0
 
28add0
 #if 0
28add0
 	ErrorF ("%p has size %d %d\n", image, width, height);
28add0
@@ -218,13 +218,13 @@ qxl_image_create (qxl_screen_t *qxl, con
28add0
 }
28add0
 
28add0
 void
28add0
-qxl_image_destroy (qxl_screen_t *qxl,
28add0
-		   struct qxl_image *image)
28add0
+compat_qxl_image_destroy (compat_qxl_screen_t *compat_qxl,
28add0
+		   struct compat_qxl_image *image)
28add0
 {
28add0
-    struct qxl_data_chunk *chunk;
28add0
+    struct compat_qxl_data_chunk *chunk;
28add0
     image_info_t *info;
28add0
 
28add0
-    chunk = virtual_address (qxl, u64_to_pointer (image->u.bitmap.data));
28add0
+    chunk = virtual_address (compat_qxl, u64_to_pointer (image->u.bitmap.data));
28add0
     
28add0
     info = lookup_image_info (image->descriptor.id,
28add0
 			      image->descriptor.width,
28add0
@@ -244,12 +244,12 @@ qxl_image_destroy (qxl_screen_t *qxl,
28add0
 	remove_image_info (info);
28add0
     }
28add0
 
28add0
-    qxl_free (qxl->mem, chunk);
28add0
-    qxl_free (qxl->mem, image);
28add0
+    compat_qxl_free (compat_qxl->mem, chunk);
28add0
+    compat_qxl_free (compat_qxl->mem, image);
28add0
 }
28add0
 
28add0
 void
28add0
-qxl_drop_image_cache (qxl_screen_t *qxl)
28add0
+compat_qxl_drop_image_cache (compat_qxl_screen_t *compat_qxl)
28add0
 {
28add0
     memset (image_table, 0, HASH_SIZE * sizeof (image_info_t *));
28add0
 }
28add0
diff -up xf86-video-qxl-20130514/src/compat/compat-qxl_mem.c.compat2 xf86-video-qxl-20130514/src/compat/compat-qxl_mem.c
28add0
--- xf86-video-qxl-20130514/src/compat/compat-qxl_mem.c.compat2	2013-07-03 14:19:39.010334593 +1000
28add0
+++ xf86-video-qxl-20130514/src/compat/compat-qxl_mem.c	2013-07-03 14:19:56.104748592 +1000
28add0
@@ -22,7 +22,7 @@ struct block
28add0
     } u;
28add0
 };
28add0
 
28add0
-struct qxl_mem
28add0
+struct compat_qxl_mem
28add0
 {
28add0
     void *		base;
28add0
     unsigned long	n_bytes;
28add0
@@ -35,7 +35,7 @@ struct qxl_mem
28add0
 };
28add0
 
28add0
 static void
28add0
-initialize (struct qxl_mem *mem)
28add0
+initialize (struct compat_qxl_mem *mem)
28add0
 {
28add0
     mem->unused = (struct block *)mem->base;
28add0
     mem->unused->n_bytes = mem->n_bytes;
28add0
@@ -47,10 +47,10 @@ initialize (struct qxl_mem *mem)
28add0
     mem->n_freed_blocks = 0;
28add0
 }
28add0
 
28add0
-struct qxl_mem *
28add0
-qxl_mem_create (void *base, unsigned long n_bytes)
28add0
+struct compat_qxl_mem *
28add0
+compat_qxl_mem_create (void *base, unsigned long n_bytes)
28add0
 {
28add0
-    struct qxl_mem *mem = NULL;
28add0
+    struct compat_qxl_mem *mem = NULL;
28add0
 
28add0
     mem = calloc (sizeof (*mem), 1);
28add0
     if (!mem)
28add0
@@ -66,13 +66,13 @@ out:
28add0
 }
28add0
 
28add0
 void
28add0
-qxl_mem_free_all (struct qxl_mem *mem)
28add0
+compat_qxl_mem_free_all (struct compat_qxl_mem *mem)
28add0
 {
28add0
     initialize (mem);
28add0
 }
28add0
 
28add0
 void
28add0
-qxl_mem_dump_stats (struct qxl_mem *mem, const char *header)
28add0
+compat_qxl_mem_dump_stats (struct compat_qxl_mem *mem, const char *header)
28add0
 {
28add0
     struct block *b;
28add0
     int n_blocks;
28add0
@@ -122,7 +122,7 @@ qxl_mem_dump_stats (struct qxl_mem *mem,
28add0
 }
28add0
 
28add0
 void *
28add0
-qxl_alloc (struct qxl_mem *mem, unsigned long n_bytes)
28add0
+compat_qxl_alloc (struct compat_qxl_mem *mem, unsigned long n_bytes)
28add0
 {
28add0
     struct block *b, *prev;
28add0
 
28add0
@@ -202,7 +202,7 @@ qxl_alloc (struct qxl_mem *mem, unsigned
28add0
     /* If we get here, we are out of memory, so print some stats */
28add0
 #if 0
28add0
     fprintf (stderr, "Failing to allocate %lu bytes\n", n_bytes);
28add0
-    qxl_mem_dump_stats (mem, "out of memory");
28add0
+    compat_qxl_mem_dump_stats (mem, "out of memory");
28add0
 #endif
28add0
     
28add0
     return NULL;
28add0
@@ -213,7 +213,7 @@ qxl_alloc (struct qxl_mem *mem, unsigned
28add0
  * last unused block.
28add0
  */
28add0
 static void
28add0
-find_neighbours (struct qxl_mem *mem, void *data,
28add0
+find_neighbours (struct compat_qxl_mem *mem, void *data,
28add0
 		 struct block **before, struct block **after)
28add0
 {
28add0
     struct block *b;
28add0
@@ -237,7 +237,7 @@ find_neighbours (struct qxl_mem *mem, vo
28add0
 }
28add0
 
28add0
 void
28add0
-qxl_free (struct qxl_mem *mem, void *d)
28add0
+compat_qxl_free (struct compat_qxl_mem *mem, void *d)
28add0
 {
28add0
     struct block *b = d - sizeof (unsigned long);
28add0
     struct block *before, *after;
28add0
@@ -248,7 +248,7 @@ qxl_free (struct qxl_mem *mem, void *d)
28add0
 #if 0
28add0
     printf ("freeing %p (%d bytes)\n", b, b->n_bytes);
28add0
     
28add0
-    qxl_mem_dump_stats (mem, "before free");
28add0
+    compat_qxl_mem_dump_stats (mem, "before free");
28add0
 #endif
28add0
     
28add0
     find_neighbours (mem, (void *)b, &before, &after);
28add0
@@ -316,6 +316,6 @@ qxl_free (struct qxl_mem *mem, void *d)
28add0
     }
28add0
 
28add0
 #if 0
28add0
-    qxl_mem_dump_stats (mem, "after free");
28add0
+    compat_qxl_mem_dump_stats (mem, "after free");
28add0
 #endif
28add0
 }
28add0
diff -up xf86-video-qxl-20130514/src/compat/compat-qxl_ring.c.compat2 xf86-video-qxl-20130514/src/compat/compat-qxl_ring.c
28add0
--- xf86-video-qxl-20130514/src/compat/compat-qxl_ring.c.compat2	2013-07-03 14:19:39.010334593 +1000
28add0
+++ xf86-video-qxl-20130514/src/compat/compat-qxl_ring.c	2013-07-03 14:19:56.104748592 +1000
28add0
@@ -5,11 +5,11 @@
28add0
 
28add0
 struct ring
28add0
 {
28add0
-    struct qxl_ring_header	header;
28add0
+    struct compat_qxl_ring_header	header;
28add0
     uint8_t			elements[0];
28add0
 };
28add0
 
28add0
-struct qxl_ring
28add0
+struct compat_qxl_ring
28add0
 {
28add0
     volatile struct ring *ring;
28add0
     int			element_size;
28add0
@@ -17,13 +17,13 @@ struct qxl_ring
28add0
     int			prod_notify;
28add0
 };
28add0
 
28add0
-struct qxl_ring *
28add0
-qxl_ring_create (struct qxl_ring_header *header,
28add0
+struct compat_qxl_ring *
28add0
+compat_qxl_ring_create (struct compat_qxl_ring_header *header,
28add0
 		 int                     element_size,
28add0
 		 int                     n_elements,
28add0
 		 int			 prod_notify)
28add0
 {
28add0
-    struct qxl_ring *ring;
28add0
+    struct compat_qxl_ring *ring;
28add0
 
28add0
     ring = malloc (sizeof *ring);
28add0
     if (!ring)
28add0
@@ -38,10 +38,10 @@ qxl_ring_create (struct qxl_ring_header
28add0
 }
28add0
 
28add0
 void
28add0
-qxl_ring_push (struct qxl_ring *ring,
28add0
+compat_qxl_ring_push (struct compat_qxl_ring *ring,
28add0
 	       const void      *new_elt)
28add0
 {
28add0
-    volatile struct qxl_ring_header *header = &(ring->ring->header);
28add0
+    volatile struct compat_qxl_ring_header *header = &(ring->ring->header);
28add0
     volatile uint8_t *elt;
28add0
     int idx;
28add0
 
28add0
@@ -66,10 +66,10 @@ qxl_ring_push (struct qxl_ring *ring,
28add0
 }
28add0
 
28add0
 Bool
28add0
-qxl_ring_pop (struct qxl_ring *ring,
28add0
+compat_qxl_ring_pop (struct compat_qxl_ring *ring,
28add0
 	      void            *element)
28add0
 {
28add0
-    volatile struct qxl_ring_header *header = &(ring->ring->header);
28add0
+    volatile struct compat_qxl_ring_header *header = &(ring->ring->header);
28add0
     volatile uint8_t *ring_elt;
28add0
     int idx;
28add0
 
28add0
@@ -87,7 +87,7 @@ qxl_ring_pop (struct qxl_ring *ring,
28add0
 }
28add0
 
28add0
 void
28add0
-qxl_ring_wait_idle (struct qxl_ring *ring)
28add0
+compat_qxl_ring_wait_idle (struct compat_qxl_ring *ring)
28add0
 {
28add0
     while (ring->ring->header.cons != ring->ring->header.prod)
28add0
     {
28add0
diff -up xf86-video-qxl-20130514/src/compat/Makefile.am.compat2 xf86-video-qxl-20130514/src/compat/Makefile.am
28add0
--- xf86-video-qxl-20130514/src/compat/Makefile.am.compat2	2013-07-03 14:19:39.010334593 +1000
28add0
+++ xf86-video-qxl-20130514/src/compat/Makefile.am	2013-07-03 14:19:56.102748510 +1000
28add0
@@ -24,13 +24,13 @@
28add0
 # -avoid-version prevents gratuitous .0.0.0 version numbers on the end
28add0
 # _ladir passes a dummy rpath to libtool so the thing will actually link
28add0
 # TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc.
28add0
-qxl_drv_la_LTLIBRARIES = qxl_drv.la
28add0
-qxl_drv_la_LDFLAGS = -module -avoid-version
28add0
-qxl_drv_ladir = @moduledir@/drivers
28add0
-AM_CFLAGS = -g
28add0
+
28add0
+noinst_LTLIBRARIES = compatdriver.la
28add0
+compatdriver_la_LDFLAGS = -module -avoid-version
28add0
+
28add0
 AM_CFLAGS = $(XORG_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS)
28add0
 
28add0
-qxl_drv_la_SOURCES =				\
28add0
+compatdriver_la_SOURCES =				\
28add0
 	compat-qxl.h					\
28add0
 	compat-qxl_driver.c				\
28add0
 	compat-qxl_image.c				\
28add0
diff -up xf86-video-qxl-20130514/src/Makefile.am.compat2 xf86-video-qxl-20130514/src/Makefile.am
28add0
--- xf86-video-qxl-20130514/src/Makefile.am.compat2	2013-07-03 14:19:56.102748510 +1000
28add0
+++ xf86-video-qxl-20130514/src/Makefile.am	2013-07-03 14:20:10.365094118 +1000
28add0
@@ -34,7 +34,7 @@ qxl_drv_la_LTLIBRARIES = qxl_drv.la
28add0
 qxl_drv_la_LDFLAGS = -module -avoid-version
28add0
 qxl_drv_ladir = @moduledir@/drivers
28add0
 
28add0
-qxl_drv_la_LIBADD = uxa/libuxa.la
28add0
+qxl_drv_la_LIBADD = uxa/libuxa.la compat/compatdriver.la
28add0
 if LIBUDEV
28add0
 qxl_drv_la_LIBADD += $(LIBUDEV_LIBS)
28add0
 endif
28add0
diff -up xf86-video-qxl-20130514/src/qxl_driver.c.compat2 xf86-video-qxl-20130514/src/qxl_driver.c
28add0
--- xf86-video-qxl-20130514/src/qxl_driver.c.compat2	2013-05-14 11:13:00.000000000 +1000
28add0
+++ xf86-video-qxl-20130514/src/qxl_driver.c	2013-07-03 14:19:56.104748592 +1000
28add0
@@ -1365,7 +1365,11 @@ qxl_pci_probe (DriverPtr drv, int entity
28add0
     qxl = pScrn->driverPrivate;
28add0
     qxl->pci = dev;
28add0
     
28add0
-    qxl_init_scrn (pScrn, kms);
28add0
+    if (!kms && qxl->pci->revision == 0x01)
28add0
+    {
28add0
+	compat_init_scrn (pScrn);
28add0
+    } else
28add0
+        qxl_init_scrn (pScrn, kms);
28add0
     
28add0
     return TRUE;
28add0
 }