Re: Issues with intelfb(4) and USB keyboards

2020-12-19 Thread RVP

On Sat, 19 Dec 2020, Mouse wrote:


Not necessarily.  At one of my jobs, we make a turnkey appliance that
typically connects to a user- (or at least dealer-)supplied monitor,
potentially with a locally-sourced cable.  We've had multiple issues in
the field with recent versions (built atop NetBSD 8.0 and 9.1) traced
to cables that don't connect the pins necessary to carry the EDID info.


Quite true. I have an old ViewSonic LCD which sometimes sends *wrong*/no
EDID data even when the (VGA) cables are OK.

-RVP



Re: Issues with intelfb(4) and USB keyboards

2020-12-19 Thread RVP

On Sat, 19 Dec 2020, Brian Buhrow wrote:


hello.  Thanks for the quick explanation.  It still doesn't work, but 
the errors are different.
Any ideas what to try next?  How does one set the dot clock?

[ 7.099124] warning: 
../../../../external/bsd/drm2/dist/drm/i915/i915_drv.c:591: 
WARN_ON(!IS_KABYLAKE(dev_priv))kern info: [drm] Memory usable by graphics 
device = 4096M
[ 7.111382] kern info: [drm] Supports vblank timestamp caching Rev 2 
(21.10.2013).
[ 7.119122] kern info: [drm] Driver supports precise vblank timestamp query.
[ 7.139122] kern info: [drm] failed to find VBIOS tables
[ 7.159122] i915drmkms0: interrupting at ioapic0 pin 16 (i915drmkms0)
[ 7.169123] kern error: 
[drm:(../../../../external/bsd/drm2/dist/drm/drm_irq.c:810)drm_calc_timestamping_constants]
 *ERROR* crtc 21: Can't calculate constants, dotclock = 0!
[ 7.169123] warning: 
../../../../external/bsd/drm2/dist/drm/i915/intel_pm.c:3276: 
WARN_ON(p->pixel_rate == 0)intelfb0 at i915drmkms0
[ 7.199122] intelfb0: framebuffer at 0x8e0139e14000, size 1280x1024, 
depth 32, stride 5120
[ 8.009123] kern error: 
[drm:(../../../../external/bsd/drm2/dist/drm/i915/intel_dp.c:3797)intel_dp_link_training_clock_recovery]
 *ERROR* too many full retries, give up
[ 8.049123] kern error: 
[drm:(../../../../external/bsd/drm2/dist/drm/i915/intel_dp.c:3797)intel_dp_link_training_clock_recovery]
 *ERROR* too many full retries, give up
[ 8.079128] kern error: 
[drm:(../../../../external/bsd/drm2/dist/drm/i915/intel_dp.c:3797)intel_dp_link_training_clock_recovery]
 *ERROR* too many full retries, give up
[ 8.119123] kern error: 
[drm:(../../../../external/bsd/drm2/dist/drm/i915/intel_dp.c:3797)intel_dp_link_training_clock_recovery]
 *ERROR* too many full retries, give up
[ 8.159124] kern error: 
[drm:(../../../../external/bsd/drm2/dist/drm/i915/intel_dp.c:3797)intel_dp_link_training_clock_recovery]
 *ERROR* too many full retries, give up
[ 8.199143] kern info: [drm] RC6 on
[ 8.199143] kern error: 
[drm:(../../../../external/bsd/drm2/dist/drm/i915/intel_dp.c:3797)intel_dp_link_training_clock_recovery]
 *ERROR* too many full retries, give up
[ 8.249123] kern error: 
[drm:(../../../../external/bsd/drm2/dist/drm/i915/intel_dp.c:3797)intel_dp_link_training_clock_recovery]
 *ERROR* too many full retries, give up
[ 8.249123] kern error: 
[drm:(../../../../external/bsd/drm2/dist/drm/i915/intel_dp.c:3868)intel_dp_link_training_channel_equalization]
 *ERROR* failed to train DP, aborting


So, the firmware got loaded OK.

You shouldn't need to set the dot clocks--the CRT, unless it is a
very old one, should respond to an EDID query and supply the correct
display-timing info back to the driver. Is the monitor OK?

