On Wed, Aug 07, 2019 at 03:16:56PM +0200, Mark Kettenis wrote: > > > > I built a kernel with DRMDEBUG and put 0xffff in drm_debug variable. > > > > initializing kernel modesetting (RV610 0x1002:0x94C3 0x1028:0x0402 0x00). > > [drm] COMBIOS detected > > drm:pid0:r600_init *ERROR* Expecting atombios for R600 GPU > > drm:pid0:radeondrm_attachhook *ERROR* Fatal error during GPU init > > [drm] radeon: finishing device. > > [TTM] Memory type 2 has not been initialized > > [drm] > > drm0 detached > > radeondrm0 detached > > vga1 at pci1 dev 0 function 0 "ATI Radeon HD 2400 Pro" rev 0x00 > > > > > > I tried to follow a bit the initialisation path from radeon_get_bios(): > > - radeon_get_bios() > > - radeon_read_disabled_bios() > > - r600_read_disabled_bios() > > - init registers > > - radeon_read_bios() > > - restore registers > > Can you try to figure out where exactly reading the BIOS from the card > goes wrong?
radeon_read_bios (called by r600_read_disabled_bios) returns something good enough to pass some tests (bios signature check) and finally returns true. the fail is later (in r600_init function, where it checks for ATOM bios. it isn't so its abort init). so I tried something stupid: commenting the call to radeon_read_disabled_bios, in order to force radeon_get_bios to try another way to get bios. it called radeon_read_platform_bios() (the next method) and succeed. it returned an ATOM bios (so r600_init is happy), radeondrm(4) finished its initialization, and xenodm started correctly. $ dmesg ... initializing kernel modesetting (RV610 0x1002:0x94C3 0x1028:0x0402 0x00). radeondrm0: 1680x1050, 32bpp wsdisplay0 at radeondrm0 mux 1: console (std, vt100 emulation), using wskbd0 ... $ xrandr < Screen 0: minimum 320 x 200, current 1680 x 1050, maximum 8192 x 8192 DIN disconnected primary (normal left inverted right x axis y axis) DVI-0 connected 1680x1050+0+0 (normal left inverted right x axis y axis) 430mm x 270mm 1680x1050 59.88*+ 1280x1024 75.02 60.02 1152x864 75.00 1024x768 75.03 60.00 800x600 75.00 60.32 640x480 75.00 59.94 720x400 70.08 Below the patch for what I did (it could be more evident than my explain) Index: radeon_bios.c =================================================================== RCS file: /cvs/src/sys/dev/pci/drm/radeon/radeon_bios.c,v retrieving revision 1.15 diff -u -p -r1.15 radeon_bios.c --- radeon_bios.c 14 Apr 2019 10:14:54 -0000 1.15 +++ radeon_bios.c 7 Aug 2019 17:41:42 -0000 @@ -815,8 +815,10 @@ bool radeon_get_bios(struct radeon_devic r = igp_read_bios_from_vram(rdev); if (r == false) r = radeon_read_bios(rdev); +#if 0 if (r == false) r = radeon_read_disabled_bios(rdev); +#endif if (r == false) r = radeon_read_platform_bios(rdev); if (r == false || rdev->bios == NULL) { Now, I know it is only a workaround on this specific machine. I still dunno if: - radeon_read_disabled_bios() should return false (because it isn't the right way for this specific card), and so the use of radeon_read_platform_bios() is the right thing to do. - radeon_read_disabled_bios() should return true and an ATOM bios, and calling radeon_read_platform_bios() is a workaround. Thanks. -- Sebastien Marie