Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/i915/huc: Normalize HuC status returned by I915_PARAM_HAS_HUC

In response for I915_PARAM_HAS_HUC we are returning value that
indicates if HuC firmware was loaded and verified. However, our
previously used positive value was based on specific register bit
which is about to change on future platform. Let's normalize our
return values to 0 and 1 before clients will start to use Gen9 value.

v2: use bool for implicit conversion (Chris)

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Michal Winiarski <michal.winiarski@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Haihao Xiang <haihao.xiang@intel.com>
Reviewed-by: Michał Winiarski <michal.winiarski@intel.com> #1
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20181017195245.39644-1-michal.wajdeczko@intel.com

authored by

Michal Wajdeczko and committed by
Chris Wilson
1a49f537 bbb8a9d7

+4 -3
+4 -3
drivers/gpu/drm/i915/intel_huc.c
··· 108 108 * This function reads status register to verify if HuC 109 109 * firmware was successfully loaded. 110 110 * 111 - * Returns positive value if HuC firmware is loaded and verified 112 - * and -ENODEV if HuC is not present. 111 + * Returns: 1 if HuC firmware is loaded and verified, 112 + * 0 if HuC firmware is not loaded and -ENODEV if HuC 113 + * is not present on this platform. 113 114 */ 114 115 int intel_huc_check_status(struct intel_huc *huc) 115 116 { 116 117 struct drm_i915_private *dev_priv = huc_to_i915(huc); 117 - u32 status; 118 + bool status; 118 119 119 120 if (!HAS_HUC(dev_priv)) 120 121 return -ENODEV;