loader: always map the "amdgpu" kernel driver name to radeonsi (v2)
authorJiang, Sonny <Sonny.Jiang@amd.com>
Tue, 3 Sep 2019 22:33:57 +0000 (22:33 +0000)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 23 Sep 2019 19:14:11 +0000 (15:14 -0400)
v2: cleanup

Signed-off-by: Sonny Jiang <sonny.jiang@amd.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
src/loader/loader.c

index 6894c65114fe53d57a5604105f21062e69bc257e..a45328e246491881080c0c81ae8373a9d1b2ad71 100644 (file)
@@ -459,6 +459,15 @@ loader_get_driver_for_fd(int fd)
       return driver;
 #endif
 
+   driver = loader_get_kernel_driver_name(fd);
+   bool is_amdgpu = driver && strcmp(driver, "amdgpu") == 0;
+   free(driver);
+
+   if (is_amdgpu) {
+      driver = strdup("radeonsi");
+      goto out;
+   }
+
    if (!loader_get_pci_id_for_fd(fd, &vendor_id, &chip_id)) {
       driver = loader_get_kernel_driver_name(fd);
       if (driver)