Bug#896979: xserver-xorg-video-nouveau: Crash when undocking Lenovo P50

2018-06-07 Thread Sam Morris
On Wed, Jun 06, 2018 at 07:49:05PM +0200, Sven Joachim wrote:
> >
> > Looks like the nouveau driver needs something like
> >
> > https://cgit.freedesktop.org/xorg/driver/xf86-video-amdgpu/commit/?id=f4107f67f147e2500582fc36cf0f0f76bc1ef098
> 
> Sam, could you please test the attached patch?
> 
> TIA,
> Sven
> 

Works like a dream. Undocking and re-docking again worked at least once,
but it's not totally reliable. On the other hand it's much better than a
crash. :)

-- 
Sam Morris 
CAAA AA1A CA69 A83A 892B  1855 D20B 4202 5CDA 27B9



Bug#896979: xserver-xorg-video-nouveau: Crash when undocking Lenovo P50

2018-06-06 Thread Sven Joachim
On 2018-06-06 15:48 +0200, Michel Dänzer wrote:

> On 2018-06-06 03:05 PM, Sam Morris wrote:
>> Source: xserver-xorg-video-nouveau
>> Followup-For: Bug #896979
>> 
>> I'm still seeing this with Xorg 1.20 (which is not unexpected). Here's a
>> better backtrace:
>> 
>> #0  0x7fd90edb5e7b in __GI_raise (sig=sig@entry=6) at 
>> ../sysdeps/unix/sysv/linux/raise.c:51
>> #1  0x7fd90edb7231 in __GI_abort () at abort.c:79
>> #2  0x557576dc55ca in OsAbort () at ../../../../os/utils.c:1350
>> #3  0x557576dcb163 in AbortServer () at ../../../../os/log.c:877
>> #4  0x557576dcbf85 in FatalError (f=f@entry=0x557576dfec30 "Caught 
>> signal %d (%s). Server aborting\n") at ../../../../os/log.c:1015
>> #5  0x557576dc26b3 in OsSigHandler (signo=11, sip=, 
>> unused=) at ../../../../os/osinit.c:156
>> #6  0x7fd90f14cf50 in  () at 
>> /lib/x86_64-linux-gnu/libpthread.so.0
>> #7  0x7fd90c027f29 in drmmode_output_dpms (output=0x557578bfaf20, 
>> mode=3) at ../../src/drmmode_display.c:921
>> #8  0x557576cd8813 in xf86DisableUnusedFunctions 
>> (pScrn=0x557578a6a120) at ../../../../../../hw/xfree86/modes/xf86Crtc.c:3021
>> #9  0x557576ce0980 in xf86RandR12CrtcSet (pScreen=, 
>> randr_crtc=0x557578c33220, randr_mode=0x0, x=0, y=0, rotation=> out>, num_randr_outputs=0, randr_outputs=0x0) at 
>> ../../../../../../hw/xfree86/modes/xf86RandR12.c:1241
>> #10 0x557576d20122 in RRCrtcSet (crtc=, mode=0x0, 
>> x=0, y=0, rotation=rotation@entry=1, numOutputs=numOutputs@entry=0, 
>> outputs=0x0) at ../../../../randr/rrcrtc.c:774
>> #11 0x557576d219fe in ProcRRSetCrtcConfig (client=0x557578a598f0) at 
>> ../../../../randr/rrcrtc.c:1401
>> #12 0x557576c660b8 in Dispatch () at ../../../../dix/dispatch.c:478
>> #13 0x557576c6a0b8 in dix_main (argc=13, argv=0x7ffd47296448, 
>> envp=) at ../../../../dix/main.c:276
>> #14 0x7fd90eda2a87 in __libc_start_main (main=0x557576c53d80 , 
>> argc=13, argv=0x7ffd47296448, init=, fini=, 
>> rtld_fini=, stack_end=0x7ffd47296438) at 
>> ../csu/libc-start.c:310
>> #15 0x557576c53dba in _start ()
>> 
>> (gdb) frame 7
>> #7  drmmode_output_dpms (output=0x557578bfaf20, mode=3) at 
>> ../../src/drmmode_display.c:921
>> 921  in ../../src/drmmode_display.c
>> 
>> Looking at that file in nouveau's source code:
>> 
>> static void
>> drmmode_output_dpms(xf86OutputPtr output, int mode)
>> {
>> drmmode_output_private_ptr drmmode_output = output->driver_private;
>> drmModeConnectorPtr koutput = drmmode_output->mode_output;
>> drmModePropertyPtr props;
>> drmmode_ptr drmmode = drmmode_output->drmmode;
>> int mode_id = -1, i;
>> 
>> for (i = 0; i < koutput->count_props; i++) { // <-- this line!
>> props = drmModeGetProperty(drmmode->fd, koutput->props[i]);
>> if (props && (props->flags & DRM_MODE_PROP_ENUM)) {
>> if (!strcmp(props->name, "DPMS")) {
>> mode_id = koutput->props[i];
>> drmModeFreeProperty(props);
>> break;
>> }
>> drmModeFreeProperty(props);
>> }
>> }
>> 
>> Examining some variables:
>> 
>> (gdb) p i
>> $7 = 0
>> 
>> (gdb) p koutput
>> $8 = (struct _drmModeConnector *) 0x0
>
> Looks like the nouveau driver needs something like
>
> https://cgit.freedesktop.org/xorg/driver/xf86-video-amdgpu/commit/?id=f4107f67f147e2500582fc36cf0f0f76bc1ef098

Sam, could you please test the attached patch?

TIA,
Sven

>From f3ba56e9adf8ed96642b70ec5cf50234a98ab23b Mon Sep 17 00:00:00 2001
From: Sven Joachim 
Date: Wed, 6 Jun 2018 19:43:31 +0200
Subject: [PATCH] Check for NULL koutput in drmmode_output_dpms

---
 src/drmmode_display.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 2b71c9c4..9900674c 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -918,6 +918,9 @@ drmmode_output_dpms(xf86OutputPtr output, int mode)
 	drmmode_ptr drmmode = drmmode_output->drmmode;
 	int mode_id = -1, i;
 
+	if (!koutput)
+		return;
+
 	for (i = 0; i < koutput->count_props; i++) {
 		props = drmModeGetProperty(drmmode->fd, koutput->props[i]);
 		if (props && (props->flags & DRM_MODE_PROP_ENUM)) {
-- 
2.17.1



Bug#896979: xserver-xorg-video-nouveau: Crash when undocking Lenovo P50

2018-06-06 Thread Michel Dänzer
On 2018-06-06 03:05 PM, Sam Morris wrote:
> Source: xserver-xorg-video-nouveau
> Followup-For: Bug #896979
> 
> I'm still seeing this with Xorg 1.20 (which is not unexpected). Here's a
> better backtrace:
> 
> #0  0x7fd90edb5e7b in __GI_raise (sig=sig@entry=6) at 
> ../sysdeps/unix/sysv/linux/raise.c:51
> #1  0x7fd90edb7231 in __GI_abort () at abort.c:79
> #2  0x557576dc55ca in OsAbort () at ../../../../os/utils.c:1350
> #3  0x557576dcb163 in AbortServer () at ../../../../os/log.c:877
> #4  0x557576dcbf85 in FatalError (f=f@entry=0x557576dfec30 "Caught 
> signal %d (%s). Server aborting\n") at ../../../../os/log.c:1015
> #5  0x557576dc26b3 in OsSigHandler (signo=11, sip=, 
> unused=) at ../../../../os/osinit.c:156
> #6  0x7fd90f14cf50 in  () at 
> /lib/x86_64-linux-gnu/libpthread.so.0
> #7  0x7fd90c027f29 in drmmode_output_dpms (output=0x557578bfaf20, 
> mode=3) at ../../src/drmmode_display.c:921
> #8  0x557576cd8813 in xf86DisableUnusedFunctions 
> (pScrn=0x557578a6a120) at ../../../../../../hw/xfree86/modes/xf86Crtc.c:3021
> #9  0x557576ce0980 in xf86RandR12CrtcSet (pScreen=, 
> randr_crtc=0x557578c33220, randr_mode=0x0, x=0, y=0, rotation= out>, num_randr_outputs=0, randr_outputs=0x0) at 
> ../../../../../../hw/xfree86/modes/xf86RandR12.c:1241
> #10 0x557576d20122 in RRCrtcSet (crtc=, mode=0x0, x=0, 
> y=0, rotation=rotation@entry=1, numOutputs=numOutputs@entry=0, outputs=0x0) 
> at ../../../../randr/rrcrtc.c:774
> #11 0x557576d219fe in ProcRRSetCrtcConfig (client=0x557578a598f0) at 
> ../../../../randr/rrcrtc.c:1401
> #12 0x557576c660b8 in Dispatch () at ../../../../dix/dispatch.c:478
> #13 0x557576c6a0b8 in dix_main (argc=13, argv=0x7ffd47296448, 
> envp=) at ../../../../dix/main.c:276
> #14 0x7fd90eda2a87 in __libc_start_main (main=0x557576c53d80 , 
> argc=13, argv=0x7ffd47296448, init=, fini=, 
> rtld_fini=, stack_end=0x7ffd47296438) at 
> ../csu/libc-start.c:310
> #15 0x557576c53dba in _start ()
> 
> (gdb) frame 7
> #7  drmmode_output_dpms (output=0x557578bfaf20, mode=3) at 
> ../../src/drmmode_display.c:921
> 921   in ../../src/drmmode_display.c
> 
> Looking at that file in nouveau's source code:
> 
> static void
> drmmode_output_dpms(xf86OutputPtr output, int mode)
> {
> drmmode_output_private_ptr drmmode_output = output->driver_private;
> drmModeConnectorPtr koutput = drmmode_output->mode_output;
> drmModePropertyPtr props;
> drmmode_ptr drmmode = drmmode_output->drmmode;
> int mode_id = -1, i;
> 
> for (i = 0; i < koutput->count_props; i++) { // <-- this line!
> props = drmModeGetProperty(drmmode->fd, koutput->props[i]);
> if (props && (props->flags & DRM_MODE_PROP_ENUM)) {
> if (!strcmp(props->name, "DPMS")) {
> mode_id = koutput->props[i];
> drmModeFreeProperty(props);
> break;
> }
> drmModeFreeProperty(props);
> }
> }
> 
> Examining some variables:
> 
> (gdb) p i
> $7 = 0
> 
> (gdb) p koutput
> $8 = (struct _drmModeConnector *) 0x0

Looks like the nouveau driver needs something like

https://cgit.freedesktop.org/xorg/driver/xf86-video-amdgpu/commit/?id=f4107f67f147e2500582fc36cf0f0f76bc1ef098


-- 
Earthling Michel Dänzer   |   http://www.amd.com
Libre software enthusiast | Mesa and X developer



Bug#896979: xserver-xorg-video-nouveau: Crash when undocking Lenovo P50

2018-06-06 Thread Sam Morris
Source: xserver-xorg-video-nouveau
Followup-For: Bug #896979

I'm still seeing this with Xorg 1.20 (which is not unexpected). Here's a
better backtrace:

#0  0x7fd90edb5e7b in __GI_raise (sig=sig@entry=6) at 
../sysdeps/unix/sysv/linux/raise.c:51
#1  0x7fd90edb7231 in __GI_abort () at abort.c:79
#2  0x557576dc55ca in OsAbort () at ../../../../os/utils.c:1350
#3  0x557576dcb163 in AbortServer () at ../../../../os/log.c:877
#4  0x557576dcbf85 in FatalError (f=f@entry=0x557576dfec30 "Caught 
signal %d (%s). Server aborting\n") at ../../../../os/log.c:1015
#5  0x557576dc26b3 in OsSigHandler (signo=11, sip=, 
unused=) at ../../../../os/osinit.c:156
#6  0x7fd90f14cf50 in  () at 
/lib/x86_64-linux-gnu/libpthread.so.0
#7  0x7fd90c027f29 in drmmode_output_dpms (output=0x557578bfaf20, 
mode=3) at ../../src/drmmode_display.c:921
#8  0x557576cd8813 in xf86DisableUnusedFunctions (pScrn=0x557578a6a120) 
at ../../../../../../hw/xfree86/modes/xf86Crtc.c:3021
#9  0x557576ce0980 in xf86RandR12CrtcSet (pScreen=, 
randr_crtc=0x557578c33220, randr_mode=0x0, x=0, y=0, rotation=, 
num_randr_outputs=0, randr_outputs=0x0) at 
../../../../../../hw/xfree86/modes/xf86RandR12.c:1241
#10 0x557576d20122 in RRCrtcSet (crtc=, mode=0x0, x=0, 
y=0, rotation=rotation@entry=1, numOutputs=numOutputs@entry=0, outputs=0x0) at 
../../../../randr/rrcrtc.c:774
#11 0x557576d219fe in ProcRRSetCrtcConfig (client=0x557578a598f0) at 
../../../../randr/rrcrtc.c:1401
#12 0x557576c660b8 in Dispatch () at ../../../../dix/dispatch.c:478
#13 0x557576c6a0b8 in dix_main (argc=13, argv=0x7ffd47296448, 
envp=) at ../../../../dix/main.c:276
#14 0x7fd90eda2a87 in __libc_start_main (main=0x557576c53d80 , 
argc=13, argv=0x7ffd47296448, init=, fini=, 
rtld_fini=, stack_end=0x7ffd47296438) at ../csu/libc-start.c:310
#15 0x557576c53dba in _start ()

