From: Dave Airlie Subject: [PATCH 2/2] drm/radeon: make pm method file show default + option. Date: Mon, 19 Sep 2011 20:53:19 +0100 Message-ID: <1316461999-8639-2-git-send-email-airlied@gmail.com> References: <1316461999-8639-1-git-send-email-airlied@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by gabe.freedesktop.org (Postfix) with ESMTP id CE82F9E926 for ; Mon, 19 Sep 2011 12:53:31 -0700 (PDT) Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p8JJrVar013156 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 19 Sep 2011 15:53:31 -0400 Received: from kvothe.redhat.com (vpn1-6-36.ams2.redhat.com [10.36.6.36]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p8JJrSWE028522 for ; Mon, 19 Sep 2011 15:53:30 -0400 In-Reply-To: <1316461999-8639-1-git-send-email-airlied@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org From: Dave Airlie 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 --- 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