crocus_get_name(struct pipe_screen *pscreen)
{
struct crocus_screen *screen = (struct crocus_screen *)pscreen;
+ const struct intel_device_info *devinfo = &screen->devinfo;
static char buf[128];
- const char *name = intel_get_device_name(screen->pci_id);
-
- if (!name)
- name = "Intel Unknown";
-
- snprintf(buf, sizeof(buf), "Mesa %s", name);
+ snprintf(buf, sizeof(buf), "Mesa %s", devinfo->name);
return buf;
}
iris_get_name(struct pipe_screen *pscreen)
{
struct iris_screen *screen = (struct iris_screen *)pscreen;
+ const struct intel_device_info *devinfo = &screen->devinfo;
static char buf[128];
- const char *name = intel_get_device_name(screen->pci_id);
-
- if (!name)
- name = "Intel Unknown";
- snprintf(buf, sizeof(buf), "Mesa %s", name);
+ snprintf(buf, sizeof(buf), "Mesa %s", devinfo->name);
return buf;
}
fprintf(stdout, "%s:\n", path);
- fprintf(stdout, " name: %s\n", intel_get_device_name(devinfo.chipset_id));
+ fprintf(stdout, " name: %s\n", devinfo.name);
fprintf(stdout, " gen: %u\n", devinfo.ver);
fprintf(stdout, " PCI id: 0x%x\n", devinfo.chipset_id);
fprintf(stdout, " revision: %u\n", devinfo.revision);
return false;
}
+ switch (pci_id) {
+#undef CHIPSET
+#define CHIPSET(_id, _family, _fam_str, _name) \
+ case _id: \
+ /* sizeof(str_literal) includes the null */ \
+ STATIC_ASSERT(sizeof(_name) + sizeof(_fam_str) + 2 <= \
+ sizeof(devinfo->name)); \
+ strncpy(devinfo->name, _name " (" _fam_str ")", sizeof(devinfo->name)); \
+ break;
+#include "pci_ids/i965_pci_ids.h"
+#include "pci_ids/iris_pci_ids.h"
+ default:
+ strncpy(devinfo->name, "Intel Unknown", sizeof(devinfo->name));
+ }
+
fill_masks(devinfo);
/* From the Skylake PRM, 3DSTATE_PS::Scratch Space Base Pointer:
return true;
}
-const char *
-intel_get_device_name(int devid)
-{
- switch (devid) {
-#undef CHIPSET
-#define CHIPSET(id, family, fam_str, name) case id: return name " (" fam_str ")"; break;
-#include "pci_ids/i965_pci_ids.h"
-#include "pci_ids/iris_pci_ids.h"
- default:
- return NULL;
- }
-}
-
/**
* for gfx8/gfx9, SLICE_MASK/SUBSLICE_MASK can be used to compute the topology
* (kernel 4.13+)
struct drm_i915_query_topology_info;
+#define INTEL_DEVICE_MAX_NAME_SIZE 64
#define INTEL_DEVICE_MAX_SLICES (6) /* Maximum on gfx10 */
#define INTEL_DEVICE_MAX_SUBSLICES (8) /* Maximum on gfx11 */
#define INTEL_DEVICE_MAX_EUS_PER_SUBSLICE (16) /* Maximum on gfx12 */
uint32_t chipset_id;
/**
+ * holds the name of the device
+ */
+ char name[INTEL_DEVICE_MAX_NAME_SIZE];
+
+ /**
* no_hw is true when the chipset_id pci device id has been overridden
*/
bool no_hw;
}
int intel_device_name_to_pci_device_id(const char *name);
-const char *intel_get_device_name(int devid);
static inline uint64_t
intel_device_info_timebase_scale(const struct intel_device_info *devinfo,
fprintf(outfile, "Application name: %s\n", app_name);
- fprintf(outfile, "Decoding as: %s\n", intel_get_device_name(pci_id));
+ fprintf(outfile, "Decoding as: %s\n", devinfo.name);
/* Throw in a new line before the first batch */
fprintf(outfile, "\n");
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", intel_get_device_name(context.file->pci_id));
+ ImGui::Text("%s", context.file->devinfo.name);
ImGui::SetNextWindowContentWidth(500);
if (ImGui::BeginPopupModal("Help", NULL, ImGuiWindowFlags_AlwaysAutoResize)) {
goto fail_fd;
}
- const char *device_name = intel_get_device_name(devinfo.chipset_id);
-
if (devinfo.is_haswell) {
mesa_logw("Haswell Vulkan support is incomplete");
} else if (devinfo.ver == 7 && !devinfo.is_baytrail) {
/* Gfx8-12 fully supported */
} else {
result = vk_errorfi(instance, NULL, VK_ERROR_INCOMPATIBLE_DRIVER,
- "Vulkan not yet supported on %s", device_name);
+ "Vulkan not yet supported on %s", devinfo.name);
goto fail_fd;
}
snprintf(device->path, ARRAY_SIZE(device->path), "%s", path);
device->info = devinfo;
- device->name = device_name;
device->no_hw = device->info.no_hw;
if (getenv("INTEL_NO_HW") != NULL)
};
snprintf(pProperties->deviceName, sizeof(pProperties->deviceName),
- "%s", pdevice->name);
+ "%s", pdevice->info.name);
memcpy(pProperties->pipelineCacheUUID,
pdevice->pipeline_cache_uuid, VK_UUID_SIZE);
}
struct anv_instance * instance;
bool no_hw;
char path[20];
- const char * name;
struct {
uint16_t domain;
uint8_t bus;
brw_get_renderer_string(const struct brw_screen *screen)
{
static char buf[128];
- const char *name = intel_get_device_name(screen->deviceID);
+ const char *name = screen->devinfo.name;
if (!name)
name = "Intel Unknown";