Sync with upstream git, bringing in a bunch if bug-fixes
- Add some extra fixes which are pending upstream - This also adds PointerWarping emulation to Xwayland, which should improve compatiblity with many games
This commit is contained in:
		
							parent
							
								
									8aa464b9f9
								
							
						
					
					
						commit
						c72d21ad14
					
				
							
								
								
									
										50
									
								
								0001-DRI2-Sync-radeonsi_pci_ids.h-from-Mesa.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										50
									
								
								0001-DRI2-Sync-radeonsi_pci_ids.h-from-Mesa.patch
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,50 @@ | |||||||
|  | From 8c99f657824e483c59745cc4c0c93240ad9fe24a Mon Sep 17 00:00:00 2001 | ||||||
|  | From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <michel.daenzer@amd.com> | ||||||
|  | Date: Mon, 17 Oct 2016 18:48:44 +0900 | ||||||
|  | Subject: [PATCH xserver v2 1/7] DRI2: Sync radeonsi_pci_ids.h from Mesa | ||||||
|  | MIME-Version: 1.0 | ||||||
|  | Content-Type: text/plain; charset=UTF-8 | ||||||
|  | Content-Transfer-Encoding: 8bit | ||||||
|  | 
 | ||||||
|  | Fixes DRI2 client driver name mapping for newer AMD GPUs with the | ||||||
|  | modesetting driver, allowing the DRI2 extension to initialize. | ||||||
|  | 
 | ||||||
|  | Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> | ||||||
|  | Reviewed-by: Alex Deucher <alexander.deucher@amd.com> | ||||||
|  | Signed-off-by: Hans de Goede <hdegoede@redhat.com> | ||||||
|  | ---
 | ||||||
|  |  hw/xfree86/dri2/pci_ids/radeonsi_pci_ids.h | 12 ++++++++++++ | ||||||
|  |  1 file changed, 12 insertions(+) | ||||||
|  | 
 | ||||||
|  | diff --git a/hw/xfree86/dri2/pci_ids/radeonsi_pci_ids.h b/hw/xfree86/dri2/pci_ids/radeonsi_pci_ids.h
 | ||||||
|  | index 4df8e9d..20c1583 100644
 | ||||||
|  | --- a/hw/xfree86/dri2/pci_ids/radeonsi_pci_ids.h
 | ||||||
|  | +++ b/hw/xfree86/dri2/pci_ids/radeonsi_pci_ids.h
 | ||||||
|  | @@ -184,12 +184,24 @@ CHIPSET(0x7300, FIJI_, FIJI)
 | ||||||
|  |   | ||||||
|  |  CHIPSET(0x67E0, POLARIS11_, POLARIS11) | ||||||
|  |  CHIPSET(0x67E1, POLARIS11_, POLARIS11) | ||||||
|  | +CHIPSET(0x67E3, POLARIS11_, POLARIS11)
 | ||||||
|  | +CHIPSET(0x67E7, POLARIS11_, POLARIS11)
 | ||||||
|  |  CHIPSET(0x67E8, POLARIS11_, POLARIS11) | ||||||
|  |  CHIPSET(0x67E9, POLARIS11_, POLARIS11) | ||||||
|  |  CHIPSET(0x67EB, POLARIS11_, POLARIS11) | ||||||
|  | +CHIPSET(0x67EF, POLARIS11_, POLARIS11)
 | ||||||
|  |  CHIPSET(0x67FF, POLARIS11_, POLARIS11) | ||||||
|  |   | ||||||
|  |  CHIPSET(0x67C0, POLARIS10_, POLARIS10) | ||||||
|  | +CHIPSET(0x67C1, POLARIS10_, POLARIS10)
 | ||||||
|  | +CHIPSET(0x67C2, POLARIS10_, POLARIS10)
 | ||||||
|  | +CHIPSET(0x67C4, POLARIS10_, POLARIS10)
 | ||||||
|  | +CHIPSET(0x67C7, POLARIS10_, POLARIS10)
 | ||||||
|  | +CHIPSET(0x67C8, POLARIS10_, POLARIS10)
 | ||||||
|  | +CHIPSET(0x67C9, POLARIS10_, POLARIS10)
 | ||||||
|  | +CHIPSET(0x67CA, POLARIS10_, POLARIS10)
 | ||||||
|  | +CHIPSET(0x67CC, POLARIS10_, POLARIS10)
 | ||||||
|  | +CHIPSET(0x67CF, POLARIS10_, POLARIS10)
 | ||||||
|  |  CHIPSET(0x67DF, POLARIS10_, POLARIS10) | ||||||
|  |   | ||||||
|  |  CHIPSET(0x98E4, STONEY_, STONEY) | ||||||
|  | -- 
 | ||||||
|  | 2.9.3 | ||||||
|  | 
 | ||||||
| @ -1,78 +0,0 @@ | |||||||
| From c622887701c70dab7b39515e4d48b2ce70822f1a Mon Sep 17 00:00:00 2001 |  | ||||||
| From: Adam Jackson <ajax@redhat.com> |  | ||||||
| Date: Tue, 4 Oct 2016 13:34:33 -0400 |  | ||||||
| Subject: [PATCH 1/7] glamor: Use eglGetPlatformDisplayEXT not eglGetDisplay |  | ||||||
| 
 |  | ||||||
| eglGetDisplay forces the implementation to guess which kind of display |  | ||||||
| it's been handed. glvnd does something different from Mesa, and in |  | ||||||
| general it's impossible for the library to get this right. Instead use |  | ||||||
| the API where you specify what kind of display it is. |  | ||||||
| 
 |  | ||||||
| The explicit call to eglGetProcAddress is to work around a bug in |  | ||||||
| libepoxy 1.3, which does not understand EGL client extensions and so its |  | ||||||
| resolver code will crash. |  | ||||||
| 
 |  | ||||||
