From patchwork Fri Mar 18 23:39:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andi Shyti X-Patchwork-Id: 12786006 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 58F68C433EF for ; Fri, 18 Mar 2022 23:40:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BFCE510E451; Fri, 18 Mar 2022 23:40:11 +0000 (UTC) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 665B110E451; Fri, 18 Mar 2022 23:40:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1647646810; x=1679182810; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=GLmFMornaSnSqY+/8GFKSjNa3P2XPko6VrSXeh1rJj4=; b=AqRVwxNjqxXIkQGUS46sPYRT2QqsOlwZ8kj1f60bGi+/ckxGIZCRXZZb ZPIPPihiV3L2cwZzPF35aSdCBCGcMvh7TCLH+0laWzEFrF117bHs5H+vq +P7ahENHH5n20kmAoCdPiSlGjtKsu5e7whi4I9UTvYzYMw3Hq7vNg2fLh pqofy/ZCw34P2qVuGD/k5bTVAPKbzySSfagfPGOQ6f696c2iNz+oXdUqM 4Qc4ePpg722lqavoPiVIjXCxLVg7IkAHVvBoLJp6fjwsPN5Bm6VM8JnOA WOG5cy9hXucDc3rlSVL6uuqHyXKNW2ksgd2Qyj0n98XjcV/Eh7K9XH/uS g==; X-IronPort-AV: E=McAfee;i="6200,9189,10290"; a="317961416" X-IronPort-AV: E=Sophos;i="5.90,192,1643702400"; d="scan'208";a="317961416" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2022 16:40:08 -0700 X-IronPort-AV: E=Sophos;i="5.90,192,1643702400"; d="scan'208";a="517463195" Received: from bradocaj-mobl.ger.corp.intel.com (HELO intel.com) ([10.249.39.168]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2022 16:40:03 -0700 From: Andi Shyti To: Intel GFX , DRI Devel Date: Sat, 19 Mar 2022 01:39:32 +0200 Message-Id: <20220318233938.149744-3-andi.shyti@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220318233938.149744-1-andi.shyti@linux.intel.com> References: <20220318233938.149744-1-andi.shyti@linux.intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH v7 2/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 996f8f3c17b95..ce471aa5c83d7 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);