drm/i915: Simplify i915_reg_read_ioctl
authorJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
Wed, 13 Sep 2017 11:52:55 +0000 (14:52 +0300)
committerJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
Thu, 14 Sep 2017 08:15:52 +0000 (11:15 +0300)
commit3fd3a6ffe279827543cbf4063e307ed18bad6763
tree0464397d30f38bd112a7a48ecec374a067f710eb
parentfe52e597fdbfd1098d47bdf314a1974dac003227
drm/i915: Simplify i915_reg_read_ioctl

Convert to use the freshly available made INTEL_GEN_MASK for easier
grepping and improve function readability and clarify the UABI
documentation.

No functional changes.

v2:
- Lift GEM_BUG_ONs and use is_power_of_2 (Chris)
- Retain -EINVAL on bad flags behavior (Chris)

v3:
- Extract flags with 'entry->size - 1' (Chris)

v4:
- Add GEM_BUG_ON on for flags vs entry offset (Chris)

v5:
- Use 'u16' to match 'dev_priv' (Ville)

v6:
- Fix checkpatch.pl errors

Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20170913115255.13851-2-joonas.lahtinen@linux.intel.com
drivers/gpu/drm/i915/intel_uncore.c
include/uapi/drm/i915_drm.h