[xorg-x11-drv-qxl] Rebase to latest upstream release Enable building of the Xspice X-server and put it in its own xorg-

Hans de Goede jwrdegoede at fedoraproject.org
Tue Sep 13 11:54:25 UTC 2011


commit d5af0afaa41b4bdc0313732eaf111a77b3068f42
Author: Hans de Goede <hdegoede at redhat.com>
Date:   Tue Sep 13 13:53:43 2011 +0200

    Rebase to latest upstream release
    Enable building of the Xspice X-server and put it in its own
    xorg-x11-server-Xspice package

 ...6.0-fix-cast-unmatching-function-pointers.patch |   35 -
 0001-xspice-add-missing-tls-port-default.patch     |   25 +
 ...spice-use-consistent-and-vnc-default-port.patch |   36 +
 ...remove-unused-variable-found-by-gcc-4.6.0.patch |   33 -
 0003-build-add-spice-protocol-dep.patch            |   39 -
 ...xl.xorg.conf.example-typo-and-order-fixes.patch |   70 ++
 ...devices-classes-when-matching-PCI-devices.patch |   36 +
 0004-use-spice-protocol-qxl_dev.h-enums.patch      |  215 ----
 ...save-the-VGA-fonts-for-the-primary-device.patch |   40 +
 ...use-structs-from-spice-protocol-qxl_dev.h.patch | 1112 --------------------
 0006-s-qxl_ram_header-QXLRam.patch                 |  161 ---
 ...ke-cgdb-non-magical-use-XSPICE_ENABLE_GDB.patch |   33 +
 ...load-read-only-surfaces-after-a-software-.patch |  107 --
 0007-rename-xspice-Xspice.patch                    |  297 ++++++
 ...dd-old-driver-in-as-a-compatibility-layer.patch |   18 +-
 ...-upload-of-images-after-software-fallback.patch |   60 --
 ...-Generate-tighter-damage-for-PolyFillRect.patch |   61 --
 ...nk-in-the-compat-driver-various-renamings.patch |   25 +-
 0010-Fix-VT-switching.patch                        |  133 ---
 ...init-is-called-without-a-confScreen-just-.patch |   31 -
 xorg-x11-drv-qxl.spec                              |   93 ++-
 21 files changed, 624 insertions(+), 2036 deletions(-)
