[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

xserver-xorg-video-qxl: Changes to 'debian-experimental'



 ChangeLog              |  378 +++++++
 configure.ac           |    4 
 debian/changelog       |    6 
 debian/control         |    2 
 src/Makefile.am        |    7 
 src/mspace.h           |    2 
 src/qxl.h              |   64 +
 src/qxl_cursor.c       |    4 
 src/qxl_driver.c       | 2420 +++++++++++++++++++++++++++++++++----------------
 src/qxl_edid.c         |  209 ++++
 src/qxl_image.c        |   20 
 src/qxl_mem.c          |   31 
 src/qxl_ring.c         |   20 
 src/qxl_surface.c      |  275 +++++
 src/spiceqxl_inputs.c  |   28 
 src/spiceqxl_io_port.c |    4 
 src/uxa/uxa-glyphs.c   |    9 
 src/uxa/uxa-priv.h     |    2 
 src/uxa/uxa.c          |    7 
 19 files changed, 2661 insertions(+), 831 deletions(-)

New commits:
commit 7dc6cdb47d84aaed58d0454cd72e068ef1500399
Author: Timo Aaltonen <tjaalton@ubuntu.com>
Date:   Tue Oct 2 00:08:47 2012 +0300

    control: Bump build-dep on libspice-protocol-dev to >= 0.12.0~.

diff --git a/debian/changelog b/debian/changelog
index 3eeda00..e445ce8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,7 +1,11 @@
 xserver-xorg-video-qxl (0.1.0-1) UNRELEASED; urgency=low
 
+  [ Maarten Lankhorst ]
   * New upstream release.
 
+  [ Timo Aaltonen ]
+  * control: Bump build-dep on libspice-protocol-dev to >= 0.12.0~.
+
  -- Maarten Lankhorst <maarten.lankhorst@canonical.com>  Thu, 19 Jul 2012 11:25:04 +0200
 
 xserver-xorg-video-qxl (0.0.17-2) unstable; urgency=low
diff --git a/debian/control b/debian/control
index 2701e96..8cd7f23 100644
--- a/debian/control
+++ b/debian/control
@@ -20,7 +20,7 @@ Build-Depends:
  libtool,
  xutils-dev (>= 1:7.5),
  quilt (>= 0.46-7~),
- libspice-protocol-dev (>= 0.8.1~),
+ libspice-protocol-dev (>= 0.12.0~),
  libspice-server-dev [amd64],
  python,
 Standards-Version: 3.9.3

commit cf8bfaecf19c9655e1424f281b9c88dbc005b6e5
Author: Timo Aaltonen <tjaalton@ubuntu.com>
Date:   Mon Oct 1 23:53:50 2012 +0300

    update the changelogs

diff --git a/ChangeLog b/ChangeLog
index 6899b64..1a3cc94 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,381 @@
+commit d8bb331784792bfd35bf158875b434243f0fe019
+Author: Søren Sandmann Pedersen <ssp@redhat.com>
+Date:   Thu Sep 20 19:11:55 2012 -0400
+
+    Version bump to 0.1.0
+
+commit 6520293e1e1f57bafbcf99592e766f810ce3ad2d
+Author: Søren Sandmann Pedersen <ssp@redhat.com>
+Date:   Thu Sep 20 16:26:36 2012 -0400
+
+    Make the checks for composite and a8 return FALSE for Xspice
+    
+    They depend on the PCI revision which is not available for Xspice.
+
+commit 7f0b820d919eb944eae201de03b186bd247b0324
+Author: Jeremy White <jwhite@codeweavers.com>
+Date:   Wed Sep 12 10:38:41 2012 -0500
+
+    Only use dixScreenSpecificPrivatesSize if we have a new enough Xorg.
+    
+    This lets us continue to support older Xorg releases.
+    This reverts 4f37cd85 and partially reverts 4a43bd4.
+
+commit fb038eb37906eba9a88e0cb6622a59f06dcc2a68
+Author: Søren Sandmann <ssp@redhat.com>
+Date:   Wed Sep 12 12:54:06 2012 -0400
+
+    Don't issue composite commands or create a8 surfaces when not available
+    
+    When the device or the client are not capable of composite commands or a8
+    surfaces, don't issue these commands.
+
+commit 4f37cd854f128714b8fcf3c0ab8afd72986407a0
+Author: Johannes Obermayr <johannesobermayr@gmx.de>
+Date:   Fri Sep 7 18:05:21 2012 +0200
+
+    Require XServer >= 1.12.99.901 in conjunction with commit 4a43bd4.
+
+commit 7059cff787eef80f3d3345de705e912b292a9f97
+Author: Søren Sandmann <ssp@redhat.com>
+Date:   Thu Jul 12 09:53:31 2012 -0400
+
+    Add Render support
+    
+    This commit adds support for using the new Composite command in spice
+    protocol 0.12.0. This command is similar to the Composite request in
+    the X Render protocol.
+    
+    By implementing the UXA composite stubs, we get acceleration for most
+    common Composite requests, including glyphs.
+
+commit 2fecf3a171e64ca0dad5653ed740409dc5af2edf
+Author: Søren Sandmann <ssp@redhat.com>
+Date:   Tue Dec 20 09:01:17 2011 -0500
+
+    Enable 8 bit pixmaps.
+    
+    a8 surfaces are now supported with the 8BIT_A format in spice, so we
+    can have support 8 bit pixmaps.
+
+commit 37c97620da959d9214abfc760835aa3031d54daa
+Author: Søren Sandmann <ssp@redhat.com>
+Date:   Sun Aug 12 11:03:16 2012 -0400
+
+    Use an RGBA format for 32 bit images
+    
+    With the upcoming Render changes, we can no longer assume that the
+    fourth channel of images is unused.
+
+commit 1e89aab2dc0beb01f43a2397faa05a8cd01a7547
+Author: Søren Sandmann <ssp@redhat.com>
+Date:   Wed Aug 22 15:27:09 2012 -0400
+
+    uxa: Plug leak in uxa_glyphs_via_masks
+    
+    If prepare_composite() fails, we need to free the temporary mask
+    before returning.
+
+commit afd8d20b84a4b4e9b22483e379d594517333e8c7
+Author: Søren Sandmann <ssp@redhat.com>
+Date:   Tue Aug 14 14:20:11 2012 -0400
+
+    uxa-glyphs: don't prepare composite when dest is not offscreen
+    
+    It is possbible for a pixmap to not be in video memory after
+    uxa_clear_pixmap() was called. When this happens, we need to destroy
+    the pixmap and return 1 to indicate that the operation can't be
+    accelerated.
+
+commit e738d00e1fb3cd469f850765e2b42976c2a85764
+Author: Søren Sandmann <ssp@redhat.com>
+Date:   Tue Aug 21 12:56:52 2012 -0400
+
+    Improved support for memory debugging.
+    
+    Make all memory allocation functions take a string that will explain
+    what the memory will be used for. This allows debug print statements
+    to be added to the allocation functions and could later potentially be
+    used for more detailed statistics.
+
+commit 4a43bd436c58dae72f91905657a36158efc68907
+Author: Alon Levy <alevy@redhat.com>
+Date:   Thu Aug 23 18:28:03 2012 +0300
+
+    src/qxl_driver: use the new dixScreenSpecificPrivatesSize
+    
+    xserver introduces a new screen specific privates infrastructure, moving
+    the PRIVATE_PIXBUF over there, breaking qxl that was using the wrong
+    dixPrivatesSize to access it - there is a new array of screen specific/not
+    flags, and PRIVATE_PIXBUF is screen specific.
+    
+    xorg-xserver commit: 9d457f9c55f12106ba44c1c9db59d14f978f0ae8
+    
+    This fix breaks backward compat. The next release will only work with
+    xorg-xserver >= 1.12.99.901
+    
+    RHBZ: 844463
+
+commit 0998bf63cd6c69a98f67094eba4e4edd2bf2a906
+Author: Søren Sandmann Pedersen <ssp@redhat.com>
+Date:   Thu Aug 23 17:24:51 2012 -0400
+
+    Coding style fixes
+    
+    Undo most of the damage from 7f8d3ed05cbe891
+
+commit 5554358fa3baf6616159b65f2f65a138f401aaf8
+Author: Søren Sandmann Pedersen <ssp@redhat.com>
+Date:   Thu Aug 23 17:22:58 2012 -0400
+
+    Bump spice-protocol version requirement to 0.12.0
+
+commit a261befde42d21f3fa9e4a56f121203cc67f3831
+Author: Alon Levy <alevy@redhat.com>
+Date:   Thu Aug 23 17:27:20 2012 +0300
+
+    qxl_driver: Xspice: fix build breakage
+
+commit c1b537fcafc3b9121d8c79cf5e98566158f34ab6
+Author: Marc-André Lureau <marcandre.lureau@gmail.com>
+Date:   Sun Jul 15 09:38:55 2012 -0400
+
+    Return a preferred mode matching the current mode
+    
+    This make gnome-settings-daemon not switch resolution automatically to
+    the largest available.
+
+commit ef4f158a18f03444d358b5ece39db636f76365f9
+Author: Marc-André Lureau <marcandre.lureau@gmail.com>
+Date:   Fri Jul 13 08:20:33 2012 -0400
+
+    Change output status when update monitors config
+
+commit 907d0ff0b0f6934d37fbab4a6889295d70ae3496
+Author: Marc-André Lureau <marcandre.lureau@gmail.com>
+Date:   Sun Jul 8 15:35:23 2012 -0400
+
+    Bypass rrcrtc.c screen size bounds check
+
+commit 557e23e82b6d738fab6fa6bd28b077dd81437b22
+Author: Marc-André Lureau <marcandre.lureau@gmail.com>
+Date:   Fri Jul 6 08:06:10 2012 -0400
+
+    Avoid calling qxl_update_monitors_config() with invalid config
+    
+    During startup, the monitors are not yet enabled/set. and we
+    can avoid sending invalid/transient config.
+
+commit 47b54dcfd9ba2aa78e0f154a288321bb0ff98dce
+Author: Marc-André Lureau <marcandre.lureau@gmail.com>
+Date:   Fri Jul 6 08:05:11 2012 -0400
+
+    Split crtc_set_mode_major()
+    
+    Avoid sending many monitor config changes during qxl_create_desired_modes()
+
+commit 6ee541636b6ed6846074afeb1c32d9e8e6a9bdda
+Author: Marc-André Lureau <marcandre.lureau@gmail.com>
+Date:   Fri Jul 6 08:02:21 2012 -0400
+
+    Add check_crtc() helper, to catch crtc/monitor config errors
+
+commit 7f8d3ed05cbe8914910e49b49ec44df15562bd16
+Author: Marc-André Lureau <marcandre.lureau@gmail.com>
+Date:   Wed Jul 4 14:56:07 2012 -0400
+
+    Coding style improvement
+
+commit f9980eec2287a01a918ff073a45f13d9dc66a1c6
+Author: Marc-André Lureau <marcandre.lureau@gmail.com>
+Date:   Wed Jul 4 14:01:45 2012 -0400
+
+    get rid of one of the gcc warnings
+
+commit 6c63d799a2b0f69485938dbae7975bf913284a23
+Author: Alon Levy <alevy@redhat.com>
+Date:   Wed Jun 27 15:53:41 2012 +0300
+
+    qxl_driver/qxl_initialize_x_modes: remove modes not fitting framebuffer
+
+commit f493653a5e09ae0e0fe1a5f70c3aba1dc9fe86fe
+Author: Alon Levy <alevy@redhat.com>
+Date:   Mon Jun 25 17:09:20 2012 +0300
+
+    qxl_driver: add infra for surface0 resizing
+    
+    Most importantly, don't allow randr resize if it is too large for the
+    currently allocated mspace. Ifdeffed out almost working code for
+    reallocating the primary mspace (qxl->mem).
+
+commit 75619d076bb029b76bed7a885864e191c386aa23
+Author: Alon Levy <alevy@redhat.com>
+Date:   Wed Jun 27 12:11:41 2012 +0300
+
+    add qxl_edid
+    
+    Taken from Virtual Box, following exactly the same logic:
+    gnome-settings-daemon relies on the serial given in the edid to set the
+    resolution to the same one last used on that screen. Since this is not
+    what we want with a virtual machine, we produce a serial that is
+    different for every resolution.
+
+commit de547245e75ea88f780205da072967bff119a636
+Author: Alon Levy <alevy@redhat.com>
+Date:   Mon Jun 25 16:13:29 2012 +0300
+
+    (for later) qxl_ring: add helpers (debugging/unused)
+
+commit b4e3f07474c919af0e484a71fb86c788a703ad8c
+Author: Alon Levy <alevy@redhat.com>
+Date:   Mon Jun 25 16:20:31 2012 +0300
+
+    qxl_driver: qxl_init_randr: limit width/height to 8192, real check done on randr screen resize callback
+
+commit d85e07921dda5e5401a336d415e8deee4b663252
+Author: Marc-André Lureau <marcandre.lureau@gmail.com>
+Date:   Wed Jul 4 11:30:58 2012 -0400
+
+    Add some error message if pci revision < 4
+
+commit e6bfdd035f3692b712496069b9361d010526802a
+Author: Alon Levy <alevy@redhat.com>
+Date:   Wed Jun 27 14:33:46 2012 +0300
+
+    qxl_driver: introduce qxl_crtc, crtc private
+    
+    Additionally prevents disabling of the primary crtc.
+
+commit f106ea65cde61c8f3cf5819d8c127fb7912ec067
+Author: Alon Levy <alevy@redhat.com>
+Date:   Mon Apr 30 18:35:59 2012 +0300
+
+    qxl_driver: implement randr, arbitrary resolution, multiple monitors (big dump)
+    
+    Send a MonitorsUpdate - this should definitely be split into it's own
+    patch.
+    
+    Require revision 4 - this is needed just for MonitorsUpdate, should go
+    with it.
+    
+    Adds new config: OPTION_NUM_HEADS, defaults to 4.
+
+commit 21e5719f74749fa6187539dc0805cb12759d66da
+Author: Alon Levy <alevy@redhat.com>
+Date:   Thu May 24 09:56:06 2012 +0300
+
+    qxl_surface: add download_box_no_update
+
+commit 26b8b350628ec053217715e7a9cb77ff56e4f56e
+Author: Alon Levy <alevy@redhat.com>
+Date:   Thu May 24 09:55:27 2012 +0300
+
+    qxl_surface: normalize surface_send names, add option to surface_destroy to send/not send destroy message
+
+commit 1db72fdf45a3ebbf7f0687671c1def75309b9499
+Author: Alon Levy <alevy@redhat.com>
+Date:   Wed May 23 20:44:51 2012 +0300
+
+    spiceqxl_io_port: mark FLUSH_SURFACES_ASYNC as unimplemented, do half of it
+
+commit 5d78c4cac24ad3830dba1900d5d879551dcbb407
+Author: Alon Levy <alevy@redhat.com>
+Date:   Wed May 23 21:23:09 2012 +0300
+
+    qxl_screen_init: move uxa_resources_init down to after qxl_switch_mode has run
+
+commit f246a251f88dab6a9db83e2d8bbd699e29950459
+Author: Alon Levy <alevy@redhat.com>
+Date:   Wed May 23 21:20:23 2012 +0300
+
+    qxl_close_screen: disable fb access, prevent segfaults in uxa later on
+    
+    I don't have a stacktrace to show any segfault unfortunately.
+
+commit 6dedd9a3f997c0112e71cfd0b28465348dfbbc36
+Author: Alon Levy <alevy@redhat.com>
+Date:   Mon Jun 25 17:08:11 2012 +0300
+
+    qxl_driver: move mspace_set_*_func earlier
+
+commit f838df1589c63fba8e99200238cf0b4e3acac6b1
+Author: Alon Levy <alevy@redhat.com>
+Date:   Tue May 29 17:24:50 2012 +0300
+
+    fix two segfaults in qxl_free_surface
+    
+    Both results from ProcFreePixmap being called in unanticipated
+    circumstances:
+    
+     cache->all_surfaces is NULL
+     surface->host_image is NULL
+    
+    To reproduce the following scripts work, in tandem:
+    
+    create xterms, destroy them
+    chvt
+    
+    ============ xterm_test ============
+    import os
+    import subprocess
+    import time
+    import atexit
+    
+    env = os.environ
+    env['DISPLAY'] = ':0.0'
+    xterms = []
+    
+    def kill_all():
+    	print "killing xterms"
+    	for x in xterms:
+    		x.kill()
+    	del xterms[:]
+    
+    atexit.register(kill_all)
+    while True:
+    	for i in range(10):
+    		xterms.append(subprocess.Popen(['xterm', '+u8']))
+    	time.sleep(1)
+    	kill_all()
+    
+    ============= chvt_test_helper ============
+    XPID=`pgrep Xorg`
+    XTTY=`find /proc/$XPID/fd -lname "/dev/tty*"`
+    XTTY=`readlink $XTTY`
+    XTTY=${XTTY#/dev/tty}
+    echo "chvt 1 (from Xorg)"
+    chvt 1
+    sleep 2
+    echo "chvt $XTTY (to Xorg)"
+    chvt $XTTY
+    
+    ============== chvt_test =================
+    while true; do ./chvt-test ; sleep 3; done
+
+commit c60681561c9cf8317be4e84ac8ac2bb465e13eb0
+Author: Alon Levy <alevy@redhat.com>
+Date:   Mon Jun 11 10:13:39 2012 +0300
+
+    qxl: remove qxl_screen_t->stride
+
+commit 203f579fed5e0c8a9970bfabebc84c7d84578ee5
+Author: Alon Levy <alevy@redhat.com>
+Date:   Wed Jun 27 12:07:16 2012 +0300
+
+    spiceqxl_inputs: don't hide the pointer global typedef
+
+commit 5706a3765bead75999f6d0ca0b17fed6c30ad7ef
+Author: Alon Levy <alevy@redhat.com>
+Date:   Wed Jun 27 11:06:17 2012 +0300
+
+    uxa: fix bad argument type from removed index API change (s/SCREEN_ARG_TYPE/SCRN_ARG_TYPE/)
+
+commit ea676f67d4c8fc863a711fb8630c1afccfa0561c
+Author: Alon Levy <alevy@redhat.com>
+Date:   Wed Jun 27 12:19:01 2012 +0300
+
+    whitespace fix
+
 commit de66207883efc1f32e96907c3e64f17b2bdf6c3e
 Author: Alon Levy <alevy@redhat.com>
 Date:   Sun Jul 8 14:05:08 2012 +0300
diff --git a/debian/changelog b/debian/changelog
index 047084a..3eeda00 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-xserver-xorg-video-qxl (0.0.18~gitde66207-1) UNRELEASED; urgency=low
+xserver-xorg-video-qxl (0.1.0-1) UNRELEASED; urgency=low
 
   * New upstream release.
 

commit d8bb331784792bfd35bf158875b434243f0fe019
Author: Søren Sandmann Pedersen <ssp@redhat.com>
Date:   Thu Sep 20 19:11:55 2012 -0400

    Version bump to 0.1.0

diff --git a/configure.ac b/configure.ac
index 11ef73c..48904a2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-video-qxl],
-        [0.0.17],
+        [0.1.0],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         [xf86-video-qxl])
 AC_CONFIG_SRCDIR([Makefile.am])

commit 6520293e1e1f57bafbcf99592e766f810ce3ad2d
Author: Søren Sandmann Pedersen <ssp@redhat.com>
Date:   Thu Sep 20 16:26:36 2012 -0400

    Make the checks for composite and a8 return FALSE for Xspice
    
    They depend on the PCI revision which is not available for Xspice.

diff --git a/src/qxl_driver.c b/src/qxl_driver.c
index 531c761..f52fec6 100644
--- a/src/qxl_driver.c
+++ b/src/qxl_driver.c
@@ -1385,17 +1385,27 @@ can_accelerate_picture (PicturePtr pict)
 static Bool
 qxl_has_composite (qxl_screen_t *qxl)
 {
+#ifndef XSPICE
     return
 	qxl->pci->revision >= 4			&&
 	QXL_HAS_CAP (qxl, SPICE_DISPLAY_CAP_COMPOSITE);
+#else
+    /* FIXME */
+    return FALSE;
+#endif
 }
 
 static Bool
 qxl_has_a8_surfaces (qxl_screen_t *qxl)
 {
+#ifndef XSPICE
     return
 	qxl->pci->revision >= 4			&&
 	QXL_HAS_CAP (qxl, SPICE_DISPLAY_CAP_A8_SURFACE);
+#else
+    /* FIXME */
+    return FALSE;
+#endif
 }
 
 static Bool

