summaryrefslogtreecommitdiff
path: root/tools
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
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')
-rw-r--r--tools/intel_audio_dump.c12
-rw-r--r--tools/intel_error_decode.c2
-rw-r--r--tools/intel_reg.c21
3 files changed, 3 insertions, 32 deletions
diff --git a/tools/intel_audio_dump.c b/tools/intel_audio_dump.c
index aec4177c..aacd52f4 100644
--- a/tools/intel_audio_dump.c
+++ b/tools/intel_audio_dump.c
@@ -2476,31 +2476,21 @@ int main(int argc, char **argv)
else
intel_mmio_use_pci_bar(pci_dev);
+ printf("%s audio registers:\n\n", intel_device_info(devid)->codename);
if (IS_VALLEYVIEW(devid)) {
- printf("Valleyview audio registers:\n\n");
dump_ironlake();
} else if (IS_GEN9(devid)
|| IS_BROADWELL(devid) || IS_HASWELL(devid)) {
- printf("%s audio registers:\n\n",
- IS_BROXTON(devid) ? "Broxton" :
- (IS_KABYLAKE(devid) ? "Kabylake" :
- (IS_SKYLAKE(devid) ? "Skylake" :
- (IS_BROADWELL(devid) ? "Broadwell" : "Haswell"))));
dump_hsw_plus();
} else if (IS_GEN6(devid) || IS_GEN7(devid)
|| getenv("HAS_PCH_SPLIT")) {
- printf("%s audio registers:\n\n",
- IS_GEN6(devid) ? "SandyBridge" : "IvyBridge");
intel_check_pch();
dump_cpt();
} else if (IS_GEN5(devid)) {
- printf("Ironlake audio registers:\n\n");
dump_ironlake();
} else if (IS_G4X(devid)) {
- printf("G45 audio registers:\n\n");
dump_eaglelake();
} else if (IS_CHERRYVIEW(devid)) {
- printf("Braswell audio registers:\n\n");
dump_braswell();
}
diff --git a/tools/intel_error_decode.c b/tools/intel_error_decode.c
index 371aa423..7959fff5 100644
--- a/tools/intel_error_decode.c
+++ b/tools/intel_error_decode.c
@@ -847,4 +847,4 @@ main(int argc, char *argv[])
return 0;
}
-/* vim: set ts=8 sw=8 tw=0 noet :*/
+/* vim: set ts=8 sw=8 tw=0 cino=:0,(0 noet :*/
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;
}
/*