9front - general discussion about 9front
 help / color / mirror / Atom feed
* [9front] aux/vga -p intermittent edid reporting
@ 2021-04-23 22:16 unobe
  2021-04-24 16:07 ` cinap_lenrek
  0 siblings, 1 reply; 4+ messages in thread
From: unobe @ 2021-04-23 22:16 UTC (permalink / raw)
  To: 9front

It was by chance that doing 'aux/vga -p' today that I saw something I
hadn't seen before: edid information at the end of the output.
Running 'aux/vga -p' only reports the edid information once in a
while.  The difference is this patch:
--- /tmp/blank	Fri Apr 23 13:32:14 2021
+++ /tmp/edid	Fri Apr 23 13:32:21 2021
@@ -6,8 +6,8 @@
 vga crt              FF FF FF FF FF FF FF FF - FF FF FF FF FF FF FF FF
                      FF FF FF FF FF FF FF FF - FF
 vga graphics         00 00 00 00 00 00 00 00 - 00
-vga attribute        20 21 22 23 24 25 26 27 - 28 29 2A 2B 2C 2D 2E 2F
-                     21 21 33 33 00
+vga attribute        00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00
+                     00 32 32 04 04
 vga virtual         0 0
 vga apz                     0
 vga linear                  1
@@ -230,4 +230,22 @@
 igfx adpa            [000e1100] = 00040000
 igfx lvds            [000e1180] = 80300302
 igfx vgacntrl        [00041000] = 8024298e
+edid mfr            APP
+edid serialstr      
+edid name           Color LCD
+edid product        40135
+edid serial         0
+edid version        1.3
+edid mfrdate        2009.36
+edid size (cm)      29x18
+edid gamma          2.20
+edid vert (Hz)      0-0
+edid horz (Hz)      0-0
+edid pclkmax        0
+edid flags           digital
+edid 1280x800@60Hz  
+		clock=72.5
+		shb=1328 ehb=1360 ht=1423
+		vrs=803 vre=809 vt=846
+		hsync=- vsync=- 

What is nice about this is that now I got the vgadb info!  But I can't
use it consistently, I think, because setting to those dimensions fail
unless aux/vga -p reports the edid.  It appears to be available every
19 seconds:
cpu% while() { aux/vga -p | grep APP | xargs echo `{date} }
Fri Apr 23 00:43:43 PDT 2021 edid mfr            APP
Fri Apr 23 00:44:02 PDT 2021 edid mfr            APP
Fri Apr 23 00:44:21 PDT 2021 edid mfr            APP
Fri Apr 23 00:44:40 PDT 2021 edid mfr            APP
Fri Apr 23 00:44:59 PDT 2021 edid mfr            APP
Fri Apr 23 00:45:18 PDT 2021 edid mfr            APP
Fri Apr 23 00:45:37 PDT 2021 edid mfr            APP

Here's vgactl output:
cpu% cat /dev/vgactl
type igfx
size 1280x800x32 x8r8g8b8
tilt none
hwgc soft
hwaccel off
hwblank off
addr p 0x90000000 v 0xffffff0090000000 size 0x4000000
softscreen on

I noticed that running aux/vga -p (and also -ip) resets the vga
configuration--the type is still there, but hwblank is reset to off,
even if I had set it previously, and I have to 'echo -n drawinit
>/dev/vgactl' if I want to have blanking work again.  I hadn't
expected that because I thought -p was diagnostic.  I do now see some
write register codes to clear things in /sys/src/cmd/aux/vga/igfx.c ,
but haven't yet grokked it all.

But back to the main issue: is edid supposed to be consistently
reported, or is this expected?


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9front] aux/vga -p intermittent edid reporting
  2021-04-23 22:16 [9front] aux/vga -p intermittent edid reporting unobe
@ 2021-04-24 16:07 ` cinap_lenrek
  2021-04-27  5:39   ` unobe
  0 siblings, 1 reply; 4+ messages in thread
From: cinap_lenrek @ 2021-04-24 16:07 UTC (permalink / raw)
  To: 9front

> But back to the main issue: is edid supposed to be consistently
> reported, or is this expected?

no, this is not expected. this hints at some issue with the i2c
controller code that is supposed to read the edid over the aux
channel.

the fix would be to fix that code so it read edid consistently.

on some intel cards, the i2c stuff doesnt work at all. in this
case, you can copy the monitor information into vgadb and tell
it to use that info directly, skipping the i2c part.

