LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Gentoo (https://www.linuxquestions.org/questions/gentoo-87/)
-   -   HDMI hotplug malfunction with X (Nvidia Optimus notebook) (https://www.linuxquestions.org/questions/gentoo-87/hdmi-hotplug-malfunction-with-x-nvidia-optimus-notebook-4175601467/)

unassailable 03-10-2017 09:46 AM

HDMI hotplug malfunction with X (Nvidia Optimus notebook)
 
I've been diagnosing my recent lack of HDMI connectivity within X for a few weeks now and have hit many walls. HDMI was functioning correctly until a kernel update (4.9.6-r1), rolling back kernel (4.4.39) did not fix the issue.

I suspect something is causing a premature unplug event when X is running, but honestly have no idea at this point. I'm looking for an external perspective, how would you diagnose this problem?

Notes:
  • enabling udev debug (/etc/conf.d/udev) only creates an empty file (/run/udevdebug.log)
  • kernel CMDLINE nvidia-drm.modeset=0 seems has no effect
  • kernel is configured with no FB
  • No applicable rules present in /etc/udev/rules.d
  • External monitor's EDID resolutions appear to be incorrect (see reference below)

From the console

HDMI connection appears to be working normally. Monitor shows 1920x1080 mirror image of eDP1 after a unplug/plug cycle.

$ udevadm monitor --environment --udev
Code:

UDEV  [2607.461058] change  /devices/pci0000:00/0000:00:02.0/drm/card0 (drm)
ACTION=change
DEVNAME=/dev/dri/card0
DEVPATH=/devices/pci0000:00/0000:00:02.0/drm/card0
DEVTYPE=drm_minor
HOTPLUG=1
ID_PATH=pci-0000:00:02.0
ID_PATH_TAG=pci-0000_00_02_0
MAJOR=226
MINOR=0
SEQNUM=2424
SUBSYSTEM=drm
TAGS=:udev-acl:
USEC_INITIALIZED=4777

/var/log/messages:
Code:

kernel: udevd[2071]: Validate module index
kernel: udevd[2071]: seq 2426 queued, 'change' 'drm'
kernel: udevd[2071]: seq 2426 forked new worker [20059]
kernel: udevd[20059]: seq 2426 running
kernel: udevd[20059]: IMPORT builtin 'path_id' /lib64/udev/rules.d/60-drm.rules:3
kernel: udevd[20059]: RUN 'udev-acl --action=$env{ACTION} --device=$env{DEVNAME}' /lib64/udev/rules.d/70-udev-acl.rules:74
kernel: udevd[20059]: handling device node '/dev/dri/card0', devnum=c226:0, mode=0600, uid=0, gid=0
kernel: udevd[20059]: preserve already existing symlink '/dev/char/226:0' to '../dri/card0'
kernel: udevd[20059]: created db file '/run/udev/data/c226:0' for '/devices/pci0000:00/0000:00:02.0/drm/card0'
kernel: udevd[20060]: starting 'udev-acl --action=change --device=/dev/dri/card0'
root[20063]: ACPI event unhandled: jack/lineout LINEOUT plug
root[20065]: ACPI event unhandled: jack/videoout VIDEOOUT plug

/sys/class/drm/:
Code:

ls card*/status; cat card*/status
card0-DP-1/status  card0-eDP-1/status    card0-HDMI-A-2/status
card0-DP-2/status  card0-HDMI-A-1/status
disconnected
disconnected
connected
connected
disconnected

Within X

The same unplug/plug cycle yields two udev events (plug/unplug?)

$ udevadm monitor --environment --udev
Code:

UDEV  [82.623296] change  /devices/pci0000:00/0000:00:02.0/drm/card0 (drm)
ACTION=change
DEVNAME=/dev/dri/card0
DEVPATH=/devices/pci0000:00/0000:00:02.0/drm/card0
DEVTYPE=drm_minor
HOTPLUG=1
ID_PATH=pci-0000:00:02.0
ID_PATH_TAG=pci-0000_00_02_0
MAJOR=226
MINOR=0
SEQNUM=2416
SUBSYSTEM=drm
TAGS=:udev-acl:
USEC_INITIALIZED=4777

UDEV  [83.377742] change  /devices/pci0000:00/0000:00:02.0/drm/card0 (drm)
ACTION=change
DEVNAME=/dev/dri/card0
DEVPATH=/devices/pci0000:00/0000:00:02.0/drm/card0
DEVTYPE=drm_minor
HOTPLUG=1
ID_PATH=pci-0000:00:02.0
ID_PATH_TAG=pci-0000_00_02_0
MAJOR=226
MINOR=0
SEQNUM=2417
SUBSYSTEM=drm
TAGS=:udev-acl:
USEC_INITIALIZED=4777

/var/log/messages (note the lack of acpi log):
Code:

udevd[2071]: Validate module index
udevd[2071]: seq 2418 queued, 'change' 'drm'
udevd[2071]: seq 2418 forked new worker [19811]
udevd[19811]: seq 2418 running
udevd[19811]: IMPORT builtin 'path_id' /lib64/udev/rules.d/60-drm.rules:3
udevd[19811]: RUN 'udev-acl --action=$env{ACTION} --device=$env{DEVNAME}' /lib64/udev/rules.d/70-udev-acl.rules:74
udevd[19811]: handling device node '/dev/dri/card0', devnum=c226:0, mode=0600, uid=0, gid=0
udevd[19811]: preserve already existing symlink '/dev/char/226:0' to '../dri/card0'
udevd[19811]: created db file '/run/udev/data/c226:0' for '/devices/pci0000:00/0000:00:02.0/drm/card0'
udevd[19813]: starting 'udev-acl --action=change --device=/dev/dri/card0'

/sys/class/drm/ and xrandr shows no connection:
Code:

ls card*/status; cat card*/status
card0-DP-1/status  card0-eDP-1/status    card0-HDMI-A-2/status
card0-DP-2/status  card0-HDMI-A-1/status
disconnected
disconnected
connected
disconnected
disconnected

Reference

Packages
Code:

x11-base/xorg-server-1.18.4
x11-drivers/nvidia-drivers-375.26-r3
x11-base/xorg-drivers-1.18-r1
media-libs/mesa-12.0.1
sys-kernel/linux-firmware-20161205

Hardware
Code:

lspci -k | grep -A 2 -E "(VGA|3D)"
00:02.0 VGA compatible controller: Intel Corporation Device 191b (rev 06)
        Subsystem: Acer Incorporated [ALI] Device 1039
        Kernel driver in use: i915
--
01:00.0 3D controller: NVIDIA Corporation GM107M [GeForce GTX 960M] (rev a2)
        Subsystem: Acer Incorporated [ALI] GM107M [GeForce GTX 960M]
        Kernel driver in use: nvidia

Monitor's EDID (it is a 4k@30Hz monitor):
Code:

sudo sh -c "get-edid |parse-edid"
This is read-edid version 3.0.1. Prepare for some fun.
Attempting to use i2c interface
No EDID on bus 0
No EDID on bus 2
No EDID on bus 4
No EDID on bus 5
3 potential busses found: 1 3 6
Will scan through until the first EDID is found.
Pass a bus number as an option to this program to go only for that one.
256-byte EDID successfully retrieved from i2c bus 1
If this isn't what you were looking for, consider the other potential busses.
Looks like i2c was successful. Have a good day.
Checksum Correct

Section "Monitor"
        Identifier "LG Ultra HD"
        ModelName "LG Ultra HD"
        VendorName "GSM"
        # Monitor Manufactured week 5 of 2016
        # EDID version 1.3
        # Digital Display
        DisplaySize 600 340
        Gamma 2.20
        Option "DPMS" "true"
        Horizsync 30-135
        VertRefresh 56-61
        # Maximum pixel clock is 300MHz
        #Not giving standard mode: 1152x864, 60Hz
        #Not giving standard mode: 1280x1024, 60Hz
        #Not giving standard mode: 1280x720, 60Hz
        #Not giving standard mode: 1600x900, 60Hz
        #Not giving standard mode: 1920x1080, 60Hz
        #Not giving standard mode: 1280x800, 60Hz

        #Extension block found. Parsing...
        Modeline        "Mode 8" +hsync +vsync
        Modeline        "Mode 0" +hsync +vsync
        Modeline        "Mode 1" +hsync +vsync
        Modeline        "Mode 2" 148.500 1920 2008 2052 2200 1080 1084 1089 1125 +hsync +vsync
        Modeline        "Mode 3" 74.250 1920 2008 2052 2200 1080 1084 1089 1125 +hsync +vsync
        Modeline        "Mode 4" 74.250 1920 2008 2052 2200 1080 1082 1087 1125 +hsync +vsync interlace
        Modeline        "Mode 5" 74.250 1280 1390 1420 1650 720 725 730 750 +hsync +vsync
        Modeline        "Mode 6" 27.027 720 736 798 858 480 489 495 525 -hsync -vsync
        Modeline        "Mode 7" 25.200 640 656 752 800 480 490 492 525 -hsync -vsync
        Option "PreferredMode" "Mode 8"
EndSection

/etc/X11/xorg.conf.d/30nvidia.conf
Code:

Section "Module"
        Load                "modesetting"
EndSection

Section "Device"
        Identifier        "nvidia"
        Driver                "nvidia"
        BusID                "1@0:0:0"
        Option                "AllowEmptyInitialConfiguration"
EndSection


unassailable 03-11-2017 08:21 AM

Further diagnosing the issue.

I completely removed the nvidia drivers from the system. xorg-drivers-1.19 was marked stable yesterday, updated this as well. One should note that this version begins transitioning from Intel DDX to generic modestting DDX.

Code:

media-libs/mesa-13.0.5::gentoo  USE="bindist classic dri3 egl gallium gbm gles2 llvm nettle nptl vdpau" VIDEO_CARDS="i965"
x11-base/xorg-server-1.19.2:0/1.19.2::gentoo  USE="glamor ipv6 suid udev xorg"
x11-base/xorg-drivers-1.19::gentoo  INPUT_DEVICES="evdev synaptics" VIDEO_CARDS="i965"

Symptoms persist. Below are the results from an unplug/plug event within X.

udevadm still showing two events
$ udevadm monitor --udev --environment
Code:

UDEV  [872.261008] change  /devices/pci0000:00/0000:00:02.0/drm/card0 (drm)
ACTION=change
DEVNAME=/dev/dri/card0
DEVPATH=/devices/pci0000:00/0000:00:02.0/drm/card0
DEVTYPE=drm_minor
HOTPLUG=1
ID_PATH=pci-0000:00:02.0
ID_PATH_TAG=pci-0000_00_02_0
MAJOR=226
MINOR=0
SEQNUM=2456
SUBSYSTEM=drm
TAGS=:udev-acl:
USEC_INITIALIZED=84987

UDEV  [873.010878] change  /devices/pci0000:00/0000:00:02.0/drm/card0 (drm)
ACTION=change
DEVNAME=/dev/dri/card0
DEVPATH=/devices/pci0000:00/0000:00:02.0/drm/card0
DEVTYPE=drm_minor
HOTPLUG=1
ID_PATH=pci-0000:00:02.0
ID_PATH_TAG=pci-0000_00_02_0
MAJOR=226
MINOR=0
SEQNUM=2457
SUBSYSTEM=drm
TAGS=:udev-acl:
USEC_INITIALIZED=84987

/var/log/Xorg.0.log now showing more (albeit incomplete) information:
Code:

[  872.261] (II) modeset(0): EDID vendor "LGD", prod id 1135
[  872.261] (II) modeset(0): Printing DDC gathered Modelines:
[  872.261] (II) modeset(0): Modeline "1920x1080"x0.0  138.70  1920 1968 2000 2080  1080 1083 1088 1111 +hsync -vsync (66.7 kHz eP)
[  872.591] (--) modeset(0): HDMI max TMDS frequency 300000KHz
[  872.732] (II) modeset(0): EDID vendor "LGD", prod id 1135
[  872.732] (II) modeset(0): Printing DDC gathered Modelines:
[  872.732] (II) modeset(0): Modeline "1920x1080"x0.0  138.70  1920 1968 2000 2080  1080 1083 1088 1111 +hsync -vsync (66.7 kHz eP)
[  873.148] (II) modeset(0): EDID vendor "LGD", prod id 1135
[  873.148] (II) modeset(0): Printing DDC gathered Modelines:
[  873.148] (II) modeset(0): Modeline "1920x1080"x0.0  138.70  1920 1968 2000 2080  1080 1083 1088 1111 +hsync -vsync (66.7 kHz eP)
[  873.565] (II) modeset(0): EDID vendor "LGD", prod id 1135
[  873.566] (II) modeset(0): Printing DDC gathered Modelines:
[  873.566] (II) modeset(0): Modeline "1920x1080"x0.0  138.70  1920 1968 2000 2080  1080 1083 1088 1111 +hsync -vsync (66.7 kHz eP)
[  873.999] (II) modeset(0): EDID vendor "LGD", prod id 1135
[  873.999] (II) modeset(0): Printing DDC gathered Modelines:
[  873.999] (II) modeset(0): Modeline "1920x1080"x0.0  138.70  1920 1968 2000 2080  1080 1083 1088 1111 +hsync -vsync (66.7 kHz eP)
[  874.425] (II) modeset(0): EDID vendor "LGD", prod id 1135
[  874.425] (II) modeset(0): Printing DDC gathered Modelines:
[  874.425] (II) modeset(0): Modeline "1920x1080"x0.0  138.70  1920 1968 2000 2080  1080 1083 1088 1111 +hsync -vsync (66.7 kHz eP)
[  874.846] (II) modeset(0): EDID vendor "LGD", prod id 1135
[  874.846] (II) modeset(0): Printing DDC gathered Modelines:
[  874.846] (II) modeset(0): Modeline "1920x1080"x0.0  138.70  1920 1968 2000 2080  1080 1083 1088 1111 +hsync -vsync (66.7 kHz eP)
[  875.274] (II) modeset(0): EDID vendor "LGD", prod id 1135
[  875.274] (II) modeset(0): Printing DDC gathered Modelines:
[  875.274] (II) modeset(0): Modeline "1920x1080"x0.0  138.70  1920 1968 2000 2080  1080 1083 1088 1111 +hsync -vsync (66.7 kHz eP)

/var/log/messages appears similar:
Code:

Mar 11 09:16:18 unbook kernel: udevd[2059]: Validate module index
Mar 11 09:16:18 unbook kernel: udevd[2059]: seq 2458 queued, 'change' 'drm'
Mar 11 09:16:18 unbook kernel: udevd[2059]: seq 2458 forked new worker [12872]
Mar 11 09:16:18 unbook kernel: udevd[12872]: seq 2458 running
Mar 11 09:16:18 unbook kernel: udevd[12872]: IMPORT builtin 'path_id' /lib64/udev/rules.d/60-drm.rules:3
Mar 11 09:16:18 unbook kernel: udevd[12872]: RUN 'udev-acl --action=$env{ACTION} --device=$env{DEVNAME}' /lib64/udev/rules.d/70-udev-acl.rules:74
Mar 11 09:16:18 unbook kernel: udevd[12872]: handling device node '/dev/dri/card0', devnum=c226:0, mode=0600, uid=0, gid=0
Mar 11 09:16:18 unbook kernel: udevd[12872]: preserve already existing symlink '/dev/char/226:0' to '../dri/card0'
Mar 11 09:16:18 unbook kernel: udevd[12872]: created db file '/run/udev/data/c226:0' for '/devices/pci0000:00/0000:00:02.0/drm/card0'
Mar 11 09:16:18 unbook kernel: udevd[12873]: starting 'udev-acl --action=change --device=/dev/dri/card0'

Still no connection
$ ls card*/status; cat card*/status
Code:

card0-DP-1/status  card0-DP-2/status  card0-eDP-1/status  card0-HDMI-A-1/status  card0-HDMI-A-2/status
disconnected
disconnected
connected
disconnected
disconnected



All times are GMT -5. The time now is 11:02 PM.