mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-01 01:38:06 +02:00
anv: strdup the device path into the physical device
This way we don't have to assume that the string coming in is a piece of constant data that exists forever.
This commit is contained in:
parent
9048dee328
commit
e023c104f7
2 changed files with 4 additions and 2 deletions
|
|
@ -67,7 +67,9 @@ anv_physical_device_init(struct anv_physical_device *device,
|
|||
|
||||
device->_loader_data.loaderMagic = ICD_LOADER_MAGIC;
|
||||
device->instance = instance;
|
||||
device->path = path;
|
||||
|
||||
assert(strlen(path) < ARRAY_SIZE(device->path));
|
||||
strncpy(device->path, path, ARRAY_SIZE(device->path));
|
||||
|
||||
device->chipset_id = anv_gem_get_param(fd, I915_PARAM_CHIPSET_ID);
|
||||
if (!device->chipset_id) {
|
||||
|
|
|
|||
|
|
@ -542,7 +542,7 @@ struct anv_physical_device {
|
|||
|
||||
struct anv_instance * instance;
|
||||
uint32_t chipset_id;
|
||||
const char * path;
|
||||
char path[20];
|
||||
const char * name;
|
||||
const struct brw_device_info * info;
|
||||
uint64_t aperture_size;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue