From: Andi Shyti Date: Fri, 18 Mar 2022 23:39:32 +0000 (+0200) Subject: drm/i915/gt: add gt_is_root() helper X-Git-Tag: v6.1-rc5~176^2~23^2~281 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b9741faadbd64db562a85dc79b31b85fa354eeb5;p=platform%2Fkernel%2Flinux-starfive.git 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 Signed-off-by: Andi Shyti Reviewed-by: Michal Wajdeczko Reviewed-by: Andrzej Hajda Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20220318233938.149744-3-andi.shyti@linux.intel.com --- diff --git a/drivers/gpu/drm/i915/gt/intel_gt.h b/drivers/gpu/drm/i915/gt/intel_gt.h index 996f8f3..ce471aa 100644 --- a/drivers/gpu/drm/i915/gt/intel_gt.h +++ b/drivers/gpu/drm/i915/gt/intel_gt.h @@ -19,6 +19,11 @@ struct drm_printer; ##__VA_ARGS__); \ } while (0) +static inline bool gt_is_root(struct intel_gt *gt) +{ + return !gt->info.id; +} + static inline struct intel_gt *uc_to_gt(struct intel_uc *uc) { return container_of(uc, struct intel_gt, uc);