From patchwork Thu Feb 17 14:41:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andi Shyti X-Patchwork-Id: 12750298 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 10900C433F5 for ; Thu, 17 Feb 2022 14:43:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 57E3A10EB9D; Thu, 17 Feb 2022 14:43:42 +0000 (UTC) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by gabe.freedesktop.org (Postfix) with ESMTPS id A0C0B10E89B; Thu, 17 Feb 2022 14:43:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645109020; x=1676645020; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=+GzPfklFZLJiAcbK45kwO4BMbNF5U3lCw9oAkgR+XJE=; b=hFB8EcNYWINzqQxXXuTxj+6MLHgUynTxYEHOIsHluwlyWso1cKFQ3vvi ZdrKKhRlIGOcsDmVrMKh4pehjOdZgjw+zMeDX2MBfi812t86POl0cuBEL zDHWN+FLYPfsX7FXqxIV9NfbRWC/NOIcHnbbF1zdw/gfdm5DVfR9/pXUX 4EBiSZ9UzLcPSvDvPHBylPLYvrGwFyWMoT7ruisDQc2lDzazMS3sH8B0w gEde3XYRJJ7FxsE76EFsddQ93RYcdEUJ4nfhHD2Lc2YundLZj/cJD1sxm bdXBG/x73ivhKPqEFU/TUZS5o8tezHVkF44uRdbqPGW6I4y/B5ouN4o1I Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10260"; a="234416664" X-IronPort-AV: E=Sophos;i="5.88,376,1635231600"; d="scan'208";a="234416664" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Feb 2022 06:43:40 -0800 X-IronPort-AV: E=Sophos;i="5.88,376,1635231600"; d="scan'208";a="637160695" Received: from sewaggon-mobl1.amr.corp.intel.com (HELO intel.com) ([10.249.33.71]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Feb 2022 06:43:35 -0800 From: Andi Shyti To: Intel GFX , DRI Devel Date: Thu, 17 Feb 2022 15:41:54 +0100 Message-Id: <20220217144158.21555-4-andi.shyti@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220217144158.21555-1-andi.shyti@linux.intel.com> References: <20220217144158.21555-1-andi.shyti@linux.intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH v5 3/7] drm/i915/gt: add gt_is_root() helper X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lucas De Marchi , Chris Wilson , Matthew Auld Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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 --- drivers/gpu/drm/i915/gt/intel_gt.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/i915/gt/intel_gt.h b/drivers/gpu/drm/i915/gt/intel_gt.h index 915d6192079b..f17f51e2d394 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);