commit 7f0b820d919eb944eae201de03b186bd247b0324
Author: Jeremy White <jwhite@codeweavers.com>
Date:   Wed Sep 12 10:38:41 2012 -0500

    Only use dixScreenSpecificPrivatesSize if we have a new enough Xorg.
    
    This lets us continue to support older Xorg releases.
    This reverts 4f37cd85 and partially reverts 4a43bd4.

diff --git a/configure.ac b/configure.ac
index b8a4b35..11ef73c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -60,7 +60,7 @@ XORG_DRIVER_CHECK_EXT(XV, videoproto)
 XORG_DRIVER_CHECK_EXT(XFreeXDGA, xf86dgaproto)
 
 # Obtain compiler/linker options for the driver dependencies
-PKG_CHECK_MODULES(XORG, [xorg-server >= 1.12.99.901] xproto fontsproto $REQUIRED_MODULES)
+PKG_CHECK_MODULES(XORG, [xorg-server >= 1.0.99.901] xproto fontsproto $REQUIRED_MODULES)
 
 save_CFLAGS="$CFLAGS"
 CFLAGS="$XORG_CFLAGS"
diff --git a/src/qxl_driver.c b/src/qxl_driver.c
index 04a9aa8..531c761 100644
--- a/src/qxl_driver.c
+++ b/src/qxl_driver.c
@@ -1821,10 +1821,14 @@ qxl_screen_init (SCREEN_INIT_ARGS_DECL)
     DamageSetup (pScreen);
     
     /* We need to set totalPixmapSize after setup_uxa and Damage,
-     * as the privatssize is not computed correctly until then
+       as the privates size is not computed correctly until then
      */
+#if (XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1, 12, 99, 901, 0))
+    pScreen->totalPixmapSize = BitmapBytePad ((sizeof (PixmapRec) + dixPrivatesSize (PRIVATE_PIXMAP) ) * 8);
+#else
     pScreen->totalPixmapSize = BitmapBytePad((sizeof(PixmapRec) +
 			    dixScreenSpecificPrivatesSize(pScreen, PRIVATE_PIXMAP) ) * 8);
+#endif
 
     miDCInitialize (pScreen, xf86GetPointerScreenFuncs());
     if (!miCreateDefColormap (pScreen))

commit fb038eb37906eba9a88e0cb6622a59f06dcc2a68
Author: Søren Sandmann <ssp@redhat.com>
Date:   Wed Sep 12 12:54:06 2012 -0400

    Don't issue composite commands or create a8 surfaces when not available
    
    When the device or the client are not capable of composite commands or a8
    surfaces, don't issue these commands.

diff --git a/src/qxl_driver.c b/src/qxl_driver.c
index c7b8486..04a9aa8 100644
--- a/src/qxl_driver.c
+++ b/src/qxl_driver.c
@@ -47,6 +47,7 @@
 #include "qxl.h"
 #include "assert.h"
 #include "qxl_option_helpers.h"
+#include <spice/protocol.h>
 
 #ifdef XSPICE
 #include "spiceqxl_driver.h"