(gdb) frame 7
#7  drmmode_output_dpms (output=0x557578bfaf20, mode=3) at 
../../src/drmmode_display.c:921
921 in ../../src/drmmode_display.c

Looking at that file in nouveau's source code:

static void
drmmode_output_dpms(xf86OutputPtr output, int mode)
{
drmmode_output_private_ptr drmmode_output = output->driver_private;
drmModeConnectorPtr koutput = drmmode_output->mode_output;
drmModePropertyPtr props;
drmmode_ptr drmmode = drmmode_output->drmmode;
int mode_id = -1, i;

for (i = 0; i < koutput->count_props; i++) { // <-- this line!
props = drmModeGetProperty(drmmode->fd, koutput->props[i]);
if (props && (props->flags & DRM_MODE_PROP_ENUM)) {
if (!strcmp(props->name, "DPMS")) {
mode_id = koutput->props[i];
drmModeFreeProperty(props);
break;
}
drmModeFreeProperty(props);
}
}

Examining some variables:

(gdb) p i
$7 = 0

(gdb) p koutput
$8 = (struct _drmModeConnector *) 0x0

(gdb) p *drmmode_output
$9 = {
  drmmode = 0x557578bf9370, 
  output_id = 73, 
  mode_output = 0x0, 
  mode_encoder = 0x557578bf96a0, 
  edid_blob = 0x0, 
  num_props = 10, 
  props = 0x557578c38f10
}

So anyway... are you likely to consider that alternative patch to Xorg,
to make it not consider nouveau for newer devices? I have tested it and
it works fine--although another bug (#900877) makes the modesetting
driver not work with external displays.

-- System Information:
Debian Release: 9.4
  APT prefers stable-updates
  APT policy: (540, 'stable-updates'), (540, 'stable'), (520, 'testing'), (510, 
'unstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 4.9.0-6-686-pae (SMP w/1 CPU core)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)



Bug#896979: xserver-xorg-video-nouveau: Crash when undocking Lenovo P50

2018-04-27 Thread Sam Morris
On Thu, 2018-04-26 at 18:45 +0200, Sven Joachim wrote:
> On 2018-04-26 14:13 +, Sam Morris wrote:
> 
> > Followup-For: Bug #896979
> > Control: tag -1 + patch
> > 
> > This patch (taken from
> > )
> > fixes
> > the problem for me.
> > 
> > (Note, I modified the patch to end the log message with a newline
> > character).
> > 
> > From 5533658dd1afa31557d4ec4b469181f1d592d8c8 Mon Sep 17
> > 00:00:00 2001
> > From: Ben Skeggs 
> > Date: Sat, 20 May 2017 00:29:27 +1000
> > Subject: [PATCH] remove support for maxwell and higher
> 
> I don't think this is a good idea, unless upstream agrees to it.  I
> would rather have us patch the xorg-server package to not use the
> nouveau driver by default on such cards, as we do for Intel GPUs.
> 
> For the record, Fedora currently uses the modesetting driver on all
> cards from GeForce 8 onwards[1].
> 
> Cheers,
>Sven
> 
> 
> 1. https://src.fedoraproject.org/rpms/xorg-x11-server/blob/master/f/0
> 001-xfree86-use-modesetting-driver-by-default-on-GeForce.patch

Either solution sounds good to me! =D

-- 
Sam Morris 
PGP: rsa4096/CAAA AA1A CA69 A83A 892B  1855 D20B 4202 5CDA 27B9


signature.asc
Description: This is a digitally signed message part


Bug#896979: xserver-xorg-video-nouveau: Crash when undocking Lenovo P50

2018-04-26 Thread Sven Joachim
On 2018-04-26 14:13 +, Sam Morris wrote:

> Followup-For: Bug #896979
> Control: tag -1 + patch
>
> This patch (taken from
> ) fixes
> the problem for me.
>
> (Note, I modified the patch to end the log message with a newline
> character).
>
> From 5533658dd1afa31557d4ec4b469181f1d592d8c8 Mon Sep 17 00:00:00 2001
> From: Ben Skeggs 
> Date: Sat, 20 May 2017 00:29:27 +1000
> Subject: [PATCH] remove support for maxwell and higher

I don't think this is a good idea, unless upstream agrees to it.  I
would rather have us patch the xorg-server package to not use the
nouveau driver by default on such cards, as we do for Intel GPUs.

For the record, Fedora currently uses the modesetting driver on all
cards from GeForce 8 onwards[1].

Cheers,
   Sven


1. 
https://src.fedoraproject.org/rpms/xorg-x11-server/blob/master/f/0001-xfree86-use-modesetting-driver-by-default-on-GeForce.patch



Bug#896979: xserver-xorg-video-nouveau: Crash when undocking Lenovo P50

2018-04-26 Thread Sam Morris
Followup-For: Bug #896979
Control: tag -1 + patch

This patch (taken from
) fixes
the problem for me.

(Note, I modified the patch to end the log message with a newline
character).

From 5533658dd1afa31557d4ec4b469181f1d592d8c8 Mon Sep 17 00:00:00 2001
From: Ben Skeggs 
Date: Sat, 20 May 2017 00:29:27 +1000
Subject: [PATCH] remove support for maxwell and higher

xf86-video-modesetting does a way better job.

Signed-off-by: Ben Skeggs 
---
 src/nv_driver.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/nv_driver.c b/src/nv_driver.c
index 32062eb..f9d47eb 100644
--- a/src/nv_driver.c
+++ b/src/nv_driver.c
@@ -389,12 +389,10 @@ NVHasKMS(struct pci_device *pci_dev, struct 
xf86_platform_device *platform_dev)
case 0xe0:
case 0xf0:
case 0x100:
-   case 0x110:
-   case 0x120:
-   case 0x130:
break;
default:
-   xf86DrvMsg(-1, X_ERROR, "Unknown chipset: NV%02X\n", chipset);
+   xf86DrvMsg(-1, X_INFO, "Using xf86-video-modesetting for "
+  "Maxwell and newer GPUs.\n");
return FALSE;
}
return TRUE;
-- 
2.13.0

-- System Information:
Debian Release: 9.4
  APT prefers stable-updates
  APT policy: (540, 'stable-updates'), (540, 'stable'), (520, 'testing'), (510, 
'unstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 4.9.0-6-686-pae (SMP w/1 CPU core)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)



Bug#896979: xserver-xorg-video-nouveau: Crash when undocking Lenovo P50

2018-04-26 Thread Sam Morris
Package: xserver-xorg-video-nouveau
Version: 1:1.0.15-2
Severity: normal

When undocking my Lenovo P50, X crashes with:

[821563.021] (II) config/udev: removing device Logitech USB Optical Mouse
[821563.022] (**) Option "fd" "30"
[821563.022] (II) event6  - Logitech USB Optical Mouse: device removed
[821563.042] (II) UnloadModule: "libinput"
[821563.042] (II) systemd-logind: releasing fd for 13:70
[821563.183] (II) config/udev: removing device Logitech USB Keyboard
[821563.183] (**) Option "fd" "31"
[821563.183] (II) event7  - Logitech USB Keyboard: device removed
[821563.200] (II) UnloadModule: "libinput"
[821563.201] (II) systemd-logind: releasing fd for 13:71
[821563.258] (II) config/udev: removing device Logitech USB Keyboard
[821563.258] (**) Option "fd" "32"
[821563.258] (II) event8  - Logitech USB Keyboard: device removed
[821563.279] (II) UnloadModule: "libinput"
[821563.279] (II) systemd-logind: releasing fd for 13:72
[821563.380] (II) config/udev: removing device Plantronics Plantronics 
C325-M
[821563.381] (**) Option "fd" "33"
[821563.381] (II) event9  - Plantronics Plantronics C325-M: device removed
[821563.391] (II) UnloadModule: "libinput"
[821563.392] (II) systemd-logind: releasing fd for 13:73
[821563.430] (II) modeset(0): EDID vendor "SHP", prod id 5179
[821563.430] (II) modeset(0): Printing DDC gathered Modelines:
[821563.430] (II) modeset(0): Modeline "3840x2160"x0.0  533.25  3840 3888 
3920 4000  2160 2163 2168  -hsync -vsync (133.3 kHz eP)
[821563.789] (II) modeset(0): EDID vendor "SHP", prod id 5179
[821563.789] (II) modeset(0): Printing DDC gathered Modelines:
[821563.789] (II) modeset(0): Modeline "3840x2160"x0.0  533.25  3840 3888 
3920 4000  2160 2163 2168  -hsync -vsync (133.3 kHz eP)
[821564.511] failed to get BO with handle -1
[821564.511] (EE) 
[821564.511] (EE) Backtrace:
[821564.512] (EE) 0: /usr/lib/xorg/Xorg (xorg_backtrace+0x4d) 
[0x558941ee0e3d]
[821564.512] (EE) 1: /usr/lib/xorg/Xorg (0x558941d29000+0x1bbbd9) 
[0x558941ee4bd9]
[821564.512] (EE) 2: /lib/x86_64-linux-gnu/libpthread.so.0 
(0x7f9837ace000+0x11f50) [0x7f9837adff50]
[821564.512] (EE) 3: /usr/lib/xorg/modules/drivers/nouveau_drv.so 
(0x7f98349aa000+0x26759) [0x7f98349d0759]
[821564.512] (EE) 4: /usr/lib/xorg/Xorg (xf86DisableUnusedFunctions+0x53) 
[0x558941df3803]
[821564.512] (EE) 5: /usr/lib/xorg/Xorg (0x558941d29000+0xd24d0) 
[0x558941dfb4d0]
[821564.512] (EE) 6: /usr/lib/xorg/Xorg (RRCrtcSet+0x122) [0x558941e3ef42]
[821564.512] (EE) 7: /usr/lib/xorg/Xorg (ProcRRSetCrtcConfig+0x253) 
[0x558941e407c3]
[821564.512] (EE) 8: /usr/lib/xorg/Xorg (0x558941d29000+0x52d48) 
[0x558941d7bd48]
[821564.512] (EE) 9: /usr/lib/xorg/Xorg (0x558941d29000+0x56d90) 
[0x558941d7fd90]
[821564.513] (EE) 10: /lib/x86_64-linux-gnu/libc.so.6 
(__libc_start_main+0xe7) [0x7f9837735a87]
[821564.513] (EE) 11: /usr/lib/xorg/Xorg (_start+0x2a) [0x558941d69a3a]
[821564.513] (EE) 
[821564.513] (EE) Segmentation fault at address 0x30
[821564.513] (EE) 
Fatal server error:
[821564.513] (EE) Caught signal 11 (Segmentation fault). Server aborting
[821564.513] (EE) 
[821564.513] (EE) 
Please consult the The X.Org Foundation support 
 at http://wiki.x.org
 for help. 
[821564.513] (EE) Please also check the log file at 
"/home/sam/.local/share/xorg/Xorg.1.log" for additional information.
[821564.513] (EE) 
[821564.513] (II) AIGLX: Suspending AIGLX clients for VT switch
[821565.550] (EE) Server terminated with error (1). Closing log file.

According to :

The newer nouveau versions add support for Maxwell/Pascal (against
my recommendation...), however, the nouveau DDX cannot handle DP MST
hotplugging, which at least the P50 dock makes use of.  I suspect
this is the cause of the dock issues on the newer version.

In F26/rawhide, I've modified the xserver to autoconfigure
'modesetting' on new NVIDIA GPUs.  For F25, I'll probably submit a
revert patch for just Maxwell/Pascal.

-- Package-specific info:
/etc/X11/X does not exist.
/etc/X11/X is not a symlink.
/etc/X11/X is not executable.

VGA-compatible devices on PCI bus:
--
00:02.0 VGA compatible controller [0300]: Intel Corporation HD Graphics 530 
[8086:191b] (rev 06)
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GM107GLM [Quadro 
M2000M] [10de:13b0] (rev a2)

/etc/X11/xorg.conf does not exist.

/etc/X11/xorg.conf.d does not exist.

/etc/modprobe.d contains no KMS configuration files.

Kernel version (/proc/version):
---
Linux version 4.15.0-3-amd64 (debian-ker...@lists.debian.org) (gcc version 
7.3.0 (Debian 7.3.0-16)) #1 SMP Debian 4.15.17-1 (2018-04-19)

udev information:
-
P: