koiuo / intelpwm-udev

Script and udev rule to set backlight PWM frequency on laptops with Intel i915 GPU
https://127001.me/post/eliminate-backlight-flicker-with-i915/
17 stars 6 forks source link

register addresses were swapped #2

Closed jayenashar closed 3 years ago

koiuo commented 3 years ago

Good catch! From the first glance at the documentation you are right.

However, this raises another question: is it just in config/doc or do we write to the wrong register?

I'm a bit busy rn, I'll doublecheck against docs and on my real hardware in a couple of days and then will merge.

Thanks a lot for this contribution!

jayenashar commented 3 years ago

the script itself seemed ok. but i can't test it on my system as i can't find the address for PCH_RAWCLK_FREQ_REG. Intel Corporation HD Graphics 620 if you know where I can find this info.

koiuo commented 3 years ago

@jayenashar

but i can't test it on my system as i can't find the address for PCH_RAWCLK_FREQ_REG

I'm not well familiar with Intel CPU/GPU generations, is it kaby lake? https://01.org/linuxgraphics/hardware-specification-prms/2016-intelr-processors-based-kaby-lake-platform

The page offers 2 downloads: Volume 2c: Command Reference: Registers, Part 1 – Registers A through L Volume 2c: Command Reference: Registers, Part 2 – Registers M through Z

I checked the latter one, on the page 712 (740 in PDF) there's a description of the following register

Address: C6204h-C6207h
Name: Rawclk Frequency
ShortName: RAWCLK_FREQ
Power: Always on
Reset: soft

Seems like it's the rigth one and the address is the same

koiuo commented 3 years ago

Thanks again for the contribution! My only intel-based laptop is undergoing maintenance right now (fully disassembled, and I'm still waiting for the thermal paste to arrive), so can't check on the real hardware, but your fix seems legit and the script seems correct indeed. Merged.

zimmnik commented 3 years ago

Hi, guys! I'm use this playbook (version from Aug 2, 2020) with Fedora Linux 33 on my Lenovo Thinkpad T420 (SandyBridge CPU family with integrated Intel® HD Graphics 3000). Flickering is gone. Thank you very much! Can you explain me, why it was necessary to swap these addresses? If these addresess were wrong, why it worked before swapping? Also I have fresh HP Probook 450 G7 (Comet Lake-U CPU family with Intel UHD Graphics 620). Unfortunately there are WIN10 only and flickerting problem still here. If it helps this project, I can temporally install Fedora 33 on it and test new changes.

koiuo commented 3 years ago

@zimmnik it worked because by default the script uses the right values. The overrides in the config file (the ones changed in this PR) are commented out and are not used by default.

jayenashar commented 3 years ago

I'm not well familiar with Intel CPU/GPU generations, is it kaby lake? https://01.org/linuxgraphics/hardware-specification-prms/2016-intelr-processors-based-kaby-lake-platform

yes it is

Address: C6204h-C6207h
Name: Rawclk Frequency
ShortName: RAWCLK_FREQ
Power: Always on
Reset: soft

Seems like it's the rigth one and the address is the same

thanks. it doesn't show up in intel_reg list, and when i do a read it doesn't show an alias, so i wasn't sure.