---
diff --git a/0001-xspice-add-missing-tls-port-default.patch b/0001-xspice-add-missing-tls-port-default.patch
new file mode 100644
index 0000000..e4f3e50
--- /dev/null
+++ b/0001-xspice-add-missing-tls-port-default.patch
@@ -0,0 +1,25 @@
+From f637c79f121348b02b0fdae7613675acda380815 Mon Sep 17 00:00:00 2001
+From: Alon Levy <alevy at redhat.com>
+Date: Sat, 23 Jul 2011 20:07:04 +0300
+Subject: [PATCH xf86-video-qxl 01/10] xspice: add missing --tls-port default
+
+---
+ scripts/xspice |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/scripts/xspice b/scripts/xspice
+index f411619..3c6b49a 100755
+--- a/scripts/xspice
++++ b/scripts/xspice
+@@ -45,7 +45,7 @@ parser.add_argument('--config', default='spiceqxl.xorg.conf')
+ # Don't use any options that are already used by Xorg (unless we must)
+ # specifically, don't use -p and -s.
+ parser.add_argument('--port', type=int, help='standard spice port')
+-parser.add_argument('--tls-port', type=int, help='spice tls port')
++parser.add_argument('--tls-port', type=int, help='spice tls port', default=0)
+ add_boolean('--disable-ticketing', help="do not require a client password")
+ add_boolean('--sasl', help="enable sasl")
+ parser.add_argument('--x509-dir', help="x509 directory for tls", default='.')
+-- 
+1.7.6.2
+
diff --git a/0002-README.xspice-use-consistent-and-vnc-default-port.patch b/0002-README.xspice-use-consistent-and-vnc-default-port.patch
new file mode 100644
index 0000000..61e5afb
--- /dev/null
+++ b/0002-README.xspice-use-consistent-and-vnc-default-port.patch
@@ -0,0 +1,36 @@
+From c65af64529a7abd99bd175e1e49fb98f289fb55a Mon Sep 17 00:00:00 2001
+From: Alon Levy <alevy at redhat.com>
+Date: Sat, 23 Jul 2011 20:08:35 +0300
+Subject: [PATCH xf86-video-qxl 02/10] README.xspice: use consistent and vnc
+ default port
+
+---
+ README.xspice |    8 ++++----
+ 1 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/README.xspice b/README.xspice
+index 6efd351..0b43553 100644
+--- a/README.xspice
++++ b/README.xspice
+@@ -101,14 +101,14 @@ cp -R /usr/share/X11/xkb $TEST/share/X11
+ $XORG is either your own built $TEST/bin/Xorg or just the default Xorg
+ 
+ Run server with:
+-export XSPICE_PORT=6000
++export XSPICE_PORT=5900
+ $XORG -noreset -config spiceqxl.xorg.conf :3.0
+ 
+ Or equivalently:
+-./xspice --port 6000 :3.0
++./xspice --port 5900 :3.0
+ 
+ Run X clients as usual by setting DISPLAY=:3.0
+-Run spice client with port 5912 (hardcoded currently):
+ 
+-spicec -h localhost -p 5912
++Run a spice client:
++spicec -h localhost -p 5900
+ 
+-- 
+1.7.6.2
+
diff --git a/0003-spiceqxl.xorg.conf.example-typo-and-order-fixes.patch b/0003-spiceqxl.xorg.conf.example-typo-and-order-fixes.patch
new file mode 100644
index 0000000..1e7f960
--- /dev/null
+++ b/0003-spiceqxl.xorg.conf.example-typo-and-order-fixes.patch
@@ -0,0 +1,70 @@
+From 3b851a37a7030688fc8ee361167b3567e6623edf Mon Sep 17 00:00:00 2001
+From: Alon Levy <alevy at redhat.com>
+Date: Sat, 23 Jul 2011 20:31:11 +0300
+Subject: [PATCH xf86-video-qxl 03/10] spiceqxl.xorg.conf.example: typo and
+ order fixes
+
+---
+ examples/spiceqxl.xorg.conf.example |   32 ++++++++++++++++----------------
+ 1 files changed, 16 insertions(+), 16 deletions(-)
+
+diff --git a/examples/spiceqxl.xorg.conf.example b/examples/spiceqxl.xorg.conf.example
+index 5e37f9c..2e42e76 100644
+--- a/examples/spiceqxl.xorg.conf.example
++++ b/examples/spiceqxl.xorg.conf.example
+@@ -11,7 +11,7 @@ Section "Device"
+     # either here or via environment varialbes or via xspice --port or --tls-port
+     #Option "SpiceTlsPort" "5901"
+     
+-    # Listen to a specific inteface. Default is to listen to all (0.0.0.0)
++    # Listen to a specific interface. Default is to listen to all (0.0.0.0)
+     #Option "SpiceAddr" ""
+ 
+     # Enable usage of SASL supported by spice-gtk client. Not required,
+@@ -32,6 +32,21 @@ Section "Device"
+     # Set spice server key file.
+     #Option "SpiceX509KeyFile" ""
+ 
++    # Set cert file location.
++    #Option "SpiceX509CertFile" ""
++
++    # Set key file password.
++    #Option "SpiceX509KeyPassword" ""
++
++    # Set tls ciphers used.
++    #Option "SpiceTlsCiphers" ""
++
++    # Set cacert file.
++    #Option "SpiceCacertFile" ""
++
++    # Set dh file used.
++    #Option "SpiceDhFile" ""
++
+     # Set streaming video method. Options are filter, off, all
+     # defaults to filter.
+     #Option "SpiceStreamingVideo" ""
+@@ -55,21 +70,6 @@ Section "Device"
+     # Set to true to only listen on ipv6 interfaces.
+     # defaults to false.
+     #Option "SpiceIPV6Only" ""
+-
+-    # Set cert file location.
+-    #Option "SpiceX509CertFile" ""
+-
+-    # Set key file password.
+-    #Option "SpiceX509KeyPassword" ""
+-
+-    # Set tls ciphers used.
+-    #Option "SpiceTlsCiphers" ""
+-
+-    # Set cacert file.
+-    #Option "SpiceCacertFile" ""
+-
+-    # Set dh file used.
+-    #Option "SpiceDhFile" ""
+ EndSection
+ 
+ Section "InputDevice"
+-- 
+1.7.6.2
+
diff --git a/0004-Ignore-devices-classes-when-matching-PCI-devices.patch b/0004-Ignore-devices-classes-when-matching-PCI-devices.patch
new file mode 100644
index 0000000..8c49884
--- /dev/null
+++ b/0004-Ignore-devices-classes-when-matching-PCI-devices.patch
@@ -0,0 +1,36 @@
+From 4a040532492b212e05f5375994adcfdd171e0410 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?S=C3=B8ren=20Sandmann=20Pedersen?= <ssp at redhat.com>
+Date: Tue, 26 Jul 2011 13:44:30 -0400
+Subject: [PATCH xf86-video-qxl 04/10] Ignore devices classes when matching
+ PCI devices
+
+A device_class of 0x00030000 means we will only match VGA compatible
+controllers, but when multiple devices are added to the VM, the
+additional ones will have subclass 0x8000 ("Display controller").
+
+We need to be able to drive those too.
+---
+ src/qxl_driver.c |    4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/qxl_driver.c b/src/qxl_driver.c
+index 2e5a9d6..f3768f7 100644
+--- a/src/qxl_driver.c
++++ b/src/qxl_driver.c
+@@ -1489,11 +1489,11 @@ enum qxl_class
+ static const struct pci_id_match qxl_device_match[] = {
+     {
+ 	PCI_VENDOR_RED_HAT, PCI_CHIP_QXL_0100, PCI_MATCH_ANY, PCI_MATCH_ANY,
+-	0x00030000, 0x00ffffff, CHIP_QXL_1
++	0x00000000, 0x00000000, CHIP_QXL_1
+     },
+     {
+ 	PCI_VENDOR_RED_HAT, PCI_CHIP_QXL_01FF, PCI_MATCH_ANY, PCI_MATCH_ANY,
+-	0x00030000, 0x00ffffff, CHIP_QXL_1
++	0x00000000, 0x00000000, CHIP_QXL_1
+     },
+ 
+     { 0 },
+-- 
+1.7.6.2
+
diff --git a/0005-Only-save-the-VGA-fonts-for-the-primary-device.patch b/0005-Only-save-the-VGA-fonts-for-the-primary-device.patch
new file mode 100644
index 0000000..1c4a87b
--- /dev/null
+++ b/0005-Only-save-the-VGA-fonts-for-the-primary-device.patch
@@ -0,0 +1,40 @@
+From b89a0b11b1133bf2991580203867830747ad4de1 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?S=C3=B8ren=20Sandmann=20Pedersen?= <ssp at localhost.localdomain>
+Date: Sun, 21 Aug 2011 10:11:48 -0400
+Subject: [PATCH xf86-video-qxl 05/10] Only save the VGA fonts for the primary
+ device.
+
+Otherwise, if we try to save the VGA fonts when initializing a
+non-primary device, the saving will be routed to the primary one
+putting it into VGA mode, which then locks up.
+---
+ src/qxl_driver.c |    6 ++++--
+ 1 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/src/qxl_driver.c b/src/qxl_driver.c
+index f3768f7..428735a 100644
+--- a/src/qxl_driver.c
++++ b/src/qxl_driver.c
+@@ -409,7 +409,8 @@ qxl_save_state(ScrnInfoPtr pScrn)
+ {
+     qxl_screen_t *qxl = pScrn->driverPrivate;
+ 
+-    vgaHWSaveFonts(pScrn, &qxl->vgaRegs);
++    if (xf86IsPrimaryPci (qxl->pci))
++        vgaHWSaveFonts(pScrn, &qxl->vgaRegs);
+ }
+ 
+ static void
+@@ -417,7 +418,8 @@ qxl_restore_state(ScrnInfoPtr pScrn)
+ {
+     qxl_screen_t *qxl = pScrn->driverPrivate;
+ 
+-    vgaHWRestoreFonts(pScrn, &qxl->vgaRegs);
++    if (xf86IsPrimaryPci (qxl->pci))
++        vgaHWRestoreFonts(pScrn, &qxl->vgaRegs);
+ }
+ #endif /* XSPICE */
+ 
+-- 
+1.7.6.2
+
diff --git a/0006-xspice-make-cgdb-non-magical-use-XSPICE_ENABLE_GDB.patch b/0006-xspice-make-cgdb-non-magical-use-XSPICE_ENABLE_GDB.patch
new file mode 100644
index 0000000..34f9c9b
--- /dev/null
+++ b/0006-xspice-make-cgdb-non-magical-use-XSPICE_ENABLE_GDB.patch
@@ -0,0 +1,33 @@
+From 38cedb7ad42f11fe451507d82922d4e94cdcf15d Mon Sep 17 00:00:00 2001
+From: Alon Levy <alevy at redhat.com>
+Date: Mon, 1 Aug 2011 19:17:48 +0300
+Subject: [PATCH xf86-video-qxl 06/10] xspice: make --cgdb non magical, use
+ XSPICE_ENABLE_GDB
+
+---
+ scripts/xspice |    9 ++++++---
+ 1 files changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/scripts/xspice b/scripts/xspice
+index 3c6b49a..4ebd8e8 100755
+--- a/scripts/xspice
++++ b/scripts/xspice
+@@ -27,9 +27,12 @@ def which(x):
+             return candidate
+     return None
+ 
+-cgdb = which('cgdb') if os.path.exists(
+-    os.path.join(os.path.dirname(sys.modules[__name__].__file__),
+-                 'Makefile.am')) else None
++if 'XSPICE_ENABLE_GDB' in os.environ:
++    cgdb = which('cgdb')
++    if not cgdb:
++        cgdb = which('gdb')
++else:
++    cgdb = None
+ 
+ def add_boolean(flag, *args, **kw):
+     parser.add_argument(flag, action='store_const', const='1', default='0',
+-- 
+1.7.6.2
+
diff --git a/0007-rename-xspice-Xspice.patch b/0007-rename-xspice-Xspice.patch
new file mode 100644
index 0000000..8128641
--- /dev/null
+++ b/0007-rename-xspice-Xspice.patch
@@ -0,0 +1,297 @@
+From 0d3a9a626402ef0cc52430fe4cb35d7b5da68536 Mon Sep 17 00:00:00 2001
+From: Alon Levy <alevy at redhat.com>
+Date: Tue, 2 Aug 2011 21:31:11 +0300
+Subject: [PATCH xf86-video-qxl 07/10] rename xspice Xspice
+
+---
+ scripts/Makefile.am |    4 +-
+ scripts/Xspice      |  128 +++++++++++++++++++++++++++++++++++++++++++++++++++
+ scripts/xspice      |  128 ---------------------------------------------------
+ 3 files changed, 130 insertions(+), 130 deletions(-)
+ create mode 100755 scripts/Xspice
+ delete mode 100755 scripts/xspice
+
+diff --git a/scripts/Makefile.am b/scripts/Makefile.am
+index c03b573..68b0c29 100644
+--- a/scripts/Makefile.am
++++ b/scripts/Makefile.am
+@@ -19,6 +19,6 @@
+ #  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ 
+ if BUILD_XSPICE
+-bin_SCRIPTS = xspice
++bin_SCRIPTS = Xspice
+ endif
+-EXTRA_DIST = xspice
++EXTRA_DIST = Xspice
+diff --git a/scripts/Xspice b/scripts/Xspice
+new file mode 100755
+index 0000000..d625ea2
+--- /dev/null
++++ b/scripts/Xspice
+@@ -0,0 +1,128 @@
++#!/usr/bin/python
++
++"""
++Xspice
++
++Xspice is a standard X server that is also a Spice server.
++
++It is implemented as a module with video, mouse and keyboard drivers.
++
++The video driver is mostly the same code as the qxl guest driver, hence
++Xspice is kept in the same repository. It can also be used to debug the qxl
++driver.
++
++Xspice (this executable) will set a bunch of environment variables that are
++used by spiceqxl_drv.so, and then exec Xorg, giving it the default config file,
++which can be overridden as well.
++"""
++
++import argparse
++import os
++import sys
++
++def which(x):
++    for p in os.environ['PATH'].split(':'):
++        candidate = os.path.join(p, x)
++        if os.path.exists(candidate):
++            return candidate
++    return None
++
++if 'XSPICE_ENABLE_GDB' in os.environ:
++    cgdb = which('cgdb')
++    if not cgdb:
++        cgdb = which('gdb')
++else:
++    cgdb = None
++
++def add_boolean(flag, *args, **kw):
++    parser.add_argument(flag, action='store_const', const='1', default='0',
++                        *args, **kw)
++
++wan_compression_options = ['auto', 'never', 'always']
++parser = argparse.ArgumentParser("Xspice",
++    description="X and Spice server. example usage: Xspice --port 5900 --disable-ticketing :1.0",
++    usage="Xspice [Xspice and Xorg options intermixed]",
++    epilog="Any options not parsed by Xspice get passed to Xorg as is.")
++parser.add_argument('--xorg', default=which('Xorg'))
++parser.add_argument('--config', default='spiceqxl.xorg.conf')
++# Don't use any options that are already used by Xorg (unless we must)
++# specifically, don't use -p and -s.
++parser.add_argument('--port', type=int, help='standard spice port')
++parser.add_argument('--tls-port', type=int, help='spice tls port', default=0)
++add_boolean('--disable-ticketing', help="do not require a client password")
++add_boolean('--sasl', help="enable sasl")
++parser.add_argument('--x509-dir', help="x509 directory for tls", default='.')
++parser.add_argument('--cacert-file', help="ca certificate file for tls")
++parser.add_argument('--x509-cert-file', help="server certificate file for tls")
++parser.add_argument('--x509-key-file', help="server key file for tls")
++parser.add_argument('--x509-key-password', help="key file password for tls")
++parser.add_argument('--tls-ciphers')
++parser.add_argument('--dh-file')
++parser.add_argument('--password', help="set password required to connect to server")
++parser.add_argument('--image-compression',
++                    choices = ['off', 'auto_glz', 'auto_lz', 'quic',
++                               'glz', 'lz'],
++                    default='auto_glz', help='auto_glz by default')
++parser.add_argument('--jpeg-wan-compression',
++                    choices=wan_compression_options,
++                    default='auto', help='auto by default')
++parser.add_argument('--zlib-glz-wan-compression',
++                    choices=wan_compression_options,
++                    default='auto', help='auto by default')
++# TODO - sound support
++#parser.add_argument('--playback-compression', choices=['0', '1'], default='1', help='enabled by default')
++parser.add_argument('--streaming-video', choices=['off', 'all', 'filter'],
++                    default='filter', help='filter by default')
++add_boolean('--ipv4-only')
++add_boolean('--ipv6-only')
++
++if cgdb:
++    parser.add_argument('--cgdb', action='store_true', default=False)
++# TODO:
++#add_boolean(parser, '--agent-mouse')
++
++args, xorg_args = parser.parse_known_args(sys.argv[1:])
++
++def tls_files(args):
++    if args.tls_port == 0:
++        return {}
++    files = {}
++    for k, var in [('ca-cert', 'cacert_file'),
++                   ('server-key', 'x509_key_file'),
++                   ('server-cert', 'x509_cert_file')]:
++        files[k] = os.path.join(args.x509_dir, k + '.pem')
++        if getattr(args, var):
++            files[k] = getattr(args, var)
++    return files
++
++# XXX spice-server aborts if it can't find the certificates - avoid by checking
++# ourselves. This isn't exhaustive - if the server key requires a password
++# and it isn't supplied spice will still abort, and Xorg with it.
++for key, filename in tls_files(args).items():
++    if not os.path.exists(filename):
++        print "missing %s - %s does not exist" % (key, filename)
++        sys.exit(1)
++
++def error(msg, exit_code=1):
++    print "Xspice: %s" % msg
++    sys.exit(exit_code)
++
++if not args.xorg:
++    error("Xorg missing")
++
++var_args = ['port', 'tls_port', 'disable_ticketing',
++    'x509_dir', 'sasl', 'cacert_file', 'x509_cert_file',
++    'x509_key_file', 'x509_key_password',
++    'tls_ciphers', 'dh_file', 'password', 'image_compression',
++    'jpeg_wan_compression', 'zlib_glz_wan_compression',
++    'streaming_video']
++for arg in var_args:
++    if getattr(args, arg):
++        os.environ['XSPICE_' + arg.upper()] = str(getattr(args, arg))
++
++exec_args = [args.xorg, '-config', args.config]
++if cgdb and args.cgdb:
++    exec_args = [cgdb, '--args'] + exec_args
++    args.xorg = cgdb
++
++os.execv(args.xorg, exec_args + xorg_args)
+diff --git a/scripts/xspice b/scripts/xspice
+deleted file mode 100755
+index 4ebd8e8..0000000
+--- a/scripts/xspice
++++ /dev/null
+@@ -1,128 +0,0 @@
+-#!/usr/bin/python
+-
+-"""
+-xspice
+-
+-xspice is a standard X server that is also a Spice server.
+-
+-It is implemented as a module with video, mouse and keyboard drivers.
+-
+-The video driver is mostly the same code as the qxl guest driver, hence
+-xspice is kept in the same repository. It can also be used to debug the qxl
+-driver.
+-
+-xspice (this executable) will set a bunch of environment variables that are
+-used by spiceqxl_drv.so, and then exec Xorg, giving it the default config file,
+-which can be overridden as well.
+-"""
+-
+-import argparse
+-import os
+-import sys
+-
+-def which(x):
+-    for p in os.environ['PATH'].split(':'):
+-        candidate = os.path.join(p, x)
+-        if os.path.exists(candidate):
+-            return candidate
+-    return None
+-
+-if 'XSPICE_ENABLE_GDB' in os.environ:
+-    cgdb = which('cgdb')
+-    if not cgdb:
+-        cgdb = which('gdb')
+-else:
+-    cgdb = None
+-
+-def add_boolean(flag, *args, **kw):
+-    parser.add_argument(flag, action='store_const', const='1', default='0',
+-                        *args, **kw)
+-
+-wan_compression_options = ['auto', 'never', 'always']
+-parser = argparse.ArgumentParser("xspice",
+-    description="X and Spice server. example usage: xspice --port 5900 --disable-ticketing :1.0",
+-    usage="xspice [xspice and Xorg options intermixed]",
+-    epilog="Any options not parsed by xspice get passed to Xorg as is.")
+-parser.add_argument('--xorg', default=which('Xorg'))
+-parser.add_argument('--config', default='spiceqxl.xorg.conf')
+-# Don't use any options that are already used by Xorg (unless we must)
+-# specifically, don't use -p and -s.
+-parser.add_argument('--port', type=int, help='standard spice port')
+-parser.add_argument('--tls-port', type=int, help='spice tls port', default=0)
+-add_boolean('--disable-ticketing', help="do not require a client password")
+-add_boolean('--sasl', help="enable sasl")
+-parser.add_argument('--x509-dir', help="x509 directory for tls", default='.')
+-parser.add_argument('--cacert-file', help="ca certificate file for tls")
+-parser.add_argument('--x509-cert-file', help="server certificate file for tls")
+-parser.add_argument('--x509-key-file', help="server key file for tls")
+-parser.add_argument('--x509-key-password', help="key file password for tls")
+-parser.add_argument('--tls-ciphers')
+-parser.add_argument('--dh-file')
+-parser.add_argument('--password', help="set password required to connect to server")
+-parser.add_argument('--image-compression',
+-                    choices = ['off', 'auto_glz', 'auto_lz', 'quic',
+-                               'glz', 'lz'],
+-                    default='auto_glz', help='auto_glz by default')
+-parser.add_argument('--jpeg-wan-compression',
+-                    choices=wan_compression_options,
+-                    default='auto', help='auto by default')
+-parser.add_argument('--zlib-glz-wan-compression',
+-                    choices=wan_compression_options,
+-                    default='auto', help='auto by default')
+-# TODO - sound support
+-#parser.add_argument('--playback-compression', choices=['0', '1'], default='1', help='enabled by default')
+-parser.add_argument('--streaming-video', choices=['off', 'all', 'filter'],
+-                    default='filter', help='filter by default')
+-add_boolean('--ipv4-only')
+-add_boolean('--ipv6-only')
+-
+-if cgdb:
+-    parser.add_argument('--cgdb', action='store_true', default=False)
+-# TODO:
+-#add_boolean(parser, '--agent-mouse')
+-
+-args, xorg_args = parser.parse_known_args(sys.argv[1:])
+-
+-def tls_files(args):
+-    if args.tls_port == 0:
+-        return {}
+-    files = {}
+-    for k, var in [('ca-cert', 'cacert_file'),
+-                   ('server-key', 'x509_key_file'),
+-                   ('server-cert', 'x509_cert_file')]:
+-        files[k] = os.path.join(args.x509_dir, k + '.pem')
+-        if getattr(args, var):
+-            files[k] = getattr(args, var)
+-    return files
+-
+-# XXX spice-server aborts if it can't find the certificates - avoid by checking
+-# ourselves. This isn't exhaustive - if the server key requires a password
+-# and it isn't supplied spice will still abort, and Xorg with it.
+-for key, filename in tls_files(args).items():
+-    if not os.path.exists(filename):
+-        print "missing %s - %s does not exist" % (key, filename)
+-        sys.exit(1)
+-
+-def error(msg, exit_code=1):
+-    print "xspice: %s" % msg
+-    sys.exit(exit_code)
+-
+-if not args.xorg:
+-    error("Xorg missing")
+-
+-var_args = ['port', 'tls_port', 'disable_ticketing',
+-    'x509_dir', 'sasl', 'cacert_file', 'x509_cert_file',
+-    'x509_key_file', 'x509_key_password',
+-    'tls_ciphers', 'dh_file', 'password', 'image_compression',
+-    'jpeg_wan_compression', 'zlib_glz_wan_compression',
+-    'streaming_video']
+-for arg in var_args:
+-    if getattr(args, arg):
+-        os.environ['XSPICE_' + arg.upper()] = str(getattr(args, arg))
+-
+-exec_args = [args.xorg, '-config', args.config]
+-if cgdb and args.cgdb:
+-    exec_args = [cgdb, '--args'] + exec_args
+-    args.xorg = cgdb
+-
+-os.execv(args.xorg, exec_args + xorg_args)
+-- 
+1.7.6.2
+
diff --git a/0011-Add-old-driver-in-as-a-compatibility-layer.patch b/0008-Add-old-driver-in-as-a-compatibility-layer.patch
similarity index 99%
rename from 0011-Add-old-driver-in-as-a-compatibility-layer.patch
rename to 0008-Add-old-driver-in-as-a-compatibility-layer.patch
index 74f67d6..53326f7 100644
--- a/0011-Add-old-driver-in-as-a-compatibility-layer.patch
+++ b/0008-Add-old-driver-in-as-a-compatibility-layer.patch
@@ -1,7 +1,8 @@
-From 60ac65a18e9cc7cf9cf78013dffd2005682f32aa Mon Sep 17 00:00:00 2001
+From 904d4856dd019e32e16fc97c58548c47691f16cf Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?S=C3=B8ren=20Sandmann=20Pedersen?= <ssp at redhat.com>
 Date: Thu, 3 Feb 2011 05:53:01 -0500
-Subject: [PATCH 11/13] Add old driver in as a compatibility layer
+Subject: [PATCH xf86-video-qxl 08/10] Add old driver in as a compatibility
+ layer
 
 ---
  configure.ac                   |    1 +
@@ -27,18 +28,19 @@ Subject: [PATCH 11/13] Add old driver in as a compatibility layer
  create mode 100644 src/compat/compat-qxl_ring.c
 
 diff --git a/configure.ac b/configure.ac
-index ce67b41..c865439 100644
+index 581521e..e775348 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -85,5 +85,6 @@ AC_CONFIG_FILES([
+@@ -117,6 +117,7 @@ AC_CONFIG_FILES([
                  Makefile
                  src/Makefile
- 		src/uxa/Makefile
+                 src/uxa/Makefile
 +		src/compat/Makefile
+                 scripts/Makefile
+                 examples/Makefile
  ])
- AC_OUTPUT
 diff --git a/src/Makefile.am b/src/Makefile.am
-index ff4fa14..f3a65bf 100644
+index 2695614..3dcdd16 100644
 --- a/src/Makefile.am
 +++ b/src/Makefile.am
 @@ -25,7 +25,7 @@
@@ -3874,5 +3876,5 @@ index 0000000..9a34583
 +    }
 +}
 -- 
-1.7.4.4
+1.7.6.2
 
diff --git a/0012-Link-in-the-compat-driver-various-renamings.patch b/0009-Link-in-the-compat-driver-various-renamings.patch
similarity index 99%
rename from 0012-Link-in-the-compat-driver-various-renamings.patch
rename to 0009-Link-in-the-compat-driver-various-renamings.patch
index da9f03d..1d162d1 100644
--- a/0012-Link-in-the-compat-driver-various-renamings.patch
+++ b/0009-Link-in-the-compat-driver-various-renamings.patch
@@ -1,7 +1,8 @@
-From 5ff4ed6f80706a8df863e1b72b4051551c850609 Mon Sep 17 00:00:00 2001
+From 172733923dd0934dbdfe70b13a2b042b78fd4faf Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?S=C3=B8ren=20Sandmann=20Pedersen?= <ssp at redhat.com>
 Date: Thu, 3 Feb 2011 06:40:29 -0500
-Subject: [PATCH 12/13] Link in the compat driver; various renamings
+Subject: [PATCH xf86-video-qxl 09/10] Link in the compat driver; various
+ renamings
 
 ---
  src/Makefile.am                |    2 +-
@@ -14,14 +15,14 @@ Subject: [PATCH 12/13] Link in the compat driver; various renamings
  src/compat/compat-qxl_image.c  |   50 ++--
  src/compat/compat-qxl_mem.c    |   26 +-
  src/compat/compat-qxl_ring.c   |   20 +-
- src/qxl_driver.c               |   11 +-
- 11 files changed, 570 insertions(+), 563 deletions(-)
+ src/qxl_driver.c               |    9 +-
+ 11 files changed, 569 insertions(+), 562 deletions(-)
 
 diff --git a/src/Makefile.am b/src/Makefile.am
-index f3a65bf..179d217 100644
+index 3dcdd16..7f63baa 100644
 --- a/src/Makefile.am
 +++ b/src/Makefile.am
-@@ -33,7 +33,7 @@ qxl_drv_la_LTLIBRARIES = qxl_drv.la
+@@ -34,7 +34,7 @@ qxl_drv_la_LTLIBRARIES = qxl_drv.la
  qxl_drv_la_LDFLAGS = -module -avoid-version
  qxl_drv_ladir = @moduledir@/drivers
  
@@ -2685,16 +2686,14 @@ index 9a34583..d875357 100644
      while (ring->ring->header.cons != ring->ring->header.prod)
      {
 diff --git a/src/qxl_driver.c b/src/qxl_driver.c
-index b8f2812..670c7e6 100644
+index 428735a..8c76077 100644
 --- a/src/qxl_driver.c
 +++ b/src/qxl_driver.c
-@@ -1435,8 +1435,15 @@ qxl_pci_probe(DriverPtr drv, int entity, struct pci_device *dev, intptr_t match)
- 	pScrn->driverPrivate = xnfcalloc(sizeof(qxl_screen_t), 1);
+@@ -1629,7 +1629,14 @@ qxl_pci_probe(DriverPtr drv, int entity, struct pci_device *dev, intptr_t match)
      qxl = pScrn->driverPrivate;
      qxl->pci = dev;
--    
+ 
 -    qxl_init_scrn(pScrn);
-+
 +    if (qxl->pci->revision == 0x01)
 +    {
 +	compat_init_scrn (pScrn);
@@ -2703,9 +2702,9 @@ index b8f2812..670c7e6 100644
 +    {
 +	qxl_init_scrn(pScrn);
 +    }
-     
+ 
      return TRUE;
  }
 -- 
-1.7.4.4
+1.7.6.2
 
diff --git a/xorg-x11-drv-qxl.spec b/xorg-x11-drv-qxl.spec
index 36f7d61..112d3c3 100644
--- a/xorg-x11-drv-qxl.spec
+++ b/xorg-x11-drv-qxl.spec
@@ -6,35 +6,34 @@ Summary:   Xorg X11 qxl video driver
 Name:      xorg-x11-drv-qxl
 
 # This is hack since a driver got built with the version number 0.0.20.f14b
-# The next upstream version will have version 0.2.0
 Version:   0.0.21
-%define tarversion 0.0.13
+%define tarversion 0.0.16
 
-Release:   4%{?dist}
+Release:   5%{?dist}
 URL:       http://www.x.org
 Source0:   http://xorg.freedesktop.org/releases/individual/driver/%{tarball}-%{tarversion}.tar.bz2
-# Patches from upstream git, bugfixes + support for old qxl device
-Patch1:    0001-gcc-4.6.0-fix-cast-unmatching-function-pointers.patch
-Patch2:    0002-qxl_driver-remove-unused-variable-found-by-gcc-4.6.0.patch
-Patch3:    0003-build-add-spice-protocol-dep.patch
-Patch4:    0004-use-spice-protocol-qxl_dev.h-enums.patch
-Patch5:    0005-use-structs-from-spice-protocol-qxl_dev.h.patch
-Patch6:    0006-s-qxl_ram_header-QXLRam.patch
-Patch7:    0007-Don-t-re-upload-read-only-surfaces-after-a-software-.patch
-Patch8:    0008-Tiled-upload-of-images-after-software-fallback.patch
-Patch9:    0009-Generate-tighter-damage-for-PolyFillRect.patch
-Patch10:   0010-Fix-VT-switching.patch
-Patch11:   0011-Add-old-driver-in-as-a-compatibility-layer.patch
-Patch12:   0012-Link-in-the-compat-driver-various-renamings.patch
-Patch13:   0013-If-qxl_pre_init-is-called-without-a-confScreen-just-.patch
-License: MIT
+# Bugfixes from upstream git
+Patch1:    0001-xspice-add-missing-tls-port-default.patch
+Patch2:    0002-README.xspice-use-consistent-and-vnc-default-port.patch
+Patch3:    0003-spiceqxl.xorg.conf.example-typo-and-order-fixes.patch
+Patch4:    0004-Ignore-devices-classes-when-matching-PCI-devices.patch
+Patch5:    0005-Only-save-the-VGA-fonts-for-the-primary-device.patch
+Patch6:    0006-xspice-make-cgdb-non-magical-use-XSPICE_ENABLE_GDB.patch
+Patch7:    0007-rename-xspice-Xspice.patch
+# Support for old revision 1 qxl device (which won't go upstream)
+Patch8:    0008-Add-old-driver-in-as-a-compatibility-layer.patch
+Patch9:    0009-Link-in-the-compat-driver-various-renamings.patch
+License:   MIT
 Group:     User Interface/X Hardware Support
 
 ExcludeArch: s390 s390x
 
 BuildRequires: pkgconfig
-BuildRequires: xorg-x11-server-devel >= 1.10.99.902
-BuildRequires: spice-protocol >= 0.8.0
+BuildRequires: xorg-x11-server-devel >= 1.1.0-1
+BuildRequires: spice-protocol >= 0.8.1
+%ifarch x86_64
+BuildRequires: spice-server-devel >= 0.8.0
+%endif
 BuildRequires: glib2-devel
 BuildRequires: libtool
 
@@ -44,6 +43,18 @@ Requires: Xorg %(xserver-sdk-abi-requires videodrv)
 %description 
 X.Org X11 qxl video driver.
 
+
+%package -n    xorg-x11-server-Xspice
+Summary:       XSpice is an X server that can be accessed by a Spice client
+Requires:      Xorg %(xserver-sdk-abi-requires ansic)
+Requires:      Xorg %(xserver-sdk-abi-requires videodrv)
+Requires:      xorg-x11-server-Xorg
+Requires:      python >= 2.6
+
+%description -n xorg-x11-server-Xspice
+XSpice is both an X and a Spice server.a
+
+
 %prep
 %setup -q -n %{tarball}-%{tarversion}
 %patch1 -p1
@@ -55,34 +66,60 @@ X.Org X11 qxl video driver.
 %patch7 -p1
 %patch8 -p1
 %patch9 -p1
-%patch10 -p1
-%patch11 -p1
-%patch12 -p1
-%patch13 -p1
 autoreconf -f -i
 
+
 %build
+# Xspice is x86_64 only since spice-server is x86_64 only
+%ifarch x86_64
+%configure --enable-xspice --disable-static
+%else
 %configure --disable-static
+%endif
 make %{?_smp_mflags}
 
-%install
-rm -rf $RPM_BUILD_ROOT
 
+%install
 make install DESTDIR=$RPM_BUILD_ROOT INSTALL='install -p'
 
 # FIXME: Remove all libtool archives (*.la) from modules directory.  This
 # should be fixed in upstream Makefile.am or whatever.
 find $RPM_BUILD_ROOT -regex ".*\.la$" | xargs rm -f --
 
-%clean
-rm -rf $RPM_BUILD_ROOT
+%ifarch x86_64
+mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/X11
+install -p -m 644 examples/spiceqxl.xorg.conf.example \
+    $RPM_BUILD_ROOT%{_sysconfdir}/X11/spiceqxl.xorg.conf
+# FIXME: upstream installs this file by default, we install it elsewhere.
+# upstream should just not install it and let dist package deal with
+# doc/examples.
+rm $RPM_BUILD_ROOT/usr/share/doc/xf86-video-qxl/spiceqxl.xorg.conf.example
+%endif
+
 
 %files
 %defattr(-,root,root,-)
 %doc COPYING README ChangeLog
 %{driverdir}/qxl_drv.so
 
+%ifarch x86_64
+
+%files -n xorg-x11-server-Xspice
+%defattr(-,root,root,-)
+%doc COPYING README.xspice README ChangeLog examples/spiceqxl.xorg.conf.example
+%config(noreplace) %{_sysconfdir}/X11/spiceqxl.xorg.conf
+%{_bindir}/Xspice
+%{driverdir}/spiceqxl_drv.so
+
+%endif
+
+
 %changelog
+* Mon Sep 12 2011 Hans de Goede <hdegoede at redhat.com> - 0.0.21-5
+- Rebase to latest upstream release
+- Enable building of the Xspice X-server and put it in its own
+  xorg-x11-server-Xspice package
+
 * Thu Aug 18 2011 Adam Jackson <ajax at redhat.com> - 0.0.21-4
 - Rebuild for xserver 1.11 ABI
 


More information about the scm-commits mailing list