From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 76B82606A322 for ; Wed, 2 Dec 2026 17:11:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=P8GcmESz Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 398F510E633; Wed, 2 Dec 2026 17:10:56 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5C94210E633 for ; Wed, 2 Dec 2026 17:10:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796231451; x=1827767451; h=message-id:date:mime-version:subject:to:references:from: in-reply-to:content-transfer-encoding; bh=LP/iVPaMUnj9OHyTxXlQVMEO6QnujcMvE/0EIJKLySc=; b=P8GcmESzRA6IhJ3OvDmBFjLK4CzDiSfHG180YdNTn6bBXQ1IoWU4vDo/ jhJu9VCarb68CF8Er3ZRNmGxUdCIU8amB7tbp5N2jU1Xg+H8LhmHLHUzt 4oCXibiJ2VY6xs/Gvawv1lVvvIZTOMBDGl1nLd/N1gYhZSKiZ57bH+tle 8tuef6PwcL26gei7PtpFbhYEbCPOJ5Nt5y6LMdJZj+IyCPbAhmnTT2MNb bmUGMXStMhiURt70TDXn5tT30MxIftmYrC7qGjiUq6+BAsAgjNHUrHAVc XQgh/CJCbqWs3nMphjLb2YMVTGf2hFLyGKEgzfcSSuD3ezT4deCIxIfkz w==; X-CSE-ConnectionGUID: 885mwOOPSjiJ0/LaC1oiCg== X-CSE-MsgGUID: 5SpJhwjfQbKfibw1QeUceQ== X-IronPort-AV: E=McAfee;i="6800,10657,11984"; a="5050881" X-IronPort-AV: E=Sophos;i="6.27,247,1787036400"; d="scan'208";a="5050881" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Dec 2026 09:10:50 -0800 X-CSE-ConnectionGUID: p47EI3d8TAGoWyzsv8k7nQ== X-CSE-MsgGUID: teL52hyjSK60yT+VC0YqEQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,247,1787036400"; d="scan'208";a="13792109" Received: from soc-5cg43972f8.clients.intel.com (HELO [172.28.182.154]) ([172.28.182.154]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Dec 2026 09:10:49 -0800 Message-ID: <63b4382f-bb02-4b60-a501-92aca1d6ad5e@linux.intel.com> Date: Wed, 2 Dec 2026 18:10:47 +0100 X-Archived-By: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1 1/4] drm/xe/pf: Share SR-IOV config unit helpers To: =?UTF-8?Q?Pi=C3=B3rkowski=2C_Piotr?= , intel-xe@lists.freedesktop.org References: <20261201162219.22723-1-piotr.piorkowski@intel.com> <20261201162219.22723-2-piotr.piorkowski@intel.com> Content-Language: en-US From: "Bernatowicz, Marcin" In-Reply-To: <20261201162219.22723-2-piotr.piorkowski@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed 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-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Intel-xe" X-Spam-Status: No, score=-15.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On 12/1/2026 5:22 PM, Piórkowski, Piotr wrote: > From: Piotr Piórkowski > > The helpers that return the unit or description printed next to the > execution quantum, preemption timeout and scheduling priority values > are private to the GT config code. We will need them also to print > the VGPU profiles, so move them to the PF helpers header instead of > duplicating them. > > Signed-off-by: Piotr Piórkowski > --- > drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c | 35 ++++++-------------- > drivers/gpu/drm/xe/xe_sriov_pf_helpers.h | 37 ++++++++++++++++++++++ > 2 files changed, 46 insertions(+), 26 deletions(-) > > diff --git a/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c b/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c > index ee8054cca1839..4935936fff946 100644 > --- a/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c > +++ b/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c > @@ -31,6 +31,7 @@ > #include "xe_lmtt.h" > #include "xe_migrate.h" > #include "xe_sriov.h" > +#include "xe_sriov_pf_helpers.h" > #include "xe_ttm_vram_mgr.h" > #include "xe_vram_types.h" > > @@ -2141,11 +2142,6 @@ int xe_gt_sriov_pf_config_set_fair_locked(struct xe_gt *gt, unsigned int vfid, > return result; > } > > -static const char *exec_quantum_unit(u32 exec_quantum) > -{ > - return exec_quantum ? "ms" : "(infinity)"; > -} > - > static int pf_provision_exec_quantum(struct xe_gt *gt, unsigned int vfid, > u32 exec_quantum) > { > @@ -2203,7 +2199,7 @@ int xe_gt_sriov_pf_config_set_exec_quantum_locked(struct xe_gt *gt, unsigned int > > return pf_config_set_u32_done(gt, vfid, exec_quantum, > pf_get_exec_quantum(gt, vfid), > - "execution quantum", exec_quantum_unit, err); > + "execution quantum", xe_sriov_pf_exec_quantum_unit, err); > } > > /** > @@ -2273,7 +2269,7 @@ static int pf_bulk_set_exec_quantum(struct xe_gt *gt, u32 exec_quantum, > > return pf_config_bulk_set_u32_done(gt, first_vf, num_vfs, exec_quantum, > pf_get_exec_quantum, "execution quantum", > - exec_quantum_unit, n, err); > + xe_sriov_pf_exec_quantum_unit, n, err); > } > > /** > @@ -2352,7 +2348,7 @@ int xe_gt_sriov_pf_config_set_groups_exec_quantums(struct xe_gt *gt, unsigned in > return pf_groups_cfg_set_u32_done(gt, vfid, exec_quantums, count, > pf_get_groups_exec_quantums, > "execution quantum", > - exec_quantum_unit, err); > + xe_sriov_pf_exec_quantum_unit, err); > } > > /** > @@ -2374,11 +2370,6 @@ void xe_gt_sriov_pf_config_get_groups_exec_quantums(struct xe_gt *gt, unsigned i > pf_get_groups_exec_quantums(gt, vfid, exec_quantums, count); > } > > -static const char *preempt_timeout_unit(u32 preempt_timeout) > -{ > - return preempt_timeout ? "us" : "(infinity)"; > -} > - > static int pf_provision_preempt_timeout(struct xe_gt *gt, unsigned int vfid, > u32 preempt_timeout) > { > @@ -2436,7 +2427,7 @@ int xe_gt_sriov_pf_config_set_preempt_timeout_locked(struct xe_gt *gt, unsigned > > return pf_config_set_u32_done(gt, vfid, preempt_timeout, > pf_get_preempt_timeout(gt, vfid), > - "preemption timeout", preempt_timeout_unit, err); > + "preemption timeout", xe_sriov_pf_preempt_timeout_unit, err); > } > > /** > @@ -2505,7 +2496,7 @@ static int pf_bulk_set_preempt_timeout(struct xe_gt *gt, u32 preempt_timeout, > > return pf_config_bulk_set_u32_done(gt, first_vf, num_vfs, preempt_timeout, > pf_get_preempt_timeout, "preemption timeout", > - preempt_timeout_unit, n, err); > + xe_sriov_pf_preempt_timeout_unit, n, err); > } > > /** > @@ -2585,7 +2576,7 @@ int xe_gt_sriov_pf_config_set_groups_preempt_timeouts(struct xe_gt *gt, unsigned > return pf_groups_cfg_set_u32_done(gt, vfid, preempt_timeouts, count, > pf_get_groups_preempt_timeouts, > "preempt_timeout", > - preempt_timeout_unit, err); > + xe_sriov_pf_preempt_timeout_unit, err); > } > > /** > @@ -2607,14 +2598,6 @@ void xe_gt_sriov_pf_config_get_groups_preempt_timeouts(struct xe_gt *gt, unsigne > pf_get_groups_preempt_timeouts(gt, vfid, preempt_timeouts, count); > } > > -static const char *sched_priority_unit(u32 priority) > -{ > - return priority == GUC_SCHED_PRIORITY_LOW ? "(low)" : > - priority == GUC_SCHED_PRIORITY_NORMAL ? "(normal)" : > - priority == GUC_SCHED_PRIORITY_HIGH ? "(high)" : > - "(?)"; > -} > - > static int pf_provision_sched_priority(struct xe_gt *gt, unsigned int vfid, u32 priority) > { > struct xe_gt_sriov_config *config = pf_pick_vf_config(gt, vfid); > @@ -2656,7 +2639,7 @@ int xe_gt_sriov_pf_config_set_sched_priority_locked(struct xe_gt *gt, unsigned i > > return pf_config_set_u32_done(gt, vfid, priority, > pf_get_sched_priority(gt, vfid), > - "scheduling priority", sched_priority_unit, err); > + "scheduling priority", xe_sriov_pf_sched_priority_unit, err); > } > > /** > @@ -2722,7 +2705,7 @@ void xe_gt_sriov_pf_config_force_sched_priority_locked(struct xe_gt *gt, u32 pri > > pf_config_bulk_set_u32_done(gt, PFID, 1 + total_vfs, priority, > pf_get_sched_priority, "scheduling priority", > - sched_priority_unit, n, 0); > + xe_sriov_pf_sched_priority_unit, n, 0); > } > > static void pf_reset_config_sched(struct xe_gt *gt, struct xe_gt_sriov_config *config) > diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_helpers.h b/drivers/gpu/drm/xe/xe_sriov_pf_helpers.h > index 19f6f8331c8df..edee89cd823fa 100644 > --- a/drivers/gpu/drm/xe/xe_sriov_pf_helpers.h > +++ b/drivers/gpu/drm/xe/xe_sriov_pf_helpers.h > @@ -6,6 +6,7 @@ > #ifndef _XE_SRIOV_PF_HELPERS_H_ > #define _XE_SRIOV_PF_HELPERS_H_ > > +#include "abi/guc_klvs_abi.h" > #include "xe_assert.h" > #include "xe_device.h" > #include "xe_device_types.h" > @@ -61,6 +62,42 @@ static inline bool xe_sriov_pf_admin_only(const struct xe_device *xe) > return xe_device_is_admin_only(xe); > } > > +/** > + * xe_sriov_pf_exec_quantum_unit() - Get the unit of the execution quantum. > + * @exec_quantum: the execution quantum value > + * > + * Return: the unit to be printed after the execution quantum value. > + */ > +static inline const char *xe_sriov_pf_exec_quantum_unit(u32 exec_quantum) > +{ > + return exec_quantum ? "ms" : "(infinity)"; > +} > + > +/** > + * xe_sriov_pf_preempt_timeout_unit() - Get the unit of the preemption timeout. > + * @preempt_timeout: the preemption timeout value > + * > + * Return: the unit to be printed after the preemption timeout value. > + */ > +static inline const char *xe_sriov_pf_preempt_timeout_unit(u32 preempt_timeout) > +{ > + return preempt_timeout ? "us" : "(infinity)"; > +} > + > +/** > + * xe_sriov_pf_sched_priority_unit() - Get the description of the scheduling priority. > + * @priority: the scheduling priority value > + * > + * Return: the description to be printed after the scheduling priority value. > + */ > +static inline const char *xe_sriov_pf_sched_priority_unit(u32 priority) > +{ > + return priority == GUC_SCHED_PRIORITY_LOW ? "(low)" : > + priority == GUC_SCHED_PRIORITY_NORMAL ? "(normal)" : > + priority == GUC_SCHED_PRIORITY_HIGH ? "(high)" : > + "(?)"; > +} > + > static inline struct mutex *xe_sriov_pf_master_mutex(struct xe_device *xe) > { > xe_assert(xe, IS_SRIOV_PF(xe)); LGTM, Reviewed-by: Marcin Bernatowicz