From: Daniel Vetter <daniel@ffwll.ch>
To: Ben Widawsky <ben@bwidawsk.net>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2 3/3] tests: rc6 residency test
Date: Tue, 27 Mar 2012 10:34:08 +0200 [thread overview]
Message-ID: <20120327083408.GD4276@phenom.ffwll.local> (raw)
In-Reply-To: <1332722012-4853-6-git-send-email-ben@bwidawsk.net>
On Sun, Mar 25, 2012 at 05:33:32PM -0700, Ben Widawsky wrote:
> +int main(int argc, char *argv[])
> +{
> + const int device = drm_get_card(0);
> + char *path, *pathp, *pathpp;
> + int fd, ret;
> + unsigned int value1, value1p, value1pp, value2, value2p, value2pp;
> + int diff;
> +
> + /* Use drm_open_any to verify device existence */
> + fd = drm_open_any();
> + close(fd);
> +
> + ret = asprintf(&path, "/sys/class/drm/card%d/power/rc6", device);
> + assert(ret != -1);
> + ret = asprintf(&pathp, "/sys/class/drm/card%d/power/rc6p", device);
> + assert(ret != -1);
> + ret = asprintf(&pathpp, "/sys/class/drm/card%d/power/rc6pp", device);
> + assert(ret != -1);
> +
> + value1 = readit(path);
> + value1p = readit(pathp);
> + value1pp = readit(pathpp);
> + // Sleep for 3 seconds and compare
> + sleep(3);
> + value2 = readit(path);
> + value2p = readit(pathp);
> + value2pp = readit(pathpp);
> +
> + diff = (value2pp - value1pp) +
> + (value2p - value1p) +
> + (value2 - value1);
> +
> + /* Plenty of fudge */
> + if (diff > 3900 || diff < 2100) {
> + printf("%d\n", diff);
While I bitch around: A slightly more informative error message could be
usueful ;-)
Cheers, Daniel
--
Daniel Vetter
Mail: daniel@ffwll.ch
Mobile: +41 (0)79 365 57 48
next prev parent reply other threads:[~2012-03-27 8:33 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-26 0:33 [PATCH v2 1/3] drm/i915: add rc6 residency times to debugfs Ben Widawsky
2012-03-26 0:33 ` [PATCH 2/3] drm/i915: extract intel_enable_rc6() Ben Widawsky
2012-03-26 9:32 ` Daniel Vetter
2012-03-26 0:33 ` [PATCH v2 3/3] drm/i915: rc6 in sysfs Ben Widawsky
2012-03-26 0:33 ` [PATCH 1/3] build: make sure we have asprintf Ben Widawsky
2012-03-26 0:33 ` [PATCH 2/3] drm/i915: extract card getting Ben Widawsky
2012-03-26 9:33 ` Daniel Vetter
2012-03-26 0:33 ` [PATCH v2 3/3] tests: rc6 residency test Ben Widawsky
2012-03-26 9:37 ` Daniel Vetter
2012-03-26 9:40 ` Daniel Vetter
2012-03-26 21:54 ` Ben Widawsky
2012-03-27 7:22 ` Daniel Vetter
2012-03-27 8:34 ` Daniel Vetter [this message]
2012-03-26 9:34 ` [PATCH v2 1/3] drm/i915: add rc6 residency times to debugfs Daniel Vetter
2012-03-26 12:33 ` Eugeni Dodonov
2012-03-26 16:49 ` Ben Widawsky
2012-03-26 22:34 ` Ben Widawsky
2012-03-26 23:04 ` Eugeni Dodonov
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=20120327083408.GD4276@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--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