Lines Matching +full:cs +full:- +full:x
1 // SPDX-License-Identifier: GPL-2.0
25 return *a - *b; in cmp_u64()
34 static u32 *emit_wait(u32 *cs, u32 offset, int op, u32 value) in emit_wait() argument
36 *cs++ = MI_SEMAPHORE_WAIT | in emit_wait()
40 *cs++ = value; in emit_wait()
41 *cs++ = offset; in emit_wait()
42 *cs++ = 0; in emit_wait()
44 return cs; in emit_wait()
47 static u32 *emit_store(u32 *cs, u32 offset, u32 value) in emit_store() argument
49 *cs++ = MI_STORE_DWORD_IMM_GEN4 | MI_USE_GGTT; in emit_store()
50 *cs++ = offset; in emit_store()
51 *cs++ = 0; in emit_store()
52 *cs++ = value; in emit_store()
54 return cs; in emit_store()
57 static u32 *emit_srm(u32 *cs, i915_reg_t reg, u32 offset) in emit_srm() argument
59 *cs++ = MI_STORE_REGISTER_MEM_GEN8 | MI_USE_GGTT; in emit_srm()
60 *cs++ = i915_mmio_reg_offset(reg); in emit_srm()
61 *cs++ = offset; in emit_srm()
62 *cs++ = 0; in emit_srm()
64 return cs; in emit_srm()
67 static void write_semaphore(u32 *x, u32 value) in write_semaphore() argument
69 WRITE_ONCE(*x, value); in write_semaphore()
76 struct intel_engine_cs *engine = ce->engine; in __measure_timestamps()
77 u32 *sema = memset32(engine->status_page.addr + 1000, 0, 5); in __measure_timestamps()
78 u32 offset = i915_ggtt_offset(engine->status_page.vma); in __measure_timestamps()
80 u32 *cs; in __measure_timestamps() local
86 cs = intel_ring_begin(rq, 28); in __measure_timestamps()
87 if (IS_ERR(cs)) { in __measure_timestamps()
89 return PTR_ERR(cs); in __measure_timestamps()
93 cs = emit_store(cs, offset + 4008, 1); in __measure_timestamps()
94 cs = emit_wait(cs, offset + 4008, MI_SEMAPHORE_SAD_NEQ_SDD, 1); in __measure_timestamps()
96 cs = emit_srm(cs, RING_TIMESTAMP(engine->mmio_base), offset + 4000); in __measure_timestamps()
97 cs = emit_srm(cs, RING_CTX_TIMESTAMP(engine->mmio_base), offset + 4004); in __measure_timestamps()
100 cs = emit_wait(cs, offset + 4008, MI_SEMAPHORE_SAD_EQ_SDD, 1); in __measure_timestamps()
102 cs = emit_srm(cs, RING_TIMESTAMP(engine->mmio_base), offset + 4016); in __measure_timestamps()
103 cs = emit_srm(cs, RING_CTX_TIMESTAMP(engine->mmio_base), offset + 4012); in __measure_timestamps()
105 intel_ring_advance(rq, cs); in __measure_timestamps()
121 *dt = local_clock() - *dt; in __measure_timestamps()
127 return -ETIME; in __measure_timestamps()
131 pr_debug("%s CTX_TIMESTAMP: [%x, %x], RING_TIMESTAMP: [%x, %x]\n", in __measure_timestamps()
132 engine->name, sema[1], sema[3], sema[0], sema[4]); in __measure_timestamps()
134 *d_ctx = sema[3] - sema[1]; in __measure_timestamps()
135 *d_ring = sema[4] - sema[0]; in __measure_timestamps()
163 engine->name, dt, in __live_engine_timestamps()
164 intel_gt_clock_interval_to_ns(engine->gt, d_ctx), in __live_engine_timestamps()
165 intel_gt_clock_interval_to_ns(engine->gt, d_ring)); in __live_engine_timestamps()
167 d_ring = intel_gt_clock_interval_to_ns(engine->gt, d_ring); in __live_engine_timestamps()
170 engine->name); in __live_engine_timestamps()
171 return -EINVAL; in __live_engine_timestamps()
177 d_ctx *= engine->gt->clock_frequency; in __live_engine_timestamps()
178 if (GRAPHICS_VER(engine->i915) == 11) in __live_engine_timestamps()
181 d_ring *= engine->gt->clock_frequency; in __live_engine_timestamps()
185 engine->name); in __live_engine_timestamps()
186 return -EINVAL; in __live_engine_timestamps()
200 * the same CS clock. in live_engine_timestamps()
203 if (GRAPHICS_VER(gt->i915) < 8) in live_engine_timestamps()
233 dt = ktime_get() - start; in __spin_until_busier()
237 return -ETIME; in __spin_until_busier()
253 * Check that if an engine supports busy-stats, they tell the truth. in live_engine_busy_stats()
257 return -ENOMEM; in live_engine_busy_stats()
273 err = -EBUSY; in live_engine_busy_stats()
288 engine->name, in live_engine_busy_stats()
291 err = -EINVAL; in live_engine_busy_stats()
297 engine->kernel_context, in live_engine_busy_stats()
307 intel_gt_set_wedged(engine->gt); in live_engine_busy_stats()
308 err = -ETIME; in live_engine_busy_stats()
327 engine->name, in live_engine_busy_stats()
330 err = -EINVAL; in live_engine_busy_stats()
337 if (igt_flush_test(gt->i915)) in live_engine_busy_stats()
338 err = -EIO; in live_engine_busy_stats()
344 if (igt_flush_test(gt->i915)) in live_engine_busy_stats()
345 err = -EIO; in live_engine_busy_stats()
362 return -EBUSY; in live_engine_pm()
369 for (p = igt_atomic_phases; p->name; p++) { in live_engine_pm()
387 p->critical_section_begin(); in live_engine_pm()
390 engine->name, p->name); in live_engine_pm()
394 p->critical_section_end(); in live_engine_pm()
400 engine->name); in live_engine_pm()
401 return -EINVAL; in live_engine_pm()
407 return -EINVAL; in live_engine_pm()