summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2020-07-06 12:58:47 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2020-07-26 23:31:10 +0100
commit3efebcb90417c294d1b2041e590e2b146670dec4 (patch)
tree770dec17b2c64c543a46731de30744dc6fa9cd5f
parent6b72caa5056a8baa90584101792324b65773463a (diff)
lib/i915: Report unknown device as the future
Since we likely know all the old devices, an unknown device is most likely a future device, so use -1u instead of 0 for its generation. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
-rw-r--r--lib/intel_device_info.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/intel_device_info.c b/lib/intel_device_info.c
index 6c9ac388..eee7cac9 100644
--- a/lib/intel_device_info.c
+++ b/lib/intel_device_info.c
@@ -454,11 +454,11 @@ out:
* Computes the Intel GFX generation for the given device id.
*
* Returns:
- * The GFX generation on successful lookup, 0 on failure.
+ * The GFX generation on successful lookup, -1u on failure.
*/
unsigned intel_gen(uint16_t devid)
{
- return ffs(intel_get_device_info(devid)->gen);
+ return ffs(intel_get_device_info(devid)->gen) ?: -1u;
}
/**