Lines Matching +full:disable +full:- +full:report +full:- +full:mask
1 // SPDX-License-Identifier: MIT
46 * MMIO register based interrupts infrastructure used for non-virtualized mode
47 * or SRIOV-8 (which supports 8 Virtual Functions) does not scale efficiently
55 * be mapped to system memory and must be marked as un-cacheable (UC) on
64 * called "page" in the specs, even if they aren't page-sized or aligned.
70 * - _`Interrupt Status Report Page`: this page contains the interrupt
78 * - _`Interrupt Source Report Page`: this is the equivalent of the
83 * - Interrupt Mask: the HW needs a location to fetch the interrupt
84 * mask vector to be used by the LRM in the context, so we just use
89 * 0x0000 +===========+ <== Interrupt Status Report Page
91 * | | ____ +----+----------------+
93 * +-----------+ __/ | 1 | |
95 * +-----------+ \ | | WAIT SEMAPHORE |
97 * | | +----+----------------+
99 * 0x0400 +===========+ <== Interrupt Source Report Page
104 * 0x0440 +===========+ <== Interrupt Enable Mask
107 * +-----------+
141 memirq_assert(memirq, !memirq->bo); in memirq_alloc_pages()
143 iosys_map_memset(&bo->vmap, 0, 0, SZ_4K); in memirq_alloc_pages()
145 memirq->bo = bo; in memirq_alloc_pages()
146 memirq->source = IOSYS_MAP_INIT_OFFSET(&bo->vmap, XE_MEMIRQ_SOURCE_OFFSET); in memirq_alloc_pages()
147 memirq->status = IOSYS_MAP_INIT_OFFSET(&bo->vmap, XE_MEMIRQ_STATUS_OFFSET); in memirq_alloc_pages()
148 memirq->mask = IOSYS_MAP_INIT_OFFSET(&bo->vmap, XE_MEMIRQ_ENABLE_OFFSET); in memirq_alloc_pages()
150 memirq_assert(memirq, !memirq->source.is_iomem); in memirq_alloc_pages()
151 memirq_assert(memirq, !memirq->status.is_iomem); in memirq_alloc_pages()
152 memirq_assert(memirq, !memirq->mask.is_iomem); in memirq_alloc_pages()
157 return drmm_add_action_or_reset(&xe->drm, __release_xe_bo, memirq->bo); in memirq_alloc_pages()
167 iosys_map_wr(&memirq->mask, 0, u32, enable ? GENMASK(15, 0) : 0); in memirq_set_enable()
169 memirq->enabled = enable; in memirq_set_enable()
173 * xe_memirq_init - Initialize data used by `Memory Based Interrupts`_.
176 * Allocate `Interrupt Source Report Page`_ and `Interrupt Status Report Page`_
209 * xe_memirq_source_ptr - Get GGTT's offset of the `Interrupt Source Report Page`_.
215 * Return: GGTT's offset of the `Interrupt Source Report Page`_.
221 memirq_assert(memirq, memirq->bo); in xe_memirq_source_ptr()
223 return xe_bo_ggtt_addr(memirq->bo) + XE_MEMIRQ_SOURCE_OFFSET; in xe_memirq_source_ptr()
227 * xe_memirq_status_ptr - Get GGTT's offset of the `Interrupt Status Report Page`_.
233 * Return: GGTT's offset of the `Interrupt Status Report Page`_.
239 memirq_assert(memirq, memirq->bo); in xe_memirq_status_ptr()
241 return xe_bo_ggtt_addr(memirq->bo) + XE_MEMIRQ_STATUS_OFFSET; in xe_memirq_status_ptr()
245 * xe_memirq_enable_ptr - Get GGTT's offset of the Interrupt Enable Mask.
251 * Return: GGTT's offset of the Interrupt Enable Mask.
257 memirq_assert(memirq, memirq->bo); in xe_memirq_enable_ptr()
259 return xe_bo_ggtt_addr(memirq->bo) + XE_MEMIRQ_ENABLE_OFFSET; in xe_memirq_enable_ptr()
263 * xe_memirq_init_guc - Prepare GuC for `Memory Based Interrupts`_.
267 * Register `Interrupt Source Report Page`_ and `Interrupt Status Report Page`_
284 memirq_assert(memirq, memirq->bo); in xe_memirq_init_guc()
303 "Failed to setup report pages in %s (%pe)\n", in xe_memirq_init_guc()
309 * xe_memirq_reset - Disable processing of `Memory Based Interrupts`_.
322 if (memirq->bo) in xe_memirq_reset()
327 * xe_memirq_postinstall - Enable processing of `Memory Based Interrupts`_.
340 if (memirq->bo) in xe_memirq_postinstall()
364 memirq_debug(memirq, "STATUS %s %*ph\n", hwe->name, 16, status->vaddr); in memirq_dispatch_engine()
366 if (memirq_received(memirq, status, ilog2(GT_RENDER_USER_INTERRUPT), hwe->name)) in memirq_dispatch_engine()
375 memirq_debug(memirq, "STATUS %s %*ph\n", name, 16, status->vaddr); in memirq_dispatch_guc()
382 * xe_memirq_handler - The `Memory Based Interrupts`_ Handler.
397 if (!memirq->bo) in xe_memirq_handler()
400 memirq_assert(memirq, !memirq->source.is_iomem); in xe_memirq_handler()
401 memirq_debug(memirq, "SOURCE %*ph\n", 32, memirq->source.vaddr); in xe_memirq_handler()
402 memirq_debug(memirq, "SOURCE %*ph\n", 32, memirq->source.vaddr + 32); in xe_memirq_handler()
405 if (gt->tile != tile) in xe_memirq_handler()
409 if (memirq_received(memirq, &memirq->source, hwe->irq_offset, "SRC")) { in xe_memirq_handler()
410 map = IOSYS_MAP_INIT_OFFSET(&memirq->status, in xe_memirq_handler()
411 hwe->irq_offset * SZ_16); in xe_memirq_handler()
419 if (memirq_received(memirq, &memirq->source, ilog2(INTR_GUC), "SRC")) { in xe_memirq_handler()
420 map = IOSYS_MAP_INIT_OFFSET(&memirq->status, ilog2(INTR_GUC) * SZ_16); in xe_memirq_handler()
421 memirq_dispatch_guc(memirq, &map, &tile->primary_gt->uc.guc); in xe_memirq_handler()
424 if (!tile->media_gt) in xe_memirq_handler()
427 if (memirq_received(memirq, &memirq->source, ilog2(INTR_MGUC), "SRC")) { in xe_memirq_handler()
428 map = IOSYS_MAP_INIT_OFFSET(&memirq->status, ilog2(INTR_MGUC) * SZ_16); in xe_memirq_handler()
429 memirq_dispatch_guc(memirq, &map, &tile->media_gt->uc.guc); in xe_memirq_handler()