| Signed-off-by: Adam Jackson <ajax@redhat.com> |  | ||||||
| Reviewed-by: Hans de Goede <hdegoede@redhat.com> |  | ||||||
| Signed-off-by: Hans de Goede <hdegoede@redhat.com> |  | ||||||
| ---
 |  | ||||||
|  glamor/glamor_egl.c           | 9 ++++++++- |  | ||||||
|  hw/xwayland/xwayland-glamor.c | 8 +++++++- |  | ||||||
|  2 files changed, 15 insertions(+), 2 deletions(-) |  | ||||||
| 
 |  | ||||||
| diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c
 |  | ||||||
| index 2b9e0e1..51d8147 100644
 |  | ||||||
| --- a/glamor/glamor_egl.c
 |  | ||||||
| +++ b/glamor/glamor_egl.c
 |  | ||||||
| @@ -736,6 +736,7 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd)
 |  | ||||||
|  { |  | ||||||
|      struct glamor_egl_screen_private *glamor_egl; |  | ||||||
|      const char *version; |  | ||||||
| +    PFNEGLGETPLATFORMDISPLAYEXTPROC getPlatformDisplay;
 |  | ||||||
|   |  | ||||||
|      EGLint config_attribs[] = { |  | ||||||
|  #ifdef GLAMOR_GLES2 |  | ||||||
| @@ -768,7 +769,13 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd)
 |  | ||||||
|          ErrorF("couldn't get display device\n"); |  | ||||||
|          goto error; |  | ||||||
|      } |  | ||||||
| -    glamor_egl->display = eglGetDisplay(glamor_egl->gbm);
 |  | ||||||
| +
 |  | ||||||
| +    getPlatformDisplay = (PFNEGLGETPLATFORMDISPLAYEXTPROC)
 |  | ||||||
| +        eglGetProcAddress("eglGetPlatformDisplayEXT");
 |  | ||||||
| +
 |  | ||||||
| +    if (getPlatformDisplay)
 |  | ||||||
| +        glamor_egl->display = getPlatformDisplay (EGL_PLATFORM_GBM_MESA,
 |  | ||||||
| +                                                  glamor_egl->gbm, NULL);
 |  | ||||||
|  #else |  | ||||||
|      glamor_egl->display = eglGetDisplay((EGLNativeDisplayType) (intptr_t) fd); |  | ||||||
|  #endif |  | ||||||
| diff --git a/hw/xwayland/xwayland-glamor.c b/hw/xwayland/xwayland-glamor.c
 |  | ||||||
| index 068c224..23402f9 100644
 |  | ||||||
| --- a/hw/xwayland/xwayland-glamor.c
 |  | ||||||
| +++ b/hw/xwayland/xwayland-glamor.c
 |  | ||||||
| @@ -280,6 +280,7 @@ xwl_drm_init_egl(struct xwl_screen *xwl_screen)
 |  | ||||||
|          GLAMOR_GL_CORE_VER_MINOR, |  | ||||||
|          EGL_NONE |  | ||||||
|      }; |  | ||||||
| +    PFNEGLGETPLATFORMDISPLAYEXTPROC getPlatformDisplay;
 |  | ||||||
|   |  | ||||||
|      if (xwl_screen->egl_display) |  | ||||||
|          return; |  | ||||||
| @@ -292,7 +293,12 @@ xwl_drm_init_egl(struct xwl_screen *xwl_screen)
 |  | ||||||
|          return; |  | ||||||
|      } |  | ||||||
|   |  | ||||||
| -    xwl_screen->egl_display = eglGetDisplay(xwl_screen->gbm);
 |  | ||||||
| +    getPlatformDisplay = (PFNEGLGETPLATFORMDISPLAYEXTPROC)
 |  | ||||||
| +        eglGetProcAddress("eglGetPlatformDisplayEXT");
 |  | ||||||
| +
 |  | ||||||
| +    if (getPlatformDisplay)
 |  | ||||||
| +        xwl_screen->egl_display = getPlatformDisplay(EGL_PLATFORM_GBM_MESA,
 |  | ||||||
| +                                                     xwl_screen->gbm, NULL);
 |  | ||||||
