Radeon
From Wiki.cyring.fr
Power profile
// switch_power_profile.c
#include <stdio.h>
#include <errno.h>
#include <string.h>
int main(void) {
FILE *fd=NULL;
int rc=0;
fd=fopen("/sys/class/drm/card0/device/power_profile", "r+");
if(fd != NULL ) {
char buffer[5]={0x20,0x20,0x20,0x20,0x20};
if( fread(buffer, 1, 5, fd) != -1) {
if(strncmp(buffer, "mid", 3) == 0)
fwrite("high", 1, 4, fd);
else if(strncmp(buffer, "high", 4) == 0)
fwrite("mid", 1, 3, fd);
}
rc=errno;
fclose(fd);
}
else
rc=errno;
return(rc);
}