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

Add workaround for marazmista/radeon-profile#151 #236

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

FMeinicke
Copy link

If the PC returns from sleep/hibernation we can enforce restoration of
the correct fan control mode by checking if the correct value is set for
pwm_enable and restore the value if necessary

If the PC returns from sleep/hibernation we can enforce restoration of
the correct fan control mode by checking if the correct value is set for
pwm_enable and restore the value if necessary
radeon-profile/gpu.cpp Outdated Show resolved Hide resolved
// If the PC is sent to sleep (or hibernate) it can happen that PWM is
// disabled (by the OS..?) and that we have to re-enable it, if needed,
// after returning from sleep
static QFile pwmEnableFile(getDriverFiles().hwmonAttributes.pwm1_enable);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can be without static I think

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could definitely be non-static. But I thought since the file is always the same it would suffice to construct the QFile object once and re-use it after that to gain a bit of performance (because this function is called quite frequently if I'm correct).

But if you prefer to have it non-static it's no problem for me.

To get around the issue that PWM isn't restored after hibernation it's
enough to check the pwm_enable file - we don't need to also store the
current PWM state into a variable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants