summaryrefslogtreecommitdiffstats
path: root/src/intel/dev
diff options
context:
space:
mode:
authorMark Janes <[email protected]>2019-07-25 15:57:30 -0700
committerMark Janes <[email protected]>2019-08-01 16:39:56 -0700
commit086c486a75fe64440cb1e76de47b3838215246b1 (patch)
treee5a808f4953f30752630e1af7fe03fbf3beac9d3 /src/intel/dev
parentd594d2a0524ff8d7c14b4842119936163bfa9318 (diff)
intel/device: rename gen_get_device_info
Rename the original device info initialization routine so callers don't mistakenly call the wrong one: gen_get_device_info_from_fd: Queries kernel for full device info, including topology details. gen_get_device_info_from_pci_id: Partially initializes device info based on PCI ID lookup, when the kernel is not available. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
Diffstat (limited to 'src/intel/dev')
-rw-r--r--src/intel/dev/gen_device_info.c13
-rw-r--r--src/intel/dev/gen_device_info.h3
-rw-r--r--src/intel/dev/gen_device_info_test.c2
3 files changed, 10 insertions, 8 deletions
diff --git a/src/intel/dev/gen_device_info.c b/src/intel/dev/gen_device_info.c
index 79ec4e0262d..462a906d08d 100644
--- a/src/intel/dev/gen_device_info.c
+++ b/src/intel/dev/gen_device_info.c
@@ -1202,15 +1202,16 @@ getparam(int fd, uint32_t param, int *value)
}
bool
-gen_get_device_info(int devid, struct gen_device_info *devinfo)
+gen_get_device_info_from_pci_id(int pci_id,
+ struct gen_device_info *devinfo)
{
- switch (devid) {
+ switch (pci_id) {
#undef CHIPSET
#define CHIPSET(id, family, name) \
case id: *devinfo = gen_device_info_##family; break;
#include "pci_ids/i965_pci_ids.h"
default:
- fprintf(stderr, "Driver does not support the 0x%x PCI ID.\n", devid);
+ fprintf(stderr, "Driver does not support the 0x%x PCI ID.\n", pci_id);
return false;
}
@@ -1248,7 +1249,7 @@ gen_get_device_info(int devid, struct gen_device_info *devinfo)
assert(devinfo->num_slices <= ARRAY_SIZE(devinfo->num_subslices));
- devinfo->chipset_id = devid;
+ devinfo->chipset_id = pci_id;
return true;
}
@@ -1328,14 +1329,14 @@ gen_get_device_info_from_fd(int fd, struct gen_device_info *devinfo)
{
int devid = gen_get_pci_device_id_override();
if (devid > 0) {
- if (!gen_get_device_info(devid, devinfo))
+ if (!gen_get_device_info_from_pci_id(devid, devinfo))
return false;
devinfo->no_hw = true;
} else {
/* query the device id */
if (!getparam(fd, I915_PARAM_CHIPSET_ID, &devid))
return false;
- if (!gen_get_device_info(devid, devinfo))
+ if (!gen_get_device_info_from_pci_id(devid, devinfo))
return false;
devinfo->no_hw = false;
}
diff --git a/src/intel/dev/gen_device_info.h b/src/intel/dev/gen_device_info.h
index d1c7230b0ff..bf5347432a5 100644
--- a/src/intel/dev/gen_device_info.h
+++ b/src/intel/dev/gen_device_info.h
@@ -273,7 +273,6 @@ gen_device_info_subslice_available(const struct gen_device_info *devinfo,
int gen_get_pci_device_id_override(void);
int gen_device_name_to_pci_device_id(const char *name);
-bool gen_get_device_info(int devid, struct gen_device_info *devinfo);
const char *gen_get_device_name(int devid);
/* Used with SLICE_MASK/SUBSLICE_MASK values from DRM_I915_GETPARAM. */
@@ -293,6 +292,8 @@ gen_device_info_timebase_scale(const struct gen_device_info *devinfo,
}
bool gen_get_device_info_from_fd(int fh, struct gen_device_info *devinfo);
+bool gen_get_device_info_from_pci_id(int pci_id,
+ struct gen_device_info *devinfo);
#ifdef __cplusplus
}
diff --git a/src/intel/dev/gen_device_info_test.c b/src/intel/dev/gen_device_info_test.c
index 6d7d279f98c..495772f1848 100644
--- a/src/intel/dev/gen_device_info_test.c
+++ b/src/intel/dev/gen_device_info_test.c
@@ -20,7 +20,7 @@ main(int argc, char *argv[])
for (uint32_t i = 0; i < ARRAY_SIZE(chipsets); i++) {
struct gen_device_info devinfo = { 0, };
- assert(gen_get_device_info(chipsets[i].pci_id, &devinfo));
+ assert(gen_get_device_info_from_pci_id(chipsets[i].pci_id, &devinfo));
assert(devinfo.gen != 0);
assert(devinfo.urb.size != 0);