NetBSD Problem Report #53126

From www@NetBSD.org  Sat Mar 24 12:12:51 2018
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 9FE9E7A1BA
	for <gnats-bugs@gnats.NetBSD.org>; Sat, 24 Mar 2018 12:12:51 +0000 (UTC)
Message-Id: <20180324121250.2BA167A202@mollari.NetBSD.org>
Date: Sat, 24 Mar 2018 12:12:50 +0000 (UTC)
From: prlw1@cam.ac.uk
Reply-To: prlw1@cam.ac.uk
To: gnats-bugs@NetBSD.org
Subject: uefi boot breaks graphics
X-Send-Pr-Version: www-1.0

>Number:         53126
>Category:       port-amd64
>Synopsis:       uefi boot breaks graphics
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-amd64-maintainer
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Mar 24 12:15:00 +0000 2018
>Closed-Date:    Sat Jul 29 12:10:39 +0000 2023
>Last-Modified:  Sat Jul 29 12:10:39 +0000 2023
>Originator:     Patrick Welche
>Release:        NetBSD-8.99.14/amd64
>Organization:
>Environment:
NetBSD-8.99.14/amd64
>Description:
Booting via MBR gives me a working box. Trying UEFI, I see a different
font displaying boot.cfg and initial kernel messages (probably expected),
but then, at the point at which the kernel switches to a higher
resolution mode, I briefly see the kernel messages in the new mode at
the top part of the screen (possibly what was already painted at that
stage, but in the new resolution), and in the bottom part, random green
pixels, and then the screen goes blank. This is all before X, as I have
a cgdconfig prompt on boot. I can ssh in, and all is working, but the
display is broken. (I didn't test audio.) The "BIOS" is from January
2018.

The graphics card is:

nouveau0 at pci9 dev 0 function 0: NVIDIA product 1180 (rev. 0xa1)
drm kern info: nouveau  [  DEVICE][nouveau0] BOOT0  : 0x0e4000a2
drm kern info: nouveau  [  DEVICE][nouveau0] Chipset: GK104 (NVE4)
drm kern info: nouveau  [  DEVICE][nouveau0] Family : NVE0

Hightlights of a diff of working vs broken dmesg:

 total memory = 32699 MB
-avail memory = 31733 MB
+avail memory = 31731 MB

+efi: systbl at pa db80f018

@@ -251,7 +253,7 @@
 drm kern info: nouveau  [     CLK][nouveau0] 0d: core 540-1202 MHz memory 6008 MHz 
 drm kern info: nouveau  [     CLK][nouveau0] 0f: core 540-1202 MHz memory 6008 MHz 
 drm kern info: nouveau  [     CLK][nouveau0] --: core 324 MHz memory 648 MHz 
-Zone  kernel: Available graphics memory: 11304594 kiB
+Zone  kernel: Available graphics memory: 11303736 kiB
 Zone   dma32: Available graphics memory: 2097152 kiB
 drm kern info: nouveau  [     DRM] VRAM: 2048 MiB
 drm kern info: nouveau  [     DRM] GART: 1048576 MiB
@@ -272,7 +274,7 @@
 drm kern info: nouveau  [     DRM] MM: using COPY for buffer copies
 nouveaufb0 at nouveau0
 nouveau0: info: registered panic notifier
-nouveaufb0: framebuffer at 0xffff80025c7c9000, size 1680x1050, depth 32, stride 6912
+nouveaufb0: framebuffer at 0xffff80025c9a0000, size 1680x1050, depth 32, stride 6912
 wsdisplay0 at nouveaufb0 kbdmux 1: console (default, vt100 emulation), using wskbd0
 wsmux1: connecting to wsdisplay0
 hdaudio0 at pci9 dev 0 function 1: HD Audio Controller


I haven't tested audio (one thing at a time), but also see:

@@ -309,18 +311,9 @@
 atabus8 at ahcisata1 channel 3
 hdaudio1 at pci11 dev 0 function 3: HD Audio Controller
 hdaudio1: interrupting at msi5 vec 0
-hdafg1 at hdaudio1: vendor 10ec product 1168
-hdafg1: DAC00 6ch: Speaker [Jack]
-hdafg1: DAC01 2ch: HP Out [Jack]
-hdafg1: DIG02 2ch: SPDIF Out [Jack]
-hdafg1: ADC03 2ch: Line In [Jack], Mic In [Jack]
-hdafg1: ADC04 2ch: Mic In [Jack]
-hdafg1: 6ch/2ch 32000Hz 44100Hz 48000Hz 88200Hz 96000Hz 192000Hz PCM16 PCM20 PCM24 AC3
-audio0 at hdafg1: full duplex, playback, capture, mmap, independent
-hdafg1: Virtual format configured - Format SLINEAR, precision 16, channels 2, frequency 48000
-hdafg1: Latency: 128 milliseconds
-spkr1 at audio0: PC Speaker (synthesized)
-wsbell at spkr1 not configured
+hdaudio1: timeout stopping RIRB
+hdaudio1: couldn't reset because RIRB is busy
+hdaudio1: device driver failed to attach
 AMD X370/X399 SMBus Controller (SMBus serial bus, revision 0x59) at pci0 dev 20 function 0 not configured
 pcib0 at pci0 dev 20 function 3: AMD product 790e (rev. 0x51)
 pchb6 at pci0 dev 24 function 0: AMD product 1460 (rev. 0x00)

>How-To-Repeat:

>Fix:

>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->feedback
State-Changed-By: maya@NetBSD.org
State-Changed-When: Tue, 19 Jun 2018 11:48:38 +0000
State-Changed-Why:
I'm guessing this is a duplicate of 53286 which is mostly resolved. are you having issues still?


From: Patrick Welche <prlw1@cam.ac.uk>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: port-amd64/53126 (uefi boot breaks graphics)
Date: Sat, 23 Jun 2018 22:27:58 +0100

 I just checked again with today's HEAD, and see the same symptoms.

State-Changed-From-To: feedback->open
State-Changed-By: maya@NetBSD.org
State-Changed-When: Sat, 23 Jun 2018 21:58:32 +0000
State-Changed-Why:
Not fixed.


From: Patrick Welche <prlw1@cam.ac.uk>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: port-amd64/53126: uefi boot breaks graphics
Date: Tue, 14 Aug 2018 09:46:49 +0100

  I just checked again with today's HEAD, and see the same symptoms.

From: Patrick Welche <prlw1@cam.ac.uk>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: port-amd64/53126: uefi boot breaks graphics
Date: Sat, 18 Aug 2018 18:48:00 +0100

 ... and just checked again after today's the acpi update - no change.

From: Tobias Nygren <tnn@NetBSD.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: port-amd64/53126 (uefi boot breaks graphics, nouveau)
Date: Tue, 26 Jul 2022 16:50:55 +0200

 I found a workaround for this problem. It seems nouveau conflicts with
 x86 genfb. The drawback is you don't get any console before going
 multiuser unless you have serial console. Maybe we are not properly
 unmapping genfb before switching console? The nouveau driver throws
 errors like this when efi genfb is used:

 nouveau0: autoconfiguration error: error: fifo: fault 01 [WRITE] at 0000000000211000 engine 04 [BAR1] client 08 [HUB/HOST_CPU_NB] reason 00 [PDE] on channel -1 [00ffeaa000 unknown]

 --- sys/arch/x86/x86/genfb_machdep.c	16 Jul 2022 06:27:24 -0000	1.17
 +++ sys/arch/x86/x86/genfb_machdep.c	26 Jul 2022 14:44:48 -0000
 @@ -117,6 +117,7 @@ x86_genfb_init(void)
  	if (fbinfo == NULL || fbinfo->physaddr == 0)
  		return 0;

 +	return 0;
  	err = _x86_memio_map(t, (bus_addr_t)fbinfo->physaddr,
  	    fbinfo->height * fbinfo->stride,
  	    BUS_SPACE_MAP_LINEAR | BUS_SPACE_MAP_PREFETCHABLE, &h);



State-Changed-From-To: open->feedback
State-Changed-By: riastradh@NetBSD.org
State-Changed-When: Tue, 21 Feb 2023 20:28:26 +0000
State-Changed-Why:
patch to test


From: Taylor R Campbell <riastradh@NetBSD.org>
To: prlw1@cam.ac.uk
Cc: tnn@NetBSD.org,
	gnats-bugs@NetBSD.org
Subject: Re: kern/53126: uefi boot breaks graphics
Date: Tue, 21 Feb 2023 20:26:35 +0000

 This is a multi-part message in MIME format.
 --=_rFLsIlDMAmZS54PhaM3eE2ii5a8qA3Zz

 Does the attached patch make a difference?

 Need to think more about the mechanism, and probably change it, before
 committing, but testing will confirm whether I'm barking up the right
 tree or not.

 --=_rFLsIlDMAmZS54PhaM3eE2ii5a8qA3Zz
 Content-Type: text/plain; charset="ISO-8859-1"; name="nvgenfbborrow"
 Content-Transfer-Encoding: quoted-printable
 Content-Disposition: attachment; filename="nvgenfbborrow.patch"

 From ee72bfac5c676ceef4a93af56bc5d3f2d4bfbf1d Mon Sep 17 00:00:00 2001
 From: Taylor R Campbell <riastradh@NetBSD.org>
 Date: Tue, 21 Feb 2023 20:22:32 +0000
 Subject: [PATCH] nouveau: Try genfb_borrow to map MMIO spaces.

 If x86 consinit has already taken the framebuffer with _x86_memio_map
 for genfb, we might need genfb_borrow to get at it.

 PR kern/53126
 ---
  sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nvif.c | 9 +++++++++
  1 file changed, 9 insertions(+)

 diff --git a/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nvif.c b/sys/ex=
 ternal/bsd/drm2/dist/drm/nouveau/nouveau_nvif.c
 index d7946dbbfd25..2c6b1744d7be 100644
 --- a/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nvif.c
 +++ b/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nvif.c
 @@ -69,6 +69,15 @@ nvkm_client_map(void *priv, bus_space_tag_t tag, u64 bus=
 addr, u32 size,
  		return 0;
  	}
 =20
 +#ifdef NGENFB > 0		/* XXX module */
 +	/* XXX tag? */
 +	/* XXX size? */
 +	if (genfb_borrow(busaddr, handlep)) {
 +		*ptrp =3D bus_space_vaddr(tag, *handlep);
 +		return 0;
 +	}
 +#endif
 +
  	ret =3D -bus_space_map(tag, busaddr, size, BUS_SPACE_MAP_LINEAR,
  	    handlep);
  	if (ret)

 --=_rFLsIlDMAmZS54PhaM3eE2ii5a8qA3Zz--

From: Taylor R Campbell <campbell@mumble.net>
To: Taylor R Campbell <riastradh@NetBSD.org>
Cc: gnats-bugs@NetBSD.org
Subject: Re: kern/53126: uefi boot breaks graphics
Date: Wed, 22 Feb 2023 13:48:55 +0000

 This is a multi-part message in MIME format.
 --=_3LM3Qr5snjR6jwWdKR2eeC80vJ4rOpBA

 Correction -- please try the attached patch, which I have confirmed
 actually results in a call to genfb_borrow in the generated code, now
 that it includes the appropriate header files to get NGENFB.

 --=_3LM3Qr5snjR6jwWdKR2eeC80vJ4rOpBA
 Content-Type: text/plain; charset="ISO-8859-1"; name="nvgenfbborrow-v2"
 Content-Transfer-Encoding: quoted-printable
 Content-Disposition: attachment; filename="nvgenfbborrow-v2.patch"

 From 6d5defc76a9cd22b52fc488115fa8d556e560ba0 Mon Sep 17 00:00:00 2001
 From: Taylor R Campbell <riastradh@NetBSD.org>
 Date: Tue, 21 Feb 2023 20:22:32 +0000
 Subject: [PATCH] nouveau: Try genfb_borrow to map MMIO spaces.

 If x86 consinit has already taken the framebuffer with _x86_memio_map
 for genfb, we might need genfb_borrow to get at it.

 PR kern/53126
 ---
  .../bsd/drm2/dist/drm/nouveau/nouveau_nvif.c  | 19 +++++++++++++++++++
  1 file changed, 19 insertions(+)

 diff --git a/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nvif.c b/sys/ex=
 ternal/bsd/drm2/dist/drm/nouveau/nouveau_nvif.c
 index d7946dbbfd25..961849395d0a 100644
 --- a/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nvif.c
 +++ b/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nvif.c
 @@ -31,6 +31,16 @@
  #include <sys/cdefs.h>
  __KERNEL_RCSID(0, "$NetBSD: nouveau_nvif.c,v 1.6 2021/12/18 23:45:32 riast=
 radh Exp $");
 =20
 +#ifdef __NetBSD__
 +#ifdef _KERNEL_OPT
 +#include "genfb.h"
 +#endif
 +
 +#if NGENFB > 0
 +#include <dev/wsfb/genfbvar.h>
 +#endif
 +#endif
 +
  #include <core/client.h>
  #include <core/notify.h>
  #include <core/ioctl.h>
 @@ -69,6 +79,15 @@ nvkm_client_map(void *priv, bus_space_tag_t tag, u64 bus=
 addr, u32 size,
  		return 0;
  	}
 =20
 +#if NGENFB > 0		/* XXX module */
 +	/* XXX tag? */
 +	/* XXX size? */
 +	if (genfb_borrow(busaddr, handlep)) {
 +		*ptrp =3D bus_space_vaddr(tag, *handlep);
 +		return 0;
 +	}
 +#endif
 +
  	ret =3D -bus_space_map(tag, busaddr, size, BUS_SPACE_MAP_LINEAR,
  	    handlep);
  	if (ret)

 --=_3LM3Qr5snjR6jwWdKR2eeC80vJ4rOpBA--

From: Taylor R Campbell <riastradh@NetBSD.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/53126: uefi boot breaks graphics
Date: Thu, 23 Feb 2023 21:35:36 +0000

 This is a multi-part message in MIME format.
 --=_17Wymd7lPaKOmlAiVMiz9N/EY5eA0fm1

 Sorry, that patch won't do anything.  Can you see if this one does?
 Even less committable as is but worth testing.

 --=_17Wymd7lPaKOmlAiVMiz9N/EY5eA0fm1
 Content-Type: text/plain; charset="ISO-8859-1"; name="nvgenfbcons"
 Content-Transfer-Encoding: quoted-printable
 Content-Disposition: attachment; filename="nvgenfbcons.patch"

 From 057cead7430f2dd53a72354f7de0089e1b67c764 Mon Sep 17 00:00:00 2001
 From: Taylor R Campbell <riastradh@NetBSD.org>
 Date: Thu, 23 Feb 2023 21:26:00 +0000
 Subject: [PATCH] WIP: Hack genfb framebuffer sharing between consinit and
  nouveau.

 PR kern/53126
 ---
  sys/arch/x86/x86/genfb_machdep.c              |  7 +++++
  .../bsd/drm2/dist/drm/nouveau/nouveau_nvif.c  | 26 +++++++++++++++++++
  2 files changed, 33 insertions(+)

 diff --git a/sys/arch/x86/x86/genfb_machdep.c b/sys/arch/x86/x86/genfb_mach=
 dep.c
 index 8384b00f4a5f..2ef9020cff83 100644
 --- a/sys/arch/x86/x86/genfb_machdep.c
 +++ b/sys/arch/x86/x86/genfb_machdep.c
 @@ -96,6 +96,10 @@ x86_genfb_ddb_trap_callback(int where)
  	}
  }
 =20
 +bus_addr_t x86_genfb_fb_addr;
 +bus_size_t x86_genfb_fb_size;
 +bus_space_handle_t x86_genfb_fb_handle;
 +
  int
  x86_genfb_init(void)
  {
 @@ -130,6 +134,9 @@ x86_genfb_init(void)
  		aprint_error("x86_genfb_cnattach: couldn't get fb vaddr\n");
  		return 0;
  	}
 +	x86_genfb_fb_addr =3D fbinfo->physaddr;
 +	x86_genfb_fb_size =3D fbinfo->height * fbinfo->stride;
 +	x86_genfb_fb_handle =3D h;
 =20
  #if NACPICA > 0
  	acpi_md_vesa_modenum =3D fbinfo->vbemode;
 diff --git a/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nvif.c b/sys/ex=
 ternal/bsd/drm2/dist/drm/nouveau/nouveau_nvif.c
 index d7946dbbfd25..80758695e692 100644
 --- a/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nvif.c
 +++ b/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nvif.c
 @@ -53,6 +53,32 @@ nvkm_client_map(void *priv, bus_space_tag_t tag, u64 bus=
 addr, u32 size,
  	struct nvkm_client *client =3D nvxx_client(priv);
  	int ret;
 =20
 +	extern bus_space_tag_t x86_bus_space_mem;
 +	extern bus_addr_t x86_genfb_fb_addr;
 +	extern bus_size_t x86_genfb_fb_size;
 +	extern bus_space_handle_t x86_genfb_fb_handle;
 +
 +	if (tag =3D=3D x86_bus_space_mem &&
 +	    x86_genfb_fb_addr <=3D busaddr &&
 +	    busaddr - x86_genfb_fb_addr <=3D x86_genfb_fb_size) {
 +		const bus_size_t offset =3D busaddr - x86_genfb_fb_addr;
 +		if (size > x86_genfb_fb_size - offset) {
 +			DRM_ERROR("Invalid fb access\n");
 +			return -EFAULT;
 +		}
 +		ret =3D -bus_space_subregion(x86_bus_space_mem,
 +		    x86_genfb_fb_handle, offset, size, handlep);
 +		if (ret)
 +			return ret;
 +		printf("%s: loaned [%"PRIxBUSADDR",%"PRIxBUSADDR")"
 +		    " to nouveau from [%"PRIxBUSADDR",%"PRIxBUSADDR")"
 +		    " genfb console\n", __func__,
 +		    (bus_addr_t)busaddr, (bus_addr_t)busaddr + size,
 +		    x86_genfb_fb_addr, x86_genfb_fb_size);
 +		*ptrp =3D bus_space_vaddr(tag, *handlep);
 +		return 0;
 +	}
 +
  	if (tag =3D=3D client->mmiot &&
  	    client->mmioaddr <=3D busaddr &&
  	    busaddr - client->mmioaddr <=3D client->mmiosz) {

 --=_17Wymd7lPaKOmlAiVMiz9N/EY5eA0fm1--

From: Taylor R Campbell <riastradh@NetBSD.org>
To: prlw1@cam.ac.uk, tnn@NetBSD.org, snj@NetBSD.org
Cc: gnats-bugs@NetBSD.org
Subject: Re: kern/53126: uefi boot breaks graphics
Date: Fri, 24 Feb 2023 10:29:02 +0000

 This is a multi-part message in MIME format.
 --=_cEFiPfdk98xHDMxf5dg4ZFdv6SEdn8RA

 New patch to try -- barking up a different tree now.  This one is more
 committable as-is, and also corresponds to a change jmcneill@ made on
 fdt platforms a couple years ago.

 --=_cEFiPfdk98xHDMxf5dg4ZFdv6SEdn8RA
 Content-Type: text/plain; charset="ISO-8859-1"; name="nvgenfb"
 Content-Transfer-Encoding: quoted-printable
 Content-Disposition: attachment; filename="nvgenfb.patch"

 From 2224ba18a1fec7f7c26cae6543526ac163135d78 Mon Sep 17 00:00:00 2001
 From: Taylor R Campbell <riastradh@NetBSD.org>
 Date: Fri, 24 Feb 2023 10:25:57 +0000
 Subject: [PATCH] nouveau: Kick out genfb on firmware framebuffer before
  initializing.

 XXX Should maybe kick out FDT at this point too, rather than earlier
 on.

 PR kern/53126
 ---
  sys/dev/wscons/wsdisplay.c                  |  9 ++++++++
  sys/dev/wscons/wsdisplayvar.h               |  1 +
  sys/external/bsd/drm2/nouveau/nouveau_pci.c | 23 +++++++++++++++++++++
  3 files changed, 33 insertions(+)

 diff --git a/sys/dev/wscons/wsdisplay.c b/sys/dev/wscons/wsdisplay.c
 index dc4c526625db..c7c89f3ce980 100644
 --- a/sys/dev/wscons/wsdisplay.c
 +++ b/sys/dev/wscons/wsdisplay.c
 @@ -981,6 +981,15 @@ wsdisplay_preattach(const struct wsscreen_descr *type,=
  void *cookie,
  	wsdisplay_console_initted =3D 1;
  }
 =20
 +void
 +wsdisplay_predetach(void)
 +{
 +	KASSERT(wsdisplay_console_initted =3D=3D 1);
 +
 +	cn_tab =3D wsdisplay_ocn;
 +	wsdisplay_console_initted =3D 0;
 +}
 +
  void
  wsdisplay_cndetach(void)
  {
 diff --git a/sys/dev/wscons/wsdisplayvar.h b/sys/dev/wscons/wsdisplayvar.h
 index 281991e7d2b1..8305ca877fb6 100644
 --- a/sys/dev/wscons/wsdisplayvar.h
 +++ b/sys/dev/wscons/wsdisplayvar.h
 @@ -172,6 +172,7 @@ void	wsdisplay_cnattach(const struct wsscreen_descr *, =
 void *, int, int,
              long);
  void	wsdisplay_preattach(const struct wsscreen_descr *, void *, int, int,
              long);
 +void	wsdisplay_predetach(void);
  void	wsdisplay_cndetach(void);
  void	wsdisplay_multicons_suspend(bool);
 =20
 diff --git a/sys/external/bsd/drm2/nouveau/nouveau_pci.c b/sys/external/bsd=
 /drm2/nouveau/nouveau_pci.c
 index 220119b45d99..881608f32c57 100644
 --- a/sys/external/bsd/drm2/nouveau/nouveau_pci.c
 +++ b/sys/external/bsd/drm2/nouveau/nouveau_pci.c
 @@ -36,6 +36,7 @@ __KERNEL_RCSID(0, "$NetBSD: nouveau_pci.c,v 1.36 2022/07/=
 18 23:34:02 riastradh E
  #if defined(__arm__) || defined(__aarch64__)
  #include "opt_fdt.h"
  #endif
 +#include "opt_genfb.h"
  #endif
 =20
  #include <sys/types.h>
 @@ -49,6 +50,10 @@ __KERNEL_RCSID(0, "$NetBSD: nouveau_pci.c,v 1.36 2022/07=
 /18 23:34:02 riastradh E
  #include <dev/fdt/fdtvar.h>
  #endif
 =20
 +#if NGENFB > 0
 +#include <dev/wscons/wsdisplayvar.h>
 +#endif
 +
  #include <drm/drm_pci.h>
 =20
  #include <core/device.h>
 @@ -220,6 +225,24 @@ nouveau_pci_attach_real(device_t self)
  	}
  	sc->sc_pci_attached =3D true;
 =20
 +#if NGENFB > 0
 +	/*
 +	 * If MD initialization has selected this as a genfb console
 +	 * with a firmware-provided framebuffer address, we may have to
 +	 * turn it off early, before we are ready to switch the console
 +	 * over -- something goes wrong if we're still writing to the
 +	 * firmware-provided framebuffer during nouveau initialization.
 +	 */
 +    {
 +	bool is_console;
 +	if (prop_dictionary_get_bool(device_properties(self), "is_console",
 +		&is_console) &&
 +	    is_console &&
 +	    genfb_is_console())
 +		wsdisplay_predetach();
 +    }
 +#endif
 +
  	/* XXX errno Linux->NetBSD */
  	error =3D -nouveau_drm_device_init(sc->sc_drm_dev);
  	if (error) {

 --=_cEFiPfdk98xHDMxf5dg4ZFdv6SEdn8RA--

From: Patrick Welche <prlw1@welche.eu>
To: gnats-bugs@netbsd.org
Cc: riastradh@netbsd.org, prlw1@netbsd.org
Subject: Re: kern/53126: uefi boot breaks graphics
Date: Sat, 25 Feb 2023 18:24:22 +0000

 On Fri, Feb 24, 2023 at 10:30:02AM +0000, Taylor R Campbell wrote:
 >  New patch to try -- barking up a different tree now.  This one is more
 >  committable as-is, and also corresponds to a change jmcneill@ made on
 >  fdt platforms a couple years ago.

 I tried that last patch, and there is progress!

 Whereas before the low resolution kernel output would stop at

 nouveau0: bios: version 80.04.09.00.01
 nouveau0: interrupting at msi8 vec 0 (nouveau0)
 nouveau0: fb: 2048 MiB GDDR5

 it now carries on to change graphics mode, but doesn't quite get it right,
 so there are lines of green pixels at the top of the screen. Presumably

 Zone  kernel: Available graphics memory: 9007199252286312 KiB
 Zone   dma32: Available graphics memory: 2097152 KiB
 nouveau0: DRM: VRAM: 2048 MiB
 nouveau0: DRM: GART: 1048576 MiB
 ...

 is being printed, but it is illegible.

From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/53126 CVS commit: src/sys
Date: Wed, 1 Mar 2023 08:42:34 +0000

 Module Name:	src
 Committed By:	riastradh
 Date:		Wed Mar  1 08:42:34 UTC 2023

 Modified Files:
 	src/sys/dev/wscons: wsdisplay.c wsdisplayvar.h
 	src/sys/external/bsd/drm2/nouveau: nouveau_pci.c

 Log Message:
 nouveau: Kick out genfb on firmware framebuffer before initializing.

 PR kern/53126


 To generate a diff of this commit:
 cvs rdiff -u -r1.165 -r1.166 src/sys/dev/wscons/wsdisplay.c
 cvs rdiff -u -r1.56 -r1.57 src/sys/dev/wscons/wsdisplayvar.h
 cvs rdiff -u -r1.36 -r1.37 src/sys/external/bsd/drm2/nouveau/nouveau_pci.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/53126 CVS commit: [netbsd-10] src/sys
Date: Mon, 20 Mar 2023 17:24:15 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Mon Mar 20 17:24:15 UTC 2023

 Modified Files:
 	src/sys/dev/wscons [netbsd-10]: wsdisplay.c wsdisplayvar.h
 	src/sys/external/bsd/drm2/dist/drm/amd/amdgpu [netbsd-10]:
 	    amdgpu_gart.c
 	src/sys/external/bsd/drm2/nouveau [netbsd-10]: nouveau_pci.c
 	src/sys/external/bsd/drm2/radeon [netbsd-10]: radeon_pci.c

 Log Message:
 Pull up following revision(s) (requested by mrg in ticket #122):

 	sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_gart.c: revision 1.11
 	sys/external/bsd/drm2/nouveau/nouveau_pci.c: revision 1.37
 	sys/external/bsd/drm2/radeon/radeon_pci.c: revision 1.22
 	sys/dev/wscons/wsdisplay.c: revision 1.166
 	sys/dev/wscons/wsdisplayvar.h: revision 1.57

 amdgpu: Fix bogus loop invariant assertions in amdgpu_gart_map.
 nouveau: Kick out genfb on firmware framebuffer before initializing.

 PR kern/53126

 radeon: Kick out genfb on firmware framebuffer before initializing.
 this is the same change as nouveau_pci.c:1.37, and should fix at
 least PR#56714 and i thought at least another PR i can't find right
 now.  it fixes at least 2 different radeon cards for me on UEFI
 booted system.


 To generate a diff of this commit:
 cvs rdiff -u -r1.165 -r1.165.4.1 src/sys/dev/wscons/wsdisplay.c
 cvs rdiff -u -r1.56 -r1.56.4.1 src/sys/dev/wscons/wsdisplayvar.h
 cvs rdiff -u -r1.10 -r1.10.4.1 \
     src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_gart.c
 cvs rdiff -u -r1.36 -r1.36.4.1 \
     src/sys/external/bsd/drm2/nouveau/nouveau_pci.c
 cvs rdiff -u -r1.21 -r1.21.4.1 src/sys/external/bsd/drm2/radeon/radeon_pci.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Soren Jacobsen <snj@blef.org>
To: gnats-bugs@netbsd.org
Cc: prlw1@welche.eu
Subject: Re: kern/53126: uefi boot breaks graphics
Date: Wed, 24 May 2023 11:07:44 -0700

 Is this fixed for you now, Patrick?  The last patch posted here was
 actually a no-op, but the committed version does what was intended.

 Soren

From: Patrick Welche <prlw1@welche.eu>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: kern/53126: uefi boot breaks graphics
Date: Fri, 26 May 2023 16:05:51 +0100

 The graphics mode problem described in the PR is fixed!

 tty terminal works fine.

 xdm: I didn't manage to get sensible key presses into the username box.
 It behaved just like when one has getty running on vt05 in
 /etc/ttys, yet AFAICT all was off. Popping serial console back on
 gets it working. But that should be the subject of a new PR if I
 can't get it going.

State-Changed-From-To: feedback->needs-pullups
State-Changed-By: riastradh@NetBSD.org
State-Changed-When: Fri, 26 May 2023 17:09:34 +0000
State-Changed-Why:
submitter reports fixed (xdm issue to be diagnosed separately)


State-Changed-From-To: needs-pullups->closed
State-Changed-By: riastradh@NetBSD.org
State-Changed-When: Sat, 29 Jul 2023 12:10:39 +0000
State-Changed-Why:
fixed and pulled up to netbsd-10

(if someone wants to apply it to netbsd-9, feel free)


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2023 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.