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 259D5C77B7A for ; Wed, 7 Jun 2023 19:17:22 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E74E610E0E1; Wed, 7 Jun 2023 19:17:21 +0000 (UTC) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id 98CB310E0E1 for ; Wed, 7 Jun 2023 19:17:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686165439; x=1717701439; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version; bh=14CtXdNMKi7qFxMu6piL/aE5LUezyhzgnl2IbF/nFbA=; b=X/ub1Qp4kO2W3zKqu41vHxouBnkR8B7lxpd5bZFJ/gVbW+P6hGjgrXgn GQlv2RUq1dZe1a+1j5KO6uBtZOsmrkc4P6zl7FAzF8AWchZ4C3oMB/2BC dJXbKfjFVY/ieGYW9sfkB8N3/iO1ekHV8C656Lr1RrT+UzG4ZO/VGBLnK NdqB5diNUGgjW0Od9+D7h0MNu60QYwpQOF5puN9eLr3E2w4wMb0uyhDvI QDxz5NRQJEu6GRahngbCKxMRPmPvuMrxTFF3d5x9IyGEV1LabEy/c60/n XhgBMxn7r8cxg/R+TYLEiWqNHjtpIrXgBLrDLD/JgLnMv5EzI4iW92NxU w==; X-IronPort-AV: E=McAfee;i="6600,9927,10734"; a="360415198" X-IronPort-AV: E=Sophos;i="6.00,225,1681196400"; d="scan'208";a="360415198" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2023 12:17:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10734"; a="956411293" X-IronPort-AV: E=Sophos;i="6.00,225,1681196400"; d="scan'208";a="956411293" Received: from guorongs-mobl1.amr.corp.intel.com (HELO adixit-arch.intel.com) ([10.209.85.43]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2023 12:17:17 -0700 Date: Wed, 07 Jun 2023 12:17:05 -0700 Message-ID: <87edmnm6a6.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: "Ghimiray, Himal Prasad" In-Reply-To: <20230607183115.GN5433@mdroper-desk1.amr.corp.intel.com> References: <20230606094929.2989914-1-himal.prasad.ghimiray@intel.com> <20230606195555.GH5433@mdroper-desk1.amr.corp.intel.com> <20230607183115.GN5433@mdroper-desk1.amr.corp.intel.com> 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-pc-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 Subject: Re: [Intel-xe] [PATCH 1/1] drm/xe: Report tile count from device query api. 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: , Cc: "intel-xe@lists.freedesktop.org" Errors-To: intel-xe-bounces@lists.freedesktop.org Sender: "Intel-xe" On Wed, 07 Jun 2023 11:31:15 -0700, Matt Roper wrote: > > On Wed, Jun 07, 2023 at 04:49:09AM +0000, Ghimiray, Himal Prasad wrote: > > > > > > > -----Original Message----- > > > From: Roper, Matthew D > > > Sent: 07 June 2023 01:26 > > > To: Ghimiray, Himal Prasad > > > Cc: intel-xe@lists.freedesktop.org; Dugast, Francois > > > > > > Subject: Re: [PATCH 1/1] drm/xe: Report tile count from device query api. > > > > > > On Tue, Jun 06, 2023 at 03:19:29PM +0530, Himal Prasad Ghimiray wrote: > > > > Cc: Matt Roper > > > > Cc: Francois Dugast > > > > > > > > Signed-off-by: Himal Prasad Ghimiray > > > > > > Does userspace actually need this reported in the device query? It seems more > > > likely that they're going to need a tile-based equivalent of 'drm_xe_query_gt' > > > that returns not only the tile count, but also further details about each tile. If > > > that's the case, then also adding this count as an extra field to the device-level > > > query seems redundant (and the existing GT count seems like it's probably > > > redundant as well). > > Hi Matt, > > > > From userspace perspective the requirement is to know number of tiles supported by device > > and agreed 'drm_xe_query_tile' should provide this info along with other details. > > Can you please provide your inputs on what other details can be part of tile query ? > > It's really something that would need to be discussed and agreed upon > with the userspace teams, but I imagine details about VRAM might be > something they'd want to receive via such a query. > > > > > > > Are there patches for any of the userspace components yet that show > > > how/when they'd use this? > > https://patchwork.freedesktop.org/series/118927/ exposes per tile vram addr_range via sysfs. > > While writing IGT to test this sysfs entry, I came across the requirement. IGT patches are WIP. > > > > Just a thought, will it makes sense to expose number of tiles device supports by sysfs ? > > Something like: /number_tiles In i915 e.g. the number of gt's was never exposed, userland would just count the number of gt/gtN directories in sysfs to get number of gt's (see how this is done in IGT). So something like that is possible for tiles too (see email thread "Re: [PATCH 0/3] drm/xe: Add sysfs entry to report per gt memory size"), though like Matt says needs discussion with UMD teams to see which particular option to go with. Sometimes I think we should put whatever we can in sysfs and minimize things exposed via the query ioctl. Though again not sure about the tradeoff's of one way vs another. Ashutosh > > IMO this info should be available to userspace even without making any code changes . > > There may be other such potential candidates which can fall under device-properties. > > That's really something that we need guidance on from the userspace > teams (mesa, media, compute, etc.). It's hard for us kernel developers > to really know exactly what the best uapi would be for userspace. > That's part of why the DRM subsystem requires that any uapi change > proposed for i915 or Xe can't be added to the driver until the > corresponding userspace patches have also been developed and fully > reviewed. We don't want to write UAPI that winds up not really meeting > userspace's needs and then be stuck supporting that broken uapi forever. > > > Matt > > > > > Himal > > > > > > > > > Matt > > > > > > > --- > > > > drivers/gpu/drm/xe/xe_query.c | 1 + > > > > include/uapi/drm/xe_drm.h | 3 ++- > > > > 2 files changed, 3 insertions(+), 1 deletion(-) > > > > > > > > diff --git a/drivers/gpu/drm/xe/xe_query.c > > > > b/drivers/gpu/drm/xe/xe_query.c index c4165fa3428e..54efbefd663f > > > > 100644 > > > > --- a/drivers/gpu/drm/xe/xe_query.c > > > > +++ b/drivers/gpu/drm/xe/xe_query.c > > > > @@ -197,6 +197,7 @@ static int query_config(struct xe_device *xe, struct > > > drm_xe_device_query *query) > > > > hweight_long(xe->info.mem_region_mask); > > > > config->info[XE_QUERY_CONFIG_MAX_ENGINE_PRIORITY] = > > > > xe_engine_device_get_max_priority(xe); > > > > + config->info[XE_QUERY_CONFIG_TILE_COUNT] = xe->info.tile_count; > > > > > > > > if (copy_to_user(query_ptr, config, size)) { > > > > kfree(config); > > > > diff --git a/include/uapi/drm/xe_drm.h b/include/uapi/drm/xe_drm.h > > > > index 0ebc50beb5e5..8e552aa55037 100644 > > > > --- a/include/uapi/drm/xe_drm.h > > > > +++ b/include/uapi/drm/xe_drm.h > > > > @@ -185,7 +185,8 @@ struct drm_xe_query_config { > > > > #define XE_QUERY_CONFIG_GT_COUNT 4 > > > > #define XE_QUERY_CONFIG_MEM_REGION_COUNT 5 > > > > #define XE_QUERY_CONFIG_MAX_ENGINE_PRIORITY 6 > > > > -#define XE_QUERY_CONFIG_NUM_PARAM > > > XE_QUERY_CONFIG_MAX_ENGINE_PRIORITY + 1 > > > > +#define XE_QUERY_CONFIG_TILE_COUNT 7 > > > > +#define XE_QUERY_CONFIG_NUM_PARAM > > > XE_QUERY_CONFIG_TILE_COUNT + 1 > > > > __u64 info[]; > > > > }; > > > > > > > > -- > > > > 2.25.1 > > > > > > > > > > -- > > > Matt Roper > > > Graphics Software Engineer > > > Linux GPU Platform Enablement > > > Intel Corporation > > -- > Matt Roper > Graphics Software Engineer > Linux GPU Platform Enablement > Intel Corporation