From: Dave Airlie <airl...@redhat.com>

If we add more options in the future this will need rework.

this is modelled after the example in /sys/power/disk.

Signed-off-by: Dave Airlie <airl...@redhat.com>
---
 drivers/gpu/drm/radeon/radeon_pm.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_pm.c 
b/drivers/gpu/drm/radeon/radeon_pm.c
index 2a44332..25bc75e 100644
--- a/drivers/gpu/drm/radeon/radeon_pm.c
+++ b/drivers/gpu/drm/radeon/radeon_pm.c
@@ -390,9 +390,13 @@ static ssize_t radeon_get_pm_method(struct device *dev,
        struct drm_device *ddev = pci_get_drvdata(to_pci_dev(dev));
        struct radeon_device *rdev = ddev->dev_private;
        int pm = rdev->pm.pm_method;
+       char *start = buf;
 
-       return snprintf(buf, PAGE_SIZE, "%s\n",
-                       (pm == PM_METHOD_DYNPM) ? "dynpm" : "profile");
+       if (pm == PM_METHOD_DYNPM)
+               buf += snprintf(buf, PAGE_SIZE, "[dynpm] profile\n");
+       else
+               buf += snprintf(buf, PAGE_SIZE, "dynpm [profile]\n");
+       return buf - start;
 }
 
 static ssize_t radeon_set_pm_method(struct device *dev,
-- 
1.7.6

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

Reply via email to