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 D4F65C021B2 for ; Tue, 25 Feb 2025 16:56:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 99F0B10E69D; Tue, 25 Feb 2025 16:56:40 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="Rg2Y4iqr"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1756410E69D for ; Tue, 25 Feb 2025 16:56: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=1740502600; x=1772038600; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version; bh=fTUNsPrV2szXKULCsH5Cyo6g+OitoSR7u2vsoCTX/5A=; b=Rg2Y4iqreKcmibAacY0TM/p5fJDnoZaeH6CuGJGYaHIevbs+klbfsmgL T5d+kqW5eCMfa5B3UgkZuq/1XVZtCg+oE9swUw8V808JM0MoCwwA7oh0q AFNVsfosdozrPZEarOYFAUN7wA0PL6wmnLghOy/2aMueLZHBFfKQNX1QW mCHc8M/HUlqBH9fOf87ycqPdjcue0D3DKNYC8QLzhxgoQNi3WEdsVQv7B 5g3MxME9s93N4Px2Q479haK+Htq4Qypy4FmpBilBW18YzU68Mc7pU4I/9 faEPPeoIUEYFJWLh3joOn4hB74lAmwwqgsTYAVpnIoaHeCxl4MoVy5cmV w==; X-CSE-ConnectionGUID: Ef4EGSYpSSq8/Z/Abr2aSA== X-CSE-MsgGUID: wOdGgGmZTEaJYwJznCWFVQ== X-IronPort-AV: E=McAfee;i="6700,10204,11356"; a="63783449" X-IronPort-AV: E=Sophos;i="6.13,314,1732608000"; d="scan'208";a="63783449" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Feb 2025 08:56:40 -0800 X-CSE-ConnectionGUID: KOeseX98R+6Pa25yOOv29g== X-CSE-MsgGUID: 800nHqTbT12h8KEi7sUeEQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,224,1728975600"; d="scan'208";a="116288708" Received: from orsosgc001.jf.intel.com (HELO orsosgc001.intel.com) ([10.165.21.142]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Feb 2025 08:56:40 -0800 Date: Tue, 25 Feb 2025 08:56:39 -0800 Message-ID: <85cyf6j73s.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Harish Chegondi Cc: Subject: Re: [PATCH v11 7/8] drm/xe/uapi: Add a device query to get EU stall sampling information In-Reply-To: References: User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/28.2 (x86_64-redhat-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII 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" On Tue, 25 Feb 2025 01:20:24 -0800, Harish Chegondi wrote: > > +static int query_eu_stall(struct xe_device *xe, > + struct drm_xe_device_query *query) > +{ > + void __user *query_ptr = u64_to_user_ptr(query->data); > + struct drm_xe_query_eu_stall *info; > + size_t size, array_size; > + const u64 *rates; > + u32 num_rates; > + int ret; > + > + if (!(xe->info.platform == XE_PVC || GRAPHICS_VER(xe) >= 20)) { > + drm_dbg(&xe->drm, "EU stall monitoring is not supported on this platform\n"); > + return -ENODEV; > + } Why not move has_eu_stall_sampling_support() into xe_eu_stall.h and use it here? Or leave that function definition in the .c and move the declaration to .h. Otherwise the same check is repeated twice and someone has to remember to change in two places?