envycontrol
envycontrol copied to clipboard
[Feature request] add support for coarse grained RTD3
by default envycontrol se fine grained RTD3 in hybrid mode but on my laptop fine grained is not available and require the use of coarse grained RTD3
i would be great to add this as a option which would be enable using a config file or a optional arguments
bellow is the change i used locally as a temp fix
MODESET_FINE_PM = '''# Automatically generated by EnvyControl
options nvidia-drm modeset=1
options nvidia "NVreg_DynamicPowerManagement=0x02"
'''
MODESET_COARSE_PM = '''# Automatically generated by EnvyControl
options nvidia-drm modeset=1
options nvidia "NVreg_DynamicPowerManagement=0x01"
'''
elif mode == 'hybrid':
_cleanup()
# Enable modeset for Nvidia driver
choice = input('Enable RTD3 Power Management? (y/N): ').lower()
if choice in yes:
_create_file(UDEV_PM_PATH, UDEV_PM)
choice = input('Use Fine Grained RTD3? (Y/n)').lower()
if choice in yes:
_create_file(MODESET_PATH, MODESET_FINE_PM)
else:
_create_file(MODESET_PATH, MODESET_COARSE_PM)
else:
_create_file(MODESET_PATH, MODESET_CONTENT)
_rebuild_initramfs()