From mboxrd@z Thu Jan 1 00:00:00 1970 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 158A1C54E71 for ; Tue, 19 Mar 2024 02:42:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9936D10E664; Tue, 19 Mar 2024 02:42:57 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="Z0hjdXUt"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id 51AC210E9B8 for ; Tue, 19 Mar 2024 02:42:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1710816177; x=1742352177; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=6t+bVrzhcpwiHptP/4WgkN39ouxq7Wycoeyw7to6FQ0=; b=Z0hjdXUt7hKlrl1QPvPD8L8WqPeXVHhWdQy+Hy+Rp3nPohdMPZjBII3B 3Wmg+Sxt1DfcGSOTZD3KRSjvY0dTwnoGetof2Ts/vj6Mn+qfjxs93fDjB ip23889q2a63n0H0t2csx3qNFumLixCRz4/ycOABun4b+uuGWYM1V/jYu AmBr2I/gxfhg3iJ7OTK+LeHrwHnOhSZeZOBJ9RwTM76rHqXjvTgU7XK9b YXYJeAH2iT1xyuvzrRD29PUNsUb7wzL8/M6KEZz3NSpCRnB3Z4EGZnvMr KkXJlsyoiHn/hY4JpY4EJvnHMwxmi5/lV7fUeNZeI5UE4dUkS0DE3OuWK A==; X-IronPort-AV: E=McAfee;i="6600,9927,11017"; a="5540739" X-IronPort-AV: E=Sophos;i="6.07,135,1708416000"; d="scan'208";a="5540739" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2024 19:42:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,135,1708416000"; d="scan'208";a="14130196" Received: from szeng-desk.jf.intel.com ([10.165.21.149]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2024 19:42:56 -0700 From: Oak Zeng To: intel-xe@lists.freedesktop.org Cc: thomas.hellstrom@intel.com, matthew.brost@intel.com, brian.welty@intel.com, himal.prasad.ghimiray@intel.com Subject: [PATCH 3/8] drm/xe: Helper to get tile from memory region Date: Mon, 18 Mar 2024 22:55:06 -0400 Message-Id: <20240319025511.1598354-4-oak.zeng@intel.com> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20240319025511.1598354-1-oak.zeng@intel.com> References: <20240319025511.1598354-1-oak.zeng@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-xe-bounces@lists.freedesktop.org Sender: "Intel-xe" A simple helper to retrieve tile from memory region v1: move the function to xe_device.h (Matt) Signed-off-by: Oak Zeng --- drivers/gpu/drm/xe/xe_device.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/xe/xe_device.h b/drivers/gpu/drm/xe/xe_device.h index 14be34d9f543..4735268cf07f 100644 --- a/drivers/gpu/drm/xe/xe_device.h +++ b/drivers/gpu/drm/xe/xe_device.h @@ -176,4 +176,9 @@ void xe_device_snapshot_print(struct xe_device *xe, struct drm_printer *p); u64 xe_device_canonicalize_addr(struct xe_device *xe, u64 address); u64 xe_device_uncanonicalize_addr(struct xe_device *xe, u64 address); +static inline struct xe_tile *xe_mem_region_to_tile(struct xe_mem_region *mr) +{ + return container_of(mr, struct xe_tile, mem.vram); +} + #endif -- 2.26.3