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:
Anuj Phogat
2021-04-05 15:59:35 -07:00
committed by Marge Bot
parent 4507e6674e
commit 726d9696dd
20 changed files with 37 additions and 37 deletions

View File

@@ -145,7 +145,7 @@ iris_get_name(struct pipe_screen *pscreen)
{ {
struct iris_screen *screen = (struct iris_screen *)pscreen; struct iris_screen *screen = (struct iris_screen *)pscreen;
static char buf[128]; 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) if (!name)
name = "Intel Unknown"; name = "Intel Unknown";
@@ -781,7 +781,7 @@ iris_screen_create(int fd, const struct pipe_screen_config *config)
if (!screen) if (!screen)
return NULL; return NULL;
if (!gen_get_device_info_from_fd(fd, &screen->devinfo)) if (!intel_get_device_info_from_fd(fd, &screen->devinfo))
return NULL; return NULL;
screen->pci_id = screen->devinfo.chipset_id; screen->pci_id = screen->devinfo.chipset_id;
screen->no_hw = screen->devinfo.no_hw; screen->no_hw = screen->devinfo.no_hw;

View File

@@ -193,7 +193,7 @@ mi_builder_test::SetUp()
ASSERT_EQ(drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, ASSERT_EQ(drmIoctl(fd, DRM_IOCTL_I915_GETPARAM,
(void *)&getparam), 0) << strerror(errno); (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)) { if (devinfo.ver != GFX_VER || devinfo.is_haswell != (GFX_VERx10 == 75)) {
close(fd); close(fd);
fd = -1; fd = -1;

View File

@@ -77,7 +77,7 @@ void validation_test::SetUp()
struct gen_info info = GetParam(); struct gen_info info = GetParam();
int devid = intel_device_name_to_pci_device_id(info.name); 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); brw_init_codegen(&devinfo, p, p);
} }

View File

@@ -64,7 +64,7 @@ main(int argc, char *argv[])
if (fd < 0) if (fd < 0)
continue; continue;
bool success = gen_get_device_info_from_fd(fd, &devinfo); bool success = intel_get_device_info_from_fd(fd, &devinfo);
close(fd); close(fd);
if (!success) if (!success)
@@ -72,7 +72,7 @@ main(int argc, char *argv[])
fprintf(stdout, "%s:\n", path); 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, " gen: %u\n", devinfo.ver);
fprintf(stdout, " PCI id: 0x%x\n", devinfo.chipset_id); fprintf(stdout, " PCI id: 0x%x\n", devinfo.chipset_id);
fprintf(stdout, " revision: %u\n", devinfo.revision); fprintf(stdout, " revision: %u\n", devinfo.revision);

View File

@@ -1222,7 +1222,7 @@ getparam(int fd, uint32_t param, int *value)
} }
bool bool
gen_get_device_info_from_pci_id(int pci_id, intel_get_device_info_from_pci_id(int pci_id,
struct intel_device_info *devinfo) struct intel_device_info *devinfo)
{ {
switch (pci_id) { switch (pci_id) {
@@ -1285,7 +1285,7 @@ gen_get_device_info_from_pci_id(int pci_id,
} }
const char * const char *
gen_get_device_name(int devid) intel_get_device_name(int devid)
{ {
switch (devid) { switch (devid) {
#undef CHIPSET #undef CHIPSET
@@ -1404,7 +1404,7 @@ gen_has_get_tiling(int fd)
} }
bool 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; int devid = 0;
@@ -1430,14 +1430,14 @@ gen_get_device_info_from_fd(int fd, struct intel_device_info *devinfo)
} }
if (devid > 0) { 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; return false;
devinfo->no_hw = true; devinfo->no_hw = true;
} else { } else {
/* query the device id */ /* query the device id */
if (!getparam(fd, I915_PARAM_CHIPSET_ID, &devid)) if (!getparam(fd, I915_PARAM_CHIPSET_ID, &devid))
return false; return false;
if (!gen_get_device_info_from_pci_id(devid, devinfo)) if (!intel_get_device_info_from_pci_id(devid, devinfo))
return false; return false;
devinfo->no_hw = false; devinfo->no_hw = false;
} }

View File

@@ -343,7 +343,7 @@ intel_device_info_num_dual_subslices(UNUSED
} }
int intel_device_name_to_pci_device_id(const char *name); 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 static inline uint64_t
intel_device_info_timebase_scale(const struct intel_device_info *devinfo, intel_device_info_timebase_scale(const struct intel_device_info *devinfo,
@@ -352,8 +352,8 @@ intel_device_info_timebase_scale(const struct intel_device_info *devinfo,
return (1000000000ull * gpu_timestamp) / devinfo->timestamp_frequency; return (1000000000ull * gpu_timestamp) / devinfo->timestamp_frequency;
} }
bool gen_get_device_info_from_fd(int fh, struct intel_device_info *devinfo); bool intel_get_device_info_from_fd(int fh, struct intel_device_info *devinfo);
bool gen_get_device_info_from_pci_id(int pci_id, bool intel_get_device_info_from_pci_id(int pci_id,
struct intel_device_info *devinfo); struct intel_device_info *devinfo);
int gen_get_aperture_size(int fd, uint64_t *size); int gen_get_aperture_size(int fd, uint64_t *size);

View File

@@ -21,7 +21,7 @@ main(int argc, char *argv[])
for (uint32_t i = 0; i < ARRAY_SIZE(chipsets); i++) { for (uint32_t i = 0; i < ARRAY_SIZE(chipsets); i++) {
struct intel_device_info devinfo = { 0, }; 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.ver != 0);
assert(devinfo.num_eu_per_subslice != 0); assert(devinfo.num_eu_per_subslice != 0);

View File

@@ -125,7 +125,7 @@ test_bdw_2d_r8g8b8a8_unorm_512x512_array01_samples01_noaux_tiley0(void)
bool ok; bool ok;
struct intel_device_info devinfo; 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; struct isl_device dev;
isl_device_init(&dev, &devinfo, /*bit6_swizzle*/ false); 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; bool ok;
struct intel_device_info devinfo; 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; struct isl_device dev;
isl_device_init(&dev, &devinfo, /*bit6_swizzle*/ false); isl_device_init(&dev, &devinfo, /*bit6_swizzle*/ false);
@@ -234,7 +234,7 @@ test_bdw_3d_r8g8b8a8_unorm_256x256x256_levels09_tiley0(void)
bool ok; bool ok;
struct intel_device_info devinfo; 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; struct isl_device dev;
isl_device_init(&dev, &devinfo, /*bit6_swizzle*/ false); isl_device_init(&dev, &devinfo, /*bit6_swizzle*/ false);

View File

@@ -85,7 +85,7 @@ handle_trace_header(struct aub_read *read, const uint32_t *p)
if (end > &p[12] && p[12] > 0) { if (end > &p[12] && p[12] > 0) {
if (sscanf((char *)&p[13], "PCI-ID=%i", &aub_pci_id) > 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, parse_error(read, p,
"can't find device information: pci_id=0x%x\n", aub_pci_id); "can't find device information: pci_id=0x%x\n", aub_pci_id);
return false; return false;
@@ -116,7 +116,7 @@ handle_memtrace_version(struct aub_read *read, const uint32_t *p)
app_name[app_name_len] = 0; app_name[app_name_len] = 0;
if (sscanf(app_name, "PCI-ID=%i %n", &aub_pci_id, &pci_id_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); parse_error(read, p, "can't find device information: pci_id=0x%x\n", aub_pci_id);
return false; return false;
} }

View File

@@ -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->verbose_log_file = debug;
aub->file = file; aub->file = file;
aub->pci_id = pci_id; 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); "failed to identify chipset=0x%x\n", pci_id);
aub->addr_bits = aub->devinfo.ver >= 8 ? 48 : 32; aub->addr_bits = aub->devinfo.ver >= 8 ? 48 : 32;

View File

@@ -78,7 +78,7 @@ aubinator_init(void *user_data, int aub_pci_id, const char *app_name)
{ {
pci_id = aub_pci_id; 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); fprintf(stderr, "can't find device information: pci_id=0x%x\n", pci_id);
exit(EXIT_FAILURE); 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, "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 */ /* Throw in a new line before the first batch */
fprintf(outfile, "\n"); fprintf(outfile, "\n");

View File

@@ -507,7 +507,7 @@ read_data_file(FILE *file)
matched = sscanf(pci_id_start, "PCI ID: 0x%04x\n", &reg); matched = sscanf(pci_id_start, "PCI ID: 0x%04x\n", &reg);
} }
if (matched == 1) { 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); printf("Unable to identify devid=%x\n", reg);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }

View File

@@ -125,7 +125,7 @@ handle_info(void *user_data, int pci_id, const char *app_name)
file->pci_id = pci_id; file->pci_id = pci_id;
snprintf(file->app_name, sizeof(app_name), "%s", app_name); 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); fprintf(stderr, "can't find device information: pci_id=0x%x\n", file->pci_id);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
@@ -1006,7 +1006,7 @@ display_aubfile_window(struct window *win)
ImGui::Text("Execbufs %u", context.file->n_execs); ImGui::Text("Execbufs %u", context.file->n_execs);
ImGui::Text("PCI ID: 0x%x", context.file->pci_id); ImGui::Text("PCI ID: 0x%x", context.file->pci_id);
ImGui::Text("Application name: %s", context.file->app_name); 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); ImGui::SetNextWindowContentWidth(500);
if (ImGui::BeginPopupModal("Help", NULL, ImGuiWindowFlags_AlwaysAutoResize)) { if (ImGui::BeginPopupModal("Help", NULL, ImGuiWindowFlags_AlwaysAutoResize)) {

View File

@@ -110,7 +110,7 @@ i965_disasm_init(uint16_t pci_id)
if (devinfo == NULL) if (devinfo == NULL)
return 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", fprintf(stderr, "can't find device information: pci_id=0x%x\n",
pci_id); pci_id);
free(devinfo); free(devinfo);

View File

@@ -122,7 +122,7 @@ i965_disasm_init(uint16_t pci_id)
if (devinfo == NULL) if (devinfo == NULL)
return 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", fprintf(stderr, "can't find device information: pci_id=0x%x\n",
pci_id); pci_id);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);

View File

@@ -121,11 +121,11 @@ ensure_device_info(int fd)
{ {
/* We can't do this at open time as we're not yet authenticated. */ /* We can't do this at open time as we're not yet authenticated. */
if (device == 0) { 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"); "failed to identify chipset.\n");
device = devinfo.chipset_id; device = devinfo.chipset_id;
} else if (devinfo.ver == 0) { } 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"); "failed to identify chipset.\n");
} }
} }

View File

@@ -368,7 +368,7 @@ drm_shim_driver_init(void)
/* Use SKL if nothing is specified. */ /* Use SKL if nothing is specified. */
i915.device_id = intel_device_name_to_pci_device_id(user_platform ?: "skl"); 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; return;
shim_device.bus_type = DRM_BUS_PCI; shim_device.bus_type = DRM_BUS_PCI;

View File

@@ -663,12 +663,12 @@ anv_physical_device_try_create(struct anv_instance *instance,
} }
struct intel_device_info devinfo; 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); result = vk_error(VK_ERROR_INCOMPATIBLE_DRIVER);
goto fail_fd; 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) { if (devinfo.is_haswell) {
mesa_logw("Haswell Vulkan support is incomplete"); mesa_logw("Haswell Vulkan support is incomplete");

View File

@@ -104,7 +104,7 @@ const char *
brw_get_renderer_string(const struct brw_screen *screen) brw_get_renderer_string(const struct brw_screen *screen)
{ {
static char buf[128]; static char buf[128];
const char *name = gen_get_device_name(screen->deviceID); const char *name = intel_get_device_name(screen->deviceID);
if (!name) if (!name)
name = "Intel Unknown"; name = "Intel Unknown";

View File

@@ -2538,7 +2538,7 @@ __DRIconfig **brw_init_screen(__DRIscreen *dri_screen)
screen->driScrnPriv = dri_screen; screen->driScrnPriv = dri_screen;
dri_screen->driverPrivate = (void *) 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; return NULL;
const struct intel_device_info *devinfo = &screen->devinfo; const struct intel_device_info *devinfo = &screen->devinfo;