[xorg-x11-drv-qxl/f18] Rebuild against latest spice-protocol so that support for multiple

Hans de Goede jwrdegoede at fedoraproject.org
Thu May 30 09:33:38 UTC 2013


commit 80b93bcf2f0c39d8cebac0e72fc6bf10a948ae05
Author: Hans de Goede <hdegoede at redhat.com>
Date:   Thu May 30 11:37:47 2013 +0200

    Rebuild against latest spice-protocol so that support for multiple
    
      monitors on a single head gets enabled (on qxl devices with a pci revision
      of 4 or higher)
    - Add some cherry-picked bugfixes related to multiple monitor handling

 ...l_driver-remove-unused-enum-ROPDescriptor.patch |   41 +++++++++
 ...t-fix-calculation-of-available-video-memo.patch |   52 +++++++++++
 ...l_driver-check_crtc-handle-qxl-crtcs-NULL.patch |   30 +++++++
 ...simplify-calling-qxl_update_monitors_conf.patch |   50 +++++++++++
 ...er-monitors_config-adjust-to-memory-remap.patch |   75 ++++++++++++++++
 ...dd-the-current-mode-to-the-modelist-as-pr.patch |   92 ++++++++++++++++++++
 xorg-x11-drv-qxl.spec                              |   28 +++++-
 7 files changed, 364 insertions(+), 4 deletions(-)
