summaryrefslogtreecommitdiff
path: root/tools/intel_reg.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-06-29 08:28:58 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2016-06-30 23:06:47 +0100
commitd308bb082d429eb25dfd2844bcbafe722660a1ff (patch)
treec0524698b1a41ade66bac888427e87cc1335becd /tools/intel_reg.c
parent0404de4f223c108cf181f6c9a26fdc84fc608fc5 (diff)
lib: Start weaning off defunct intel_chipset.h
Several years ago we made the plan of only having one canonical source for i915_pciids.h, the kernel and everyone importing their definitions from that. For consistency, we style the intel_device_info after the kernel, most notably using a generation mask and a per-codename bitfield. This first step converts looking up the generation for a devid tree from a massive if(devid)-chain to a (cached) table lookup. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tools/intel_reg.c')
-rw-r--r--tools/intel_reg.c21
1 files changed, 1 insertions, 20 deletions
diff --git a/tools/intel_reg.c b/tools/intel_reg.c
index 92be1ce7..73fbd6da 100644
--- a/tools/intel_reg.c
+++ b/tools/intel_reg.c
@@ -657,26 +657,7 @@ static int intel_reg_help(struct config *config, int argc, char *argv[])
*/
static const char *get_codename(uint32_t devid)
{
- if (IS_GEN5(devid))
- return "ironlake";
- else if (IS_GEN6(devid))
- return "sandybridge";
- else if (IS_IVYBRIDGE(devid))
- return "ivybridge";
- else if (IS_HASWELL(devid))
- return "haswell";
- else if (IS_BROADWELL(devid))
- return "broadwell";
- else if (IS_SKYLAKE(devid))
- return "skylake";
- else if (IS_KABYLAKE(devid))
- return "kabylake";
- else if (IS_CHERRYVIEW(devid))
- return "cherryview";
- else if (IS_VALLEYVIEW(devid))
- return "valleyview";
-
- return NULL;
+ return intel_device_info(devid)->codename;
}
/*