[PATCH] drm/i915: add register read IOCTL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 12 Jul 2012 09:58:43 +0200, Daniel Vetter <daniel at 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


[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux