The NEW Build Your Own Arcade Controls

Main => Software Forum => Linux => Topic started by: Substring on September 26, 2019, 08:07:40 am

Title: kernel drivers vs Xorg drivers : resolutions limits seem not the same
Post by: Substring on September 26, 2019, 08:07:40 am
Hey,

TL/DR : a same resolution would work with Xorg, but not in DRM drivers (through EDID) on nvidia GPU (need to test on i915).

Full version :
Along with my tests with EDID in groovyarcade, I stumbled about a strange behaviour : some almost identical resolutions (648x480 EDID generated by switchres vs 640x480 modeline for X vs 640x480 patched resolution in 15kHz kernel) do not always work whereas they should. For example : the nouveau drm drivers says the EDID resolution is "invalid" (I'm not sure about the real error behind, I suspect it's a MODE_CLOCK_LOW), whereas the "almost same resolution" (pixel clocks are almost the same. Don't have them at hand for now, but it's something like 13MHz vs 13.128 MHz).

So, anyone would have an idea why DRM would reject a resolution that would run perfect from the 15kHz kernel or Xorg ?

The same EDID worked fine with the amd drm driver, I have yet to test on i915.

Sources :
DRM/nouveau : https://github.com/torvalds/linux/blob/v5.3/drivers/gpu/drm/nouveau/nouveau_connector.c#L1020-L1064
DRM/i915 : I guess it's somewhere in the intel_sdvo.c, looks connector dependant, haven't found yet anything for VGA (HDMI would be 25MHz, DP 10MHz)

Now here is the whole point of it : is it worh patching the DRM drivers for lower pixel clock limits (to 10MHz for example) ?
Title: Re: kernel drivers vs Xorg drivers : resolutions limits seem not the same
Post by: Doozer on September 26, 2019, 08:45:28 am
Hey,

TL/DR : a same resolution would work with Xorg, but not in DRM drivers (through EDID) on nvidia GPU (need to test on i915).

Full version :
Along with my tests with EDID in groovyarcade, I stumbled about a strange behaviour : some almost identical resolutions (648x480 EDID generated by switchres vs 640x480 modeline for X vs 640x480 patched resolution in 15kHz kernel) do not always work whereas they should. For example : the nouveau drm drivers says the EDID resolution is "invalid" (I'm not sure about the real error behind, I suspect it's a MODE_CLOCK_LOW), whereas the "almost same resolution" (pixel clocks are almost the same. Don't have them at hand for now, but it's something like 13MHz vs 13.128 MHz).

So, anyone would have an idea why DRM would reject a resolution that would run perfect from the 15kHz kernel or Xorg ?

The same EDID worked fine with the amd drm driver, I have yet to test on i915.

Sources :
DRM/nouveau : https://github.com/torvalds/linux/blob/v5.3/drivers/gpu/drm/nouveau/nouveau_connector.c#L1020-L1064
DRM/i915 : I guess it's somewhere in the intel_sdvo.c, looks connector dependant, haven't found yet anything for VGA (HDMI would be 25MHz, DP 10MHz)

Now here is the whole point of it : is it worh patching the DRM drivers for lower pixel clock limits (to 10MHz for example) ?

Hi Substring,

Have you tried to enable the DRM debug output with at least DRM_DEBUG_KMS option? (drm.debug=0x...)
A quick look at the clock in drm_edid does not reveal any pixel clock limitation or dot clock lower cap. But maybe you are unlucky and used a manufacturer ID that has a quirk defined.

Code: [Select]
parm:           debug:Enable debug output, where each bit enables a debug category.
Bit 0 (0x01)  will enable CORE messages (drm core code)
Bit 1 (0x02)  will enable DRIVER messages (drm controller code)
Bit 2 (0x04)  will enable KMS messages (modesetting code)
Bit 3 (0x08)  will enable PRIME messages (prime code)
Bit 4 (0x10)  will enable ATOMIC messages (atomic code)
Bit 5 (0x20)  will enable VBL messages (vblank code)
Bit 7 (0x80)  will enable LEASE messages (leasing code)
Bit 8 (0x100) will enable DP messages (displayport code) (int)

Is the EDID binary available somewhere?
Title: Re: kernel drivers vs Xorg drivers : resolutions limits seem not the same
Post by: Substring on September 26, 2019, 12:28:09 pm
The edid is available on Ansa89 github repo, generic 15. I repeat : just removing the nvidia card and using the onboard  ATI HD3200 (quite an old beast tbh) -> it does work, nothing changed in boot parameters
Title: Re: kernel drivers vs Xorg drivers : resolutions limits seem not the same
Post by: Doozer on September 26, 2019, 01:02:13 pm
HD 3200 has a low dot clock limitation. May be it is coming from this. I am a bit skeptic because it is a 13MHz dot clock, which is not so low.


No issue here with EDID from Ansa89 on HD5450.

[    2.298272] [drm] Got external EDID base block and 0 extensions from "edid/edid_arcade15.bin" for connector "VGA-1"

VGA-0 connected 640x480+0+0 (normal left inverted right x axis y axis) 485mm x 364mm
   640x480i      59.98*+

EDIT: reading myself few hours later shows that I tested arcade15 and not generic15, but I does not change the result, arcade15 is only bumping modeline H range to 16kHz
Title: Re: kernel drivers vs Xorg drivers : resolutions limits seem not the same
Post by: Substring on September 26, 2019, 04:17:43 pm
It doesn"t work with a nvidia, not an ati ;)