From d308bb082d429eb25dfd2844bcbafe722660a1ff Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 29 Jun 2016 08:28:58 +0100 Subject: 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 --- tools/intel_reg.c | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) (limited to 'tools/intel_reg.c') 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; } /* -- cgit v1.2.3