koiuo / randrctl

Profile based screen manager for X
GNU General Public License v3.0
47 stars 12 forks source link

profile prioritization and crtc support #6

Closed xornet-sl closed 6 years ago

koiuo commented 6 years ago

This is just to acknowledge that I've seen this PR (I had no time to check, what's there). Thanks for the contribution, will look into this later today.

koiuo commented 6 years ago

Could you please fix tests?

I wouldn't bother (one test was broken already, I made a fix just now), but the last commit from this PR breaks EDID calculation, rendering all existing profiles with edid matching invalid.

See the following case please

xrandr --verbose output

LVDS1 connected primary 1366x768+0+800 (0x4a) normal (normal left inverted right x axis y axis) 277mm x 156mm
...        
        EDID: 
                00ffffffffffff0030e4d80200000000
                00140103801c1078ead4e59559578b28
                20505400000001010101010101010101
                010101010101601d56d8500018303040
                4700159c1000001b0000000000000000
                00000000000000000000000000fe004c
                4720446973706c61790a2020000000fe
                004c503132355748322d534c42310084
...
HDMI1 connected 1280x800+0+0 (0x219) normal (normal left inverted right x axis y axis) 0mm x 0mm
...
        EDID: 
                00ffffffffffff001203017404010101
                0a190103800000780a3003b24c2bc426
                074a59bfef80457c617c81fc81008180
                90409500a9409e20009051201f304880
                360000000000001c011d007251d01e20
                6e28550000000000001e000000fd002b
                781e6411000a202020202020000000fc
                0050524f4a4543544f520a2020200107
                020325714f101f051484131211030201
                16150706230907048301000065030c00
                1000e2007f023a801871382d40582c45
                00000000000018011d8018711c162058
                2c25000000000000998f0ad08a20e02d
                10103e9600000000000018011d00bc52
                d01e20b8285540000000000018000000
                000000000000000000000000000000bd
...

Before commit edids dictionary was:

{'LVDS1': '00ffffffffffff0030e4d8020000000000140103801c1078ead4e59559578b2820505400000001010101010101010101010101010101601d56d85000183030404700159c1000001b000000000000000000000000000000000000000000fe004c4720446973706c61790a2020000000fe004c503132355748322d534c42310084', 'HDMI1': '00ffffffffffff0012030174040101010a190103800000780a3003b24c2bc426074a59bfef80457c617c81fc8100818090409500a9409e20009051201f304880360000000000001c011d007251d01e206e28550000000000001e000000fd002b781e6411000a202020202020000000fc0050524f4a4543544f520a2020200107020325714f101f05148413121103020116150706230907048301000065030c001000e2007f023a801871382d40582c4500000000000018011d8018711c1620582c25000000000000998f0ad08a20e02d10103e9600000000000018011d00bc52d01e20b8285540000000000018000000000000000000000000000000000000bd'}

After commit it is

{'LVDS1': '00ffffffffffff0030e4d8020000000000140103801c1078ead4e59559578b2820505400000001010101010101010101010101010101601d56d85000183030404700159c1000001b000000000000000000000000000000000000000000fe004c4720446973706c61790a2020000000fe004c503132355748322d534c42310084', 'HDMI1': '00ffffffffffff0012030174040101010a190103800000780a3003b24c2bc426074a59bfef80457c617c81fc8100818090409500a9409e20009051201f304880360000000000001c011d007251d01e206e28550000000000001e000000fd002b781e6411000a202020202020000000fc0050524f4a4543544f520a2020200107'}

As you can see, it is now truncated after the 8th line.

To run the tests do

python -m unittest
xornet-sl commented 6 years ago

Oh, I forgot about the tests. I will fix them of course in a few days.

xornet-sl commented 6 years ago

And I will fix EDID calculation so that it will match all existing profiles.

koiuo commented 6 years ago

Thanks for your contribution!