Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: intel-gfx@lists.freedesktop.org
Cc: Ben Widawsky <ben@bwidawsk.net>,
	Arjan van de Ven <arjan@linux.intel.com>
Subject: Re: [PATCH 2/2] drm/i915: Add current GPU freq to sysfs
Date: Sun, 02 Sep 2012 09:44:32 +0100	[thread overview]
Message-ID: <275ffc$6ep7nn@fmsmga002.fm.intel.com> (raw)
In-Reply-To: <1346570681-21242-2-git-send-email-ben@bwidawsk.net>

On Sun,  2 Sep 2012 00:24:41 -0700, Ben Widawsky <ben@bwidawsk.net> wrote:
> Userspace applications such as PowerTOP are interesting in being able to
> read the current GPU frequency. The patch itself sets up a generic array
> for gen6 attributes so we can easily add other items in the future (and
> it also happens to be just about the cleanest way to do this).
> 
> The patch is a nice addition to
> commit 1ac02185dff3afac146d745ba220dc6672d1d162
> Author: Daniel Vetter <daniel.vetter@ffwll.ch>
> Date:   Thu Aug 30 13:26:48 2012 +0200
> 
>     drm/i915: add a tracepoint for gpu frequency changes
> 
> Reading the GPU frequncy can be done by reading a file like:
> /sys/class/drm/card0/render_frequency_mhz
> 
> CC: Arjan van de Ven <arjan@linux.intel.com>
> Signed-off-by: Ben Widawsky <ben@bwidawsk.net>

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>

> ---
>  drivers/gpu/drm/i915/i915_sysfs.c | 31 +++++++++++++++++++++++++++++++
>  1 file changed, 31 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/i915_sysfs.c b/drivers/gpu/drm/i915/i915_sysfs.c
> index da733a3..0cb479d 100644
> --- a/drivers/gpu/drm/i915/i915_sysfs.c
> +++ b/drivers/gpu/drm/i915/i915_sysfs.c
> @@ -203,6 +203,30 @@ static struct bin_attribute dpf_attrs = {
>  	.mmap = NULL
>  };
>  
> +static ssize_t render_frequency_mhz_show(struct device *dev,
> +				     struct device_attribute *attr, char *buf)
> +{
> +	struct drm_minor *dminor = container_of(dev, struct drm_minor, kdev);
> +	struct drm_device *drm_dev = dminor->dev;
I would have called the struct device *kdev so that we could have our
standard nameing convention of struct drm_device *dev.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

  reply	other threads:[~2012-09-02  8:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-02  7:24 [PATCH 1/2] drm/i915: Enable some sysfs stuff without CONFIG_PM Ben Widawsky
2012-09-02  7:24 ` [PATCH 2/2] drm/i915: Add current GPU freq to sysfs Ben Widawsky
2012-09-02  8:44   ` Chris Wilson [this message]
2012-09-03  8:41   ` Daniel Vetter
2012-09-03 20:48     ` Ben Widawsky
2012-09-05 21:27 ` [PATCH 1/2] drm/i915: Enable some sysfs stuff without CONFIG_PM Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='275ffc$6ep7nn@fmsmga002.fm.intel.com' \
    --to=chris@chris-wilson.co.uk \
    --cc=arjan@linux.intel.com \
    --cc=ben@bwidawsk.net \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox