Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

edid-generator: init at unstable-2018-03-15 #81200

Merged
merged 1 commit into from Mar 19, 2020
Merged

Conversation

flokli
Copy link
Contributor

@flokli flokli commented Feb 27, 2020

Motivation for this change

I'd like to generate custom edids to drive display with custom modes on wayland.

This derivation exposes a modelines argument, which can be used to add arbitrary modelines.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@flokli
Copy link
Contributor Author

flokli commented Feb 27, 2020

Something still seems to be wrong with these edid files:

[    4.978469] [drm:edid_load [drm]] *ERROR* Size of EDID firmware "edid/1280x800_60.00.bin" is invalid (expected 6272, got 130

@flokli
Copy link
Contributor Author

flokli commented Feb 28, 2020

Okay, I figured it out - some of the tooling didn't like the _60.00 part of 1280x800_60.00.

Removing this, I was able to build a working edid file.

I added the package to hardware.firmware, and after adding boot.kernelParams = [ "drm.edid_firmware=edid/1280x800.bin"];, qemu successfully booted up in the desired resolution 🎉

@flokli flokli merged commit d07af37 into NixOS:master Mar 19, 2020
@flokli flokli deleted the edid-generator branch March 19, 2020 21:48
@YellowOnion
Copy link
Contributor

YellowOnion commented May 7, 2021

Should this append "Modeline " to the front? it seems kind of redundant to specify it, only makes sense if you're parsing an xorg file.

Plus is there much reason to make/install the already included .bin files?

Maybe a flag includeDefaults = true would make sense.

@flokli
Copy link
Contributor Author

flokli commented May 20, 2021

I'm not sure if it's necessary - right now, this consumes the output of the cvt command:

$ cvt 1024 768 60
# 1024x768 59.92 Hz (CVT 0.79M3) hsync: 47.82 kHz; pclk: 63.50 MHz
Modeline "1024x768_60.00"   63.50  1024 1072 1176 1328  768 771 775 798 -hsync +vsync

@edrex
Copy link
Contributor

edrex commented Mar 10, 2022

Shouldn't this package actually install the edid-generator script as well @flokli? That was my expectation.
It seems like it would be useful to couple this with a nixos module that can use it with the cvt command from xorg.xorgserver to generate a custom EDID from a list of modes and load it on boot. What do you all think?

@flokli
Copy link
Contributor Author

flokli commented Mar 12, 2022

Shouldn't this package actually install the edid-generator script as well @flokli? That was my expectation.

Yeah, this should probably be split, have a package for the edid generator, and another component to create the edid binaries.

I'm not sure it that part should be a NixOS module, it feels more like a library function, that might also make sense to use independent of an individual NixOS instantiation.

Would you mind opening a PR?

@edrex
Copy link
Contributor

edrex commented Mar 13, 2022

I've been trying to get a custom EDID working for a couple of days, and have been documenting my progress with an eye towards upstreaming it in some form, but I'm stuck on two issues:

Do you mean a function in nixpkgs.lib to generate an EDID?

I haven't been successful yet (and there may be some hard reason why I won't be, in display capabilities), so it's hard to know if this is right, but it seems like a good progression for customizing your EDID is:

  • Try loading a barebones one from edid-generator, if available, with the mode you want. (if not, gen with cvt | edid-generator). I haven't gotten this to work with the debug interface (sway/wlroots still shows the old edid, need to dig into that code to find out why).
  • Once that's successful, start with a stock EDID from your display or a similarly-spec'd one (https://github.com/linuxhw/EDID) and copy the DTD you want from the above, into one of the four 18-byte regions. this could be automated with a simple script.

At the very least, I'd like to add a specific NixOS kernel option for adding a custom EDID file, since doing it using extraParams is a bit complicated (I haven't gotten it working yet, this was my attempt so far: edrex/nixos-config@c7c5f82)

@edrex
Copy link
Contributor

edrex commented Mar 13, 2022

i also want to package https://sourceforge.net/projects/wxedid/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants