Revert "ac: don't call ac_query_pci_bus_info from ac_query_gpu_info"
This reverts commit a48642400b
.
Instead, add a new parameter require_pci_bus_info to control the behavior.
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24759>
This commit is contained in:
@@ -547,7 +547,7 @@ static void set_custom_cu_en_mask(struct radeon_info *info)
|
||||
}
|
||||
}
|
||||
|
||||
bool ac_query_pci_bus_info(int fd, struct radeon_info *info)
|
||||
static bool ac_query_pci_bus_info(int fd, struct radeon_info *info)
|
||||
{
|
||||
drmDevicePtr devinfo;
|
||||
|
||||
@@ -568,7 +568,8 @@ bool ac_query_pci_bus_info(int fd, struct radeon_info *info)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ac_query_gpu_info(int fd, void *dev_p, struct radeon_info *info)
|
||||
bool ac_query_gpu_info(int fd, void *dev_p, struct radeon_info *info,
|
||||
bool require_pci_bus_info)
|
||||
{
|
||||
struct amdgpu_gpu_info amdinfo;
|
||||
struct drm_amdgpu_info_device device_info = {0};
|
||||
@@ -587,6 +588,11 @@ bool ac_query_gpu_info(int fd, void *dev_p, struct radeon_info *info)
|
||||
STATIC_ASSERT(AMDGPU_HW_IP_VCN_ENC == AMD_IP_VCN_ENC);
|
||||
STATIC_ASSERT(AMDGPU_HW_IP_VCN_JPEG == AMD_IP_VCN_JPEG);
|
||||
|
||||
if (!ac_query_pci_bus_info(fd, info)) {
|
||||
if (require_pci_bus_info)
|
||||
return false;
|
||||
}
|
||||
|
||||
assert(info->drm_major == 3);
|
||||
info->is_amdgpu = true;
|
||||
|
||||
|
@@ -274,8 +274,8 @@ struct radeon_info {
|
||||
bool has_fw_based_shadowing;
|
||||
};
|
||||
|
||||
bool ac_query_gpu_info(int fd, void *dev_p, struct radeon_info *info);
|
||||
bool ac_query_pci_bus_info(int fd, struct radeon_info *info);
|
||||
bool ac_query_gpu_info(int fd, void *dev_p, struct radeon_info *info,
|
||||
bool require_pci_bus_info);
|
||||
|
||||
void ac_compute_driver_uuid(char *uuid, size_t size);
|
||||
|
||||
|
@@ -42,7 +42,7 @@
|
||||
static bool
|
||||
do_winsys_init(struct radv_amdgpu_winsys *ws, int fd)
|
||||
{
|
||||
if (!ac_query_gpu_info(fd, ws->dev, &ws->info))
|
||||
if (!ac_query_gpu_info(fd, ws->dev, &ws->info, true))
|
||||
return false;
|
||||
|
||||
/*
|
||||
@@ -57,9 +57,6 @@ do_winsys_init(struct radv_amdgpu_winsys *ws, int fd)
|
||||
for (enum amd_ip_type ip_type = AMD_IP_UVD; ip_type <= AMD_IP_VCN_ENC; ip_type++)
|
||||
ws->info.max_submitted_ibs[ip_type] = 1;
|
||||
|
||||
if (!ac_query_pci_bus_info(fd, &ws->info))
|
||||
return false;
|
||||
|
||||
if (ws->info.drm_minor < 27) {
|
||||
fprintf(stderr, "radv/amdgpu: DRM 3.27+ is required (Linux kernel 4.20+)\n");
|
||||
return false;
|
||||
|
@@ -75,11 +75,9 @@ static bool do_winsys_init(struct amdgpu_winsys *ws,
|
||||
const struct pipe_screen_config *config,
|
||||
int fd)
|
||||
{
|
||||
if (!ac_query_gpu_info(fd, ws->dev, &ws->info))
|
||||
if (!ac_query_gpu_info(fd, ws->dev, &ws->info, false))
|
||||
goto fail;
|
||||
|
||||
ac_query_pci_bus_info(fd, &ws->info);
|
||||
|
||||
/* TODO: Enable this once the kernel handles it efficiently. */
|
||||
if (ws->info.has_dedicated_vram)
|
||||
ws->info.has_local_buffers = false;
|
||||
|
Reference in New Issue
Block a user