Mesa (master): anv: Drop separate chipset_id fields

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jan 20 22:25:53 UTC 2020


Module: Mesa
Branch: master
Commit: 3ecfba388a01d5ceb32fdd8122c5cf14e174aa3c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=3ecfba388a01d5ceb32fdd8122c5cf14e174aa3c

Author: Jason Ekstrand <jason at jlekstrand.net>
Date:   Fri Jan 17 23:45:31 2020 -0600

anv: Drop separate chipset_id fields

This already exists in gen_device_info.  There's no reason to keep
duplicate copies.

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

---

 src/intel/vulkan/anv_device.c         | 16 +++++++---------
 src/intel/vulkan/anv_pipeline_cache.c |  4 ++--
 src/intel/vulkan/anv_private.h        |  2 --
 3 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
index 6d7c7ad3c97..b0ff56aa801 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -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;
 
diff --git a/src/intel/vulkan/anv_pipeline_cache.c b/src/intel/vulkan/anv_pipeline_cache.c
index 1684198a2e0..02bc832ceeb 100644
--- a/src/intel/vulkan/anv_pipeline_cache.c
+++ b/src/intel/vulkan/anv_pipeline_cache.c
@@ -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));
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h
index 838f27dc45f..c083f0b30ff 100644
--- a/src/intel/vulkan/anv_private.h
+++ b/src/intel/vulkan/anv_private.h
@@ -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;



More information about the mesa-commit mailing list