If it isn't a CRT issue, then I don't know how to make the DRMKMS
driver use a custom modeline.

Suggestions:

1. Try the latest -HEAD build. It may have fixes.

2. Try `genfb/wsfb'--the generic framebuffer and the X driver which
runs on top of `genfb'. Disable i915drmkms using the userconf facility:

https://mail-index.netbsd.org/tech-x11/2020/12/10/msg002183.html

-RVP


re: Issues with intelfb(4) and USB keyboards

2020-12-19 Thread matthew green
> [ 1.03] cpu0: Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz, id 0x506e3
[ .. ]
> [ 7.099124] warning: 
> ../../../../external/bsd/drm2/dist/drm/i915/i915_drv.c:591: 
> WARN_ON(!IS_KABYLAKE(dev_priv))kern info: [drm] Memory usable by graphics 
> device = 4096M

this is odd.  it indicates that a skylake cpu (
https://ark.intel.com/content/www/us/en/ark/products/88184/intel-core-i5-6500-processor-6m-cache-up-to-3-60-ghz.html)
but the GPU is calling itself kabylake generation.

i wonder if there's something fixed in newer drm that
handles this situation.  might be worth looking at
the upstream code around this part now.  does it add
additional types for skylake vs kabylake?  when i
patched in the kabylake support in 2018, i had made it
mostly match the upstream version from then.


.mrg.


Re: Issues with intelfb(4) and USB keyboards

2020-12-19 Thread RVP

On Sat, 19 Dec 2020, RVP wrote:

[ 7.124810] kern error: 
[drm:(../../../../external/bsd/drm2/dist/drm/i915/i915_drv.c:636)i915_firmware_load_error_print] 
*ERROR* failed to load firmware i915/skl_dmc_ver1.bin (0)
[ 7.124810] kern error: 
[drm:(../../../../external/bsd/drm2/dist/drm/i915/i915_drv.c:651)i915_firmware_load_error_print] 
*ERROR* The driver is built-in, so to load the firmware you need to
[ 7.124810] include it either in the kernel (see CONFIG_EXTRA_FIRMWARE) 
or

[ 7.124810] in your initrd/initramfs image.
[ 7.134810] warning: 
../../../../external/bsd/drm2/dist/drm/i915/intel_pm.c:3276: 
WARN_ON(p->pixel_rate == 0)kern error: 
[drm:(../../../../external/bsd/drm2/dist/drm/i915/intel_guc_loader.c:560)guc_fw_fetch] 
*ERROR* Failed to fetch GuC firmware from i915/skl_guc_ver4.bin (error -2)
[ 7.134810] kern error: 
[drm:(../../../../external/bsd/drm2/dist/drm/i915/i915_gem.c:5417)i915_gem_init_hw] 
*ERROR* Failed to initialize GuC, error -5 (ignored)


Looks like you need to load the GPU firmware.
Create a directory called /libdata/firmware/i915drmkms and copy the
/lib/firmware/i915/*.bin files from some Linux system into it.
Create symbolic links, if needed, from what the kernel expects
(see above) to the latest `skl_*' (Skylake) versions of the same files.


Correction: Copy the `i915' directory into `/libdata/firmware/i915drmkms'
because the firmware loader is trying to load `i915/skl_...'.

-RVP



Re: Issues with intelfb(4) and USB keyboards

2020-12-19 Thread John Franklin



On Sat, Dec 19, 2020 at 3:44 PM, RVP  wrote:

On Sat, 19 Dec 2020, Brian Buhrow wrote:

	hello.  Thanks for the quick explanation.  It still doesn't work, 
but the errors are different.

Any ideas what to try next?  How does one set the dot clock?


Suggestions:

1. Try the latest -HEAD build. It may have fixes.

2. Try `genfb/wsfb'--the generic framebuffer and the X driver which
runs on top of `genfb'. Disable i915drmkms using the userconf 
facility:


https://mail-index.netbsd.org/tech-x11/2020/12/10/msg002183.html



Another suggestion, check the Xorg.0.log for clues.  There should be 
log entries in there about reported EDID information, what display 
outputs the driver can see, and maybe something about which one it's 
choosing.


jf
--
John Franklin
frank...@elfie.org


Re: Issues with intelfb(4) and USB keyboards

2020-12-19 Thread Mouse
> You shouldn't need to set the dot clocks--the CRT, unless it is a
> very old one, should respond to an EDID query and supply the correct
> display-timing info back to the driver.

Not necessarily.  At one of my jobs, we make a turnkey appliance that
typically connects to a user- (or at least dealer-)supplied monitor,
potentially with a locally-sourced cable.  We've had multiple issues in
the field with recent versions (built atop NetBSD 8.0 and 9.1) traced
to cables that don't connect the pins necessary to carry the EDID info.

So, even if the monitor is capable of it, the host might not see EDID.

Of course, you can also squint your mind a different way and see the
problem as being the switch from the "computer generates signal, it's
the monitor's responsibility to display it" paradigm to "monitor tells
computer what kind of signal to generate, it's the computer's
responsibility to obey" paradigm.  I ran into this bigtime when trying
to connect my SS20s to flatscreens - each end thought it had control
over the details of the video timing.  (I eventually managed to get the
SS20 to generate something the flatscreen would handle, but it took
fiddling.  Yet another case of technology advancing to the point where
it becomes difficult or impossible to do what used to be easy.)

/~\ The ASCII Mouse
\ / Ribbon Campaign
 X  Against HTMLmo...@rodents-montreal.org
/ \ Email!   7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


Re: Issues with intelfb(4) and USB keyboards

2020-12-19 Thread RVP

On Sat, 19 Dec 2020, Brian Buhrow wrote:


When the machine boots, the BIOS sets up the display as it should
and the VGA port works.  when the kernel takes over, it configures
the intelfb(4) device and the screen goes black and the monitor
claims there's no signal.


The display should be mirrored after i915drmkms takes over (at least
it does on 9.99.77).


[ 7.124810] kern error: 
[drm:(../../../../external/bsd/drm2/dist/drm/i915/i915_drv.c:636)i915_firmware_load_error_print]
 *ERROR* failed to load firmware i915/skl_dmc_ver1.bin (0)
[ 7.124810] kern error: 
[drm:(../../../../external/bsd/drm2/dist/drm/i915/i915_drv.c:651)i915_firmware_load_error_print]
 *ERROR* The driver is built-in, so to load the firmware you need to
[ 7.124810] include it either in the kernel (see CONFIG_EXTRA_FIRMWARE) or
[ 7.124810] in your initrd/initramfs image.
[ 7.134810] warning: 
../../../../external/bsd/drm2/dist/drm/i915/intel_pm.c:3276: 
WARN_ON(p->pixel_rate == 0)kern error: 
[drm:(../../../../external/bsd/drm2/dist/drm/i915/intel_guc_loader.c:560)guc_fw_fetch]
 *ERROR* Failed to fetch GuC firmware from i915/skl_guc_ver4.bin (error -2)
[ 7.134810] kern error: 
[drm:(../../../../external/bsd/drm2/dist/drm/i915/i915_gem.c:5417)i915_gem_init_hw]
 *ERROR* Failed to initialize GuC, error -5 (ignored)


Looks like you need to load the GPU firmware.
Create a directory called /libdata/firmware/i915drmkms and copy the
/lib/firmware/i915/*.bin files from some Linux system into it.
Create symbolic links, if needed, from what the kernel expects
(see above) to the latest `skl_*' (Skylake) versions of the same files.

-RVP


Re: Issues with intelfb(4) and USB keyboards

2020-12-19 Thread Brian Buhrow
hello.  Thanks for the quick explanation.  It still doesn't work, but 
the errors are different.
Any ideas what to try next?  How does one set the dot clock?
-thanks
-Brian

[ 1.00] Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 
2004, 2005,
[ 1.00] 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 
2016, 2017,
[ 1.00] 2018, 2019, 2020 The NetBSD Foundation, Inc.  All rights 
reserved.
[ 1.00] Copyright (c) 1982, 1986, 1989, 1991, 1993
[ 1.00] The Regents of the University of California.  All rights 
reserved.

[ 1.00] NetBSD 9.1_STABLE (MIRKWOOD) #0: Wed Dec 16 23:49:40 PST 2020
[ 1.00] 
buh...@loth-9.nfbcal.org:/usr/local/netbsd/src-90/sys/arch/amd64/compile/MIRKWOOD
[ 1.00] total memory = 16088 MB
[ 1.00] avail memory = 15594 MB
[ 1.00] WARNING: module error: module `msdos' pushed by boot loader 
already exists
[ 1.00] cpu_rng: RDSEED
[ 1.00] rnd: seeded with 256 bits
[ 1.00] timecounter: Timecounters tick every 10.000 msec
[ 1.00] Kernelized RAIDframe activated
[ 1.00] running cgd selftest aes-xts-256 aes-xts-512 done
[ 1.00] timecounter: Timecounter "i8254" frequency 1193182 Hz quality 
100
[ 1.03] efi: systbl at pa dbd17018
[ 1.03] Dell Inc. OptiPlex 5050
[ 1.03] mainbus0 (root)
[ 1.03] ACPI: RSDP 0xD0ED9000 24 (v02 DELL  )
[ 1.03] ACPI: XSDT 0xD0ED90B8 F4 (v01 DELL   CBX3 
01072009 AMI  00010013)
[ 1.03] ACPI: FACP 0xD0F009F8 00010C (v05 DELL   CBX3 
01072009 AMI  00010013)
[ 1.03] ACPI: DSDT 0xD0ED9240 0277B4 (v02 DELL   CBX3 
01072009 INTL 20160422)
[ 1.03] ACPI: FACS 0xDB80DF00 40
[ 1.03] ACPI: APIC 0xD0F00B08 84 (v03 DELL   CBX3 
01072009 AMI  00010013)
[ 1.03] ACPI: FPDT 0xD0F00B90 44 (v01 DELL   CBX3 
01072009 AMI  00010013)
[ 1.03] ACPI: FIDT 0xD0F00BD8 AC (v01 DELL   CBX3 
01072009 AMI  00010013)
[ 1.03] ACPI: MCFG 0xD0F00C88 3C (v01 DELL   CBX3 
01072009 MSFT 0097)
[ 1.03] ACPI: HPET 0xD0F00CC8 38 (v01 DELL   CBX3 
01072009 AMI. 0005000B)
[ 1.03] ACPI: SSDT 0xD0F00D00 003176 (v02 SaSsdt SaSsdt   
3000 INTL 20160422)
[ 1.03] ACPI: SSDT 0xD0F03E78 0025A5 (v02 PegSsd PegSsdt  
1000 INTL 20160422)
[ 1.03] ACPI: HPET 0xD0F06420 38 (v01 INTEL  SKL  
0001 MSFT 005F)
[ 1.03] ACPI: SSDT 0xD0F06458 000DE5 (v02 INTEL  Ther_Rvp 
1000 INTL 20160422)
[ 1.03] ACPI: SSDT 0xD0F07240 0008F6 (v02 INTEL  DELL_SFF 
 INTL 20160422)
[ 1.03] ACPI: UEFI 0xD0F07B38 42 (v01 
  )
[ 1.03] ACPI: SSDT 0xD0F07B80 000EDE (v02 CpuRef CpuSsdt  
3000 INTL 20160422)
[ 1.03] ACPI: LPIT 0xD0F08A60 94 (v01 INTEL  SKL  
 MSFT 005F)
[ 1.03] ACPI: SSDT 0xD0F08AF8 000141 (v02 INTEL  HdaDsp   
 INTL 20160422)
[ 1.03] ACPI: SSDT 0xD0F08C40 00029F (v02 INTEL  sensrhub 
 INTL 20160422)
[ 1.03] ACPI: SSDT 0xD0F08EE0 003002 (v02 INTEL  PtidDevc 
1000 INTL 20160422)
[ 1.03] ACPI: SSDT 0xD0F0BEE8 00050D (v02 INTEL  TbtTypeC 
 INTL 20160422)
[ 1.03] ACPI: DBGP 0xD0F0C3F8 34 (v01 INTEL   
0002 MSFT 005F)
[ 1.03] ACPI: DBG2 0xD0F0C430 54 (v00 INTEL   
0002 MSFT 005F)
[ 1.03] ACPI: MSDM 0xD0F0C488 55 (v03 DELL   CBX3 
06222004 AMI  00010013)
[ 1.03] ACPI: SLIC 0xD0F0C4E0 000176 (v03 DELL   CBX3 
01072009 MSFT 00010013)
[ 1.03] ACPI: TCPA 0xD0F0C658 32 (v02 ALASKA NAPAASF  
 MSFT 0113)
[ 1.03] ACPI: ASF! 0xD0F0C690 A0 (v32 INTEL   HCG 
0001 TFSM 000F4240)
[ 1.03] ACPI: BGRT 0xD0F0C730 38 (v00 ??  
01072009 AMI  00010013)
[ 1.03] ACPI: DMAR 0xD0F0C768 A8 (v01 INTEL  SKL  
0001 INTL 0001)
[ 1.03] ACPI: 10 ACPI AML tables successfully acquired and loaded
[ 1.03] ioapic0 at mainbus0 apid 2: pa 0xfec0, version 0x20, 120 
pins
[ 1.03] cpu0 at mainbus0 apid 0
[ 1.03] cpu0: CPU base freq 32 Hz
[ 1.03] cpu0: CPU max freq 36 Hz
[ 1.03] cpu0: TSC freq CPUID 319200 Hz
[ 1.03] cpu0: Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz, id 0x506e3
[ 1.03] cpu0: package 0, core 0, smt 0
[ 1.03] cpu1 at mainbus0 apid 2
[ 1.03] cpu1: Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz, id 0x506e3
[ 1.03] cpu1: package 0, core 1, smt 0
[ 1.03] cpu2 at mainbus0 apid 4
[ 1.03] cpu2: 

Issues with intelfb(4) and USB keyboards

2020-12-19 Thread Brian Buhrow
hello.  I'm working to get a new installation of NetBSD-9.1 working on 
a Dell Optiplex 5050.  This machine has an Intel HD graphics 530 video chip in
it with 2 Display ports, 1 HDMI port and 1 VGA port attached to it.  I'm trying 
to get the VGA port working and I'm having trouble with that.  When the
machine boots, the BIOS sets up the display as it should and the VGA port 
works.  when the kernel takes over, it configures the intelfb(4) device and the 
screen
goes black and the monitor claims there's no signal.  Dmesg is shown below, but 
it looks like either 1 of 2 things is happening:

1.  The i915DRM driver is incorrectly assigning the video output to one of the 
displayporp jacks.

2.  The i915DRM driver is unable to properly detect the supported clock rates 
on the VGA connected monitor and it's settting a resolution that's out of
range for the Monitor.

If it helps, I can log in without the screen on the console and I get a 
window of 64 lines X 160 characters.
That seems like a lot of text on a VGA screen.  

I don't understand the significance or not of the dmesg output from the i915  
driver, so I'm wondering if anyone might be able to help me track this issue
down?

-thanks
-Brian


[ 1.00] Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 
2004, 2005,
[ 1.00] 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 
2016, 2017,
[ 1.00] 2018, 2019, 2020 The NetBSD Foundation, Inc.  All rights 
reserved.
[ 1.00] Copyright (c) 1982, 1986, 1989, 1991, 1993
[ 1.00] The Regents of the University of California.  All rights 
reserved.

[ 1.00] NetBSD 9.1_STABLE (MIRKWOOD) #0: Wed Dec 16 23:49:40 PST 2020
[ 1.00] 
buh...@loth-9.nfbcal.org:/usr/local/netbsd/src-90/sys/arch/amd64/compile/MIRKWOOD
[ 1.00] total memory = 16088 MB
[ 1.00] avail memory = 15594 MB
[ 1.00] WARNING: module error: module `msdos' pushed by boot loader 
already exists
[ 1.00] cpu_rng: RDSEED
[ 1.00] rnd: seeded with 256 bits
[ 1.00] timecounter: Timecounters tick every 10.000 msec
[ 1.00] Kernelized RAIDframe activated
[ 1.00] running cgd selftest aes-xts-256 aes-xts-512 done
[ 1.00] timecounter: Timecounter "i8254" frequency 1193182 Hz quality 
100
[ 1.03] efi: systbl at pa dbd17018
[ 1.03] Dell Inc. OptiPlex 5050
[ 1.03] mainbus0 (root)
[ 1.03] ACPI: RSDP 0xD0ED9000 24 (v02 DELL  )
[ 1.03] ACPI: XSDT 0xD0ED90B8 F4 (v01 DELL   CBX3 
01072009 AMI  00010013)
[ 1.03] ACPI: FACP 0xD0F009F8 00010C (v05 DELL   CBX3 
01072009 AMI  00010013)
[ 1.03] ACPI: DSDT 0xD0ED9240 0277B4 (v02 DELL   CBX3 
01072009 INTL 20160422)
[ 1.03] ACPI: FACS 0xDB80DF00 40
[ 1.03] ACPI: APIC 0xD0F00B08 84 (v03 DELL   CBX3 
01072009 AMI  00010013)
[ 1.03] ACPI: FPDT 0xD0F00B90 44 (v01 DELL   CBX3 
01072009 AMI  00010013)
[ 1.03] ACPI: FIDT 0xD0F00BD8 AC (v01 DELL   CBX3 
01072009 AMI  00010013)
[ 1.03] ACPI: MCFG 0xD0F00C88 3C (v01 DELL   CBX3 
01072009 MSFT 0097)
[ 1.03] ACPI: HPET 0xD0F00CC8 38 (v01 DELL   CBX3 
01072009 AMI. 0005000B)
[ 1.03] ACPI: SSDT 0xD0F00D00 003176 (v02 SaSsdt SaSsdt   
3000 INTL 20160422)
[ 1.03] ACPI: SSDT 0xD0F03E78 0025A5 (v02 PegSsd PegSsdt  
1000 INTL 20160422)
[ 1.03] ACPI: HPET 0xD0F06420 38 (v01 INTEL  SKL  
0001 MSFT 005F)
[ 1.03] ACPI: SSDT 0xD0F06458 000DE5 (v02 INTEL  Ther_Rvp 
1000 INTL 20160422)
[ 1.03] ACPI: SSDT 0xD0F07240 0008F6 (v02 INTEL  DELL_SFF 
 INTL 20160422)
[ 1.03] ACPI: UEFI 0xD0F07B38 42 (v01 
  )
[ 1.03] ACPI: SSDT 0xD0F07B80 000EDE (v02 CpuRef CpuSsdt  
3000 INTL 20160422)
[ 1.03] ACPI: LPIT 0xD0F08A60 94 (v01 INTEL  SKL  
 MSFT 005F)
[ 1.03] ACPI: SSDT 0xD0F08AF8 000141 (v02 INTEL  HdaDsp   
 INTL 20160422)
[ 1.03] ACPI: SSDT 0xD0F08C40 00029F (v02 INTEL  sensrhub 
 INTL 20160422)
[ 1.03] ACPI: SSDT 0xD0F08EE0 003002 (v02 INTEL  PtidDevc 
1000 INTL 20160422)
[ 1.03] ACPI: SSDT 0xD0F0BEE8 00050D (v02 INTEL  TbtTypeC 
 INTL 20160422)
[ 1.03] ACPI: DBGP 0xD0F0C3F8 34 (v01 INTEL   
0002 MSFT 005F)
[ 1.03] ACPI: DBG2 0xD0F0C430 54 (v00 INTEL   
0002 MSFT 005F)
[ 1.03] ACPI: MSDM 0xD0F0C488 55 (v03 DELL   CBX3 
06222004 AMI  00010013)
[ 1.03] ACPI: SLIC 0xD0F0C4E0 000176 (v03 DELL   CBX3 
01072009 MSFT 00010013)
[ 1.03] ACPI: TCPA 0xD0F0C658