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

[WIP] update-amd-tdp #13157

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Mikhailzrick
Copy link
Contributor

@Mikhailzrick Mikhailzrick commented Dec 29, 2024

Aims to change behavior of amd TDP scripts to account for new slider which when set to "auto" will not have an entry in batocera.conf and should allow system bios to determine tdp values.

Improved resume script which now saves the current tdp to a temp file if it does not equal system.cpu.tdp, which is then used to revert back to after resume. This should handle situations where a user suspends while a game is running ensuring per system/game setting is kept.

Refactor code for better readability.

stapm/fast/slow set to same tdp value.

Also removed hard coded temp limit so bios can handle it. May be beneficial to include a separate temp limit slider which could be used in the future.

@Mikhailzrick Mikhailzrick force-pushed the update-amd-tdp branch 2 times, most recently from e780702 to e7267c7 Compare December 29, 2024 12:13
@Mikhailzrick Mikhailzrick force-pushed the update-amd-tdp branch 2 times, most recently from e92d6fd to e0cfa5c Compare January 5, 2025 13:28
if [ "$EVENT" == "gameStop" ]; then
# set user global setting
TDP_SETTING=$(printf "%.0f" "$(/usr/bin/batocera-settings-get global.tdp)")
if [ -z "${TDP_SETTING}" ]; then
echo "No TDP setting defined, cannot set TDP." >> $log
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens if a user has global.tdp set to "auto" (it's not set in batocera.conf), but has TDP set for a system or a game? It seems like when the game stops, this branch would not revert the game TDP settings.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If a user has a per system or per game but not global tdp setting it now checks the current tdp value, and if does not equal the system.cpu.tdp determined at boot, indicating it was changed, it then restores to system.cpu.tdp

@Mikhailzrick
Copy link
Contributor Author

@bryanforbes thanks for reviewing, I’ll fix some of the obvious stuff I missed in the first draft of changes. The issue with a system or game tdp value but not global I didn’t even think of, I’ll address that as well. I’ll try to find time this coming weekend to work on it.

@dmanlfc dmanlfc marked this pull request as draft February 9, 2025 08:54
Update es_features.yml

Update tdp_hooks.sh

Update batocera-amd-tdp

Update batocera-amd-tdp

amd-tdp-update
@Mikhailzrick
Copy link
Contributor Author

Mikhailzrick commented Feb 21, 2025

Updated PR to resolve prior issues and clean up some. Also changed the resume script to better handle situations where if a user has a per system/game tdp value and suspends while a game is running it will save tdp, suspend, resume, and the revert back to saved tdp value. This is needed since ryzenadj changes do not persist after suspend.

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.

2 participants