#include "xe_query.h"
#include <linux/nospec.h>
#include <linux/sched/clock.h>
#include <drm/ttm/ttm_placement.h>
#include <drm/xe_drm.h>
#include "regs/xe_engine_regs.h"
#include "regs/xe_gt_regs.h"
#include "xe_bo.h"
#include "xe_device.h"
#include "xe_exec_queue.h"
#include "xe_force_wake.h"
#include "xe_ggtt.h"
#include "xe_gt.h"
#include "xe_guc_hwconfig.h"
#include "xe_macros.h"
#include "xe_mmio.h"
#include "xe_ttm_vram_mgr.h"
static const u16 xe_to_user_engine_class[] = …;
static const enum xe_engine_class user_to_xe_engine_class[] = …;
static size_t calc_hw_engine_info_size(struct xe_device *xe)
{ … }
__ktime_func_t;
static __ktime_func_t __clock_id_to_func(clockid_t clk_id)
{ … }
static void
__read_timestamps(struct xe_gt *gt,
struct xe_reg lower_reg,
struct xe_reg upper_reg,
u64 *engine_ts,
u64 *cpu_ts,
u64 *cpu_delta,
__ktime_func_t cpu_clock)
{ … }
static int
query_engine_cycles(struct xe_device *xe,
struct drm_xe_device_query *query)
{ … }
static int query_engines(struct xe_device *xe,
struct drm_xe_device_query *query)
{ … }
static size_t calc_mem_regions_size(struct xe_device *xe)
{ … }
static int query_mem_regions(struct xe_device *xe,
struct drm_xe_device_query *query)
{ … }
static int query_config(struct xe_device *xe, struct drm_xe_device_query *query)
{ … }
static int query_gt_list(struct xe_device *xe, struct drm_xe_device_query *query)
{ … }
static int query_hwconfig(struct xe_device *xe,
struct drm_xe_device_query *query)
{ … }
static size_t calc_topo_query_size(struct xe_device *xe)
{ … }
static int copy_mask(void __user **ptr,
struct drm_xe_query_topology_mask *topo,
void *mask, size_t mask_size)
{ … }
static int query_gt_topology(struct xe_device *xe,
struct drm_xe_device_query *query)
{ … }
static int
query_uc_fw_version(struct xe_device *xe, struct drm_xe_device_query *query)
{ … }
static size_t calc_oa_unit_query_size(struct xe_device *xe)
{ … }
static int query_oa_units(struct xe_device *xe,
struct drm_xe_device_query *query)
{ … }
static int (* const xe_query_funcs[])(struct xe_device *xe,
struct drm_xe_device_query *query) = …;
int xe_query_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
{ … }