Merge tag 'rtc-6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux
[linux-block.git] / drivers / gpu / drm / xe / xe_pt.h
CommitLineData
dd08ebf6
MB
1/* SPDX-License-Identifier: MIT */
2/*
3 * Copyright © 2022 Intel Corporation
4 */
5#ifndef _XE_PT_H_
6#define _XE_PT_H_
7
8#include <linux/types.h>
9
10#include "xe_pt_types.h"
11
12struct dma_fence;
13struct xe_bo;
14struct xe_device;
9b9529ce 15struct xe_exec_queue;
dd08ebf6 16struct xe_sync_entry;
876611c2 17struct xe_tile;
dd08ebf6
MB
18struct xe_vm;
19struct xe_vma;
20
e84d716d
TH
21/* Largest huge pte is currently 1GiB. May become device dependent. */
22#define MAX_HUGEPTE_LEVEL 2
23
dd08ebf6
MB
24#define xe_pt_write(xe, map, idx, data) \
25 xe_map_wr(xe, map, (idx) * sizeof(u64), u64, data)
26
27unsigned int xe_pt_shift(unsigned int level);
28
876611c2 29struct xe_pt *xe_pt_create(struct xe_vm *vm, struct xe_tile *tile,
dd08ebf6
MB
30 unsigned int level);
31
876611c2 32void xe_pt_populate_empty(struct xe_tile *tile, struct xe_vm *vm,
dd08ebf6
MB
33 struct xe_pt *pt);
34
35void xe_pt_destroy(struct xe_pt *pt, u32 flags, struct llist_head *deferred);
36
37struct dma_fence *
9b9529ce 38__xe_pt_bind_vma(struct xe_tile *tile, struct xe_vma *vma, struct xe_exec_queue *q,
dd08ebf6
MB
39 struct xe_sync_entry *syncs, u32 num_syncs,
40 bool rebind);
41
42struct dma_fence *
9b9529ce 43__xe_pt_unbind_vma(struct xe_tile *tile, struct xe_vma *vma, struct xe_exec_queue *q,
dd08ebf6
MB
44 struct xe_sync_entry *syncs, u32 num_syncs);
45
876611c2 46bool xe_pt_zap_ptes(struct xe_tile *tile, struct xe_vma *vma);
dd08ebf6 47
dd08ebf6 48#endif