anv: Drop separate chipset_id fields
authorJason Ekstrand <jason@jlekstrand.net>
Sat, 18 Jan 2020 05:45:31 +0000 (23:45 -0600)
committerMarge Bot <eric+marge@anholt.net>
Mon, 20 Jan 2020 22:08:52 +0000 (22:08 +0000)
This already exists in gen_device_info.  There's no reason to keep
duplicate copies.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3461>

src/intel/vulkan/anv_device.c
src/intel/vulkan/anv_pipeline_cache.c
src/intel/vulkan/anv_private.h

index 6d7c7ad3c979de4be317784e4e133bd8f8844c5f..b0ff56aa801aa842f7a2647749676c2a1872d038 100644 (file)
@@ -237,8 +237,8 @@ anv_physical_device_init_uuids(struct anv_physical_device *device)
     */
    _mesa_sha1_init(&sha1_ctx);
    _mesa_sha1_update(&sha1_ctx, build_id_data(note), build_id_len);
-   _mesa_sha1_update(&sha1_ctx, &device->chipset_id,
-                     sizeof(device->chipset_id));
+   _mesa_sha1_update(&sha1_ctx, &device->info.chipset_id,
+                     sizeof(device->info.chipset_id));
    _mesa_sha1_update(&sha1_ctx, &device->always_use_bindless,
                      sizeof(device->always_use_bindless));
    _mesa_sha1_update(&sha1_ctx, &device->has_a64_buffer_access,
@@ -264,8 +264,8 @@ anv_physical_device_init_uuids(struct anv_physical_device *device)
     * some bits of ISL info to ensure that this is safe.
     */
    _mesa_sha1_init(&sha1_ctx);
-   _mesa_sha1_update(&sha1_ctx, &device->chipset_id,
-                     sizeof(device->chipset_id));
+   _mesa_sha1_update(&sha1_ctx, &device->info.chipset_id,
+                     sizeof(device->info.chipset_id));
    _mesa_sha1_update(&sha1_ctx, &device->isl_dev.has_bit6_swizzling,
                      sizeof(device->isl_dev.has_bit6_swizzling));
    _mesa_sha1_final(&sha1_ctx, sha1);
@@ -280,7 +280,7 @@ anv_physical_device_init_disk_cache(struct anv_physical_device *device)
 #ifdef ENABLE_SHADER_CACHE
    char renderer[10];
    ASSERTED int len = snprintf(renderer, sizeof(renderer), "anv_%04x",
-                                   device->chipset_id);
+                               device->info.chipset_id);
    assert(len == sizeof(renderer) - 2);
 
    char timestamp[41];
@@ -355,7 +355,6 @@ anv_physical_device_init(struct anv_physical_device *device,
       result = vk_error(VK_ERROR_INCOMPATIBLE_DRIVER);
       goto fail;
    }
-   device->chipset_id = device->info.chipset_id;
    device->no_hw = device->info.no_hw;
 
    if (getenv("INTEL_NO_HW") != NULL)
@@ -366,7 +365,7 @@ anv_physical_device_init(struct anv_physical_device *device,
    device->pci_info.device = drm_device->businfo.pci->dev;
    device->pci_info.function = drm_device->businfo.pci->func;
 
-   device->name = gen_get_device_name(device->chipset_id);
+   device->name = gen_get_device_name(device->info.chipset_id);
 
    if (device->info.is_haswell) {
       intel_logw("Haswell Vulkan support is incomplete");
@@ -1541,7 +1540,7 @@ void anv_GetPhysicalDeviceProperties(
       .apiVersion = anv_physical_device_api_version(pdevice),
       .driverVersion = vk_get_driver_version(),
       .vendorID = 0x8086,
-      .deviceID = pdevice->chipset_id,
+      .deviceID = pdevice->info.chipset_id,
       .deviceType = VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU,
       .limits = limits,
       .sparseProperties = {0}, /* Broadwell doesn't do sparse. */
@@ -2700,7 +2699,6 @@ VkResult anv_CreateDevice(
 
    device->_loader_data.loaderMagic = ICD_LOADER_MAGIC;
    device->physical = physical_device;
-   device->chipset_id = physical_device->chipset_id;
    device->no_hw = physical_device->no_hw;
    device->_lost = false;
 
index 1684198a2e0e183fecfec45ebd6a0412374c62ab..02bc832ceeb63297421c602a1dde6d91eae3d6a2 100644 (file)
@@ -485,7 +485,7 @@ anv_pipeline_cache_load(struct anv_pipeline_cache *cache,
       return;
    if (header.vendor_id != 0x8086)
       return;
-   if (header.device_id != device->chipset_id)
+   if (header.device_id != device->info.chipset_id)
       return;
    if (memcmp(header.uuid, pdevice->pipeline_cache_uuid, VK_UUID_SIZE) != 0)
       return;
@@ -566,7 +566,7 @@ VkResult anv_GetPipelineCacheData(
       .header_size = sizeof(struct cache_header),
       .header_version = VK_PIPELINE_CACHE_HEADER_VERSION_ONE,
       .vendor_id = 0x8086,
-      .device_id = device->chipset_id,
+      .device_id = device->info.chipset_id,
    };
    memcpy(header.uuid, device->physical->pipeline_cache_uuid, VK_UUID_SIZE);
    blob_write_bytes(&blob, &header, sizeof(header));
index 838f27dc45f2ef9a9c352ad701a0392ac7c8e59c..c083f0b30ff1cc587fce593e0206870adba92a45 100644 (file)
@@ -966,7 +966,6 @@ struct anv_physical_device {
     VK_LOADER_DATA                              _loader_data;
 
     struct anv_instance *                       instance;
-    uint32_t                                    chipset_id;
     bool                                        no_hw;
     char                                        path[20];
     const char *                                name;
@@ -1210,7 +1209,6 @@ struct anv_device {
     VkAllocationCallbacks                       alloc;
 
     struct anv_physical_device *                physical;
-    uint32_t                                    chipset_id;
     bool                                        no_hw;
     struct gen_device_info                      info;
     struct isl_device                           isl_dev;