|
14 | 14 | #include "abi/guc_actions_abi.h"
|
15 | 15 | #include "xe_bo.h"
|
16 | 16 | #include "xe_gt.h"
|
| 17 | +#include "xe_gt_stats.h" |
17 | 18 | #include "xe_gt_tlb_invalidation.h"
|
18 | 19 | #include "xe_guc.h"
|
19 | 20 | #include "xe_guc_ct.h"
|
@@ -124,16 +125,20 @@ static int xe_pf_begin(struct drm_exec *exec, struct xe_vma *vma,
|
124 | 125 | return 0;
|
125 | 126 | }
|
126 | 127 |
|
127 |
| -static int handle_vma_pagefault(struct xe_tile *tile, struct pagefault *pf, |
| 128 | +static int handle_vma_pagefault(struct xe_gt *gt, struct pagefault *pf, |
128 | 129 | struct xe_vma *vma)
|
129 | 130 | {
|
130 | 131 | struct xe_vm *vm = xe_vma_vm(vma);
|
| 132 | + struct xe_tile *tile = gt_to_tile(gt); |
131 | 133 | struct drm_exec exec;
|
132 | 134 | struct dma_fence *fence;
|
133 | 135 | ktime_t end = 0;
|
134 | 136 | int err;
|
135 | 137 | bool atomic;
|
136 | 138 |
|
| 139 | + xe_gt_stats_incr(gt, XE_GT_STATS_ID_VMA_PAGEFAULT_COUNT, 1); |
| 140 | + xe_gt_stats_incr(gt, XE_GT_STATS_ID_VMA_PAGEFAULT_BYTES, xe_vma_size(vma)); |
| 141 | + |
137 | 142 | trace_xe_vma_pagefault(vma);
|
138 | 143 | atomic = access_is_atomic(pf->access_type);
|
139 | 144 |
|
@@ -202,7 +207,6 @@ static struct xe_vm *asid_to_vm(struct xe_device *xe, u32 asid)
|
202 | 207 | static int handle_pagefault(struct xe_gt *gt, struct pagefault *pf)
|
203 | 208 | {
|
204 | 209 | struct xe_device *xe = gt_to_xe(gt);
|
205 |
| - struct xe_tile *tile = gt_to_tile(gt); |
206 | 210 | struct xe_vm *vm;
|
207 | 211 | struct xe_vma *vma = NULL;
|
208 | 212 | int err;
|
@@ -231,7 +235,7 @@ static int handle_pagefault(struct xe_gt *gt, struct pagefault *pf)
|
231 | 235 | goto unlock_vm;
|
232 | 236 | }
|
233 | 237 |
|
234 |
| - err = handle_vma_pagefault(tile, pf, vma); |
| 238 | + err = handle_vma_pagefault(gt, pf, vma); |
235 | 239 |
|
236 | 240 | unlock_vm:
|
237 | 241 | if (!err)
|
|
0 commit comments