mirror of
https://github.com/torvalds/linux.git
synced 2024-11-24 21:21:41 +00:00
drm/xe: Add helper to return any available hw engine
Get the first available engine from a gt, which helps in the case any engine serves as a context, like when reading RING_TIMESTAMP. Reviewed-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240517204310.88854-8-lucas.demarchi@intel.com Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
This commit is contained in:
parent
baa1486552
commit
6aa18d7436
@ -833,3 +833,14 @@ struct xe_hw_engine *xe_gt_any_hw_engine_by_reset_domain(struct xe_gt *gt,
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
struct xe_hw_engine *xe_gt_any_hw_engine(struct xe_gt *gt)
|
||||
{
|
||||
struct xe_hw_engine *hwe;
|
||||
enum xe_hw_engine_id id;
|
||||
|
||||
for_each_hw_engine(hwe, gt, id)
|
||||
return hwe;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
@ -67,6 +67,13 @@ void xe_gt_remove(struct xe_gt *gt);
|
||||
struct xe_hw_engine *
|
||||
xe_gt_any_hw_engine_by_reset_domain(struct xe_gt *gt, enum xe_engine_class class);
|
||||
|
||||
/**
|
||||
* xe_gt_any_hw_engine - scan the list of engines and return the
|
||||
* first available
|
||||
* @gt: GT structure
|
||||
*/
|
||||
struct xe_hw_engine *xe_gt_any_hw_engine(struct xe_gt *gt);
|
||||
|
||||
struct xe_hw_engine *xe_gt_hw_engine(struct xe_gt *gt,
|
||||
enum xe_engine_class class,
|
||||
u16 instance,
|
||||
|
Loading…
Reference in New Issue
Block a user