Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/i915/gt: add gt_is_root() helper

The "gt_is_root(struct intel_gt *gt)" helper return true if the
gt is the root gt, which means that its id is 0. Return false
otherwise.

Suggested-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
Reviewed-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220318233938.149744-3-andi.shyti@linux.intel.com

authored by

Andi Shyti and committed by
Matthew Auld
b9741faa fa732088

+5
+5
drivers/gpu/drm/i915/gt/intel_gt.h
··· 19 19 ##__VA_ARGS__); \ 20 20 } while (0) 21 21 22 + static inline bool gt_is_root(struct intel_gt *gt) 23 + { 24 + return !gt->info.id; 25 + } 26 + 22 27 static inline struct intel_gt *uc_to_gt(struct intel_uc *uc) 23 28 { 24 29 return container_of(uc, struct intel_gt, uc);