@@ -1378,6 +1379,25 @@ can_accelerate_picture (PicturePtr pict)
     return TRUE;
 }
 
+#define QXL_HAS_CAP(qxl, cap)						\
+    (((qxl)->rom->client_capabilities[(cap) / 8]) & (1 << ((cap) % 8)))
+
+static Bool
+qxl_has_composite (qxl_screen_t *qxl)
+{
+    return
+	qxl->pci->revision >= 4			&&
+	QXL_HAS_CAP (qxl, SPICE_DISPLAY_CAP_COMPOSITE);
+}
+
+static Bool
+qxl_has_a8_surfaces (qxl_screen_t *qxl)
+{
+    return
+	qxl->pci->revision >= 4			&&
+	QXL_HAS_CAP (qxl, SPICE_DISPLAY_CAP_A8_SURFACE);
+}
+
 static Bool
 qxl_check_composite (int op,
 		     PicturePtr pSrcPicture,
@@ -1386,7 +1406,10 @@ qxl_check_composite (int op,
 		     int width, int height)
 {
     int i;
-
+    ScreenPtr pScreen = pDstPicture->pDrawable->pScreen;
+    ScrnInfoPtr pScrn = xf86ScreenToScrn (pScreen);
+    qxl_screen_t *qxl = pScrn->driverPrivate;
+    
     static const int accelerated_ops[] =
     {
 	PictOpClear, PictOpSrc, PictOpDst, PictOpOver, PictOpOverReverse,
@@ -1397,6 +1420,9 @@ qxl_check_composite (int op,
 	PictOpHardLight, PictOpSoftLight, PictOpDifference, PictOpExclusion,
 	PictOpHSLHue, PictOpHSLSaturation, PictOpHSLColor, PictOpHSLLuminosity,
     };
+
+    if (!qxl_has_composite (qxl))
+	return FALSE;
     
     if (!can_accelerate_picture (pSrcPicture)	||
 	!can_accelerate_picture (pMaskPicture)	||
@@ -1502,6 +1528,15 @@ qxl_create_pixmap (ScreenPtr screen, int w, int h, int depth, unsigned usage)
     
     if (uxa_swapped_out (screen))
 	goto fallback;
+
+    if (depth == 8 && !qxl_has_a8_surfaces (qxl))
+    {
+	/* FIXME: When we detect a _change_ in the property of having a8
+	 * surfaces, we should copy all existing a8 surface to host memory
+	 * and then destroy the ones on the device.
+	 */
+	goto fallback;
+    }
     
     surface = qxl_surface_create (qxl->surface_cache, w, h, depth);
     

commit 4f37cd854f128714b8fcf3c0ab8afd72986407a0
Author: Johannes Obermayr <johannesobermayr@gmx.de>
Date:   Fri Sep 7 18:05:21 2012 +0200

    Require XServer >= 1.12.99.901 in conjunction with commit 4a43bd4.

diff --git a/configure.ac b/configure.ac
index 11ef73c..b8a4b35 100644
--- a/configure.ac
+++ b/configure.ac
@@ -60,7 +60,7 @@ XORG_DRIVER_CHECK_EXT(XV, videoproto)
 XORG_DRIVER_CHECK_EXT(XFreeXDGA, xf86dgaproto)
 
 # Obtain compiler/linker options for the driver dependencies
-PKG_CHECK_MODULES(XORG, [xorg-server >= 1.0.99.901] xproto fontsproto $REQUIRED_MODULES)
+PKG_CHECK_MODULES(XORG, [xorg-server >= 1.12.99.901] xproto fontsproto $REQUIRED_MODULES)
 
 save_CFLAGS="$CFLAGS"
 CFLAGS="$XORG_CFLAGS"

commit 7059cff787eef80f3d3345de705e912b292a9f97
Author: Søren Sandmann <ssp@redhat.com>
Date:   Thu Jul 12 09:53:31 2012 -0400

    Add Render support
    
    This commit adds support for using the new Composite command in spice
    protocol 0.12.0. This command is similar to the Composite request in
    the X Render protocol.
    
    By implementing the UXA composite stubs, we get acceleration for most
    common Composite requests, including glyphs.

diff --git a/src/qxl.h b/src/qxl.h
index d976fd5..8494550 100644
--- a/src/qxl.h
+++ b/src/qxl.h
@@ -392,7 +392,21 @@ Bool		    qxl_surface_put_image    (qxl_surface_t *dest,
 					      const char *src, int src_pitch);
 void		    qxl_surface_unref        (surface_cache_t *cache,
 					      uint32_t surface_id);
-					      
+
+/* composite */
+Bool		    qxl_surface_prepare_composite (int op,
+						   PicturePtr	src_picture,
+						   PicturePtr	mask_picture,
+						   PicturePtr   dst_picture,
+						   qxl_surface_t *src,
+						   qxl_surface_t *mask,
+						   qxl_surface_t *dest);
+void		   qxl_surface_composite (qxl_surface_t *dest,
+					  int src_x, int src_y,
+					  int mask_x, int mask_y,
+					  int dst_x, int dst_y,
+					  int width, int height);
+
 #if HAS_DEVPRIVATEKEYREC
 extern DevPrivateKeyRec uxa_pixmap_index;
 #else
diff --git a/src/qxl_driver.c b/src/qxl_driver.c
index 634f181..c7b8486 100644
--- a/src/qxl_driver.c
+++ b/src/qxl_driver.c
@@ -339,14 +339,14 @@ qxl_garbage_collect_internal (qxl_screen_t *qxl, uint64_t id)
     int is_cursor = FALSE;
     int is_surface = FALSE;
     int is_drawable = FALSE;
-
+    
     if ((id & POINTER_MASK) == 1)
 	is_cursor = TRUE;
     else if ((id & POINTER_MASK) == 2)
 	is_surface = TRUE;
     else
 	is_drawable = TRUE;
-
+    
     if (is_cursor && cmd->type == QXL_CURSOR_SET)
     {
 	struct QXLCursor *cursor = (void *)virtual_address (
@@ -358,7 +358,7 @@ qxl_garbage_collect_internal (qxl_screen_t *qxl, uint64_t id)
     {
 	struct QXLImage *image = virtual_address (
 	    qxl, u64_to_pointer (drawable->u.copy.src_bitmap), qxl->main_mem_slot);
-
+	
 	if (image->descriptor.type == SPICE_IMAGE_TYPE_SURFACE)
 	{
 	    qxl_surface_unref (qxl->surface_cache, image->surface_image.surface_id);
@@ -370,16 +370,50 @@ qxl_garbage_collect_internal (qxl_screen_t *qxl, uint64_t id)
 	    qxl_image_destroy (qxl, image);
 	}
     }
+    else if (is_drawable && drawable->type == QXL_DRAW_COMPOSITE)
+    {
+	struct QXLTransform *src_trans, *mask_trans;
+	struct QXLImage *src_img, *mask_img;
+	struct QXLComposite *composite = &drawable->u.composite;
+	
+	/* Source */
+	src_img = virtual_address (
+	    qxl, u64_to_pointer (drawable->u.composite.src), qxl->main_mem_slot);
+	qxl_free (qxl->mem, src_img, "image struct");
+	
+	if (composite->src_transform)
+	{
+	    src_trans = virtual_address (
+		qxl, u64_to_pointer (composite->src_transform), qxl->main_mem_slot);
+	    qxl_free (qxl->mem, src_trans, "transform");
+	}
+	
+	/* Mask */
+	if (drawable->u.composite.mask)
+	{
+	    if (drawable->u.composite.mask_transform)
+	    {
+		mask_trans = virtual_address (
+		    qxl, u64_to_pointer (drawable->u.composite.mask_transform), qxl->main_mem_slot);
+		
+		qxl_free (qxl->mem, mask_trans, "transform");
+	    }
+	    
+	    mask_img = virtual_address (
+		qxl, u64_to_pointer (drawable->u.composite.mask), qxl->main_mem_slot);
+	    qxl_free (qxl->mem, mask_img, "image struct");
+	}
+    }
     else if (is_surface && surface_cmd->type == QXL_SURFACE_CMD_DESTROY)
     {
 	qxl_surface_recycle (qxl->surface_cache, surface_cmd->surface_id);
 	qxl_surface_cache_sanity_check (qxl->surface_cache);
     }
-	    
+    
     id = info->next;
-	    
+    
     qxl_free (qxl->mem, info, "command");
-
+    
     return id;
 }
 
@@ -1198,12 +1232,6 @@ int uxa_pixmap_index;
 #endif
 
 static Bool
-unaccel (void)
-{
-    return FALSE;
-}
-
-static Bool
 qxl_prepare_access (PixmapPtr pixmap, RegionPtr region, uxa_access_t access)
 {
     return qxl_surface_prepare_access (get_surface (pixmap),
@@ -1312,6 +1340,131 @@ qxl_done_copy (PixmapPtr dest)
 {
 }
 
+/*
+ * Composite
+ */
+static Bool
+can_accelerate_picture (PicturePtr pict)
+{
+    if (!pict)
+	return TRUE;
+
+    if (pict->format != PICT_a8r8g8b8		&&
+	pict->format != PICT_x8r8g8b8		&&
+	pict->format != PICT_a8)
+    {
+	return FALSE;
+    }
+
+    if (!pict->pDrawable)
+	return FALSE;
+
+    if (pict->transform)
+    {
+	if (pict->transform->matrix[2][0] != 0	||
+	    pict->transform->matrix[2][1] != 0	||
+	    pict->transform->matrix[2][2] != pixman_int_to_fixed (1))
+	{
+	    return FALSE;
+	}
+    }
+
+    if (pict->filter != PictFilterBilinear	&&
+	pict->filter != PictFilterNearest)
+    {
+	return FALSE;
+    }
+    
+    return TRUE;
+}
+
+static Bool
+qxl_check_composite (int op,
+		     PicturePtr pSrcPicture,
+		     PicturePtr pMaskPicture,
+		     PicturePtr pDstPicture,
+		     int width, int height)
+{
+    int i;
+
+    static const int accelerated_ops[] =
+    {
+	PictOpClear, PictOpSrc, PictOpDst, PictOpOver, PictOpOverReverse,
+	PictOpIn, PictOpInReverse, PictOpOut, PictOpOutReverse,
+	PictOpAtop, PictOpAtopReverse, PictOpXor, PictOpAdd,
+	PictOpSaturate, PictOpMultiply, PictOpScreen, PictOpOverlay,
+	PictOpDarken, PictOpLighten, PictOpColorDodge, PictOpColorBurn,
+	PictOpHardLight, PictOpSoftLight, PictOpDifference, PictOpExclusion,
+	PictOpHSLHue, PictOpHSLSaturation, PictOpHSLColor, PictOpHSLLuminosity,
+    };
+    
+    if (!can_accelerate_picture (pSrcPicture)	||
+	!can_accelerate_picture (pMaskPicture)	||
+	!can_accelerate_picture (pDstPicture))
+    {
+	return FALSE;
+    }
+
+    for (i = 0; i < sizeof (accelerated_ops) / sizeof (accelerated_ops[0]); ++i)
+    {
+	if (accelerated_ops[i] == op)
+	    goto found;
+    }
+    return FALSE;
+
+found:
+    return TRUE;
+}
+
+static Bool
+qxl_check_composite_target (PixmapPtr pixmap)
+{
+    return TRUE;
+}
+
+static Bool
+qxl_check_composite_texture (ScreenPtr screen,
+			     PicturePtr pPicture)
+{
+    return TRUE;
+}
+
+static Bool
+qxl_prepare_composite (int op,
+		       PicturePtr pSrcPicture,
+		       PicturePtr pMaskPicture,
+		       PicturePtr pDstPicture,
+		       PixmapPtr pSrc,
+		       PixmapPtr pMask,
+		       PixmapPtr pDst)
+{
+    return qxl_surface_prepare_composite (
+	op, pSrcPicture, pMaskPicture, pDstPicture,
+	get_surface (pSrc),
+	pMask? get_surface (pMask) : NULL,
+	get_surface (pDst));
+}
+
+static void
+qxl_composite (PixmapPtr pDst,
+	       int src_x, int src_y,
+	       int mask_x, int mask_y,
+	       int dst_x, int dst_y,
+	       int width, int height)
+{
+    qxl_surface_composite (
+	get_surface (pDst),
+	src_x, src_y,
+	mask_x, mask_y,
+	dst_x, dst_y, width, height);
+}
+
+static void
+qxl_done_composite (PixmapPtr pDst)
+{
+    ;
+}
+
 static Bool
 qxl_put_image (PixmapPtr pDst, int x, int y, int w, int h,
                char *src, int src_pitch)
@@ -1453,12 +1606,12 @@ setup_uxa (qxl_screen_t *qxl, ScreenPtr screen)
     qxl->uxa->done_copy = qxl_done_copy;
     
     /* Composite */
-    qxl->uxa->check_composite = (typeof (qxl->uxa->check_composite))unaccel;
-    qxl->uxa->check_composite_target = (typeof (qxl->uxa->check_composite_target))unaccel;
-    qxl->uxa->check_composite_texture = (typeof (qxl->uxa->check_composite_texture))unaccel;
-    qxl->uxa->prepare_composite = (typeof (qxl->uxa->prepare_composite))unaccel;
-    qxl->uxa->composite = (typeof (qxl->uxa->composite))unaccel;
-    qxl->uxa->done_composite = (typeof (qxl->uxa->done_composite))unaccel;
+    qxl->uxa->check_composite = qxl_check_composite;
+    qxl->uxa->check_composite_target = qxl_check_composite_target;
+    qxl->uxa->check_composite_texture = qxl_check_composite_texture;
+    qxl->uxa->prepare_composite = qxl_prepare_composite;
+    qxl->uxa->composite = qxl_composite;
+    qxl->uxa->done_composite = qxl_done_composite;
     
     /* PutImage */
     qxl->uxa->put_image = qxl_put_image;
@@ -1625,6 +1778,10 @@ qxl_screen_init (SCREEN_INIT_ARGS_DECL)
     pScreen->SaveScreen = qxl_blank_screen;
     
     setup_uxa (qxl, pScreen);
+
+#if 0
+    uxa_set_fallback_debug(pScreen, TRUE);
+#endif
     
     DamageSetup (pScreen);
     
diff --git a/src/qxl_image.c b/src/qxl_image.c
index 4d9bc77..fcecf8a 100644
--- a/src/qxl_image.c
+++ b/src/qxl_image.c
@@ -138,7 +138,7 @@ qxl_image_create (qxl_screen_t *qxl, const uint8_t *data,
 	struct QXLImage *image;
 	struct QXLDataChunk *head;
 	struct QXLDataChunk *tail;
-	int dest_stride = width * Bpp;
+	int dest_stride = (width * Bpp + 3) & (~3);
 	int h;
 
 	data += y * stride + x * Bpp;
@@ -216,7 +216,7 @@ qxl_image_create (qxl_screen_t *qxl, const uint8_t *data,
 	image->bitmap.flags = SPICE_BITMAP_FLAGS_TOP_DOWN;
 	image->bitmap.x = width;
 	image->bitmap.y = height;
-	image->bitmap.stride = width * Bpp;
+	image->bitmap.stride = dest_stride;
 	image->bitmap.palette = 0;
 	image->bitmap.data = physical_address (qxl, head, qxl->main_mem_slot);
 
diff --git a/src/qxl_surface.c b/src/qxl_surface.c
index 0169350..e88675f 100644
--- a/src/qxl_surface.c
+++ b/src/qxl_surface.c
@@ -89,6 +89,17 @@ struct qxl_surface_t
     {
 	qxl_surface_t *copy_src;
 	Pixel	       solid_pixel;


Reply to: