summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>2023-05-11 10:17:49 +0300
committerMarge Bot <emma+marge@anholt.net>2023-05-16 19:32:41 +0000
commit9ebd553fc216085e9a7ca1a28dc38030ed7e2071 (patch)
tree298038e795ed7a46c6127da8f7b73a41fcc458a6
parentfce55ffb7d04993839acd25ca69c412080d92b2f (diff)
downloadmesa-9ebd553fc216085e9a7ca1a28dc38030ed7e2071.tar.gz
intel/devinfo: allow -p to take a pci-id in hexa
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Mark Janes <markjanes@swizzler.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22862>
-rw-r--r--src/intel/dev/intel_dev_info.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/intel/dev/intel_dev_info.c b/src/intel/dev/intel_dev_info.c
index d4d8e0e5936..065d95cb65f 100644
--- a/src/intel/dev/intel_dev_info.c
+++ b/src/intel/dev/intel_dev_info.c
@@ -222,7 +222,12 @@ main(int argc, char *argv[])
}
if (platform) {
- int pci_id = intel_device_name_to_pci_device_id(platform);
+ int pci_id;
+
+ if (strstr(platform, "0x") == platform)
+ pci_id = strtol(platform, NULL, 16);
+ else
+ pci_id = intel_device_name_to_pci_device_id(platform);
struct intel_device_info devinfo;
if (!intel_get_device_info_from_pci_id(pci_id, &devinfo))