#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2024 ArchR (https://github.com/archr-linux/Arch-R)

# Minimal OS variable loading for performance
. /etc/profile.d/001-functions

# Set max gpu freq
case $1 in
  disable)
    echo 587000000 > $GPU_FREQ/max_freq
    set_setting enable.gpu-overclock 0
  ;;
  enable)
    echo 650000000 > $GPU_FREQ/max_freq
    set_setting enable.gpu-overclock 1
  ;;
esac