--
cinap

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9front] aux/vga -p intermittent edid reporting
  2021-04-24 16:07 ` cinap_lenrek
@ 2021-04-27  5:39   ` unobe
  2021-04-27  9:19     ` cinap_lenrek
  0 siblings, 1 reply; 4+ messages in thread
From: unobe @ 2021-04-27  5:39 UTC (permalink / raw)
  To: 9front

[-- Attachment #1: Type: text/plain, Size: 2517 bytes --]

Quoth cinap_lenrek@felloff.net:
> > But back to the main issue: is edid supposed to be consistently
> > reported, or is this expected?
> 
> no, this is not expected. this hints at some issue with the i2c
> controller code that is supposed to read the edid over the aux
> channel.
> 

Thanks cinap.

> the fix would be to fix that code so it read edid consistently.

I have no idea how to do that.  I see auxctl and auxdat in
/sys/src/cmd/aux/vga/igfx.c so assume that's where I should start, and
refer to the manuals to figure things out.  I see things like:

	/* hack: slow down a bit */

in /sys/src/cmd/aux/vga/igfx.c:/^dpauxio .

> on some intel cards, the i2c stuff doesnt work at all. in this
> case, you can copy the monitor information into vgadb and tell
> it to use that info directly, skipping the i2c part.

It looks to me like the edid fetching is not very stable in igfx.c, so
might be giving some wrong values, or misapplying the values provided.
I've concluded this because I've used the returned edid values in
/lib/vgadb, and it produces a scrambled (illegible) screen.

cpu% tail /lib/vgadb
	lcd=1

#
# Apple MacBook Pro early 2011
#
mbp2011=1280x800
	clock=72.5
	shb=1328 ehb=1360 ht=1423
	vrs=803 vre=809 vt=846
	hsync=- vsync=-

cpu% cat /dev/vgactl
type igfx
size 1280x800x32 x8r8g8b8
tilt none
hwgc soft
hwaccel off
hwblank on
addr p 0x90000000 v 0xffffff0090000000 size 0x4000000
softscreen on
cpu% aux/vga -m mbp2011 -l 1280x800
aux/vga: main: mbp2011@1280x800 not in /lib/vgadb
cpu% aux/vga -m mbp2011 -l 1280x800
aux/vga: main: mbp2011@1280x800 not in /lib/vgadb
cpu% ""
	 cpu% aux/vga -m mbp2011 -l 1280x800
aux/vga: main: mbp2011@1280x800 not in /lib/vgadb
cpu% ""
	 cpu% aux/vga -m mbp2011 -l 1280x800
aux/vga: main: mbp2011@1280x800 not in /lib/vgadb
cpu% ""
	 cpu% aux/vga -m mbp2011 -l 1280x800
aux/vga: main: mbp2011@1280x800 not in /lib/vgadb
cpu% ""
	 cpu% aux/vga -m mbp2011 -l 1280x800
aux/vga: main: mbp2011@1280x800 not in /lib/vgadb
cpu% ""
	 cpu% aux/vga -m mbp2011 -l 1280x800
cpu% ss

As seen above, when the info is finally loaded from /lib/vgadb (1 in
19 odds, or so), there is no error from aux/vga.  Ss is just a
screenshot command:
cpu% cat /bin/ss
#!/bin/rc
cat /dev/screen | topng > /tmp/screenshot.png

It does not reflect the visual scrambing of the screen: the screenshot
looks as my screen *should* look, but does not.

Regardless, I've read enough of the aux/vga/igfx.c code to realize I
need to learn more before I try to address the issues I'm
experiencing.

[-- Attachment #2: screenshot.png --]
[-- Type: image/png, Size: 21046 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9front] aux/vga -p intermittent edid reporting
  2021-04-27  5:39   ` unobe
@ 2021-04-27  9:19     ` cinap_lenrek
  0 siblings, 0 replies; 4+ messages in thread
From: cinap_lenrek @ 2021-04-27  9:19 UTC (permalink / raw)
  To: 9front

> It looks to me like the edid fetching is not very stable in igfx.c, so
> might be giving some wrong values, or misapplying the values provided.
> I've concluded this because I've used the returned edid values in
> /lib/vgadb, and it produces a scrambled (illegible) screen.

that is not possible. the edid structure is checksummed. so even if
theres a problem on transmission it is unlikely to contain conconsitent
values.

it is more likely that theres some problem with your specific controller
version that hasnt been addressed (wrong clock calculation, wrong
reference frequency used). you have to read the documentation
from 01.org and verify.

> I have no idea how to do that.  I see auxctl and auxdat in
> /sys/src/cmd/aux/vga/igfx.c so assume that's where I should start, and
> refer to the manuals to figure things out.

yeah, pretty much.

also, you have to be more specific what "garbled" means. the controller
might just work fine producing a clean signal (the image is stable),
but theres some issue with the video memory mapping in the GTT so it
renders garbage?

> #
> # Apple MacBook Pro early 2011
> #
> mbp2011=1280x800
>	clock=72.5
>	shb=1328 ehb=1360 ht=1423
>	vrs=803 vre=809 vt=846
>	hsync=- vsync=-

you should add lcd=1 attribute here too.

--
cinap

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-04-28  9:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-23 22:16 [9front] aux/vga -p intermittent edid reporting unobe
2021-04-24 16:07 ` cinap_lenrek
2021-04-27  5:39   ` unobe
2021-04-27  9:19     ` cinap_lenrek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).