mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-03 18:00:10 +01:00
amd/drm-shim: export a function that allows to select a different device
To be used by ACO tests. Need to remove gnu_symbol_visibility for exporting the symbol. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38536>
This commit is contained in:
parent
07b7de35cc
commit
b4121a30df
3 changed files with 26 additions and 5 deletions
|
|
@ -8,6 +8,7 @@
|
|||
#include <string.h>
|
||||
#include "amdgpu_devices.h"
|
||||
#include "common/amd_family.h"
|
||||
#include "drm-shim/amdgpu_noop_drm_shim.h"
|
||||
#include "drm-shim/drm_shim.h"
|
||||
#include "drm-uapi/amdgpu_drm.h"
|
||||
#include "util/log.h"
|
||||
|
|
@ -199,10 +200,9 @@ static ioctl_fn_t amdgpu_ioctls[] = {
|
|||
[DRM_AMDGPU_SCHED] = amdgpu_ioctl_noop,
|
||||
};
|
||||
|
||||
static void
|
||||
amdgpu_select_device()
|
||||
void
|
||||
drm_shim_amdgpu_select_device(const char *gpu_id)
|
||||
{
|
||||
const char *gpu_id = os_get_option("AMDGPU_GPU_ID");
|
||||
if (gpu_id) {
|
||||
for (uint32_t i = 0; i < num_amdgpu_devices; i++) {
|
||||
const struct amdgpu_device *dev = &amdgpu_devices[i];
|
||||
|
|
@ -224,7 +224,9 @@ amdgpu_select_device()
|
|||
void
|
||||
drm_shim_driver_init(void)
|
||||
{
|
||||
amdgpu_select_device();
|
||||
const char *gpu_id = os_get_option("AMDGPU_GPU_ID");
|
||||
|
||||
drm_shim_amdgpu_select_device(gpu_id);
|
||||
|
||||
shim_device.bus_type = DRM_BUS_PCI;
|
||||
shim_device.driver_name = "amdgpu";
|
||||
|
|
|
|||
20
src/amd/drm-shim/amdgpu_noop_drm_shim.h
Normal file
20
src/amd/drm-shim/amdgpu_noop_drm_shim.h
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
* Copyright 2025 Valve Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
#ifndef AMDGPU_NOOP_DRM_SHIM_H
|
||||
#define AMDGPU_NOOP_DRM_SHIM_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void drm_shim_amdgpu_select_device(const char *gpu_id);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
@ -15,7 +15,6 @@ libamdgpu_noop_drm_shim = shared_library(
|
|||
['amdgpu_noop_drm_shim.c', 'amdgpu_devices.c'],
|
||||
include_directories: [inc_include, inc_src, inc_amd],
|
||||
dependencies: dep_drm_shim,
|
||||
gnu_symbol_visibility : 'hidden',
|
||||
install : true,
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue