]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Extend the parser to check register writes against a mask/value pair.
authorFrancisco Jerez <currojerez@riseup.net>
Fri, 29 May 2015 13:44:14 +0000 (16:44 +0300)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 15 Jun 2015 10:34:50 +0000 (12:34 +0200)
commitcb8ebc37a483abb3f2e0a33153590dbf7397151b
tree1c7677fafa4f28117685b71e4b03f6af404e31e9
parent793b755bc82eaddd40ac6b52a50a6286c63413d8
drm/i915: Extend the parser to check register writes against a mask/value pair.

In some cases it might be unnecessary or dangerous to give userspace
the right to write arbitrary values to some register, even though it
might be desirable to give it control of some of its bits.  This patch
extends the register whitelist entries to contain a mask/value pair in
addition to the register offset.  For registers with non-zero mask,
any LRM writes and LRI writes where the bits of the immediate given by
the mask don't match the specified value will be rejected.

This will be used in my next patch to grant userspace partial write
access to some sensitive registers.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_cmd_parser.c
drivers/gpu/drm/i915/intel_ringbuffer.h