mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 04:48:08 +02:00
amd/virtio: fix amdgpu_sw_info_address_prt_wa_control_bit handling
Fixes: 60b406e233 ("ac/gpu_info: query the PRT workaround control bit from libdrm")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41381>
This commit is contained in:
parent
760ed3e888
commit
e3beb262bd
2 changed files with 10 additions and 7 deletions
|
|
@ -895,10 +895,8 @@ int ac_drm_query_sw_info(ac_drm_device *dev,
|
|||
enum amdgpu_sw_info info, void *value)
|
||||
{
|
||||
#ifdef HAVE_AMDGPU_VIRTIO
|
||||
if (dev->is_virtio) {
|
||||
assert(info == amdgpu_sw_info_address32_hi);
|
||||
if (dev->is_virtio)
|
||||
return amdvgpu_query_sw_info(dev->vdev, info, value);
|
||||
}
|
||||
#endif
|
||||
return amdgpu_query_sw_info(dev->adev, info, value);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
#include <libdrm/amdgpu.h>
|
||||
|
||||
#include "amdgpu_virtio_private.h"
|
||||
#include "drm-uapi/amdgpu_drm.h"
|
||||
|
||||
#include "util/log.h"
|
||||
#include "util/u_math.h"
|
||||
|
|
@ -48,10 +49,14 @@ amdvgpu_query_info(amdvgpu_device_handle dev, struct drm_amdgpu_info *info)
|
|||
int
|
||||
amdvgpu_query_sw_info(amdvgpu_device_handle dev, enum amdgpu_sw_info info, void *value)
|
||||
{
|
||||
if (info != amdgpu_sw_info_address32_hi)
|
||||
return -EINVAL;
|
||||
memcpy(value, &dev->vdev->caps.u.amdgpu.address32_hi, 4);
|
||||
return 0;
|
||||
if (info == amdgpu_sw_info_address32_hi) {
|
||||
memcpy(value, &dev->vdev->caps.u.amdgpu.address32_hi, 4);
|
||||
return 0;
|
||||
} else if (info == amdgpu_sw_info_address_prt_wa_control_bit) {
|
||||
return amdgpu_va_manager_query_sw_info(dev->va_mgr, amdgpu_va_manager_sw_info_address_prt_wa_control_bit, value);
|
||||
}
|
||||
assert(false);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue