You are not logged in.

#1 2012-12-19 10:55:16

whoops
Member
Registered: 2009-03-19
Posts: 852

KMS, misbehaving monitor, add custom EDID to kernel

Hi!


My monitor is sending a hdmi/TV edid to graphic cards that support hdmi instead of the proper nontv / DVI edid. Doesn't matter if I connect to the hdmi or the DVI port of my card: the picture sent is always cropped / a LOT bigger than the screen for some reason and changing resolutions does not help.

So... that means I needed to create a custom EDID (which I somehow managed to do despite having no Idea what I'm doing) and override the EDID sent by the mintor in xorg.conf, like that:

Option         "CustomEDID" "DFP-0:/etc/edid-todvi.bin

This works so far in X, with nvidia proprietary driver, without KMS. But I don't manage to switch from nvidia driver to nouveau because there, I have the same problem with KMS.



I tried forcing a valid "modeset" with kernel parameter "video" but that didn't help.
Also, among other things, I tried reading that (and a little beyond): https://www.osadl.org/Single-View.111+M … fd1.0.html
But I don't really understand what I need to do, not even about which "/lib" they are talking (kernel or system?).

Do I need to add the edid.bin blob that I already created to a custom kernel's module stuff to have it built in somehow or just tell my kernel to load it somehow from /lib (have it included in the kernel image, add it to mkinitcpio?)?


I'm confused, so thanks for any hints!

Last edited by whoops (2012-12-19 10:57:57)

Offline

#2 2012-12-31 14:15:42

whoops
Member
Registered: 2009-03-19
Posts: 852

Re: KMS, misbehaving monitor, add custom EDID to kernel

Ok, I might have done... what I found behind this link by just putting the edid in all the places and changed stuff everywhere I found stuff. I was surprised stuff still worked at all afterwards, but nothing changed. So I either did the wrong thing or I did the thing wrong.

Did I mention, that I'm in there way over my head already and barely understand what I'm trying to do? Doesn't look like a problem I should be able to solve... has anyone here already done something like it? Not even sure if this is still "user stuff"... tastes like "dev stuff" :3

Never had the chance to see a machine that has working KMS, so I'm not sure how it should be behaving...

Last edited by whoops (2012-12-31 14:17:52)

Offline

#3 2012-12-31 14:33:12

Gusar
Member
Registered: 2009-08-25
Posts: 3,500

Re: KMS, misbehaving monitor, add custom EDID to kernel

Overscan is what you're observing. Does the TV have any settings regarding this? If no, return it and buy a proper TV smile

Ok, seriously: The custom EDID stuff is very simple: On your system, create a /usr/lib/firmware/edid directory and put your edid there. Then simply add drm_kms_helper.edid_firmware=edid/edid-todvi.bin to the kernel commandline (if you're using grub2, refer to it's documentation how to do that, I'm not touching that over-engineered monster).

Offline

#4 2012-12-31 15:06:50

whoops
Member
Registered: 2009-03-19
Posts: 852

Re: KMS, misbehaving monitor, add custom EDID to kernel

Argh, then WHYYYYY have I been editing sources and recompiling my kernel over and over again? xD I don't understand how I always end up doing stuff like that T_T

Thanks for the simple / real solution! I'll try if I manage to do that without setting something on fire as soon as I have time to potentially ruin and fix my Desktop again.

( BTW: If I understood it right, in my case this is not really overscan... the TFT has overscan compensation but that left me with a very blurry / barely readable result when I first had the problem without KMS - just rediscovered this: https://bbs.archlinux.org/viewtopic.php … 31#p975431 / and with KMS it was a LOT worse ).

Last edited by whoops (2012-12-31 15:10:11)

Offline

#5 2012-12-31 15:40:59

Gusar
Member
Registered: 2009-08-25
Posts: 3,500

Re: KMS, misbehaving monitor, add custom EDID to kernel

It is overscan. And the "overscan compensation" option is a hacky band-aid, not really a solution. The problem is stupid Nvidia cards, treating HDMI-out as TV-out. Mine fortunately doesn't have this stupidity.

Also, I just remembered one thing - if you have the drm_kms_helper module in the initramfs (because you've added nouveau to it, the wiki calls this "early KMS"), you probably also need the modified edid inside the initramfs. In the initramfs, I think it should then be /lib/firmware/edid/edid-todvi.bin

Offline

#6 2012-12-31 17:32:58

whoops
Member
Registered: 2009-03-19
Posts: 852

Re: KMS, misbehaving monitor, add custom EDID to kernel

Phew, couldn't help it and tried it out today despite lack of time and better judgement. Half an hour and a hell of an headache later, I have this:

629-[    1.966082] nouveau  [   VBIOS][0000:01:00.0] version 70.24.21.00
630-[    1.988431] nouveau  [     MXM][0000:01:00.0] no VBIOS data, nothing to do
631-[    1.988451] nouveau  [     PFB][0000:01:00.0] RAM type: GDDR5
632-[    1.988452] nouveau  [     PFB][0000:01:00.0] RAM size: 1024 MiB
633-[    2.013781] [TTM] Zone  kernel: Available graphics memory: 4084850 kiB
634-[    2.013782] [TTM] Zone   dma32: Available graphics memory: 2097152 kiB
635-[    2.013783] [TTM] Initializing pool allocator
636-[    2.013785] [TTM] Initializing DMA pool allocator
637-[    2.020135] nouveau  [     DRM] VRAM: 1024 MiB
638-[    2.020140] nouveau  [     DRM] GART: 512 MiB
639-[    2.020143] nouveau  [     DRM] BIT BIOS found
640-[    2.020145] nouveau  [     DRM] Bios version 70.24.21.00
641-[    2.020148] nouveau  [     DRM] TMDS table version 2.0
642-[    2.020149] nouveau  [     DRM] DCB version 4.0
643-[    2.020151] nouveau  [     DRM] DCB outp 00: 02000300 00000000
644-[    2.020153] nouveau  [     DRM] DCB outp 01: 01000302 00020030
645-[    2.020154] nouveau  [     DRM] DCB outp 02: 04011380 00000000
646-[    2.020155] nouveau  [     DRM] DCB outp 03: 08011382 00020030
647-[    2.020156] nouveau  [     DRM] DCB outp 04: 02022362 00020010
648-[    2.020158] nouveau  [     DRM] DCB conn 00: 00001030
649-[    2.020160] nouveau  [     DRM] DCB conn 01: 00010130
650-[    2.020161] nouveau  [     DRM] DCB conn 02: 00002261
651-[    2.020704] [drm] Supports vblank timestamp caching Rev 1 (10.10.2010).
652-[    2.020705] [drm] No driver support for vblank timestamp query.
653-[    2.039307] nouveau  [     DRM] 3 available performance level(s)
654-[    2.039310] nouveau  [     DRM] 0: core 50MHz shader 101MHz memory 135MHz voltage 950mV
655-[    2.039312] nouveau  [     DRM] 1: core 405MHz shader 810MHz memory 324MHz voltage 950mV
656-[    2.039318] nouveau  [     DRM] 3: core 880MHz shader 1760MHz memory 2100MHz voltage 962mV-1050mV
657-[    2.039321] nouveau  [     DRM] c: core 50MHz shader 101MHz memory 135MHz voltage 950mV fanspeed 40%
658-[    2.080721] nouveau  [     DRM] MM: using COPY0 for buffer copies
659:[    2.136574] [drm] Got external EDID base block and 1 extension from "edid/edid-todvi.bin" for connector "DVI-I-1"
660-[    2.269787] nouveau  [     DRM] allocated 1920x1200 fb: 0x60000, bo ffff8802245f1c00
661-[    2.269838] fbcon: nouveaufb (fb0) is primary device
662-[    2.269889] nouveau E[     DRM] no native mode, forcing panel scaling
663-[    2.288087] Console: switching to colour frame buffer device 240x75
664-[    2.300010] fb0: nouveaufb frame buffer device
665-[    2.300011] drm: registered panic notifier
666-[    2.300014] [drm] Initialized nouveau 1.1.0 20120801 for 0000:01:00.0 on minor 0

[...]

951-[  139.565203] compiz[10489]: segfault at c ip 00007f64e371d4e0 sp 00007fffdb9d4d78 error 4 in 
libxcb-glx.so.0.0.0[7f64e370f000+15000]
952:[  160.860591] [drm] Got external EDID base block and 1 extension from "edid/edid-todvi.bin" for connector "DVI-I-1"
953:[  397.364713] [drm] Got external EDID base block and 1 extension from "edid/edid-todvi.bin" for connector "DVI-I-1"
954:[  402.623993] [drm] Got external EDID base block and 1 extension from "edid/edid-todvi.bin" for connector "DVI-I-1"
955:[  411.253902] [drm] Got external EDID base block and 1 extension from "edid/edid-todvi.bin" for connector "DVI-I-1"
956:[  415.494836] [drm] Got external EDID base block and 1 extension from "edid/edid-todvi.bin" for connector "DVI-I-1"
957:[  418.207055] [drm] Got external EDID base block and 1 extension from "edid/edid-todvi.bin" for connector "DVI-I-1"
958:[  423.854645] [drm] Got external EDID base block and 1 extension from "edid/edid-todvi.bin" for connector "DVI-I-1"
959:[  433.063912] [drm] Got external EDID base block and 1 extension from "edid/edid-todvi.bin" for connector "DVI-I-1"
960-[  433.167669] nouveau E[     DRM] no native mode, forcing panel scaling
961:[  448.126794] [drm] Got external EDID base block and 1 extension from "edid/edid-todvi.bin" for connector "DVI-I-1"
962-[  448.231492] nouveau E[     DRM] no native mode, forcing panel scaling
963:[  470.672444] [drm] Got external EDID base block and 1 extension from "edid/edid-todvi.bin" for connector "DVI-I-1"
964:[  472.920208] [drm] Got external EDID base block and 1 extension from "edid/edid-todvi.bin" for connector "DVI-I-1"
965:[  475.384458] [drm] Got external EDID base block and 1 extension from "edid/edid-todvi.bin" for connector "DVI-I-1"

... and still the same overscan. Looks like that means it's using the custom edid now but the same edid file that's working fine for my nvidia driver / X isn't working for nouveau / KMS for some reason. No time to look into that further right now... maybe next week.

Well, at least I FINALLY realized the obvious: Using a terminal in a window I can drag it to match the size of the visible screen so I can see the whole terminal. THAT would have made the previous steps a lot less painful, but somehow I forgot that such "floating windows" even exit. Stoopid tiling WMs / tty! First thing to do for me should have been to install xfwm4 or something like that and do stuff there instead of in a cropped tty!

Offline

#7 2013-01-06 10:26:12

whoops
Member
Registered: 2009-03-19
Posts: 852

Re: KMS, misbehaving monitor, add custom EDID to kernel

I tried attaching the TFT with different cables, to different ports. Every time the same problem, but way further down in dmesg, I found the following:

931:[   60.906665] [drm:drm_edid_block_valid] *ERROR* EDID checksum is invalid, remainder is 157
932-[   60.906677] Raw EDID:
933-[   60.906681]  	00 ff ff ff ff ff ff 00 5a 63 1f 0f 1b 05 00 00
934-[   60.906686]  	0b 13 01 03 80 3b 25 7e 7f ff ff ff ff ff ff ff
935-[   60.906690]  	ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
936-[   60.906695]  	ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
937-[   60.906699]  	ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
938-[   60.906703]  	ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
939-[   60.906708]  	ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
940-[   60.906712]  	ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
941-[   60.907973] nouveau E[     DRM] DDC responded, but no EDID for DVI-I-1
942:[  100.495477] [drm] Got external EDID base block and 1 extension from "edid/edid-todvi.bin" for connector "HDMI-A-1"
943-[  100.495600] nouveau E[     DRM] no native mode, forcing panel scaling

The "raw edid" does only match a small first part of my custom edid:

00000000   00 FF FF FF FF FF FF 00  5A 63 1F 0F 1B 05 00 00  ........Zc......
00000010   0B 13 01 03 80 3B 25 78  2E 9E 71 A6 54 4C 9F 24  .....;%x..q.TL.$
00000020   10 51 57 BF EF 80 D1 00  B3 00 A9 40 95 00 90 40  .QW........@...@
00000030   81 80 81 40 71 4F 28 3C  80 A0 70 B0 23 40 30 20  ...@qO(<..p.#@0
00000040   36 00 51 73 21 00 00 1A  00 00 00 FF 00 51 46 47  6.Qs!........QFG
00000050   30 39 31 31 30 31 33 30  37 0A 00 00 00 FD 00 32  091101307......2
00000060   4C 1E 52 0F 00 0A 20 20  20 20 20 20 00 00 00 FC  L.R...      ....
00000070   00 56 58 32 38 33 35 77  6D 0A 20 20 20 20 01 19  .VX2835wm.    ..
00000080   02 03 0C B1 47 9F 14 13  12 1E 16 01 02 3A 80 D0  ....G........:..
00000090   72 38 2D 40 10 2C 45 80  51 73 21 00 00 1F 01 1D  r8-@.,E.Qs!.....
000000A0   80 D0 72 1C 16 20 10 2C  25 80 51 73 21 00 00 9E  ..r.. .,%.Qs!...
000000B0   01 1D 00 BC 52 D0 1E 20  B8 28 55 40 51 73 21 00  ....R.. .(U@Qs!.
000000C0   00 1E 8C 0A D0 90 20 40  31 20 0C 40 55 00 51 73  ...... @1 .@U.Qs
000000D0   21 00 00 18 00 00 00 00  00 00 00 00 00 00 00 00  !...............
000000E0   00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
000000F0   00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 B5  ................

So.. now I'm not sure if this is a broken edid sent from my monitor... or if reading the custom edid is somehow broken... and if the broken edid is discarded... or used... it says

" Got external EDID base block and 1 extension from "edid/edid-todvi.bin"

... below the error so it looks like the correct one should be the one that is used instead of the broken one (wherever that came from)? So this error is probably a dead end?

I don't understand why I'm getting this:

nouveau E[     DRM] no native mode, forcing panel scaling

The native mode is inside the custom edid... which it seems to be using... and which is working with nvidia proprietary driver... couldn't find anything on that problem that looks related.

Stuck again... no idea what else to look for / try.

Any hints?

Offline

Board footer

Powered by FluxBB