|      if (xwl_screen->egl_display == EGL_NO_DISPLAY) { |  | ||||||
|          ErrorF("eglGetDisplay() failed\n"); |  | ||||||
|          return; |  | ||||||
| -- 
 |  | ||||||
| 2.9.3 |  | ||||||
| 
 |  | ||||||
| @ -1,63 +0,0 @@ | |||||||
| From 18ed71c29863580e960293ff67465aaed69be9bb Mon Sep 17 00:00:00 2001 |  | ||||||
| From: Olivier Fourdan <ofourdan@redhat.com> |  | ||||||
| Date: Wed, 5 Oct 2016 08:36:21 +0200 |  | ||||||
| Subject: [PATCH 2/7] glamor: Fix pixmap offset for bitplane in |  | ||||||
|  glamor_copy_fbo_cpu |  | ||||||
| MIME-Version: 1.0 |  | ||||||
| Content-Type: text/plain; charset=UTF-8 |  | ||||||
| Content-Transfer-Encoding: 8bit |  | ||||||
| 
 |  | ||||||
| Commit cba28d5 - "glamor: Handle bitplane in glamor_copy_fbo_cpu" |  | ||||||
| introduced a regression as the computed pixmap offset would not match |  | ||||||
| the actual coordinates and write data elsewhere in memory causing a |  | ||||||
| segfault in fbBltOne(). |  | ||||||
| 
 |  | ||||||
| Translate the pixmap coordinates so that the data is read and written at |  | ||||||
| the correct location. |  | ||||||
| 
 |  | ||||||
| Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97974 |  | ||||||
| Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> |  | ||||||
| Reviewed-and-Tested-by: Michel Dänzer <michel.daenzer@amd.com> |  | ||||||
| Signed-off-by: Hans de Goede <hdegoede@redhat.com> |  | ||||||
| ---
 |  | ||||||
|  glamor/glamor_copy.c | 18 ++++++++++-------- |  | ||||||
|  1 file changed, 10 insertions(+), 8 deletions(-) |  | ||||||
| 
 |  | ||||||
| diff --git a/glamor/glamor_copy.c b/glamor/glamor_copy.c
 |  | ||||||
| index 8a329d2..3ca56fb 100644
 |  | ||||||
| --- a/glamor/glamor_copy.c
 |  | ||||||
| +++ b/glamor/glamor_copy.c
 |  | ||||||
| @@ -230,20 +230,22 @@ glamor_copy_cpu_fbo(DrawablePtr src,
 |  | ||||||
|              goto bail; |  | ||||||
|          } |  | ||||||
|   |  | ||||||
| +        src_pix->drawable.x = -dst->x;
 |  | ||||||
| +        src_pix->drawable.y = -dst->y;
 |  | ||||||
| +
 |  | ||||||
|          fbGetDrawable(&src_pix->drawable, src_bits, src_stride, src_bpp, src_xoff, |  | ||||||
|                        src_yoff); |  | ||||||
|   |  | ||||||
|          if (src->bitsPerPixel > 1) |  | ||||||
| -            fbCopyNto1(src, &src_pix->drawable, gc, box, nbox,
 |  | ||||||
| -                       dst_xoff + dx, dst_yoff + dy, reverse, upsidedown,
 |  | ||||||
| -                       bitplane, closure);
 |  | ||||||
| +            fbCopyNto1(src, &src_pix->drawable, gc, box, nbox, dx, dy,
 |  | ||||||
| +                       reverse, upsidedown, bitplane, closure);
 |  | ||||||
|          else |  | ||||||
| -            fbCopy1toN(src, &src_pix->drawable, gc, box, nbox,
 |  | ||||||
| -                       dst_xoff + dx, dst_yoff + dy, reverse, upsidedown,
 |  | ||||||
| -                       bitplane, closure);
 |  | ||||||
| +            fbCopy1toN(src, &src_pix->drawable, gc, box, nbox, dx, dy,
 |  | ||||||
| +                       reverse, upsidedown, bitplane, closure);
 |  | ||||||
|   |  | ||||||
| -        glamor_upload_boxes(dst_pixmap, box, nbox, 0, 0, 0, 0,
 |  | ||||||
| -                            (uint8_t *) src_bits, src_stride * sizeof(FbBits));
 |  | ||||||
| +        glamor_upload_boxes(dst_pixmap, box, nbox, src_xoff, src_yoff,
 |  | ||||||
| +                            dst_xoff, dst_yoff, (uint8_t *) src_bits,
 |  | ||||||
| +                            src_stride * sizeof(FbBits));
 |  | ||||||
|          fbDestroyPixmap(src_pix); |  | ||||||
|      } else { |  | ||||||
|          fbGetDrawable(src, src_bits, src_stride, src_bpp, src_xoff, src_yoff); |  | ||||||
| -- 
 |  | ||||||
| 2.9.3 |  | ||||||
| 
 |  | ||||||
| @ -0,0 +1,40 @@ | |||||||
|  | From 227734be9cbd9934e51a345ccb6b28524c784584 Mon Sep 17 00:00:00 2001 | ||||||
|  | From: Hans de Goede <hdegoede@redhat.com> | ||||||
|  | Date: Tue, 18 Oct 2016 16:10:19 +0200 | ||||||
|  | Subject: [PATCH xserver v2 2/7] xfree86: Xorg.wrap: Do not require root rights | ||||||
|  |  for cards with 0 outputs | ||||||
|  | 
 | ||||||
|  | Prior to this commit the Xorg.wrap code to detect if root rights | ||||||
|  | are necessary checked for DRM_IOCTL_MODE_GETRESOURCES succeeding *and* | ||||||
|  | reporting more then 0 output connectors. | ||||||
|  | 
 | ||||||
|  | DRM_IOCTL_MODE_GETRESOURCES succeeding alone is enough to differentiate | ||||||
|  | between old drm only cards (which need ums and thus root) and kms capable | ||||||
|  | cards. | ||||||
|  | 
 | ||||||
|  | Some hybrid gfx laptops have 0 output connectors on one of their 2 GPUs, | ||||||
|  | resulting in Xorg needlessly running as root. This commits removes the | ||||||
|  | res.count_connectors > 0 check, fixing this. | ||||||
|  | 
 | ||||||
|  | Signed-off-by: Hans de Goede <hdegoede@redhat.com> | ||||||
|  | Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> | ||||||
|  | ---
 | ||||||
|  |  hw/xfree86/xorg-wrapper.c | 2 +- | ||||||
|  |  1 file changed, 1 insertion(+), 1 deletion(-) | ||||||
|  | 
 | ||||||
|  | diff --git a/hw/xfree86/xorg-wrapper.c b/hw/xfree86/xorg-wrapper.c
 | ||||||
|  | index d930962..a25e6ff 100644
 | ||||||
|  | --- a/hw/xfree86/xorg-wrapper.c
 | ||||||
|  | +++ b/hw/xfree86/xorg-wrapper.c
 | ||||||
|  | @@ -240,7 +240,7 @@ int main(int argc, char *argv[])
 | ||||||
|  |   | ||||||
|  |              memset(&res, 0, sizeof(struct drm_mode_card_res)); | ||||||
|  |              r = ioctl(fd, DRM_IOCTL_MODE_GETRESOURCES, &res); | ||||||
|  | -            if (r == 0 && res.count_connectors > 0)
 | ||||||
|  | +            if (r == 0)
 | ||||||
|  |                  kms_cards++; | ||||||
|  |   | ||||||
|  |              close(fd); | ||||||
|  | -- 
 | ||||||
|  | 2.9.3 | ||||||
|  | 
 | ||||||
| @ -1,39 +0,0 @@ | |||||||
| From 909cc5e8d1a51184259803ca66a1fc352c547e02 Mon Sep 17 00:00:00 2001 |  | ||||||
| From: Hans de Goede <hdegoede@redhat.com> |  | ||||||
| Date: Wed, 5 Oct 2016 14:40:00 +0200 |  | ||||||
| Subject: [PATCH 3/7] inputthread: Fix inputthread not listening if a fd gets |  | ||||||
|  re-added immediately after removal |  | ||||||
| 
 |  | ||||||
| When a fd is removed dev->state gets set to device_state_removed, |  | ||||||
| if the fd then gets re-added before InputThreadDoWork() deals with |  | ||||||
| the removal, the InputThreadDevice struct gets reused, but its |  | ||||||
| state would stay device_state_removed, so it would still get removed |  | ||||||
| on the first InputThreadDoWork() run, resulting in a non functioning |  | ||||||
| input device. |  | ||||||
| 
 |  | ||||||
| This commit fixes this by (re-)setting dev->state to device_state_running |  | ||||||
| when a InputThreadDevice struct gets reused. |  | ||||||
| 
 |  | ||||||
| This fixes input devices sometimes no longer working after a vt-switch. |  | ||||||
| 
 |  | ||||||
| Signed-off-by: Hans de Goede <hdegoede@redhat.com> |  | ||||||
| ---
 |  | ||||||
|  os/inputthread.c | 2 ++ |  | ||||||
|  1 file changed, 2 insertions(+) |  | ||||||
| 
 |  | ||||||
| diff --git a/os/inputthread.c b/os/inputthread.c
 |  | ||||||
| index 6aa0a9c..ab1559f 100644
 |  | ||||||
| --- a/os/inputthread.c
 |  | ||||||
| +++ b/os/inputthread.c
 |  | ||||||
| @@ -206,6 +206,8 @@ InputThreadRegisterDev(int fd,
 |  | ||||||
|      if (dev) { |  | ||||||
|          dev->readInputProc = readInputProc; |  | ||||||
|          dev->readInputArgs = readInputArgs; |  | ||||||
| +        /* Override possible unhandled state == device_state_removed */
 |  | ||||||
| +        dev->state = device_state_running;
 |  | ||||||
|      } else { |  | ||||||
|          dev = calloc(1, sizeof(InputThreadDevice)); |  | ||||||
|          if (dev == NULL) { |  | ||||||
| -- 
 |  | ||||||
| 2.9.3 |  | ||||||
| 
 |  | ||||||
| @ -0,0 +1,50 @@ | |||||||
|  | From f0429ee0a57f2cee8ca5e5bfc60fe43152c0f236 Mon Sep 17 00:00:00 2001 | ||||||
|  | From: Rui Matos <tiagomatos@gmail.com> | ||||||
|  | Date: Tue, 25 Oct 2016 19:24:49 +0200 | ||||||
|  | Subject: [PATCH xserver v2 3/7] xwayland: Transform pointer enter event | ||||||
|  |  coordinates | ||||||
|  | MIME-Version: 1.0 | ||||||
|  | Content-Type: text/plain; charset=UTF-8 | ||||||
|  | Content-Transfer-Encoding: 8bit | ||||||
|  | 
 | ||||||
|  | Pointer enter event coordinates are surface relative and we need them | ||||||
|  | to be screen relative for pScreen->SetCursorPosition(). | ||||||
|  | 
 | ||||||
|  | https://bugzilla.gnome.org/show_bug.cgi?id=758283 | ||||||
|  | 
 | ||||||
|  | Signed-off-by: Rui Matos <tiagomatos@gmail.com> | ||||||
|  | Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> | ||||||
|  | Reviewed-by: Jonas Ådahl <jadahl@gmail.com> | ||||||
|  | Signed-off-by: Hans de Goede <hdegoede@redhat.com> | ||||||
|  | ---
 | ||||||
|  |  hw/xwayland/xwayland-input.c | 5 ++++- | ||||||
|  |  1 file changed, 4 insertions(+), 1 deletion(-) | ||||||
|  | 
 | ||||||
|  | diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c
 | ||||||
|  | index 4d447a5..1991076 100644
 | ||||||
|  | --- a/hw/xwayland/xwayland-input.c
 | ||||||
|  | +++ b/hw/xwayland/xwayland-input.c
 | ||||||
|  | @@ -298,6 +298,7 @@ pointer_handle_enter(void *data, struct wl_pointer *pointer,
 | ||||||
|  |      int i; | ||||||
|  |      int sx = wl_fixed_to_int(sx_w); | ||||||
|  |      int sy = wl_fixed_to_int(sy_w); | ||||||
|  | +    int dx, dy;
 | ||||||
|  |      ScreenPtr pScreen = xwl_seat->xwl_screen->screen; | ||||||
|  |      ValuatorMask mask; | ||||||
|  |   | ||||||
|  | @@ -314,9 +315,11 @@ pointer_handle_enter(void *data, struct wl_pointer *pointer,
 | ||||||
|  |      xwl_seat->pointer_enter_serial = serial; | ||||||
|  |   | ||||||
|  |      xwl_seat->focus_window = wl_surface_get_user_data(surface); | ||||||
|  | +    dx = xwl_seat->focus_window->window->drawable.x;
 | ||||||
|  | +    dy = xwl_seat->focus_window->window->drawable.y;
 | ||||||
|  |   | ||||||
|  |      master = GetMaster(dev, POINTER_OR_FLOAT); | ||||||
|  | -    (*pScreen->SetCursorPosition) (dev, pScreen, sx, sy, TRUE);
 | ||||||
|  | +    (*pScreen->SetCursorPosition) (dev, pScreen, dx + sx, dy + sy, TRUE);
 | ||||||
|  |   | ||||||
|  |      miPointerInvalidateSprite(master); | ||||||
|  |   | ||||||
|  | -- 
 | ||||||
|  | 2.9.3 | ||||||
|  | 
 | ||||||
| @ -0,0 +1,31 @@ | |||||||
|  | From 886a3a8bba89134c16661ba81256735d7933ec7b Mon Sep 17 00:00:00 2001 | ||||||
|  | From: Hans de Goede <hdegoede@redhat.com> | ||||||
|  | Date: Tue, 27 Sep 2016 14:30:10 +0200 | ||||||
|  | Subject: [PATCH xserver v2 4/7] xfree86: Remove redundant ServerIsNotSeat0 | ||||||
|  |  check from xf86CallDriverProbe | ||||||
|  | 
 | ||||||
|  | If foundScreen is TRUE, then all the code below the removed if | ||||||
|  | will not execute until we reach the return foundScreen; at the | ||||||
|  | end, so this entire if block is redundant. | ||||||
|  | 
 | ||||||
|  | Signed-off-by: Hans de Goede <hdegoede@redhat.com> | ||||||
|  | ---
 | ||||||
|  |  hw/xfree86/common/xf86Bus.c | 2 -- | ||||||
|  |  1 file changed, 2 deletions(-) | ||||||
|  | 
 | ||||||
|  | diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c
 | ||||||
|  | index 5b93940..27c6b1b 100644
 | ||||||
|  | --- a/hw/xfree86/common/xf86Bus.c
 | ||||||
|  | +++ b/hw/xfree86/common/xf86Bus.c
 | ||||||
|  | @@ -82,8 +82,6 @@ xf86CallDriverProbe(DriverPtr drv, Bool detect_only)
 | ||||||
|  |      if (!xf86DoConfigure && drv->platformProbe != NULL) { | ||||||
|  |          foundScreen = xf86platformProbeDev(drv); | ||||||
|  |      } | ||||||
|  | -    if (ServerIsNotSeat0() && foundScreen)
 | ||||||
|  | -        return foundScreen;
 | ||||||
|  |  #endif | ||||||
|  |   | ||||||
|  |  #ifdef XSERVER_LIBPCIACCESS | ||||||
|  | -- 
 | ||||||
|  | 2.9.3 | ||||||
|  | 
 | ||||||
| @ -0,0 +1,89 @@ | |||||||
|  | From 54fb5e9e6ed76ae4eef3ea61b1784ac9d52e1689 Mon Sep 17 00:00:00 2001 | ||||||
|  | From: Hans de Goede <hdegoede@redhat.com> | ||||||
|  | Date: Fri, 30 Sep 2016 11:59:04 +0200 | ||||||
|  | Subject: [PATCH xserver v2 5/7] xfree86: Make adding unclaimed devices as GPU | ||||||
|  |  devices a separate step | ||||||
|  | 
 | ||||||
|  | This is primarily a preparation patch for fixing the xserver exiting with | ||||||
|  | a "no screens found" error even though there are supported video cards, | ||||||
|  | due to the server not recognizing any card as the primary card. | ||||||
|  | 
 | ||||||
|  | This also fixes the (mostly theoretical) case of a platformBus capable | ||||||
|  | driver adding a device as GPUscreen before a driver which only supports | ||||||
|  | the old PCI probe method gets a chance to claim it as a normal screen. | ||||||
|  | 
 | ||||||
|  | Signed-off-by: Hans de Goede <hdegoede@redhat.com> | ||||||
|  | ---
 | ||||||
|  |  hw/xfree86/common/xf86Bus.c         |  4 ++++ | ||||||
|  |  hw/xfree86/common/xf86platformBus.c | 15 +++++++++++++++ | ||||||
|  |  hw/xfree86/common/xf86platformBus.h |  6 ++++++ | ||||||
|  |  3 files changed, 25 insertions(+) | ||||||
|  | 
 | ||||||
|  | diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c
 | ||||||
|  | index 27c6b1b..a3a9898 100644
 | ||||||
|  | --- a/hw/xfree86/common/xf86Bus.c
 | ||||||
|  | +++ b/hw/xfree86/common/xf86Bus.c
 | ||||||
|  | @@ -125,6 +125,10 @@ xf86BusConfig(void)
 | ||||||
|  |          xf86CallDriverProbe(xf86DriverList[i], FALSE); | ||||||
|  |      } | ||||||
|  |   | ||||||
|  | +    for (i = 0; i < xf86NumDrivers; i++) {
 | ||||||
|  | +        xf86platformAddGPUDevices(xf86DriverList[i]);
 | ||||||
|  | +    }
 | ||||||
|  | +
 | ||||||
|  |      /* If nothing was detected, return now */ | ||||||
|  |      if (xf86NumScreens == 0) { | ||||||
|  |          xf86Msg(X_ERROR, "No devices detected.\n"); | ||||||
|  | diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c
 | ||||||
|  | index 39fb1dd..8dd0d5d 100644
 | ||||||
|  | --- a/hw/xfree86/common/xf86platformBus.c
 | ||||||
|  | +++ b/hw/xfree86/common/xf86platformBus.c
 | ||||||
|  | @@ -475,6 +475,21 @@ xf86platformProbeDev(DriverPtr drvp)
 | ||||||
|  |                                          isGPUDevice(devList[i]) ? PLATFORM_PROBE_GPU_SCREEN : 0); | ||||||
|  |      } | ||||||
|  |   | ||||||
|  | +    return foundScreen;
 | ||||||
|  | +}
 | ||||||
|  | +
 | ||||||
|  | +int
 | ||||||
|  | +xf86platformAddGPUDevices(DriverPtr drvp)
 | ||||||
|  | +{
 | ||||||
|  | +    Bool foundScreen = FALSE;
 | ||||||
|  | +    GDevPtr *devList;
 | ||||||
|  | +    int j;
 | ||||||
|  | +
 | ||||||
|  | +    if (!drvp->platformProbe)
 | ||||||
|  | +        return FALSE;
 | ||||||
|  | +
 | ||||||
|  | +    xf86MatchDevice(drvp->driverName, &devList);
 | ||||||
|  | +
 | ||||||
|  |      /* if autoaddgpu devices is enabled then go find any unclaimed platform | ||||||
|  |       * devices and add them as GPU screens */ | ||||||
|  |      if (xf86Info.autoAddGPU) { | ||||||
|  | diff --git a/hw/xfree86/common/xf86platformBus.h b/hw/xfree86/common/xf86platformBus.h
 | ||||||
|  | index a7335b9..0f5c0ef 100644
 | ||||||
|  | --- a/hw/xfree86/common/xf86platformBus.h
 | ||||||
|  | +++ b/hw/xfree86/common/xf86platformBus.h
 | ||||||
|  | @@ -41,6 +41,7 @@ struct xf86_platform_device {
 | ||||||
|  |  #ifdef XSERVER_PLATFORM_BUS | ||||||
|  |  int xf86platformProbe(void); | ||||||
|  |  int xf86platformProbeDev(DriverPtr drvp); | ||||||
|  | +int xf86platformAddGPUDevices(DriverPtr drvp);
 | ||||||
|  |   | ||||||
|  |  extern int xf86_num_platform_devices; | ||||||
|  |  extern struct xf86_platform_device *xf86_platform_devices; | ||||||
|  | @@ -156,6 +157,11 @@ xf86PlatformMatchDriver(char *matches[], int nmatches);
 | ||||||
|  |   | ||||||
|  |  extern void xf86platformVTProbe(void); | ||||||
|  |  extern void xf86platformPrimary(void); | ||||||
|  | +
 | ||||||
|  | +#else
 | ||||||
|  | +
 | ||||||
|  | +static inline int xf86platformAddGPUDevices(DriverPtr drvp) { return FALSE; }
 | ||||||
|  | +
 | ||||||
|  |  #endif | ||||||
|  |   | ||||||
|  |  #endif | ||||||
|  | -- 
 | ||||||
|  | 2.9.3 | ||||||
|  | 
 | ||||||
							
								
								
									
										122
									
								
								0006-xfree86-Try-harder-to-find-atleast-1-non-GPU-Screen.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										122
									
								
								0006-xfree86-Try-harder-to-find-atleast-1-non-GPU-Screen.patch
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,122 @@ | |||||||
|  | From 5f6ac38e569369b39c34e7b0095f237cc30b51b5 Mon Sep 17 00:00:00 2001 | ||||||
|  | From: Hans de Goede <hdegoede@redhat.com> | ||||||
|  | Date: Fri, 30 Sep 2016 12:29:09 +0200 | ||||||
|  | Subject: [PATCH xserver v2 6/7] xfree86: Try harder to find atleast 1 non GPU | ||||||
|  |  Screen | ||||||
|  | 
 | ||||||
|  | If we did not find any non GPU Screens, try again ignoring the notion | ||||||
|  | of any video devices being the primary device. This fixes Xorg exiting | ||||||
|  | with a "no screens found" error when using virtio-vga in a | ||||||
|  | virtual-machine and when using a device driven by simpledrm. | ||||||
|  | 
 | ||||||
|  | This is a somewhat ugly solution, but it is the best I can come up with | ||||||
|  | without major surgery to the bus and probe code. | ||||||
|  | 
 | ||||||
|  | Signed-off-by: Hans de Goede <hdegoede@redhat.com> | ||||||
|  | ---
 | ||||||
|  |  hw/xfree86/common/xf86.h            |  1 + | ||||||
|  |  hw/xfree86/common/xf86Bus.c         | 26 +++++++++++++++++++++++--- | ||||||
|  |  hw/xfree86/common/xf86Globals.c     |  1 + | ||||||
|  |  hw/xfree86/common/xf86pciBus.c      |  4 ++++ | ||||||
|  |  hw/xfree86/common/xf86platformBus.c |  4 ++++ | ||||||
|  |  5 files changed, 33 insertions(+), 3 deletions(-) | ||||||
|  | 
 | ||||||
|  | diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h
 | ||||||
|  | index e54c811..f724688 100644
 | ||||||
|  | --- a/hw/xfree86/common/xf86.h
 | ||||||
|  | +++ b/hw/xfree86/common/xf86.h
 | ||||||
|  | @@ -55,6 +55,7 @@
 | ||||||
|  |  extern _X_EXPORT int xf86DoConfigure; | ||||||
|  |  extern _X_EXPORT int xf86DoShowOptions; | ||||||
|  |  extern _X_EXPORT Bool xf86DoConfigurePass1; | ||||||
|  | +extern _X_EXPORT Bool xf86ProbeIgnorePrimary;
 | ||||||
|  |  extern _X_EXPORT Bool xorgHWAccess; | ||||||
|  |   | ||||||
|  |  extern _X_EXPORT DevPrivateKeyRec xf86ScreenKeyRec; | ||||||
|  | diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c
 | ||||||
|  | index a3a9898..9836803 100644
 | ||||||
|  | --- a/hw/xfree86/common/xf86Bus.c
 | ||||||
|  | +++ b/hw/xfree86/common/xf86Bus.c
 | ||||||
|  | @@ -117,14 +117,34 @@ xf86BusConfig(void)
 | ||||||
|  |      int i, j; | ||||||
|  |   | ||||||
|  |      /* | ||||||
|  | -     * Now call each of the Probe functions.  Each successful probe will
 | ||||||
|  | -     * result in an extra entry added to the xf86Screens[] list for each
 | ||||||
|  | -     * instance of the hardware found.
 | ||||||
|  | +     * 3 step probe to (hopefully) ensure that we always find at least 1
 | ||||||
|  | +     * (non GPU) screen:
 | ||||||
|  | +     *
 | ||||||
|  | +     * 1. Call each drivers probe function normally,
 | ||||||
|  | +     *    Each successful probe will result in an extra entry added to the
 | ||||||
|  | +     *    xf86Screens[] list for each instance of the hardware found.
 | ||||||
|  |       */ | ||||||
|  |      for (i = 0; i < xf86NumDrivers; i++) { | ||||||
|  |          xf86CallDriverProbe(xf86DriverList[i], FALSE); | ||||||
|  |      } | ||||||
|  |   | ||||||
|  | +    /*
 | ||||||
|  | +     * 2. If no Screens were found, call each drivers probe function with
 | ||||||
|  | +     *    ignorePrimary = TRUE, to ensure that we do actually get a
 | ||||||
|  | +     *    Screen if there is atleast one supported video card.
 | ||||||
|  | +     */
 | ||||||
|  | +    if (xf86NumScreens == 0) {
 | ||||||
|  | +        xf86ProbeIgnorePrimary = TRUE;
 | ||||||
|  | +        for (i = 0; i < xf86NumDrivers && xf86NumScreens == 0; i++) {
 | ||||||
|  | +            xf86CallDriverProbe(xf86DriverList[i], FALSE);
 | ||||||
|  | +        }
 | ||||||
|  | +        xf86ProbeIgnorePrimary = FALSE;
 | ||||||
|  | +    }
 | ||||||
|  | +
 | ||||||
|  | +    /*
 | ||||||
|  | +     * 3. Call xf86platformAddGPUDevices() to add any additional video cards as
 | ||||||
|  | +     *    GPUScreens (GPUScreens are only supported by platformBus drivers).
 | ||||||
|  | +     */
 | ||||||
|  |      for (i = 0; i < xf86NumDrivers; i++) { | ||||||
|  |          xf86platformAddGPUDevices(xf86DriverList[i]); | ||||||
|  |      } | ||||||
|  | diff --git a/hw/xfree86/common/xf86Globals.c b/hw/xfree86/common/xf86Globals.c
 | ||||||
|  | index 07cfabf..e962b75 100644
 | ||||||
|  | --- a/hw/xfree86/common/xf86Globals.c
 | ||||||
|  | +++ b/hw/xfree86/common/xf86Globals.c
 | ||||||
|  | @@ -152,6 +152,7 @@ XF86ConfigPtr xf86configptr = NULL;
 | ||||||
|  |  Bool xf86Resetting = FALSE; | ||||||
|  |  Bool xf86Initialising = FALSE; | ||||||
|  |  Bool xf86DoConfigure = FALSE; | ||||||
|  | +Bool xf86ProbeIgnorePrimary = FALSE;
 | ||||||
|  |  Bool xf86DoShowOptions = FALSE; | ||||||
|  |  DriverPtr *xf86DriverList = NULL; | ||||||
|  |  int xf86NumDrivers = 0; | ||||||
|  | diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c
 | ||||||
|  | index 8158c2b..9adfee5 100644
 | ||||||
|  | --- a/hw/xfree86/common/xf86pciBus.c
 | ||||||
|  | +++ b/hw/xfree86/common/xf86pciBus.c
 | ||||||
|  | @@ -352,6 +352,10 @@ xf86ComparePciBusString(const char *busID, int bus, int device, int func)
 | ||||||
|  |  Bool | ||||||
|  |  xf86IsPrimaryPci(struct pci_device *pPci) | ||||||
|  |  { | ||||||
|  | +    /* Add max. 1 screen for the IgnorePrimary fallback path */
 | ||||||
|  | +    if (xf86ProbeIgnorePrimary && xf86NumScreens == 0)
 | ||||||
|  | +        return TRUE;
 | ||||||
|  | +
 | ||||||
|  |      if (primaryBus.type == BUS_PCI) | ||||||
|  |          return pPci == primaryBus.id.pci; | ||||||
|  |  #ifdef XSERVER_PLATFORM_BUS | ||||||
|  | diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c
 | ||||||
|  | index 8dd0d5d..063e81c 100644
 | ||||||
|  | --- a/hw/xfree86/common/xf86platformBus.c
 | ||||||
|  | +++ b/hw/xfree86/common/xf86platformBus.c
 | ||||||
|  | @@ -114,6 +114,10 @@ xf86_find_platform_device_by_devnum(int major, int minor)
 | ||||||
|  |  static Bool | ||||||
|  |  xf86IsPrimaryPlatform(struct xf86_platform_device *plat) | ||||||
|  |  { | ||||||
|  | +    /* Add max. 1 screen for the IgnorePrimary fallback path */
 | ||||||
|  | +    if (xf86ProbeIgnorePrimary && xf86NumScreens == 0)
 | ||||||
|  | +        return TRUE;
 | ||||||
|  | +
 | ||||||
|  |      if (primaryBus.type == BUS_PLATFORM) | ||||||
|  |          return plat == primaryBus.id.plat; | ||||||
|  |  #ifdef XSERVER_LIBPCIACCESS | ||||||
|  | -- 
 | ||||||
|  | 2.9.3 | ||||||
|  | 
 | ||||||
| @ -0,0 +1,41 @@ | |||||||
|  | From bd4c8cb4db6e3a1905998f8b848e9f4624f51d52 Mon Sep 17 00:00:00 2001 | ||||||
|  | From: Peter Hutterer <peter.hutterer@who-t.net> | ||||||
|  | Date: Tue, 18 Oct 2016 14:13:47 +1000 | ||||||
|  | Subject: [PATCH xserver v2 7/7] inputthread: On Linux leave the main thread's | ||||||
|  |  name as-is | ||||||
|  | 
 | ||||||
|  | On Linux, setting the main thread's name changes the program name | ||||||
|  | (/proc/self/comm). Setting it to MainThread breaks scripts that rely on | ||||||
|  | the command name, e.g. ps -C Xorg. | ||||||
|  | 
 | ||||||
|  | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> | ||||||
|  | Signed-off-by: Hans de Goede <hdegoede@redhat.com> | ||||||
|  | ---
 | ||||||
|  | Changes in v2 (hdegoede): | ||||||
|  | -Only leave the main thread as-is in Linux, naming it is not an issue on
 | ||||||
|  |  other platforms | ||||||
|  | ---
 | ||||||
|  |  os/inputthread.c | 2 ++ | ||||||
|  |  1 file changed, 2 insertions(+) | ||||||
|  | 
 | ||||||
|  | diff --git a/os/inputthread.c b/os/inputthread.c
 | ||||||
|  | index ddafa7f..8e7f2ed 100644
 | ||||||
|  | --- a/os/inputthread.c
 | ||||||
|  | +++ b/os/inputthread.c
 | ||||||
|  | @@ -431,11 +431,13 @@ InputThreadPreInit(void)
 | ||||||
|  |      } | ||||||
|  |      hotplugPipeWrite = hotplugPipe[1]; | ||||||
|  |   | ||||||
|  | +#ifndef __linux__ /* Linux does not deal well with renaming the main thread */
 | ||||||
|  |  #if defined(HAVE_PTHREAD_SETNAME_NP_WITH_TID) | ||||||
|  |      pthread_setname_np (pthread_self(), "MainThread"); | ||||||
|  |  #elif defined(HAVE_PTHREAD_SETNAME_NP_WITHOUT_TID) | ||||||
|  |      pthread_setname_np ("MainThread"); | ||||||
|  |  #endif | ||||||
|  | +#endif
 | ||||||
|  |   | ||||||
|  |  } | ||||||
|  |   | ||||||
|  | -- 
 | ||||||
|  | 2.9.3 | ||||||
|  | 
 | ||||||
							
								
								
									
										2
									
								
								commitid
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								commitid
									
									
									
									
									
								
							| @ -1 +1 @@ | |||||||
| 7a5ddf8da5ed817aa2dd6f7af1b9197a5ceec60b | d13cb974426f7f1110b0bdb08c4ebb46ff8975f7 | ||||||
|  | |||||||
							
								
								
									
										2
									
								
								sources
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								sources
									
									
									
									
									
								
							| @ -1 +1 @@ | |||||||
| f5b974279cda42bdc7589366817b3a9c  xorg-server-20160929.tar.xz | 0c24ed612ba0a0327be167f0178bfac9  xorg-server-20161026.tar.xz | ||||||
|  | |||||||
| @ -11,7 +11,7 @@ | |||||||
| # X.org requires lazy relocations to work. | # X.org requires lazy relocations to work. | ||||||
| %undefine _hardened_build | %undefine _hardened_build | ||||||
| 
 | 
 | ||||||
| %global gitdate 20160929 | %global gitdate 20161026 | ||||||
| %global stable_abi 1 | %global stable_abi 1 | ||||||
| 
 | 
 | ||||||
| %if !0%{?gitdate} || %{stable_abi} | %if !0%{?gitdate} || %{stable_abi} | ||||||
| @ -45,7 +45,7 @@ | |||||||
| Summary:   X.Org X11 X server | Summary:   X.Org X11 X server | ||||||
| Name:      xorg-x11-server | Name:      xorg-x11-server | ||||||
| Version:   1.19.0 | Version:   1.19.0 | ||||||
| Release:   0.2%{?gitdate:.%{gitdate}}%{dist} | Release:   0.3%{?gitdate:.%{gitdate}}%{dist} | ||||||
| URL:       http://www.x.org | URL:       http://www.x.org | ||||||
| License:   MIT | License:   MIT | ||||||
| Group:     User Interface/X | Group:     User Interface/X | ||||||
| @ -78,9 +78,13 @@ Source31: xserver-sdk-abi-requires.git | |||||||
| Source40: driver-abi-rebuild.sh | Source40: driver-abi-rebuild.sh | ||||||
| 
 | 
 | ||||||
| # Various fixes pending upstream | # Various fixes pending upstream | ||||||
| Patch1: 0001-glamor-Use-eglGetPlatformDisplayEXT-not-eglGetDispla.patch | Patch1: 0001-DRI2-Sync-radeonsi_pci_ids.h-from-Mesa.patch | ||||||
| Patch2: 0002-glamor-Fix-pixmap-offset-for-bitplane-in-glamor_copy.patch | Patch2: 0002-xfree86-Xorg.wrap-Do-not-require-root-rights-for-car.patch | ||||||
| Patch3: 0003-inputthread-Fix-inputthread-not-listening-if-a-fd-ge.patch | Patch3: 0003-xwayland-Transform-pointer-enter-event-coordinates.patch | ||||||
|  | Patch4: 0004-xfree86-Remove-redundant-ServerIsNotSeat0-check-from.patch | ||||||
|  | Patch5: 0005-xfree86-Make-adding-unclaimed-devices-as-GPU-devices.patch | ||||||
|  | Patch6: 0006-xfree86-Try-harder-to-find-atleast-1-non-GPU-Screen.patch | ||||||
|  | Patch7: 0007-inputthread-On-Linux-leave-the-main-thread-s-name-as.patch | ||||||
| 
 | 
 | ||||||
| #Patch6044: xserver-1.6.99-hush-prerelease-warning.patch | #Patch6044: xserver-1.6.99-hush-prerelease-warning.patch | ||||||
| 
 | 
 | ||||||
| @ -600,6 +604,12 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete | |||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| %changelog | %changelog | ||||||
|  | * Wed Oct 26 2016 Hans de Goede <hdegoede@redhat.com> - 1.19.0-0.3.20161026 | ||||||
|  | - Sync with upstream git, bringing in a bunch if bug-fixes | ||||||
|  | - Add some extra fixes which are pending upstream | ||||||
|  | - This also adds PointerWarping emulation to Xwayland, which should improve | ||||||
|  |   compatiblity with many games | ||||||
|  | 
 | ||||||
| * Wed Oct  5 2016 Hans de Goede <hdegoede@redhat.com> - 1.19.0-0.2.20160929 | * Wed Oct  5 2016 Hans de Goede <hdegoede@redhat.com> - 1.19.0-0.2.20160929 | ||||||
| - Add a fix from upstream to fix xterm crash under Xwayland (fdo#97974) | - Add a fix from upstream to fix xterm crash under Xwayland (fdo#97974) | ||||||
| - Add a fix from upstream to fix glamor / xwayland not working with glvnd | - Add a fix from upstream to fix glamor / xwayland not working with glvnd | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user