All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Daniel Vetter <daniel@ffwll.ch>, Ben Widawsky <ben@bwidawsk.net>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: add register read IOCTL
Date: Thu, 12 Jul 2012 09:11:39 +0100	[thread overview]
Message-ID: <1342080707_56@CP5-2952> (raw)
In-Reply-To: <20120712075843.GA5039@phenom.ffwll.local>

On Thu, 12 Jul 2012 09:58:43 +0200, Daniel Vetter <daniel@ffwll.ch> wrote:
> On Wed, Jul 11, 2012 at 05:07:36PM -0700, Ben Widawsky wrote:
> I think we should check for both reg offset _and_ size. Just to avoid
> people reading 64bit for a 32bit reg to get at the secret stuff in the
> next reg ;-) Or in case that the hw has strange semantics if you don't
> read the right size (I've seen that). Imo just creating a little table
> with { offset; size; } pairs would be good enough.

Do you want to allow people to read a subregister? That's the only
reason I see to have userspace pass in a size, and extracting a field
from a register can be trivially done in userspace (and will be done as
part of the normal process of extracting a value from the result).
Reading 8,16,32,64 bits all generate a 64-bit read cycle so should be
immaterial performance wise.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

  reply	other threads:[~2012-07-12  8:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-12  0:07 [PATCH] drm/i915: add register read IOCTL Ben Widawsky
2012-07-12  0:08 ` [PATCH] reg_read: basic register read ioctl test Ben Widawsky
2012-07-12  8:06   ` Daniel Vetter
2012-07-12  7:58 ` [PATCH] drm/i915: add register read IOCTL Daniel Vetter
2012-07-12  8:11   ` Chris Wilson [this message]
2012-07-12 18:01 ` [PATCH v2] " Ben Widawsky
2012-07-12 18:01   ` [PATCH] reg_read: basic register read ioctl test Ben Widawsky
2012-07-18 17:14   ` [PATCH v2] drm/i915: add register read IOCTL Eric Anholt
2012-07-18 17:22     ` Ben Widawsky
2012-07-18 18:12       ` Daniel Vetter
2012-07-12 19:42 ` [PATCH] " Eric Anholt
2012-07-12 20:08   ` 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=1342080707_56@CP5-2952 \
    --to=chris@chris-wilson.co.uk \
    --cc=ben@bwidawsk.net \
    --cc=daniel@ffwll.ch \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.