]> 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)
committerJani Nikula <jani.nikula@intel.com>
Mon, 15 Jun 2015 13:00:43 +0000 (16:00 +0300)
commit8edfb1a4ada39ed48aa9622b8f64014e14d98691
tree8dd2998a7bb9a36b9cf90e74abadcc05e4a51197
parent0fdd940167fb6013f8eb9e758a6cb36a9ed0daa5
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>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/i915_cmd_parser.c
drivers/gpu/drm/i915/intel_ringbuffer.h