linux/drivers/gpu/drm/xe/xe_gt_pagefault.c

// SPDX-License-Identifier: MIT
/*
 * Copyright © 2022 Intel Corporation
 */

#include "xe_gt_pagefault.h"

#include <linux/bitfield.h>
#include <linux/circ_buf.h>

#include <drm/drm_exec.h>
#include <drm/drm_managed.h>
#include <drm/ttm/ttm_execbuf_util.h>

#include "abi/guc_actions_abi.h"
#include "xe_bo.h"
#include "xe_gt.h"
#include "xe_gt_tlb_invalidation.h"
#include "xe_guc.h"
#include "xe_guc_ct.h"
#include "xe_migrate.h"
#include "xe_trace_bo.h"
#include "xe_vm.h"

struct pagefault {};

enum access_type {};

enum fault_type {};

struct acc {};

static bool access_is_atomic(enum access_type access_type)
{}

static bool vma_is_valid(struct xe_tile *tile, struct xe_vma *vma)
{}

static bool vma_matches(struct xe_vma *vma, u64 page_addr)
{}

static struct xe_vma *lookup_vma(struct xe_vm *vm, u64 page_addr)
{}

static int xe_pf_begin(struct drm_exec *exec, struct xe_vma *vma,
		       bool atomic, unsigned int id)
{}

static int handle_vma_pagefault(struct xe_tile *tile, struct pagefault *pf,
				struct xe_vma *vma)
{}

static int handle_pagefault(struct xe_gt *gt, struct pagefault *pf)
{}

static int send_pagefault_reply(struct xe_guc *guc,
				struct xe_guc_pagefault_reply *reply)
{}

static void print_pagefault(struct xe_device *xe, struct pagefault *pf)
{}

#define PF_MSG_LEN_DW

static bool get_pagefault(struct pf_queue *pf_queue, struct pagefault *pf)
{}

static bool pf_queue_full(struct pf_queue *pf_queue)
{}

int xe_guc_pagefault_handler(struct xe_guc *guc, u32 *msg, u32 len)
{}

#define USM_QUEUE_MAX_RUNTIME_MS

static void pf_queue_work_func(struct work_struct *w)
{}

static void acc_queue_work_func(struct work_struct *w);

int xe_gt_pagefault_init(struct xe_gt *gt)
{}

void xe_gt_pagefault_reset(struct xe_gt *gt)
{}

static int granularity_in_byte(int val)
{}

static int sub_granularity_in_byte(int val)
{}

static void print_acc(struct xe_device *xe, struct acc *acc)
{}

static struct xe_vma *get_acc_vma(struct xe_vm *vm, struct acc *acc)
{}

static int handle_acc(struct xe_gt *gt, struct acc *acc)
{}

#define make_u64(hi__, low__)

#define ACC_MSG_LEN_DW

static bool get_acc(struct acc_queue *acc_queue, struct acc *acc)
{}

static void acc_queue_work_func(struct work_struct *w)
{}

static bool acc_queue_full(struct acc_queue *acc_queue)
{}

int xe_guc_access_counter_notify_handler(struct xe_guc *guc, u32 *msg, u32 len)
{}