mesa/src/intel/dev/gen_device_info_test.c
Mark Janes 086c486a75 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 <kenneth@whitecape.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2019-08-01 16:39:56 -07:00

33 lines
746 B
C

#undef NDEBUG
#include <stdint.h>
#include <assert.h>
#include "gen_device_info.h"
int
main(int argc, char *argv[])
{
struct {
uint32_t pci_id;
const char *name;
} chipsets[] = {
#undef CHIPSET
#define CHIPSET(id, family, str_name) { .pci_id = id, .name = str_name, },
#include "pci_ids/i965_pci_ids.h"
};
for (uint32_t i = 0; i < ARRAY_SIZE(chipsets); i++) {
struct gen_device_info devinfo = { 0, };
assert(gen_get_device_info_from_pci_id(chipsets[i].pci_id, &devinfo));
assert(devinfo.gen != 0);
assert(devinfo.urb.size != 0);
assert(devinfo.num_eu_per_subslice != 0);
assert(devinfo.num_thread_per_eu != 0);
assert(devinfo.timestamp_frequency != 0);
}
return 0;
}