diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2016-06-29 12:11:28 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2016-06-30 23:06:51 +0100 |
commit | 2aa3dc83399a16588ba06ec1718ed709f55bb8d9 (patch) | |
tree | d9b2c4550481d9375298ceb79fe7cf214cae3f08 /debugger | |
parent | e63f1544ff033f8b8b5e83e16cb0e60e65a04c7d (diff) |
intel_chipset: Replace lookup of GT size with computation
Instead of a large if-chain for matching devid to GT, we can just
compute it directly from the encoded devid.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'debugger')
-rw-r--r-- | debugger/eudb.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/debugger/eudb.c b/debugger/eudb.c index 47d5d922..866d4b52 100644 --- a/debugger/eudb.c +++ b/debugger/eudb.c @@ -351,16 +351,14 @@ die(int reason) { static int identify_device(int devid) { - switch(devid) { - case PCI_CHIP_SANDYBRIDGE_GT1: - case PCI_CHIP_SANDYBRIDGE_M_GT1: - case PCI_CHIP_SANDYBRIDGE_S: + if (!IS_SANDYBRIDGE(devid)) + return -ENODEV; + + switch (intel_gt(devid)) { + case 0: eu_info = >1; break; - case PCI_CHIP_SANDYBRIDGE_GT2: - case PCI_CHIP_SANDYBRIDGE_GT2_PLUS: - case PCI_CHIP_SANDYBRIDGE_M_GT2: - case PCI_CHIP_SANDYBRIDGE_M_GT2_PLUS: + case 1: eu_info = >2; break; default: |