intel: Rename gen_get_device prefix to intel_get_device
export SEARCH_PATH="src/intel src/gallium/drivers/iris src/mesa/drivers/dri/i965" grep -E "gen_get_device" -rIl $SEARCH_PATH | xargs sed -ie "s/gen_get_device/intel_get_device/g" Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10241>
This commit is contained in:
@@ -145,7 +145,7 @@ iris_get_name(struct pipe_screen *pscreen)
|
||||
{
|
||||
struct iris_screen *screen = (struct iris_screen *)pscreen;
|
||||
static char buf[128];
|
||||
const char *name = gen_get_device_name(screen->pci_id);
|
||||
const char *name = intel_get_device_name(screen->pci_id);
|
||||
|
||||
if (!name)
|
||||
name = "Intel Unknown";
|
||||
@@ -781,7 +781,7 @@ iris_screen_create(int fd, const struct pipe_screen_config *config)
|
||||
if (!screen)
|
||||
return NULL;
|
||||
|
||||
if (!gen_get_device_info_from_fd(fd, &screen->devinfo))
|
||||
if (!intel_get_device_info_from_fd(fd, &screen->devinfo))
|
||||
return NULL;
|
||||
screen->pci_id = screen->devinfo.chipset_id;
|
||||
screen->no_hw = screen->devinfo.no_hw;
|
||||
|
@@ -193,7 +193,7 @@ mi_builder_test::SetUp()
|
||||
ASSERT_EQ(drmIoctl(fd, DRM_IOCTL_I915_GETPARAM,
|
||||
(void *)&getparam), 0) << strerror(errno);
|
||||
|
||||
ASSERT_TRUE(gen_get_device_info_from_pci_id(device_id, &devinfo));
|
||||
ASSERT_TRUE(intel_get_device_info_from_pci_id(device_id, &devinfo));
|
||||
if (devinfo.ver != GFX_VER || devinfo.is_haswell != (GFX_VERx10 == 75)) {
|
||||
close(fd);
|
||||
fd = -1;
|
||||
|
@@ -77,7 +77,7 @@ void validation_test::SetUp()
|
||||
struct gen_info info = GetParam();
|
||||
int devid = intel_device_name_to_pci_device_id(info.name);
|
||||
|
||||
gen_get_device_info_from_pci_id(devid, &devinfo);
|
||||
intel_get_device_info_from_pci_id(devid, &devinfo);
|
||||
|
||||
brw_init_codegen(&devinfo, p, p);
|
||||
}
|
||||
|
@@ -64,7 +64,7 @@ main(int argc, char *argv[])
|
||||
if (fd < 0)
|
||||
continue;
|
||||
|
||||
bool success = gen_get_device_info_from_fd(fd, &devinfo);
|
||||
bool success = intel_get_device_info_from_fd(fd, &devinfo);
|
||||
close(fd);
|
||||
|
||||
if (!success)
|
||||
@@ -72,7 +72,7 @@ main(int argc, char *argv[])
|
||||
|
||||
fprintf(stdout, "%s:\n", path);
|
||||
|
||||
fprintf(stdout, " name: %s\n", gen_get_device_name(devinfo.chipset_id));
|
||||
fprintf(stdout, " name: %s\n", intel_get_device_name(devinfo.chipset_id));
|
||||
fprintf(stdout, " gen: %u\n", devinfo.ver);
|
||||
fprintf(stdout, " PCI id: 0x%x\n", devinfo.chipset_id);
|
||||
fprintf(stdout, " revision: %u\n", devinfo.revision);
|
||||
|
@@ -1222,8 +1222,8 @@ getparam(int fd, uint32_t param, int *value)
|
||||
}
|
||||
|
||||
bool
|
||||
gen_get_device_info_from_pci_id(int pci_id,
|
||||
struct intel_device_info *devinfo)
|
||||
intel_get_device_info_from_pci_id(int pci_id,
|
||||
struct intel_device_info *devinfo)
|
||||
{
|
||||
switch (pci_id) {
|
||||
#undef CHIPSET
|
||||
@@ -1285,7 +1285,7 @@ gen_get_device_info_from_pci_id(int pci_id,
|
||||
}
|
||||
|
||||
const char *
|
||||
gen_get_device_name(int devid)
|
||||
intel_get_device_name(int devid)
|
||||
{
|
||||
switch (devid) {
|
||||
#undef CHIPSET
|
||||
@@ -1404,7 +1404,7 @@ gen_has_get_tiling(int fd)
|
||||
}
|
||||
|
||||
bool
|
||||
gen_get_device_info_from_fd(int fd, struct intel_device_info *devinfo)
|
||||
intel_get_device_info_from_fd(int fd, struct intel_device_info *devinfo)
|
||||
{
|
||||
int devid = 0;
|
||||
|
||||
@@ -1430,14 +1430,14 @@ gen_get_device_info_from_fd(int fd, struct intel_device_info *devinfo)
|
||||
}
|
||||
|
||||
if (devid > 0) {
|
||||
if (!gen_get_device_info_from_pci_id(devid, devinfo))
|
||||
if (!intel_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_from_pci_id(devid, devinfo))
|
||||
if (!intel_get_device_info_from_pci_id(devid, devinfo))
|
||||
return false;
|
||||
devinfo->no_hw = false;
|
||||
}
|
||||
|
@@ -343,7 +343,7 @@ intel_device_info_num_dual_subslices(UNUSED
|
||||
}
|
||||
|
||||
int intel_device_name_to_pci_device_id(const char *name);
|
||||
const char *gen_get_device_name(int devid);
|
||||
const char *intel_get_device_name(int devid);
|
||||
|
||||
static inline uint64_t
|
||||
intel_device_info_timebase_scale(const struct intel_device_info *devinfo,
|
||||
@@ -352,9 +352,9 @@ intel_device_info_timebase_scale(const struct intel_device_info *devinfo,
|
||||
return (1000000000ull * gpu_timestamp) / devinfo->timestamp_frequency;
|
||||
}
|
||||
|
||||
bool gen_get_device_info_from_fd(int fh, struct intel_device_info *devinfo);
|
||||
bool gen_get_device_info_from_pci_id(int pci_id,
|
||||
struct intel_device_info *devinfo);
|
||||
bool intel_get_device_info_from_fd(int fh, struct intel_device_info *devinfo);
|
||||
bool intel_get_device_info_from_pci_id(int pci_id,
|
||||
struct intel_device_info *devinfo);
|
||||
int gen_get_aperture_size(int fd, uint64_t *size);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@@ -21,7 +21,7 @@ main(int argc, char *argv[])
|
||||
for (uint32_t i = 0; i < ARRAY_SIZE(chipsets); i++) {
|
||||
struct intel_device_info devinfo = { 0, };
|
||||
|
||||
assert(gen_get_device_info_from_pci_id(chipsets[i].pci_id, &devinfo));
|
||||
assert(intel_get_device_info_from_pci_id(chipsets[i].pci_id, &devinfo));
|
||||
|
||||
assert(devinfo.ver != 0);
|
||||
assert(devinfo.num_eu_per_subslice != 0);
|
||||
|
@@ -125,7 +125,7 @@ test_bdw_2d_r8g8b8a8_unorm_512x512_array01_samples01_noaux_tiley0(void)
|
||||
bool ok;
|
||||
|
||||
struct intel_device_info devinfo;
|
||||
t_assert(gen_get_device_info_from_pci_id(BDW_GT2_DEVID, &devinfo));
|
||||
t_assert(intel_get_device_info_from_pci_id(BDW_GT2_DEVID, &devinfo));
|
||||
|
||||
struct isl_device dev;
|
||||
isl_device_init(&dev, &devinfo, /*bit6_swizzle*/ false);
|
||||
@@ -173,7 +173,7 @@ test_bdw_2d_r8g8b8a8_unorm_1024x1024_array06_samples01_noaux_tiley0(void)
|
||||
bool ok;
|
||||
|
||||
struct intel_device_info devinfo;
|
||||
t_assert(gen_get_device_info_from_pci_id(BDW_GT2_DEVID, &devinfo));
|
||||
t_assert(intel_get_device_info_from_pci_id(BDW_GT2_DEVID, &devinfo));
|
||||
|
||||
struct isl_device dev;
|
||||
isl_device_init(&dev, &devinfo, /*bit6_swizzle*/ false);
|
||||
@@ -234,7 +234,7 @@ test_bdw_3d_r8g8b8a8_unorm_256x256x256_levels09_tiley0(void)
|
||||
bool ok;
|
||||
|
||||
struct intel_device_info devinfo;
|
||||
t_assert(gen_get_device_info_from_pci_id(BDW_GT2_DEVID, &devinfo));
|
||||
t_assert(intel_get_device_info_from_pci_id(BDW_GT2_DEVID, &devinfo));
|
||||
|
||||
struct isl_device dev;
|
||||
isl_device_init(&dev, &devinfo, /*bit6_swizzle*/ false);
|
||||
|
@@ -85,7 +85,7 @@ handle_trace_header(struct aub_read *read, const uint32_t *p)
|
||||
|
||||
if (end > &p[12] && p[12] > 0) {
|
||||
if (sscanf((char *)&p[13], "PCI-ID=%i", &aub_pci_id) > 0) {
|
||||
if (!gen_get_device_info_from_pci_id(aub_pci_id, &read->devinfo)) {
|
||||
if (!intel_get_device_info_from_pci_id(aub_pci_id, &read->devinfo)) {
|
||||
parse_error(read, p,
|
||||
"can't find device information: pci_id=0x%x\n", aub_pci_id);
|
||||
return false;
|
||||
@@ -116,7 +116,7 @@ handle_memtrace_version(struct aub_read *read, const uint32_t *p)
|
||||
app_name[app_name_len] = 0;
|
||||
|
||||
if (sscanf(app_name, "PCI-ID=%i %n", &aub_pci_id, &pci_id_len) > 0) {
|
||||
if (!gen_get_device_info_from_pci_id(aub_pci_id, &read->devinfo)) {
|
||||
if (!intel_get_device_info_from_pci_id(aub_pci_id, &read->devinfo)) {
|
||||
parse_error(read, p, "can't find device information: pci_id=0x%x\n", aub_pci_id);
|
||||
return false;
|
||||
}
|
||||
|
@@ -159,7 +159,7 @@ aub_file_init(struct aub_file *aub, FILE *file, FILE *debug, uint16_t pci_id, co
|
||||
aub->verbose_log_file = debug;
|
||||
aub->file = file;
|
||||
aub->pci_id = pci_id;
|
||||
fail_if(!gen_get_device_info_from_pci_id(pci_id, &aub->devinfo),
|
||||
fail_if(!intel_get_device_info_from_pci_id(pci_id, &aub->devinfo),
|
||||
"failed to identify chipset=0x%x\n", pci_id);
|
||||
aub->addr_bits = aub->devinfo.ver >= 8 ? 48 : 32;
|
||||
|
||||
|
@@ -78,7 +78,7 @@ aubinator_init(void *user_data, int aub_pci_id, const char *app_name)
|
||||
{
|
||||
pci_id = aub_pci_id;
|
||||
|
||||
if (!gen_get_device_info_from_pci_id(pci_id, &devinfo)) {
|
||||
if (!intel_get_device_info_from_pci_id(pci_id, &devinfo)) {
|
||||
fprintf(stderr, "can't find device information: pci_id=0x%x\n", pci_id);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
@@ -123,7 +123,7 @@ aubinator_init(void *user_data, int aub_pci_id, const char *app_name)
|
||||
|
||||
fprintf(outfile, "Application name: %s\n", app_name);
|
||||
|
||||
fprintf(outfile, "Decoding as: %s\n", gen_get_device_name(pci_id));
|
||||
fprintf(outfile, "Decoding as: %s\n", intel_get_device_name(pci_id));
|
||||
|
||||
/* Throw in a new line before the first batch */
|
||||
fprintf(outfile, "\n");
|
||||
|
@@ -507,7 +507,7 @@ read_data_file(FILE *file)
|
||||
matched = sscanf(pci_id_start, "PCI ID: 0x%04x\n", ®);
|
||||
}
|
||||
if (matched == 1) {
|
||||
if (!gen_get_device_info_from_pci_id(reg, &devinfo)) {
|
||||
if (!intel_get_device_info_from_pci_id(reg, &devinfo)) {
|
||||
printf("Unable to identify devid=%x\n", reg);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
@@ -125,7 +125,7 @@ handle_info(void *user_data, int pci_id, const char *app_name)
|
||||
file->pci_id = pci_id;
|
||||
snprintf(file->app_name, sizeof(app_name), "%s", app_name);
|
||||
|
||||
if (!gen_get_device_info_from_pci_id(file->pci_id, &file->devinfo)) {
|
||||
if (!intel_get_device_info_from_pci_id(file->pci_id, &file->devinfo)) {
|
||||
fprintf(stderr, "can't find device information: pci_id=0x%x\n", file->pci_id);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
@@ -1006,7 +1006,7 @@ display_aubfile_window(struct window *win)
|
||||
ImGui::Text("Execbufs %u", context.file->n_execs);
|
||||
ImGui::Text("PCI ID: 0x%x", context.file->pci_id);
|
||||
ImGui::Text("Application name: %s", context.file->app_name);
|
||||
ImGui::Text("%s", gen_get_device_name(context.file->pci_id));
|
||||
ImGui::Text("%s", intel_get_device_name(context.file->pci_id));
|
||||
|
||||
ImGui::SetNextWindowContentWidth(500);
|
||||
if (ImGui::BeginPopupModal("Help", NULL, ImGuiWindowFlags_AlwaysAutoResize)) {
|
||||
|
@@ -110,7 +110,7 @@ i965_disasm_init(uint16_t pci_id)
|
||||
if (devinfo == NULL)
|
||||
return NULL;
|
||||
|
||||
if (!gen_get_device_info_from_pci_id(pci_id, devinfo)) {
|
||||
if (!intel_get_device_info_from_pci_id(pci_id, devinfo)) {
|
||||
fprintf(stderr, "can't find device information: pci_id=0x%x\n",
|
||||
pci_id);
|
||||
free(devinfo);
|
||||
|
@@ -122,7 +122,7 @@ i965_disasm_init(uint16_t pci_id)
|
||||
if (devinfo == NULL)
|
||||
return NULL;
|
||||
|
||||
if (!gen_get_device_info_from_pci_id(pci_id, devinfo)) {
|
||||
if (!intel_get_device_info_from_pci_id(pci_id, devinfo)) {
|
||||
fprintf(stderr, "can't find device information: pci_id=0x%x\n",
|
||||
pci_id);
|
||||
exit(EXIT_FAILURE);
|
||||
|
@@ -121,11 +121,11 @@ ensure_device_info(int fd)
|
||||
{
|
||||
/* We can't do this at open time as we're not yet authenticated. */
|
||||
if (device == 0) {
|
||||
fail_if(!gen_get_device_info_from_fd(fd, &devinfo),
|
||||
fail_if(!intel_get_device_info_from_fd(fd, &devinfo),
|
||||
"failed to identify chipset.\n");
|
||||
device = devinfo.chipset_id;
|
||||
} else if (devinfo.ver == 0) {
|
||||
fail_if(!gen_get_device_info_from_pci_id(device, &devinfo),
|
||||
fail_if(!intel_get_device_info_from_pci_id(device, &devinfo),
|
||||
"failed to identify chipset.\n");
|
||||
}
|
||||
}
|
||||
|
@@ -368,7 +368,7 @@ drm_shim_driver_init(void)
|
||||
|
||||
/* Use SKL if nothing is specified. */
|
||||
i915.device_id = intel_device_name_to_pci_device_id(user_platform ?: "skl");
|
||||
if (!gen_get_device_info_from_pci_id(i915.device_id, &i915.devinfo))
|
||||
if (!intel_get_device_info_from_pci_id(i915.device_id, &i915.devinfo))
|
||||
return;
|
||||
|
||||
shim_device.bus_type = DRM_BUS_PCI;
|
||||
|
@@ -663,12 +663,12 @@ anv_physical_device_try_create(struct anv_instance *instance,
|
||||
}
|
||||
|
||||
struct intel_device_info devinfo;
|
||||
if (!gen_get_device_info_from_fd(fd, &devinfo)) {
|
||||
if (!intel_get_device_info_from_fd(fd, &devinfo)) {
|
||||
result = vk_error(VK_ERROR_INCOMPATIBLE_DRIVER);
|
||||
goto fail_fd;
|
||||
}
|
||||
|
||||
const char *device_name = gen_get_device_name(devinfo.chipset_id);
|
||||
const char *device_name = intel_get_device_name(devinfo.chipset_id);
|
||||
|
||||
if (devinfo.is_haswell) {
|
||||
mesa_logw("Haswell Vulkan support is incomplete");
|
||||
|
@@ -104,7 +104,7 @@ const char *
|
||||
brw_get_renderer_string(const struct brw_screen *screen)
|
||||
{
|
||||
static char buf[128];
|
||||
const char *name = gen_get_device_name(screen->deviceID);
|
||||
const char *name = intel_get_device_name(screen->deviceID);
|
||||
|
||||
if (!name)
|
||||
name = "Intel Unknown";
|
||||
|
@@ -2538,7 +2538,7 @@ __DRIconfig **brw_init_screen(__DRIscreen *dri_screen)
|
||||
screen->driScrnPriv = dri_screen;
|
||||
dri_screen->driverPrivate = (void *) screen;
|
||||
|
||||
if (!gen_get_device_info_from_fd(dri_screen->fd, &screen->devinfo))
|
||||
if (!intel_get_device_info_from_fd(dri_screen->fd, &screen->devinfo))
|
||||
return NULL;
|
||||
|
||||
const struct intel_device_info *devinfo = &screen->devinfo;
|
||||
|
Reference in New Issue
Block a user