notro / gud

GUD USB Display

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

nvidia-drm.modeset=1 is broken

notro opened this issue · comments

(Split out from #9)

Importing buffers from Nvidia GPU does not work:

янв 21 20:04:49 Zenith kernel: microcode: microcode updated early to revision 0xea, date = 2021-01-05
янв 21 20:04:49 Zenith kernel: Linux version 5.15.15-1-lts (linux-lts@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) 2.36.1) #1 SMP Sun, 16 Jan 2022 09:28:22 +0000
янв 21 20:04:49 Zenith kernel: Command line: BOOT_IMAGE=/boot/vmlinuz-linux-lts root=UUID=9bf5bc40-5e15-4a4d-9140-0641f698b427 rw audit=0 loglevel=3 mitigations=off nvidia-drm.modeset=1 drm.debug=0x8
[...]
янв 21 20:04:49 Zenith kernel: efifb: probing for efifb
янв 21 20:04:49 Zenith kernel: efifb: framebuffer at 0x80000000, using 8128k, total 8128k
янв 21 20:04:49 Zenith kernel: efifb: mode is 1920x1080x32, linelength=7680, pages=1
янв 21 20:04:49 Zenith kernel: efifb: scrolling: redraw
янв 21 20:04:49 Zenith kernel: efifb: Truecolor: size=8:8:8:8, shift=24:16:8:0
янв 21 20:04:49 Zenith kernel: fbcon: Deferring console take-over
янв 21 20:04:49 Zenith kernel: fb0: EFI VGA frame buffer device
[...]
янв 21 20:04:49 Zenith kernel: Run /init as init process
[...]
янв 21 20:04:49 Zenith kernel: fbcon: Taking over console
янв 21 20:04:49 Zenith kernel: Console: switching to colour frame buffer device 240x67
[...]
янв 21 20:04:49 Zenith kernel: fb0: switching to i915 from EFI VGA
янв 21 20:04:49 Zenith kernel: Console: switching to colour dummy device 80x25
янв 21 20:04:49 Zenith kernel: i915 0000:00:02.0: vgaarb: deactivate vga console
янв 21 20:04:49 Zenith kernel: i915 0000:00:02.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=io+mem:owns=io+mem
янв 21 20:04:49 Zenith kernel: i915 0000:00:02.0: [drm] Finished loading DMC firmware i915/kbl_dmc_ver1_04.bin (v1.4)
янв 21 20:04:49 Zenith kernel: i915 0000:00:02.0: [drm] [ENCODER:102:DDI B/PHY B] is disabled/in DSI mode with an ungated DDI clock, gate it
янв 21 20:04:49 Zenith kernel: i915 0000:00:02.0: [drm] [ENCODER:118:DDI C/PHY C] is disabled/in DSI mode with an ungated DDI clock, gate it
[...]
янв 21 20:04:49 Zenith kernel: [drm] Initialized i915 1.6.0 20201103 for 0000:00:02.0 on minor 0
янв 21 20:04:49 Zenith kernel: ACPI: video: Video Device [GFX0] (multi-head: yes  rom: no  post: no)
янв 21 20:04:49 Zenith kernel: input: Video Bus as /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/LNXVIDEO:00/input/input4
янв 21 20:04:49 Zenith kernel: ACPI: video: Video Device [PEGP] (multi-head: no  rom: yes  post: no)
янв 21 20:04:49 Zenith kernel: input: Video Bus as /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:0b/LNXVIDEO:01/input/input5
[...]
янв 21 20:04:49 Zenith kernel: fbcon: i915drmfb (fb0) is primary device
янв 21 20:04:49 Zenith kernel: Console: switching to colour frame buffer device 240x67
янв 21 20:04:49 Zenith kernel: i915 0000:00:02.0: [drm] fb0: i915drmfb frame buffer device
янв 21 20:04:49 Zenith kernel: nvidia: loading out-of-tree module taints kernel.
янв 21 20:04:49 Zenith kernel: nvidia: module license 'NVIDIA' taints kernel.
янв 21 20:04:49 Zenith kernel: Disabling lock debugging due to kernel taint
янв 21 20:04:49 Zenith kernel: nvidia: module verification failed: signature and/or required key missing - tainting kernel
янв 21 20:04:49 Zenith kernel: nvidia-nvlink: Nvlink Core is being initialized, major device number 235
янв 21 20:04:49 Zenith kernel: 
янв 21 20:04:49 Zenith kernel: nvidia 0000:01:00.0: enabling device (0006 -> 0007)
янв 21 20:04:49 Zenith kernel: NVRM: loading NVIDIA UNIX x86_64 Kernel Module  495.46  Wed Oct 27 16:31:33 UTC 2021
янв 21 20:04:49 Zenith kernel: nvidia-modeset: Loading NVIDIA Kernel Mode Setting Driver for UNIX platforms  495.46  Wed Oct 27 16:22:48 UTC 2021
янв 21 20:04:49 Zenith kernel: nvidia_uvm: module uses symbols from proprietary module nvidia, inheriting taint.
янв 21 20:04:49 Zenith kernel: nvidia-uvm: Loaded the UVM driver, major device number 511.
янв 21 20:04:49 Zenith kernel: [drm] [nvidia-drm] [GPU ID 0x00000100] Loading driver
[...]
янв 21 20:04:49 Zenith kernel: [drm] Initialized nvidia-drm 0.0.0 20160202 for 0000:01:00.0 on minor 1
[...]
янв 21 20:04:49 Zenith kernel: usb 1-3: New USB device found, idVendor=1d50, idProduct=614d, bcdDevice= 5.15
янв 21 20:04:49 Zenith kernel: usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
янв 21 20:04:49 Zenith kernel: usb 1-3: Product: GUD USB Display Gadget
янв 21 20:04:49 Zenith kernel: usb 1-3: Manufacturer: Zenithal
янв 21 20:04:49 Zenith kernel: usb 1-3: SerialNumber: 0000000
[...]
янв 21 20:04:50 Zenith kernel: [drm] Initialized gud 1.0.0 20200422 for 1-3:1.0 on minor 2
[...]
янв 21 20:04:55 Zenith kernel: gud 1-3:1.0: [drm] fb1: guddrmfb frame buffer device
[...]
янв 21 20:06:23 Zenith kernel: [drm:drm_gem_shmem_prime_import_sg_table] size = 3932160
янв 21 20:06:23 Zenith kernel: [drm:drm_gem_shmem_prime_import_sg_table] size = 3932160
янв 21 20:06:24 Zenith kernel: ------------[ cut here ]------------
янв 21 20:06:24 Zenith kernel: WARNING: CPU: 4 PID: 145 at drivers/gpu/drm/drm_gem_shmem_helper.c:277 drm_gem_shmem_vmap+0x18c/0x1a0
янв 21 20:06:24 Zenith kernel: Workqueue: events_long gud_flush_work [gud]
янв 21 20:06:24 Zenith kernel: Call Trace:
янв 21 20:06:24 Zenith kernel:  <TASK>
янв 21 20:06:24 Zenith kernel:  drm_gem_vmap+0x1b/0x50
янв 21 20:06:24 Zenith kernel:  drm_gem_fb_vmap+0x41/0x110
янв 21 20:06:24 Zenith kernel:  gud_prep_flush+0xca/0x570 [gud 6cea9e5e28340538c7e4454279c144d1d9b15010]
янв 21 20:06:24 Zenith kernel:  ? load_balance+0xa82/0xd00
янв 21 20:06:24 Zenith kernel:  gud_flush_work+0x22b/0x430 [gud 6cea9e5e28340538c7e4454279c144d1d9b15010]
янв 21 20:06:24 Zenith kernel:  process_one_work+0x1ee/0x390
янв 21 20:06:24 Zenith kernel:  worker_thread+0x53/0x3e0
янв 21 20:06:24 Zenith kernel:  ? process_one_work+0x390/0x390
янв 21 20:06:24 Zenith kernel:  kthread+0x124/0x150
янв 21 20:06:24 Zenith kernel:  ? set_kthread_struct+0x50/0x50
янв 21 20:06:24 Zenith kernel:  ret_from_fork+0x1f/0x30
янв 21 20:06:24 Zenith kernel:  </TASK>
янв 21 20:06:24 Zenith kernel: ---[ end trace 99b2feb94888d55b ]---
янв 21 20:06:24 Zenith kernel: gud 1-3:1.0: Failed to flush framebuffer: error=-5

Full log: http://shz.al/P3SB

The warning is triggered in drm_gem_shmem_vmap_locked() due to the imported buffer being in iomem:

static int drm_gem_shmem_vmap_locked(struct drm_gem_shmem_object *shmem, struct dma_buf_map *map)
{
[...]
	if (obj->import_attach) {
		ret = dma_buf_vmap(obj->import_attach->dmabuf, map);
		if (!ret) {
			if (WARN_ON(map->is_iomem)) {
				ret = -EIO;
				goto err_put_pages;
			}
			shmem->vaddr = map->vaddr;
		}
	} else {
[...]

The GUD driver should really have detected this on atomic commit/check somehow so userspace can be told that this won't work. Maybe it should try a vmap in gud_pipe_check() but that wouldn't avoid the warning though.

Cc: @ZenithalHourlyRate