[Mesa-dev] [PATCH 2/2] radv: drop entrypoint split out.

Dave Airlie airlied at gmail.com
Tue Oct 11 05:59:01 UTC 2016


From: Dave Airlie <airlied at redhat.com>

radv really doesn't need different dispatch per gen yet,
there really isn't that many differences yet.

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 src/amd/vulkan/radv_device_info.h      | 32 ----------------------------
 src/amd/vulkan/radv_entrypoints_gen.py | 38 ++--------------------------------
 src/amd/vulkan/radv_private.h          |  1 -
 3 files changed, 2 insertions(+), 69 deletions(-)
 delete mode 100644 src/amd/vulkan/radv_device_info.h

diff --git a/src/amd/vulkan/radv_device_info.h b/src/amd/vulkan/radv_device_info.h
deleted file mode 100644
index c38bd2a..0000000
--- a/src/amd/vulkan/radv_device_info.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright © 2016 Red Hat.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-
-#pragma once
-
-#include <amdgpu.h>
-
-#include "radv_radeon_winsys.h"
-struct radv_device_info {
-	uint32_t pci_id;
-	enum chip_class chip_class;
-};
diff --git a/src/amd/vulkan/radv_entrypoints_gen.py b/src/amd/vulkan/radv_entrypoints_gen.py
index e8ef8a4..d6c49ce 100644
--- a/src/amd/vulkan/radv_entrypoints_gen.py
+++ b/src/amd/vulkan/radv_entrypoints_gen.py
@@ -125,14 +125,9 @@ if opt_header:
     print "   };\n"
     print "};\n"
 
-    print "void radv_set_dispatch_devinfo(const struct radv_device_info *info);\n"
-
     for type, name, args, num, h in entrypoints:
         print_guard_start(name)
         print "%s radv_%s%s;" % (type, name, args)
-        print "%s vi_%s%s;" % (type, name, args)
-        print "%s cik_%s%s;" % (type, name, args)
-        print "%s si_%s%s;" % (type, name, args)
         print "%s radv_validate_%s%s;" % (type, name, args)
         print_guard_end(name)
     exit()
@@ -201,7 +196,7 @@ print """
  */
 """
 
-for layer in [ "radv", "validate", "si", "cik", "vi" ]:
+for layer in [ "radv", "validate" ]:
     for type, name, args, num, h in entrypoints:
         print_guard_start(name)
         print "%s %s_%s%s __attribute__ ((weak));" % (type, layer, name, args)
@@ -235,42 +230,13 @@ determine_validate(void)
       enable_validate = atoi(s);
 }
 
-static const struct radv_device_info *dispatch_devinfo;
-
-void
-radv_set_dispatch_devinfo(const struct radv_device_info *devinfo)
-{
-   dispatch_devinfo = devinfo;
-}
-
 void * __attribute__ ((noinline))
 radv_resolve_entrypoint(uint32_t index)
 {
    if (enable_validate && validate_layer.entrypoints[index])
       return validate_layer.entrypoints[index];
 
-   if (dispatch_devinfo == NULL) {
-      return radv_layer.entrypoints[index];
-   }
-
-   switch (dispatch_devinfo->chip_class) {
-   case VI:
-      if (vi_layer.entrypoints[index])
-         return vi_layer.entrypoints[index];
-      /* fall through */
-   case CIK:
-      if (cik_layer.entrypoints[index])
-         return cik_layer.entrypoints[index];
-      /* fall through */
-   case SI:
-      if (si_layer.entrypoints[index])
-         return si_layer.entrypoints[index];
-      /* fall through */
-   case 0:
-      return radv_layer.entrypoints[index];
-   default:
-      unreachable("unsupported gen\\n");
-   }
+   return radv_layer.entrypoints[index];
 }
 """
 
diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h
index a72b284..2c6b07c 100644
--- a/src/amd/vulkan/radv_private.h
+++ b/src/amd/vulkan/radv_private.h
@@ -44,7 +44,6 @@
 #endif
 
 #include <amdgpu.h>
-#include "radv_device_info.h"
 #include "compiler/shader_enums.h"
 #include "util/macros.h"
 #include "util/list.h"
-- 
2.5.5



More information about the mesa-dev mailing list