---
diff --git a/0007-qxl_driver-remove-unused-enum-ROPDescriptor.patch b/0007-qxl_driver-remove-unused-enum-ROPDescriptor.patch
new file mode 100644
index 0000000..5e7638d
--- /dev/null
+++ b/0007-qxl_driver-remove-unused-enum-ROPDescriptor.patch
@@ -0,0 +1,41 @@
+From 0819c9b2cb5cb3396cc954ad2a6556bd14da3ca6 Mon Sep 17 00:00:00 2001
+Message-Id: <0819c9b2cb5cb3396cc954ad2a6556bd14da3ca6.1358430965.git.uril at redhat.com>
+In-Reply-To: <cover.1358430965.git.uril at redhat.com>
+References: <cover.1358430965.git.uril at redhat.com>
+From: Uri Lublin <uril at redhat.com>
+Date: Thu, 17 Jan 2013 13:29:05 +0200
+Subject: [xf86 qxl driver PATCH 1/5] qxl_driver: remove unused enum ROPDescriptor
+
+---
+ src/qxl_driver.c |   15 ---------------
+ 1 files changed, 0 insertions(+), 15 deletions(-)
+
+diff --git a/src/qxl_driver.c b/src/qxl_driver.c
+index e2d08c7..e289c70 100644
+--- a/src/qxl_driver.c
++++ b/src/qxl_driver.c
+@@ -1034,21 +1034,6 @@ qxl_switch_mode (SWITCH_MODE_ARGS_DECL)
+     return qxl_resize_primary_to_virtual (qxl);
+ }
+ 
+-enum ROPDescriptor
+-{
+-    ROPD_INVERS_SRC = (1 << 0),
+-    ROPD_INVERS_BRUSH = (1 << 1),
+-    ROPD_INVERS_DEST = (1 << 2),
+-    ROPD_OP_PUT = (1 << 3),
+-    ROPD_OP_OR = (1 << 4),
+-    ROPD_OP_AND = (1 << 5),
+-    ROPD_OP_XOR = (1 << 6),
+-    ROPD_OP_BLACKNESS = (1 << 7),
+-    ROPD_OP_WHITENESS = (1 << 8),
+-    ROPD_OP_INVERS = (1 << 9),
+-    ROPD_INVERS_RES = (1 << 10),
+-};
+-
+ static int
+ check_crtc (qxl_screen_t *qxl)
+ {
+-- 
+1.7.1
+
diff --git a/0008-qxl_pre_init-fix-calculation-of-available-video-memo.patch b/0008-qxl_pre_init-fix-calculation-of-available-video-memo.patch
new file mode 100644
index 0000000..ae015ff
--- /dev/null
+++ b/0008-qxl_pre_init-fix-calculation-of-available-video-memo.patch
@@ -0,0 +1,52 @@
+From c819c0c6b1f80cde00fb61893facbf01ebedad09 Mon Sep 17 00:00:00 2001
+Message-Id: <c819c0c6b1f80cde00fb61893facbf01ebedad09.1358430965.git.uril at redhat.com>
+In-Reply-To: <cover.1358430965.git.uril at redhat.com>
+References: <cover.1358430965.git.uril at redhat.com>
+From: Uri Lublin <uril at redhat.com>
+Date: Mon, 14 Jan 2013 15:06:57 +0200
+Subject: [xf86 qxl driver PATCH 2/5] qxl_pre_init: fix calculation of available video memory
+
+Don't forget to substract monitors_config area.
+
+Memory map of qxl RAM looks something like the following:
+---------------------
+|                   |
+| Surface0 Area     |
+|                   |
+---------------------
+|                   |
+|                   |
+| Video Pages       |
+|                   |
+|                   |
+---------------------
+| Monitors Config   |
+---------------------
+| RAM Header        |
+---------------------
+---
+ src/qxl_driver.c |    8 +++++++-
+ 1 files changed, 7 insertions(+), 1 deletions(-)
+
+diff --git a/src/qxl_driver.c b/src/qxl_driver.c
+index e289c70..1a253d2 100644
+--- a/src/qxl_driver.c
++++ b/src/qxl_driver.c
+@@ -2453,7 +2453,13 @@ qxl_pre_init (ScrnInfoPtr pScrn, int flags)
+ #else
+     xspice_init_qxl_ram (qxl); /* initialize the rings */
+ #endif
+-    pScrn->videoRam = (qxl->rom->num_pages * 4096) / 1024;
++
++#define DIV_ROUND_UP(n, a) (((n) + (a) - 1) / (a))
++#define BYTES_TO_KB(bytes) DIV_ROUND_UP(bytes, 1024)
++#define PAGES_TO_KB(pages) ((pages) * getpagesize() / 1024)
++
++    pScrn->videoRam = PAGES_TO_KB(qxl->rom->num_pages)
++                      - BYTES_TO_KB(qxl->monitors_config_size);
+     xf86DrvMsg (scrnIndex, X_INFO, "%d KB of video RAM\n", pScrn->videoRam);
+     xf86DrvMsg (scrnIndex, X_INFO, "%d surfaces\n", qxl->rom->n_surfaces);
+     
+-- 
+1.7.1
+
diff --git a/0009-qxl_driver-check_crtc-handle-qxl-crtcs-NULL.patch b/0009-qxl_driver-check_crtc-handle-qxl-crtcs-NULL.patch
new file mode 100644
index 0000000..7968509
--- /dev/null
+++ b/0009-qxl_driver-check_crtc-handle-qxl-crtcs-NULL.patch
@@ -0,0 +1,30 @@
+From 83f80d69e8a6cfc3c9572d757fd117c790aa28cf Mon Sep 17 00:00:00 2001
+Message-Id: <83f80d69e8a6cfc3c9572d757fd117c790aa28cf.1358430965.git.uril at redhat.com>
+In-Reply-To: <cover.1358430965.git.uril at redhat.com>
+References: <cover.1358430965.git.uril at redhat.com>
+From: Uri Lublin <uril at redhat.com>
+Date: Thu, 17 Jan 2013 13:05:20 +0200
+Subject: [xf86 qxl driver PATCH 3/5] qxl_driver: check_crtc: handle qxl->crtcs == NULL
+
+---
+ src/qxl_driver.c |    4 ++++
+ 1 files changed, 4 insertions(+), 0 deletions(-)
+
+diff --git a/src/qxl_driver.c b/src/qxl_driver.c
+index 1a253d2..d8abb7b 100644
+--- a/src/qxl_driver.c
++++ b/src/qxl_driver.c
+@@ -1040,6 +1040,10 @@ check_crtc (qxl_screen_t *qxl)
+     int i, count = 0;
+     xf86CrtcPtr crtc;
+     
++    if (qxl->crtcs == NULL) {
++        return 0;
++    }
++
+     for (i = 0 ; i < qxl->num_heads; ++i)
+     {
+ 	crtc = qxl->crtcs[i];
+-- 
+1.7.1
+
diff --git a/0010-qxl_driver-simplify-calling-qxl_update_monitors_conf.patch b/0010-qxl_driver-simplify-calling-qxl_update_monitors_conf.patch
new file mode 100644
index 0000000..3b2f123
--- /dev/null
+++ b/0010-qxl_driver-simplify-calling-qxl_update_monitors_conf.patch
@@ -0,0 +1,50 @@
+From b64b577363cd27e2b0973a00b7210baefc9077ea Mon Sep 17 00:00:00 2001
+Message-Id: <b64b577363cd27e2b0973a00b7210baefc9077ea.1358430965.git.uril at redhat.com>
+In-Reply-To: <cover.1358430965.git.uril at redhat.com>
+References: <cover.1358430965.git.uril at redhat.com>
+From: Uri Lublin <uril at redhat.com>
+Date: Thu, 17 Jan 2013 13:14:22 +0200
+Subject: [xf86 qxl driver PATCH 4/5] qxl_driver: simplify calling qxl_update_monitors_config
+
+Simplify by calling check_crtc from within qxl_update_monitors_config,
+instead of calling check_crtc before every call to
+qxl_update_monitors_config.
+---
+ src/qxl_driver.c |    7 +++----
+ 1 files changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/src/qxl_driver.c b/src/qxl_driver.c
+index d8abb7b..05c357b 100644
+--- a/src/qxl_driver.c
++++ b/src/qxl_driver.c
+@@ -1076,7 +1076,8 @@ qxl_update_monitors_config (qxl_screen_t *qxl)
+     qxl_output_private *qxl_output;
+     QXLRam * ram = get_ram_header (qxl);
+     
+-    check_crtc (qxl);
++    if (check_crtc (qxl) == 0)
++        return;
+     
+     qxl->monitors_config->count = 0;
+     qxl->monitors_config->max_allowed = qxl->num_heads;
+@@ -2175,7 +2176,6 @@ qxl_crtc_set_mode_major (xf86CrtcPtr crtc, DisplayModePtr mode,
+     if (!crtc_set_mode_major (crtc, mode, rotation, x, y))
+ 	return FALSE;
+     
+-    check_crtc (qxl);
+     qxl_update_monitors_config (qxl);
+     
+     return TRUE;
+@@ -2271,8 +2271,7 @@ qxl_xf86crtc_resize (ScrnInfoPtr scrn, int width, int height)
+     
+     // when starting, no monitor is enabled, and count == 0
+     // we want to avoid server/client freaking out with temporary config
+-    if (check_crtc (qxl) != 0)
+-	qxl_update_monitors_config (qxl);
++    qxl_update_monitors_config (qxl);
+     
+     return TRUE;
+ }
+-- 
+1.7.1
+
diff --git a/0011-qxl_driver-monitors_config-adjust-to-memory-remap.patch b/0011-qxl_driver-monitors_config-adjust-to-memory-remap.patch
new file mode 100644
index 0000000..7f17d44
--- /dev/null
+++ b/0011-qxl_driver-monitors_config-adjust-to-memory-remap.patch
@@ -0,0 +1,75 @@
+From 14b056ab8dac6aaf3dd59b7768b698708af040e7 Mon Sep 17 00:00:00 2001
+Message-Id: <14b056ab8dac6aaf3dd59b7768b698708af040e7.1358430965.git.uril at redhat.com>
+In-Reply-To: <cover.1358430965.git.uril at redhat.com>
+References: <cover.1358430965.git.uril at redhat.com>
+From: Uri Lublin <uril at redhat.com>
+Date: Thu, 17 Jan 2013 13:43:28 +0200
+Subject: [xf86 qxl driver PATCH 5/5] qxl_driver: monitors_config: adjust to memory-remap
+
+Resolves: rhbz#883578
+
+Call qxl_allocate_monitors_config upon memory-remap such
+that qxl->monitors_config points to the start of
+monitors_config segment in qxl RAM memory.
+
+Currently after memory remap, it's possible that monitors_config
+memory and video-memory (or graphics) overlap, which means
+that one may overwrite another.
+Specifically in the bug above, monitors_config value are being
+overwritten by video pages, and on the destination bad values
+are read which cause problems on the server and client.
+
+It may be a good idea to add some protection on the server side,
+e.g. calcluate checksum, compare values against modes, or limit
+->count and ->max_allowed and ignore bad monitors_config values
+
+Also do not memset-0 monitors-config upon allocation (remapping)
+to not overwrite likely good configuration (in case it is
+being read by the host, e.g. upon migration).
+---
+ src/qxl_driver.c |   13 ++++++-------
+ 1 files changed, 6 insertions(+), 7 deletions(-)
+
+diff --git a/src/qxl_driver.c b/src/qxl_driver.c
+index 05c357b..e1893dc 100644
+--- a/src/qxl_driver.c
++++ b/src/qxl_driver.c
+@@ -134,6 +134,10 @@ const OptionInfoRec DefaultOptions[] =
+     { -1, NULL, OPTV_NONE, {0}, FALSE }
+ };
+ 
++
++static void qxl_update_monitors_config (qxl_screen_t *qxl);
++
++
+ static const OptionInfoRec *
+ qxl_available_options (int chipid, int busid)
+ {
+@@ -318,15 +322,8 @@ qxl_io_monitors_config_async (qxl_screen_t *qxl)
+ static void
+ qxl_allocate_monitors_config (qxl_screen_t *qxl)
+ {
+-    int size = sizeof (QXLMonitorsConfig) + sizeof (QXLHead) * MAX_MONITORS_NUM;
+-    
+-    if (qxl->monitors_config)
+-	return;
+-    
+     qxl->monitors_config = (QXLMonitorsConfig *)(void *)
+ 	((unsigned long)qxl->ram + qxl->rom->ram_header_offset - qxl->monitors_config_size);
+-    
+-    memset (qxl->monitors_config, 0, size);
+ }
+ 
+ static uint64_t
+@@ -845,6 +842,8 @@ qxl_reset_and_create_mem_slots (qxl_screen_t *qxl)
+                                      (uint64_t)(uintptr_t)qxl->vram,
+                                      (uint64_t)(uintptr_t)qxl->vram + (uint64_t)qxl->vram_size);
+ #endif
++
++    qxl_allocate_monitors_config(qxl);
+ }
+ 
+ static void
+-- 
+1.7.1
+
diff --git a/0012-qxl-Don-t-add-the-current-mode-to-the-modelist-as-pr.patch b/0012-qxl-Don-t-add-the-current-mode-to-the-modelist-as-pr.patch
new file mode 100644
index 0000000..c52a831
--- /dev/null
+++ b/0012-qxl-Don-t-add-the-current-mode-to-the-modelist-as-pr.patch
@@ -0,0 +1,92 @@
+From 2a9d5f7afd4e4aedfd75d154026975a001a6c9b8 Mon Sep 17 00:00:00 2001
+From: Hans de Goede <hdegoede at redhat.com>
+Date: Wed, 23 Jan 2013 18:26:29 +0100
+Subject: [PATCH xf86-video-qxl] qxl: Don't add the current mode to the
+ modelist as preferred-mode (rhbz#894421)
+
+Adding the current mode to the monitor modelist as "extra" preferred
+mode means that each time the modelist gets queried, and the resolution
+has changed, a different modelist is returned for the output. A different
+modelist gets seen as a different monitor by gnome-settings-daemon, causing
+it to think that the monitor has been unplugged and replaced with another
+one and to re-do any auto-configuration for that monitor.
+
+This causes undesirable "funny" side-effects such as described in detail
+here: https://bugzilla.redhat.com/show_bug.cgi?id=894421#c7
+
+This patch fixes the "initial resolution too large" problem the adding
+of the current mode to the list was added for, by instead marking 1024x768,
+which is our default resolution, as preferred mode.
+
+Signed-off-by: Hans de Goede <hdegoede at redhat.com>
+---
+ src/qxl_driver.c | 24 ++++++++++++------------
+ 1 file changed, 12 insertions(+), 12 deletions(-)
+
+diff --git a/src/qxl_driver.c b/src/qxl_driver.c
+index c383c14..063e7a6 100644
+--- a/src/qxl_driver.c
++++ b/src/qxl_driver.c
+@@ -61,6 +61,9 @@
+ 
+ extern void compat_init_scrn (ScrnInfoPtr);
+ 
++#define DEFAULT_WIDTH 1024
++#define DEFAULT_HEIGHT 768
++
+ #ifdef WITH_CHECK_POINT
+ #define CHECK_POINT() ErrorF ("%s: %d  (%s)\n", __FILE__, __LINE__, __FUNCTION__);
+ #else
+@@ -2083,15 +2086,6 @@ qxl_output_get_modes (xf86OutputPtr output)
+     qxl_output_private *qxl_output = output->driver_private;
+     DisplayModePtr      modes = xf86DuplicateModes (qxl_output->qxl->pScrn, qxl_output->qxl->x_modes);
+     
+-    if (output &&
+-        output->crtc && output->crtc->enabled)
+-    {
+-	DisplayModePtr crtc_mode = &output->crtc->mode;
+-	crtc_mode = screen_create_mode (qxl_output->qxl->pScrn, crtc_mode->HDisplay, crtc_mode->VDisplay, M_T_PREFERRED);
+-	output->crtc->mode = *crtc_mode;
+-	modes = xf86ModesAdd (modes, crtc_mode);
+-    }
+-    
+     /* xf86ProbeOutputModes owns this memory */
+     return modes;
+ }
+@@ -2322,8 +2316,8 @@ qxl_init_randr (ScrnInfoPtr pScrn, qxl_screen_t *qxl)
+ 	qxl_crtc->output = output;
+     }
+     
+-    qxl->virtual_x = 1024;
+-    qxl->virtual_y = 768;
++    qxl->virtual_x = DEFAULT_WIDTH;
++    qxl->virtual_y = DEFAULT_HEIGHT;
+     
+     pScrn->display->virtualX = qxl->virtual_x;
+     pScrn->display->virtualY = qxl->virtual_y;
+@@ -2339,6 +2333,7 @@ qxl_initialize_x_modes (qxl_screen_t *qxl, ScrnInfoPtr pScrn,
+ {
+     int i;
+     int size;
++    int preferred_flag;
+     
+     *max_x = *max_y = 0;
+     /* Create a list of modes used by the qxl_output_get_modes */
+@@ -2354,8 +2349,13 @@ qxl_initialize_x_modes (qxl_screen_t *qxl, ScrnInfoPtr pScrn,
+ 		continue;
+ 	    }
+ 	    
++            if (qxl->modes[i].x_res == 1024 && qxl->modes[i].y_res == 768)
++                preferred_flag = M_T_PREFERRED;
++            else
++                preferred_flag = 0;
++
+ 	    qxl_add_mode (qxl, pScrn, qxl->modes[i].x_res, qxl->modes[i].y_res,
+-	                  M_T_DRIVER);
++	                  M_T_DRIVER | preferred_flag);
+ 	    if (qxl->modes[i].x_res > *max_x)
+ 		*max_x = qxl->modes[i].x_res;
+ 	    if (qxl->modes[i].y_res > *max_y)
+-- 
+1.8.1
+
diff --git a/xorg-x11-drv-qxl.spec b/xorg-x11-drv-qxl.spec
index 9052013..6bda31c 100644
--- a/xorg-x11-drv-qxl.spec
+++ b/xorg-x11-drv-qxl.spec
@@ -18,7 +18,7 @@ Name:      xorg-x11-drv-qxl
 
 Version:   0.1.0
 
-Release:   1%{?gver}%{?dist}
+Release:   2%{?gver}%{?dist}
 URL:       http://www.x.org
 Source0:   http://xorg.freedesktop.org/releases/individual/driver/%{tarball}-%{version}.tar.bz2
 
@@ -27,6 +27,13 @@ Source0:   http://xorg.freedesktop.org/releases/individual/driver/%{tarball}-%{v
 Patch1:	   0001-Add-old-driver-in-as-a-compatibility-layer.patch
 Patch2:	   0002-Link-in-the-compat-driver-various-renamings.patch
 Patch3:	   0003-compat-bump-to-new-server-API-changes.patch
+# Cherry picked multi-monitor fixes
+Patch7:     0007-qxl_driver-remove-unused-enum-ROPDescriptor.patch
+Patch8:     0008-qxl_pre_init-fix-calculation-of-available-video-memo.patch
+Patch9:     0009-qxl_driver-check_crtc-handle-qxl-crtcs-NULL.patch
+Patch10:    0010-qxl_driver-simplify-calling-qxl_update_monitors_conf.patch
+Patch11:    0011-qxl_driver-monitors_config-adjust-to-memory-remap.patch
+Patch12:    0012-qxl-Don-t-add-the-current-mode-to-the-modelist-as-pr.patch
 
 License:   MIT
 Group:     User Interface/X Hardware Support
@@ -67,6 +74,13 @@ XSpice is both an X and a Spice server.
 %patch2 -p1
 %patch3 -p1
 
+%patch7 -p1
+%patch8 -p1
+%patch9 -p1
+%patch10 -p1
+%patch11 -p1
+%patch12 -p1
+
 autoreconf -f -i
 
 
@@ -115,13 +129,19 @@ rm -f $RPM_BUILD_ROOT%{_sysconfdir}/X11/spiceqxl.xorg.conf
 
 
 %changelog
+* Thu May 30 2013 Hans de Goede <hdegoede at redhat.com> - 0.1.0-2
+- Rebuild against latest spice-protocol so that support for multiple
+  monitors on a single head gets enabled (on qxl devices with a pci revision
+  of 4 or higher)
+- Add some cherry-picked bugfixes related to multiple monitor handling
+
 * Sat Sep 22 2012 Soren Sandmann <ssp at redhat.com> 0.1.0-1
 - Upstream 0.1.0
 
 * Wed Aug 29 2012 Adam Jackson <ajax at redhat.com> 0.0.22-6
 - Exclude Xspice from RHEL6 builds
 
-* Thu Aug 26 2012 Alon Levy <alevy at redhat.com>
+* Sun Aug 26 2012 Alon Levy <alevy at redhat.com>
 - fix uxa_xorg_enable_disable_fb_access - 0.0.22-5.20120718gitde6620788 (#844463)
 
 * Thu Aug 23 2012 Alon Levy <alevy at redhat.com>
@@ -164,10 +184,10 @@ rm -f $RPM_BUILD_ROOT%{_sysconfdir}/X11/spiceqxl.xorg.conf
 * Wed Nov 09 2011 Adam Jackson <ajax at redhat.com> - 0.0.21-9
 - ABI rebuild
 
-* Wed Oct 28 2011 Soren Sandmann <ssp at redhat.com> - 0.0.21-8
+* Fri Oct 28 2011 Soren Sandmann <ssp at redhat.com> - 0.0.21-8
 - Bump release
 
-* Wed Oct 28 2011 Soren Sandmann <ssp at redhat.com> - 0.0.21-7
+* Fri Oct 28 2011 Soren Sandmann <ssp at redhat.com> - 0.0.21-7
 - Add patch to translate access regions according to drawable offset
   Bug 731245.
 


More information about the scm-commits mailing list