Re: Issues with intelfb(4) and USB keyboards

2020-12-22 Thread RVP

On Tue, 22 Dec 2020, Brian Buhrow wrote:


While I don't remember the exact numbers for this monitor, they
look reasonable and, there is a dotclock value in there.


Forgot to mention this: You can use cvt(1) or gtf(1) to generate
modelines.

-RVP


Re: Issues with intelfb(4) and USB keyboards

2020-12-22 Thread Michael van Elst
buh...@nfbcal.org (Brian Buhrow) writes:

>The default, as created by X -configure, is "kbd"

"kbd" is fine, it corresponds to

/usr/X11R7/lib/modules/drivers/kbd_drv.so

-- 
-- 
Michael van Elst
Internet: mlel...@serpens.de
"A potential Snark may lurk in every tree."


Re: Issues with intelfb(4) and USB keyboards

2020-12-22 Thread RVP

On Tue, 22 Dec 2020, Brian Buhrow wrote:


hello.  Below is the output of edid-decode against the data I
extracted using your wsedid program.


So, a valid EDID is present after all. This begins to look like
a DRMKMS issue. I'll try to look into this, but, we will need
a kernel guru for this sooner or later.

Try:

1. genfb/wsfb.

2. Since you have EDID and modelines, try running X blind with
   the "intel" display driver. This config fragment alone usually
   suffices:

   $ cat /etc/X11/xorg.conf.d/intel.conf
   Section "Device"
   Identifier  "Card0"
   Driver  "intel"
   # Option  "AccelMethod" "UXA"
   Option  "TearFree""on"
   Option  "VSync"   "on"
   Option  "PageFlip""on"
   Option  "SwapbuffersWait"   "on"
   Option  "TripleBuffer"  "on"
   Option  "LinearFramebuffer" "on"
   EndSection
   $

   Explicitly supply a modeline and a full config file if the "intel"
   X driver fails to read the EDID.

   Run a compositor if you have visual glitches:
   https://wiki.netbsd.org/laptops/

3. Output of this command:

   $ sysctl machdep.dmi

4. Compile a new GENERIC kernel with `.load_detect_test = 1'
   (file: /usr/src/sys/external/bsd/drm2/dist/drm/i915/i915_params.c)


-RVP


Re: Issues with intelfb(4) and USB keyboards

2020-12-22 Thread Brian Buhrow
hello.  My apologies for such a naive question, but what driver should 
I use for the keyboard?  
The default, as created by X -configure, is "kbd"
I'm thinking it should be "wskbd".  Is that correct?
In any case, the keyboard doesn't appear to work when X is running, though it 
works fine, using a USB keyboard and the wskbd driver when I'm using the
console.

I'll try the xorg.conf section you suggest and, if that doesn't work, i'll try 
the genfb driver.

I'm hoping it's an easy fix for the i915drmkms driver, soon.
Again, thanks for the help.
-Brian



Re: Issues with intelfb(4) and USB keyboards

2020-12-22 Thread Mouse
> The only thing that looks odd is that it says the monitor is attached
> to the displayport, which is incorrect.  It's attached to the 15-pin
> VGA port.

There's a work machine which according to RandR has seven outputs: DP1,
DP2, DP3, HDMI1, HDMI2, HDMI3, and VIRTUAL1.  VIRTUAL1 is, I believe,
well, virtual.  But, in terms of the connectors actually present on the
case, there are two HDMI and one VGA.  When the VGA is connected, one
of the DPx outputs shows connected (I forget offhand which one).

I don't _know_ that DP stands for DisplayPort, but it seems likely.

So perhaps VGA looks like DP to software often enough?

/~\ 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-22 Thread Brian Buhrow
hello.  Below is the output of edid-decode against the data I extracted 
using your wsedid program.  While I don't remember the exact numbers for this
monitor, they look reasonable and, there is a dotclock value in there.  The 
only thing that looks odd is that it says the monitor is attached to the
displayport, which is incorrect.  It's attached to the 15-pin VGA port.  
Perhaps that's normal, I'm not familiar with this graphics adapter.  Anyway, 
what
do you think?
And, yes, this monitor was really made in the year 2000.
-thanks
-Brian


edid-decode (hex):

00 ff ff ff ff ff ff 00 4d d9 90 03 d1 24 7b 00
2a 0a 01 04 a5 25 1b 96 e3 0c c9 a0 57 47 9b 27
12 48 4c ff ff 80 c2 80 a9 4f 81 59 81 4f 71 59
61 59 45 59 31 59 86 3d 00 c0 51 00 30 40 40 a0
13 00 60 08 11 00 00 1e 00 00 00 fd 00 30 78 1e
60 1e 00 0a 20 20 20 20 20 20 00 00 00 fc 00 53
4f 4e 59 20 43 50 44 2d 45 34 30 30 00 00 00 ff
00 38 30 37 30 33 35 33 0a 20 20 20 20 20 00 8f



Block 0, Base EDID:
  EDID Structure Version & Revision: 1.4
  Vendor & Product Identification:
Manufacturer: SNY
Model: 912
Serial Number: 8070353
Made in: week 42 of 2000
  Basic Display Parameters & Features:
Digital display
Bits per primary color channel: 8
DisplayPort interface
Maximum image size: 37 cm x 27 cm
Gamma: 2.50
DPMS levels: Standby Suspend Off
Supported color formats: RGB 4:4:4
First detailed timing includes the native pixel format and preferred 
refresh rate
Display is continuous frequency
  Color Characteristics:
Red  : 0.6250, 0.3398
Green: 0.2802, 0.6054
Blue : 0.1552, 0.0703
White: 0.2832, 0.2978
  Established Timings I & II:
IBM :   720x40070.082 Hz   9:531.467 kHz  28.320 MHz
IBM :   720x40087.850 Hz   9:539.444 kHz  35.500 MHz
DMT 0x04:   640x48059.940 Hz   4:331.469 kHz  25.175 MHz
Apple   :   640x48066.667 Hz   4:335.000 kHz  30.240 MHz
DMT 0x05:   640x48072.809 Hz   4:337.861 kHz  31.500 MHz
DMT 0x06:   640x48075.000 Hz   4:337.500 kHz  31.500 MHz
DMT 0x08:   800x60056.250 Hz   4:335.156 kHz  36.000 MHz
DMT 0x09:   800x60060.317 Hz   4:337.879 kHz  40.000 MHz
DMT 0x0a:   800x60072.188 Hz   4:348.077 kHz  50.000 MHz
DMT 0x0b:   800x60075.000 Hz   4:346.875 kHz  49.500 MHz
Apple   :   832x62474.551 Hz   4:349.726 kHz  57.284 MHz
DMT 0x0f:  1024x768i   86.958 Hz   4:335.522 kHz  44.900 MHz
DMT 0x10:  1024x76860.004 Hz   4:348.363 kHz  65.000 MHz
DMT 0x11:  1024x76870.069 Hz   4:356.476 kHz  75.000 MHz
DMT 0x12:  1024x76875.029 Hz   4:360.023 kHz  78.750 MHz
DMT 0x24:  1280x1024   75.025 Hz   5:479.976 kHz 135.000 MHz
Apple   :  1152x87075.062 Hz 192:145  68.681 kHz 100.000 MHz
  Standard Timings:
CVT :  1800x1440   59.911 Hz   5:489.447 kHz 218.250 MHz (EDID 1.4 
source)
GTF :  1800x1440   60.000 Hz   5:489.400 kHz 219.566 MHz (EDID 1.3 
source)
DMT 0x36:  1600x1200   75.000 Hz   4:393.750 kHz 202.500 MHz
DMT 0x21:  1280x96085.002 Hz   4:385.938 kHz 148.500 MHz
CVT :  1280x96074.857 Hz   4:375.231 kHz 130.000 MHz (EDID 1.4 
source)
GTF :  1280x96075.000 Hz   4:375.150 kHz 129.859 MHz (EDID 1.3 
source)
CVT :  1152x86484.790 Hz   4:377.159 kHz 119.750 MHz (EDID 1.4 
source)
GTF :  1152x86485.000 Hz   4:377.095 kHz 119.651 MHz (EDID 1.3 
source)
DMT 0x13:  1024x76884.997 Hz   4:368.677 kHz  94.500 MHz
DMT 0x0c:   800x60085.061 Hz   4:353.674 kHz  56.250 MHz
DMT 0x07:   640x48085.008 Hz   4:343.269 kHz  36.000 MHz
  Detailed Timing Descriptors:
DTD 1:  1280x1024   85.024 Hz   5:491.146 kHz 157.500 MHz (352 mm x 264 
mm)
 Hfront   64 Hsync 160 Hback 224 Hpol P
 Vfront1 Vsync   3 Vback  44 Vpol P
  Display Range Limits:
Monitor ranges (GTF): 48-120 Hz V, 30-96 kHz H, max dotclock 300 MHz
Display Product Name: 'SONY CPD-E400'
Display Product Serial Number: '8070353'
Checksum: 0x8f


Wrong test in vcons_invalidate_cache() in sys/dev/wscons/wsdisplay_vcons.c

2020-12-22 Thread RVP

This looks wrong:

for (i = 0; i > vd->cells; i++) {

Surely it is meant to be: `i < vd->cells'

-RVP


Re: Issues with intelfb(4) and USB keyboards

2020-12-22 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.
...
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.


The default font is 8x16 (WxH). So, on an 1280x1024 pixel display you
will have 64x160 chars.


...
[ 7.144810] intelfb0 at i915drmkms0
[ 7.144810] intelfb0: framebuffer at 0x848139e34000, size 1280x1024, 
depth 32, stride 5120
[ 8.254809] wsdisplay0 at intelfb0 kbdmux 1: console (default, vt100 
emulation), using wskbd0
[ 8.265725] wsmux1: connecting to wsdisplay0
[ 8.265725] wskbd1: connecting to wsdisplay0


I wonder how BIOS/intelfb configured a 1280x1024x32 display without an
EDID. Might be a DRM-driver issue as mrg@ hinted. Let's look at your
EDID.

1. Get the edid-decode sources from https://git.linuxtv.org/edid-decode.git/
   and compile it. It compiles cleanly on NetBSD.

2. Compile the program below, and run it like this:

./wsedid | edid-decode > /tmp/edid.txt

If the EDID and checksum look OK, then the DRMKMS driver will need
looking into. (And, in the interim, a program to set the correct
timings using libdrm may need to be written.--if you're not happy
with genfb.)

If they don't look OK, then unplug the CRT and try again. My old
ViewSonic LCD monitor has a "soft" off-button, and switching the LCD
off using that does no good when it's misbehaving.




Makefile:
=
CC ?= gcc
CFLAGS ?= -Wall -pedantic -g
LDFLAGS ?=

EXE = wsedid
SRC = ${EXE}.c

${EXE}: ${SRC}
${CC} ${CFLAGS} ${LDFLAGS} -o $@ ${SRC}

clean:
rm -f ${EXE}

wsedid.c:
=
/**
 * wsedid.c: Print NetBSD/OpenBSD EDID info. using wsdisplay(4).
 */
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 

int
main(int argc, char* argv[])
{
struct utsname un;
struct wsdisplayio_edid_info ei;
char ebuf[4096];
char* dev, *os;
int fd, rc = EXIT_FAILURE;

if ((uname()) < 0)
err(rc, "uname failed");
os = un.sysname;
if (argc == 2)
dev = argv[1];
else {
if (strcmp(os, "NetBSD") == 0)
dev = "/dev/ttyE0";
else if (strcmp(os, "OpenBSD") == 0)
dev = "/dev/ttyC0";
else
errx(rc, "%s: OS is not supported", os);
}
ei.edid_data = ebuf;
ei.buffer_size = sizeof ebuf;
if ((fd = open(dev, O_RDONLY)) < 0)
err(rc, "%s: open failed", dev);
if (ioctl(fd, WSDISPLAYIO_GET_EDID, ) < 0)
err(rc, "ioctl(WSDISPLAYIO_GET_EDID) failed");
fprintf(stderr, "%s EDID data_size = %u\n", dev, ei.data_size);
fwrite(ebuf, 1, ei.data_size, stdout);

rc = EXIT_SUCCESS;
return rc;
}
=

-RVP


Re: Issues with intelfb(4) and USB keyboards

2020-12-22 Thread Brian Buhrow
hello.  Thanks for the help.  I'll follow your instructions and report 
back.
-Brian




Re: Issues with intelfb(4) and USB keyboards

2020-12-22 Thread RVP

On Mon, 21 Dec 2020, Brian Buhrow wrote:


Yes, I have a very old monitor, an old Sony Trenitron multisync.
I can probably find a dotclock value to use in this configuration,
but I don't know how to put it in the i915drmkms driver.  Can I
put in a number with sysctl?


I don't know of any sysctl for this. Nor do I know how to pass
GTF/CVT modelines to the driver like you can do for Linux. The
solution here might be to write a small program to use the DRM
ioctls to set the desired mode (like with X and xrandr). I'll
root around. In the meantime, try genfb(4) + wsfb(4):

https://www.unitedbsd.com/d/271-wfsb/6

-RVP