mirror of
https://github.com/torvalds/linux.git
synced 2026-05-26 08:02:27 +02:00
drm/xe: Introduce xe_device_uses_memirq()
Simplify some memirq usage scenarios and asserts in memirq infrastructure. Signed-off-by: Ilia Levi <ilia.levi@intel.com> Reviewed-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240918053942.1331811-3-illevi@habana.ai
This commit is contained in:
parent
b46afdac45
commit
6fa86e7ad4
|
|
@ -676,11 +676,9 @@ int xe_device_probe(struct xe_device *xe)
|
|||
err = xe_ggtt_init_early(tile->mem.ggtt);
|
||||
if (err)
|
||||
return err;
|
||||
if (IS_SRIOV_VF(xe)) {
|
||||
err = xe_memirq_init(&tile->sriov.vf.memirq);
|
||||
if (err)
|
||||
return err;
|
||||
}
|
||||
err = xe_memirq_init(&tile->sriov.vf.memirq);
|
||||
if (err)
|
||||
return err;
|
||||
}
|
||||
|
||||
for_each_gt(gt, xe, id) {
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
#include "xe_device_types.h"
|
||||
#include "xe_gt_types.h"
|
||||
#include "xe_sriov.h"
|
||||
|
||||
static inline struct xe_device *to_xe_device(const struct drm_device *dev)
|
||||
{
|
||||
|
|
@ -159,6 +160,11 @@ static inline bool xe_device_has_memirq(struct xe_device *xe)
|
|||
return GRAPHICS_VERx100(xe) >= 1250;
|
||||
}
|
||||
|
||||
static inline bool xe_device_uses_memirq(struct xe_device *xe)
|
||||
{
|
||||
return xe_device_has_memirq(xe) && IS_SRIOV_VF(xe);
|
||||
}
|
||||
|
||||
u32 xe_device_ccs_bytes(struct xe_device *xe, u64 size);
|
||||
|
||||
void xe_device_snapshot_print(struct xe_device *xe, struct drm_printer *p);
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ void xe_irq_enable_hwe(struct xe_gt *gt)
|
|||
u32 gsc_mask = 0;
|
||||
u32 heci_mask = 0;
|
||||
|
||||
if (IS_SRIOV_VF(xe) && xe_device_has_memirq(xe))
|
||||
if (xe_device_uses_memirq(xe))
|
||||
return;
|
||||
|
||||
if (xe_device_uc_enabled(xe)) {
|
||||
|
|
|
|||
|
|
@ -602,7 +602,7 @@ static void set_memory_based_intr(u32 *regs, struct xe_hw_engine *hwe)
|
|||
struct xe_memirq *memirq = >_to_tile(hwe->gt)->sriov.vf.memirq;
|
||||
struct xe_device *xe = gt_to_xe(hwe->gt);
|
||||
|
||||
if (!IS_SRIOV_VF(xe) || !xe_device_has_memirq(xe))
|
||||
if (!xe_device_uses_memirq(xe))
|
||||
return;
|
||||
|
||||
regs[CTX_LRM_INT_MASK_ENABLE] = MI_LOAD_REGISTER_MEM |
|
||||
|
|
|
|||
|
|
@ -200,9 +200,7 @@ int xe_memirq_init(struct xe_memirq *memirq)
|
|||
struct xe_device *xe = memirq_to_xe(memirq);
|
||||
int err;
|
||||
|
||||
memirq_assert(memirq, IS_SRIOV_VF(xe));
|
||||
|
||||
if (!xe_device_has_memirq(xe))
|
||||
if (!xe_device_uses_memirq(xe))
|
||||
return 0;
|
||||
|
||||
err = memirq_alloc_pages(memirq);
|
||||
|
|
@ -226,8 +224,7 @@ int xe_memirq_init(struct xe_memirq *memirq)
|
|||
*/
|
||||
u32 xe_memirq_source_ptr(struct xe_memirq *memirq)
|
||||
{
|
||||
memirq_assert(memirq, IS_SRIOV_VF(memirq_to_xe(memirq)));
|
||||
memirq_assert(memirq, xe_device_has_memirq(memirq_to_xe(memirq)));
|
||||
memirq_assert(memirq, xe_device_uses_memirq(memirq_to_xe(memirq)));
|
||||
memirq_assert(memirq, memirq->bo);
|
||||
|
||||
return xe_bo_ggtt_addr(memirq->bo) + XE_MEMIRQ_SOURCE_OFFSET;
|
||||
|
|
@ -244,8 +241,7 @@ u32 xe_memirq_source_ptr(struct xe_memirq *memirq)
|
|||
*/
|
||||
u32 xe_memirq_status_ptr(struct xe_memirq *memirq)
|
||||
{
|
||||
memirq_assert(memirq, IS_SRIOV_VF(memirq_to_xe(memirq)));
|
||||
memirq_assert(memirq, xe_device_has_memirq(memirq_to_xe(memirq)));
|
||||
memirq_assert(memirq, xe_device_uses_memirq(memirq_to_xe(memirq)));
|
||||
memirq_assert(memirq, memirq->bo);
|
||||
|
||||
return xe_bo_ggtt_addr(memirq->bo) + XE_MEMIRQ_STATUS_OFFSET;
|
||||
|
|
@ -262,8 +258,7 @@ u32 xe_memirq_status_ptr(struct xe_memirq *memirq)
|
|||
*/
|
||||
u32 xe_memirq_enable_ptr(struct xe_memirq *memirq)
|
||||
{
|
||||
memirq_assert(memirq, IS_SRIOV_VF(memirq_to_xe(memirq)));
|
||||
memirq_assert(memirq, xe_device_has_memirq(memirq_to_xe(memirq)));
|
||||
memirq_assert(memirq, xe_device_uses_memirq(memirq_to_xe(memirq)));
|
||||
memirq_assert(memirq, memirq->bo);
|
||||
|
||||
return xe_bo_ggtt_addr(memirq->bo) + XE_MEMIRQ_ENABLE_OFFSET;
|
||||
|
|
@ -289,8 +284,7 @@ int xe_memirq_init_guc(struct xe_memirq *memirq, struct xe_guc *guc)
|
|||
u32 source, status;
|
||||
int err;
|
||||
|
||||
memirq_assert(memirq, IS_SRIOV_VF(memirq_to_xe(memirq)));
|
||||
memirq_assert(memirq, xe_device_has_memirq(memirq_to_xe(memirq)));
|
||||
memirq_assert(memirq, xe_device_uses_memirq(memirq_to_xe(memirq)));
|
||||
memirq_assert(memirq, memirq->bo);
|
||||
|
||||
source = xe_memirq_source_ptr(memirq) + offset;
|
||||
|
|
@ -325,8 +319,7 @@ int xe_memirq_init_guc(struct xe_memirq *memirq, struct xe_guc *guc)
|
|||
*/
|
||||
void xe_memirq_reset(struct xe_memirq *memirq)
|
||||
{
|
||||
memirq_assert(memirq, IS_SRIOV_VF(memirq_to_xe(memirq)));
|
||||
memirq_assert(memirq, xe_device_has_memirq(memirq_to_xe(memirq)));
|
||||
memirq_assert(memirq, xe_device_uses_memirq(memirq_to_xe(memirq)));
|
||||
|
||||
if (memirq->bo)
|
||||
memirq_set_enable(memirq, false);
|
||||
|
|
@ -343,8 +336,7 @@ void xe_memirq_reset(struct xe_memirq *memirq)
|
|||
*/
|
||||
void xe_memirq_postinstall(struct xe_memirq *memirq)
|
||||
{
|
||||
memirq_assert(memirq, IS_SRIOV_VF(memirq_to_xe(memirq)));
|
||||
memirq_assert(memirq, xe_device_has_memirq(memirq_to_xe(memirq)));
|
||||
memirq_assert(memirq, xe_device_uses_memirq(memirq_to_xe(memirq)));
|
||||
|
||||
if (memirq->bo)
|
||||
memirq_set_enable(memirq, true);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user