From 7ad8f26999ecf95d43dffb8e965372a46e0af855 Mon Sep 17 00:00:00 2001 From: Prajwal S N Date: Wed, 18 Oct 2023 13:22:49 +0530 Subject: [PATCH] feat(backlight): support amdgpu_bl Signed-off-by: Prajwal S N --- share/90-backlight.rules | 2 ++ src/powerkit_backlight.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/share/90-backlight.rules b/share/90-backlight.rules index 644660f..c15c90e 100644 --- a/share/90-backlight.rules +++ b/share/90-backlight.rules @@ -4,3 +4,5 @@ ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="intel_backlight", RUN+="/bin/chg ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="intel_backlight", RUN+="/bin/chmod g+w /sys/class/backlight/%k/brightness" ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="radeon_bl0", RUN+="/bin/chgrp video /sys/class/backlight/%k/brightness" ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="radeon_bl0", RUN+="/bin/chmod g+w /sys/class/backlight/%k/brightness" +ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="amdgpu_bl0", RUN+="/bin/chgrp video /sys/class/backlight/%k/brightness" +ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="amdgpu_bl0", RUN+="/bin/chmod g+w /sys/class/backlight/%k/brightness" diff --git a/src/powerkit_backlight.cpp b/src/powerkit_backlight.cpp index 5cf98d9..239d2b0 100644 --- a/src/powerkit_backlight.cpp +++ b/src/powerkit_backlight.cpp @@ -20,6 +20,8 @@ const QString PowerBacklight::getDevice() QString foundDir = it.next(); if (foundDir.startsWith(QString("%1/radeon").arg(path))) { return foundDir; + } else if (foundDir.startsWith(QString("%1/amdgpu").arg(path))) { + return foundDir; } else if (foundDir.startsWith(QString("%1/intel").arg(path))) { return foundDir; } else if (foundDir.startsWith(QString("%1/acpi").arg(path))) {