[SWDEV-528647/SWDEV-528450] Reduce API load times and libdrm/libdrm_amdgpu dynamic loading (#333)

Changes:
- Removed libdrm/libdrm_amdgpu dependencies
- Added/updated new internal libdrm/libdrm_amdgpu/xf86drm APIs
  to allow our APIs to reference before dynamic loading
  the libdrm/libdrm_amdgpu libraries:
  1. amdgpu_drm.h to what's seen in mainline
  2. Added xf86drm.h to whats seen in mainline
- Modified internal DRM capabilities:
  1. Require each API to independently connect to libdrm/libdrm_amdgpu
     + validate API handles reponses accordingly
  2. Initialization of AMD SMI no longer has as strong of a tie to
     libdrm
- Updated internal implementations of several APIs which have
connections to libdrm/libdrm_amdgpu or APIs which have conflicts
with open libdrm/libdrm_amdgpu connections:
  1. amdsmi_init()
  2. amdsmi_get_gpu_vram_usage()
  3. amdsmi_get_gpu_asic_info()
  4. amdsmi_get_gpu_vram_info()
  5. amdsmi_get_gpu_vbios_info()
  6. amdsmi_get_gpu_driver_info()
  7. amdsmi_get_gpu_virtualization_mode()
  8. amdsmi_set_gpu_memory_partition()
  9. amdsmi_set_gpu_memory_partition_mode()
- Cleaned up effected tests/APIs

Change-Id: I96e2cf1b06b0cfee1b01a5e991ccc6116c4245a8
Tento commit je obsažen v:
Poag, Charis
2025-05-02 21:58:53 -05:00
odevzdal GitHub
rodič 757aa016f4
revize b5a43b7744
25 změnil soubory, kde provedl 2264 přidání a 629 odebrání
+5 -3
Zobrazit soubor
@@ -139,8 +139,9 @@ void TestIdInfoRead::Run(void) {
IF_VERB(STANDARD) {
std::cout << "\t**Device Vram type id: "
<< vram_info.vram_type << std::endl;
std::cout << "\t**Device Vram vendor id: "
<< vram_info.vram_vendor << std::endl;
std::cout << "\t**Device Vram vendor id: 0x"
<< std::hex << std::setw(4) << std::setfill('0') << vram_info.vram_vendor
<< " (" << std::dec << vram_info.vram_vendor << ")" << std::endl;
std::cout << "\t**Device Vram size: 0x"
<< std::hex << vram_info.vram_size
<< " (" << std::dec << vram_info.vram_size << ")"
@@ -242,7 +243,8 @@ void TestIdInfoRead::Run(void) {
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
amdsmi_virtualization_mode_t vmode;
err = amdsmi_get_gpu_virtualization_mode(processor_handles_[i], &vmode);
ASSERT_EQ(err, AMDSMI_STATUS_SUCCESS);
ASSERT_TRUE(err == AMDSMI_STATUS_SUCCESS ||
err == AMDSMI_STATUS_NOT_SUPPORTED);
IF_VERB(STANDARD) {
auto it = virtualization_mode_map.find(vmode);
if (it != virtualization_mode_map.end()) {