intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Kenneth Graunke <kenneth@whitecape.org>
To: intel-gfx@lists.freedesktop.org
Subject: Re: [intel-gpu-tools] [PATCH 1/3] intel-gpu-tools add ioctl	interface usage
Date: Wed, 06 Apr 2011 11:38:11 -0700	[thread overview]
Message-ID: <4D9CB313.8040602@whitecape.org> (raw)
In-Reply-To: <1302032017-1771-2-git-send-email-ben@bwidawsk.net>

On 04/05/2011 12:33 PM, Ben Widawsky wrote:
> Added the mechnanism to communicate with the i915 IOCTL interface, and
> removed the existing forcewake code, as it is not reliable.
>
> Modified gpu_top to take a flag -i, to use the IOCTL interface. Previous
> gpu_top behavior with no args is maintained from previous version.
>
> Signed-off-by: Ben Widawsky<ben@bwidawsk.net>
> ---
>   lib/intel_gpu_tools.h |   58 +++++++++++++++++++++++++++++++++++++++++++++++-
>   lib/intel_mmio.c      |   18 +++++++++++++++
>   tools/intel_gpu_top.c |   45 +++++++++++--------------------------
>   3 files changed, 88 insertions(+), 33 deletions(-)

One high level comment and a nitpick...

I'm a bit surprised that there's a command line option to use the IOCTL 
interface (i.e. non-broken mode).  Shouldn't it try the IOCTL and, if 
the kernel doesn't support it, fall back to using MMIO?

Or, perhaps better...try using the IOCTL by default on gen6, and if it 
fails, print a message like "Your kernel doesn't support the necessary 
IOCTLs; please upgrade or run intel_gpu_top -m to force MMIO mode (which 
may be inaccurate)." and quit.

> +#define INREG(reg) \
> +	(use_ioctl_mmio ? INREG_IOCTL(reg) : INREG_PCI(reg))
> +
> +#define OUTREG(reg, val) \
> +	(use_ioctl_mmio ? OUTREG_IOCTL(reg, val) : OUTREG_PCI(reg, val))
> +
>   static inline uint32_t
> -INREG(uint32_t reg)
> +INREG_PCI(uint32_t reg)
>   {
>   	return *(volatile uint32_t *)((volatile char *)mmio + reg);
>   }

As long as you're renaming these, can we please use lowercase for inline 
functions, while keeping the INREG/OUTREG macros uppercase?

> +/*
> + * Try to read a register using the i915 IOCTL interface. The operations should
> + * not fall back to the normal pci mmio method to avoid confusion. IOCTL usage
> + * should be explicitly specified.
> + */

  reply	other threads:[~2011-04-06 18:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-05 19:33 read/write ioctl usage in intel-gpu-tools, for review Ben Widawsky
2011-04-05 19:33 ` [intel-gpu-tools] [PATCH 1/3] intel-gpu-tools add ioctl interface usage Ben Widawsky
2011-04-06 18:38   ` Kenneth Graunke [this message]
2011-04-05 19:33 ` [intel-gpu-tools] [PATCH 2/3] intel-gpu-tools update reg_read to use ioctls Ben Widawsky
2011-04-05 19:33 ` [intel-gpu-tools] [PATCH 3/3] intel-gpu-tools: update reg_write to use ioctl interface Ben Widawsky

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=4D9CB313.8040602@whitecape.org \
    --to=kenneth@whitecape.org \
    --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;
as well as URLs for NNTP newsgroup(s).