mirror of
https://github.com/torvalds/linux.git
synced 2026-11-13 05:04:29 +01:00
drm/xe: Engine class and instance into a u8
Pack the engine class and instance fields into a single u8 to save space in struct xe_pagefault. This also makes future extensions easier. Signed-off-by: Matthew Brost <matthew.brost@intel.com> Reviewed-by: Maciej Patelczyk <maciej.patelczyk@intel.com> Link: https://patch.msgid.link/20260806185202.3922432-7-matthew.brost@intel.com
This commit is contained in:
parent
b56f37907a
commit
24fca684c4
|
|
@ -89,8 +89,11 @@ int xe_guc_pagefault_handler(struct xe_guc *guc, u32 *msg, u32 len)
|
|||
FIELD_GET(PFD_FAULT_LEVEL, msg[0])) |
|
||||
FIELD_PREP(XE_PAGEFAULT_TYPE_MASK,
|
||||
FIELD_GET(PFD_FAULT_TYPE, msg[2]));
|
||||
pf.consumer.engine_class = FIELD_GET(PFD_ENG_CLASS, msg[0]);
|
||||
pf.consumer.engine_instance = FIELD_GET(PFD_ENG_INSTANCE, msg[0]);
|
||||
pf.consumer.engine_class_instance =
|
||||
FIELD_PREP(XE_PAGEFAULT_ENGINE_CLASS_MASK,
|
||||
FIELD_GET(PFD_ENG_CLASS, msg[0])) |
|
||||
FIELD_PREP(XE_PAGEFAULT_ENGINE_INSTANCE_MASK,
|
||||
FIELD_GET(PFD_ENG_INSTANCE, msg[0]));
|
||||
|
||||
pf.producer.private = guc;
|
||||
pf.producer.ops = &guc_pagefault_ops;
|
||||
|
|
|
|||
|
|
@ -239,13 +239,16 @@ static bool xe_pagefault_queue_pop(struct xe_pagefault_queue *pf_queue,
|
|||
|
||||
static void xe_pagefault_print(struct xe_pagefault *pf)
|
||||
{
|
||||
u8 engine_class = FIELD_GET(XE_PAGEFAULT_ENGINE_CLASS_MASK,
|
||||
pf->consumer.engine_class_instance);
|
||||
|
||||
xe_gt_info(pf->gt, "\n\tASID: %d\n"
|
||||
"\tFaulted Address: 0x%08x%08x\n"
|
||||
"\tFaultType: %lu\n"
|
||||
"\tAccessType: %lu\n"
|
||||
"\tFaultLevel: %lu\n"
|
||||
"\tEngineClass: %d %s\n"
|
||||
"\tEngineInstance: %d\n",
|
||||
"\tEngineInstance: %lu\n",
|
||||
pf->consumer.asid,
|
||||
upper_32_bits(pf->consumer.page_addr),
|
||||
lower_32_bits(pf->consumer.page_addr),
|
||||
|
|
@ -255,9 +258,10 @@ static void xe_pagefault_print(struct xe_pagefault *pf)
|
|||
pf->consumer.access_type),
|
||||
FIELD_GET(XE_PAGEFAULT_LEVEL_MASK,
|
||||
pf->consumer.fault_type_level),
|
||||
pf->consumer.engine_class,
|
||||
xe_hw_engine_class_to_str(pf->consumer.engine_class),
|
||||
pf->consumer.engine_instance);
|
||||
engine_class,
|
||||
xe_hw_engine_class_to_str(engine_class),
|
||||
FIELD_GET(XE_PAGEFAULT_ENGINE_INSTANCE_MASK,
|
||||
pf->consumer.engine_class_instance));
|
||||
}
|
||||
|
||||
static void xe_pagefault_save_to_vm(struct xe_device *xe, struct xe_pagefault *pf)
|
||||
|
|
|
|||
|
|
@ -82,10 +82,12 @@ struct xe_pagefault {
|
|||
#define XE_PAGEFAULT_TYPE_LEVEL_NACK 0xff /* Producer indicates nack fault */
|
||||
#define XE_PAGEFAULT_LEVEL_MASK GENMASK(3, 0)
|
||||
#define XE_PAGEFAULT_TYPE_MASK GENMASK(7, 4)
|
||||
/** @consumer.engine_class: engine class */
|
||||
u8 engine_class;
|
||||
/** @consumer.engine_instance: engine instance */
|
||||
u8 engine_instance;
|
||||
/** @consumer.engine_class_instance: engine class and instance */
|
||||
u8 engine_class_instance;
|
||||
#define XE_PAGEFAULT_ENGINE_CLASS_MASK GENMASK(3, 0)
|
||||
#define XE_PAGEFAULT_ENGINE_INSTANCE_MASK GENMASK(7, 4)
|
||||
/** @pad: alignment padding */
|
||||
u8 pad;
|
||||
/** @consumer.reserved: reserved bits for future expansion */
|
||||
u64 reserved;
|
||||
} consumer;
|
||||
|
|
|
|||
|
|
@ -615,10 +615,13 @@ void xe_vm_add_fault_entry_pf(struct xe_vm *vm, struct xe_pagefault *pf)
|
|||
{
|
||||
struct xe_vm_fault_entry *e;
|
||||
struct xe_hw_engine *hwe;
|
||||
u8 engine_class = FIELD_GET(XE_PAGEFAULT_ENGINE_CLASS_MASK,
|
||||
pf->consumer.engine_class_instance);
|
||||
u8 engine_instance = FIELD_GET(XE_PAGEFAULT_ENGINE_INSTANCE_MASK,
|
||||
pf->consumer.engine_class_instance);
|
||||
|
||||
/* Do not report faults on reserved engines */
|
||||
hwe = xe_gt_hw_engine(pf->gt, pf->consumer.engine_class,
|
||||
pf->consumer.engine_instance, false);
|
||||
hwe = xe_gt_hw_engine(pf->gt, engine_class, engine_instance, false);
|
||||
if (!hwe || xe_hw_engine_is_reserved(hwe))
|
||||
return;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user