mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-06-18 17:18:30 +02:00
anv: Add function to get the list of page faults
Adds function to get the list of page faults, returns NULL if the KMD is too old or if there was an error retrieving the data. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41318>
This commit is contained in:
parent
39a0d76f64
commit
249c227fa4
5 changed files with 33 additions and 1 deletions
|
|
@ -2472,3 +2472,16 @@ anv_device_get_pat_entry(struct anv_device *device,
|
|||
else
|
||||
return &device->info->pat.writecombining;
|
||||
}
|
||||
|
||||
struct intel_pagefault_buffer *
|
||||
anv_device_alloc_get_vm_faults(struct anv_device *device)
|
||||
{
|
||||
if (!device->physical->can_get_vm_faults)
|
||||
return NULL;
|
||||
switch (device->info->kmd_type) {
|
||||
case INTEL_KMD_TYPE_XE:
|
||||
return anv_xe_device_alloc_get_vm_faults(device);
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
|
||||
#include "common/intel_common.h"
|
||||
#include "common/intel_uuid.h"
|
||||
#include "common/xe/intel_gem.h"
|
||||
#include "common/xe/intel_queue.h"
|
||||
|
||||
#include "perf/intel_perf.h"
|
||||
|
|
@ -2977,6 +2978,9 @@ anv_physical_device_try_create(struct vk_instance *vk_instance,
|
|||
device->info.ver < 20 || device->info.kmd_type == INTEL_KMD_TYPE_I915 ||
|
||||
instance->drirc.features.scratch_page;
|
||||
|
||||
device->can_get_vm_faults =
|
||||
!device->has_scratch_page && xe_gem_supports_get_vm_faults(device->local_fd);
|
||||
|
||||
device->compiler = brw_compiler_create(NULL, &device->info);
|
||||
if (device->compiler == NULL) {
|
||||
result = vk_error(instance, VK_ERROR_OUT_OF_HOST_MEMORY);
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@
|
|||
#include "common/intel_l3_config.h"
|
||||
#include "common/intel_measure.h"
|
||||
#include "common/intel_sample_positions.h"
|
||||
#include "common/intel_pagefault.h"
|
||||
#include "decoder/intel_decoder.h"
|
||||
#include "dev/intel_device_info.h"
|
||||
#include "blorp/blorp.h"
|
||||
|
|
@ -1553,6 +1554,8 @@ struct anv_physical_device {
|
|||
|
||||
bool has_scratch_page;
|
||||
|
||||
bool can_get_vm_faults;
|
||||
|
||||
/** Whether the device can support compression control */
|
||||
bool has_compression_control;
|
||||
/** Whether the device expose support for compression control */
|
||||
|
|
@ -7150,6 +7153,8 @@ anv_device_utrace_emit_gfx_copy_buffer(struct u_trace_context *utctx,
|
|||
void *ts_from, uint64_t from_offset_B,
|
||||
void *ts_to, uint64_t to_offset_B,
|
||||
uint64_t size_B);
|
||||
struct intel_pagefault_buffer *
|
||||
anv_device_alloc_get_vm_faults(struct anv_device *device);
|
||||
|
||||
void
|
||||
anv_device_update_fault_state(struct anv_device *device,
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
#include "drm-uapi/xe_drm.h"
|
||||
|
||||
#include "common/xe/intel_device_query.h"
|
||||
#include "common/xe/intel_gem.h"
|
||||
|
||||
bool anv_xe_device_destroy_vm(struct anv_device *device)
|
||||
{
|
||||
|
|
@ -227,3 +228,9 @@ anv_xe_device_check_status(struct vk_device *vk_device)
|
|||
|
||||
return result;
|
||||
}
|
||||
|
||||
struct intel_pagefault_buffer *
|
||||
anv_xe_device_alloc_get_vm_faults(struct anv_device *device)
|
||||
{
|
||||
return xe_gem_alloc_get_vm_faults(device->fd, device->vm_id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,13 +27,16 @@
|
|||
#include "vulkan/vulkan_core.h"
|
||||
#include "vk_device.h"
|
||||
|
||||
#include "common/intel_pagefault.h"
|
||||
|
||||
struct anv_device;
|
||||
struct anv_physical_device;
|
||||
|
||||
bool anv_xe_device_destroy_vm(struct anv_device *device);
|
||||
VkResult anv_xe_device_setup_vm(struct anv_device *device);
|
||||
VkResult anv_xe_device_check_status(struct vk_device *vk_device);
|
||||
|
||||
struct intel_pagefault_buffer *
|
||||
anv_xe_device_alloc_get_vm_faults(struct anv_device *device);
|
||||
VkResult
|
||||
anv_xe_physical_device_get_parameters(struct anv_physical_device *device);
|
||||
VkResult
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue