AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Felix Kuehling <felix.kuehling@amd.com>
To: Graham Sider <Graham.Sider@amd.com>, amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/amdkfd: Expose GFXIP engine version to sysfs
Date: Thu, 5 Aug 2021 11:33:13 -0400	[thread overview]
Message-ID: <1ddc1015-208b-c7ef-f2c8-46cdd9f0fe80@amd.com> (raw)
In-Reply-To: <20210804181738.6339-1-Graham.Sider@amd.com>

Am 2021-08-04 um 2:17 p.m. schrieb Graham Sider:
> Add u32 gfx_version field to kfd_node_properties and kfd_device_info.

Update this description with the new property name. With that fixed, the
patch is

Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>


> Populate <asic>_device_info structs accordingly and expose to sysfs.
>
> This allows eliminating device-ID-based lookup tables in user mode for
> future ASICs.
>
> Signed-off-by: Graham Sider <Graham.Sider@amd.com>
> ---
>  drivers/gpu/drm/amd/amdkfd/kfd_device.c   | 29 +++++++++++++++++++++++
>  drivers/gpu/drm/amd/amdkfd/kfd_priv.h     |  1 +
>  drivers/gpu/drm/amd/amdkfd/kfd_topology.c |  3 +++
>  drivers/gpu/drm/amd/amdkfd/kfd_topology.h |  1 +
>  4 files changed, 34 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
> index b551dd675085..16a57b70cc1a 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_device.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
> @@ -91,6 +91,7 @@ static const struct kfd2kgd_calls *kfd2kgd_funcs[] = {
>  static const struct kfd_device_info kaveri_device_info = {
>  	.asic_family = CHIP_KAVERI,
>  	.asic_name = "kaveri",
> +	.gfx_target_version = 70000,
>  	.max_pasid_bits = 16,
>  	/* max num of queues for KV.TODO should be a dynamic value */
>  	.max_no_of_hqd	= 24,
> @@ -110,6 +111,7 @@ static const struct kfd_device_info kaveri_device_info = {
>  static const struct kfd_device_info carrizo_device_info = {
>  	.asic_family = CHIP_CARRIZO,
>  	.asic_name = "carrizo",
> +	.gfx_target_version = 80001,
>  	.max_pasid_bits = 16,
>  	/* max num of queues for CZ.TODO should be a dynamic value */
>  	.max_no_of_hqd	= 24,
> @@ -130,6 +132,7 @@ static const struct kfd_device_info carrizo_device_info = {
>  static const struct kfd_device_info raven_device_info = {
>  	.asic_family = CHIP_RAVEN,
>  	.asic_name = "raven",
> +	.gfx_target_version = 90002,
>  	.max_pasid_bits = 16,
>  	.max_no_of_hqd  = 24,
>  	.doorbell_size  = 8,
> @@ -148,6 +151,7 @@ static const struct kfd_device_info raven_device_info = {
>  static const struct kfd_device_info hawaii_device_info = {
>  	.asic_family = CHIP_HAWAII,
>  	.asic_name = "hawaii",
> +	.gfx_target_version = 70001,
>  	.max_pasid_bits = 16,
>  	/* max num of queues for KV.TODO should be a dynamic value */
>  	.max_no_of_hqd	= 24,
> @@ -167,6 +171,7 @@ static const struct kfd_device_info hawaii_device_info = {
>  static const struct kfd_device_info tonga_device_info = {
>  	.asic_family = CHIP_TONGA,
>  	.asic_name = "tonga",
> +	.gfx_target_version = 80002,
>  	.max_pasid_bits = 16,
>  	.max_no_of_hqd  = 24,
>  	.doorbell_size  = 4,
> @@ -185,6 +190,7 @@ static const struct kfd_device_info tonga_device_info = {
>  static const struct kfd_device_info fiji_device_info = {
>  	.asic_family = CHIP_FIJI,
>  	.asic_name = "fiji",
> +	.gfx_target_version = 80003,
>  	.max_pasid_bits = 16,
>  	.max_no_of_hqd  = 24,
>  	.doorbell_size  = 4,
> @@ -203,6 +209,7 @@ static const struct kfd_device_info fiji_device_info = {
>  static const struct kfd_device_info fiji_vf_device_info = {
>  	.asic_family = CHIP_FIJI,
>  	.asic_name = "fiji",
> +	.gfx_target_version = 80003,
>  	.max_pasid_bits = 16,
>  	.max_no_of_hqd  = 24,
>  	.doorbell_size  = 4,
> @@ -222,6 +229,7 @@ static const struct kfd_device_info fiji_vf_device_info = {
>  static const struct kfd_device_info polaris10_device_info = {
>  	.asic_family = CHIP_POLARIS10,
>  	.asic_name = "polaris10",
> +	.gfx_target_version = 80003,
>  	.max_pasid_bits = 16,
>  	.max_no_of_hqd  = 24,
>  	.doorbell_size  = 4,
> @@ -240,6 +248,7 @@ static const struct kfd_device_info polaris10_device_info = {
>  static const struct kfd_device_info polaris10_vf_device_info = {
>  	.asic_family = CHIP_POLARIS10,
>  	.asic_name = "polaris10",
> +	.gfx_target_version = 80003,
>  	.max_pasid_bits = 16,
>  	.max_no_of_hqd  = 24,
>  	.doorbell_size  = 4,
> @@ -258,6 +267,7 @@ static const struct kfd_device_info polaris10_vf_device_info = {
>  static const struct kfd_device_info polaris11_device_info = {
>  	.asic_family = CHIP_POLARIS11,
>  	.asic_name = "polaris11",
> +	.gfx_target_version = 80003,
>  	.max_pasid_bits = 16,
>  	.max_no_of_hqd  = 24,
>  	.doorbell_size  = 4,
> @@ -276,6 +286,7 @@ static const struct kfd_device_info polaris11_device_info = {
>  static const struct kfd_device_info polaris12_device_info = {
>  	.asic_family = CHIP_POLARIS12,
>  	.asic_name = "polaris12",
> +	.gfx_target_version = 80003,
>  	.max_pasid_bits = 16,
>  	.max_no_of_hqd  = 24,
>  	.doorbell_size  = 4,
> @@ -294,6 +305,7 @@ static const struct kfd_device_info polaris12_device_info = {
>  static const struct kfd_device_info vegam_device_info = {
>  	.asic_family = CHIP_VEGAM,
>  	.asic_name = "vegam",
> +	.gfx_target_version = 80003,
>  	.max_pasid_bits = 16,
>  	.max_no_of_hqd  = 24,
>  	.doorbell_size  = 4,
> @@ -312,6 +324,7 @@ static const struct kfd_device_info vegam_device_info = {
>  static const struct kfd_device_info vega10_device_info = {
>  	.asic_family = CHIP_VEGA10,
>  	.asic_name = "vega10",
> +	.gfx_target_version = 90000,
>  	.max_pasid_bits = 16,
>  	.max_no_of_hqd  = 24,
>  	.doorbell_size  = 8,
> @@ -330,6 +343,7 @@ static const struct kfd_device_info vega10_device_info = {
>  static const struct kfd_device_info vega10_vf_device_info = {
>  	.asic_family = CHIP_VEGA10,
>  	.asic_name = "vega10",
> +	.gfx_target_version = 90000,
>  	.max_pasid_bits = 16,
>  	.max_no_of_hqd  = 24,
>  	.doorbell_size  = 8,
> @@ -348,6 +362,7 @@ static const struct kfd_device_info vega10_vf_device_info = {
>  static const struct kfd_device_info vega12_device_info = {
>  	.asic_family = CHIP_VEGA12,
>  	.asic_name = "vega12",
> +	.gfx_target_version = 90004,
>  	.max_pasid_bits = 16,
>  	.max_no_of_hqd  = 24,
>  	.doorbell_size  = 8,
> @@ -366,6 +381,7 @@ static const struct kfd_device_info vega12_device_info = {
>  static const struct kfd_device_info vega20_device_info = {
>  	.asic_family = CHIP_VEGA20,
>  	.asic_name = "vega20",
> +	.gfx_target_version = 90006,
>  	.max_pasid_bits = 16,
>  	.max_no_of_hqd	= 24,
>  	.doorbell_size	= 8,
> @@ -384,6 +400,7 @@ static const struct kfd_device_info vega20_device_info = {
>  static const struct kfd_device_info arcturus_device_info = {
>  	.asic_family = CHIP_ARCTURUS,
>  	.asic_name = "arcturus",
> +	.gfx_target_version = 90008,
>  	.max_pasid_bits = 16,
>  	.max_no_of_hqd	= 24,
>  	.doorbell_size	= 8,
> @@ -402,6 +419,7 @@ static const struct kfd_device_info arcturus_device_info = {
>  static const struct kfd_device_info aldebaran_device_info = {
>  	.asic_family = CHIP_ALDEBARAN,
>  	.asic_name = "aldebaran",
> +	.gfx_target_version = 90010,
>  	.max_pasid_bits = 16,
>  	.max_no_of_hqd	= 24,
>  	.doorbell_size	= 8,
> @@ -420,6 +438,7 @@ static const struct kfd_device_info aldebaran_device_info = {
>  static const struct kfd_device_info renoir_device_info = {
>  	.asic_family = CHIP_RENOIR,
>  	.asic_name = "renoir",
> +	.gfx_target_version = 90002,
>  	.max_pasid_bits = 16,
>  	.max_no_of_hqd  = 24,
>  	.doorbell_size  = 8,
> @@ -438,6 +457,7 @@ static const struct kfd_device_info renoir_device_info = {
>  static const struct kfd_device_info navi10_device_info = {
>  	.asic_family = CHIP_NAVI10,
>  	.asic_name = "navi10",
> +	.gfx_target_version = 100100,
>  	.max_pasid_bits = 16,
>  	.max_no_of_hqd  = 24,
>  	.doorbell_size  = 8,
> @@ -456,6 +476,7 @@ static const struct kfd_device_info navi10_device_info = {
>  static const struct kfd_device_info navi12_device_info = {
>  	.asic_family = CHIP_NAVI12,
>  	.asic_name = "navi12",
> +	.gfx_target_version = 100101,
>  	.max_pasid_bits = 16,
>  	.max_no_of_hqd  = 24,
>  	.doorbell_size  = 8,
> @@ -474,6 +495,7 @@ static const struct kfd_device_info navi12_device_info = {
>  static const struct kfd_device_info navi14_device_info = {
>  	.asic_family = CHIP_NAVI14,
>  	.asic_name = "navi14",
> +	.gfx_target_version = 100102,
>  	.max_pasid_bits = 16,
>  	.max_no_of_hqd  = 24,
>  	.doorbell_size  = 8,
> @@ -492,6 +514,7 @@ static const struct kfd_device_info navi14_device_info = {
>  static const struct kfd_device_info sienna_cichlid_device_info = {
>  	.asic_family = CHIP_SIENNA_CICHLID,
>  	.asic_name = "sienna_cichlid",
> +	.gfx_target_version = 100300,
>  	.max_pasid_bits = 16,
>  	.max_no_of_hqd  = 24,
>  	.doorbell_size  = 8,
> @@ -510,6 +533,7 @@ static const struct kfd_device_info sienna_cichlid_device_info = {
>  static const struct kfd_device_info navy_flounder_device_info = {
>  	.asic_family = CHIP_NAVY_FLOUNDER,
>  	.asic_name = "navy_flounder",
> +	.gfx_target_version = 100301,
>  	.max_pasid_bits = 16,
>  	.max_no_of_hqd  = 24,
>  	.doorbell_size  = 8,
> @@ -528,6 +552,7 @@ static const struct kfd_device_info navy_flounder_device_info = {
>  static const struct kfd_device_info vangogh_device_info = {
>  	.asic_family = CHIP_VANGOGH,
>  	.asic_name = "vangogh",
> +	.gfx_target_version = 100303,
>  	.max_pasid_bits = 16,
>  	.max_no_of_hqd  = 24,
>  	.doorbell_size  = 8,
> @@ -546,6 +571,7 @@ static const struct kfd_device_info vangogh_device_info = {
>  static const struct kfd_device_info dimgrey_cavefish_device_info = {
>  	.asic_family = CHIP_DIMGREY_CAVEFISH,
>  	.asic_name = "dimgrey_cavefish",
> +	.gfx_target_version = 100302,
>  	.max_pasid_bits = 16,
>  	.max_no_of_hqd  = 24,
>  	.doorbell_size  = 8,
> @@ -564,6 +590,7 @@ static const struct kfd_device_info dimgrey_cavefish_device_info = {
>  static const struct kfd_device_info beige_goby_device_info = {
>  	.asic_family = CHIP_BEIGE_GOBY,
>  	.asic_name = "beige_goby",
> +	.gfx_target_version = 100304,
>  	.max_pasid_bits = 16,
>  	.max_no_of_hqd  = 24,
>  	.doorbell_size  = 8,
> @@ -582,6 +609,7 @@ static const struct kfd_device_info beige_goby_device_info = {
>  static const struct kfd_device_info yellow_carp_device_info = {
>  	.asic_family = CHIP_YELLOW_CARP,
>  	.asic_name = "yellow_carp",
> +	.gfx_target_version = 100305,
>  	.max_pasid_bits = 16,
>  	.max_no_of_hqd  = 24,
>  	.doorbell_size  = 8,
> @@ -600,6 +628,7 @@ static const struct kfd_device_info yellow_carp_device_info = {
>  static const struct kfd_device_info cyan_skillfish_device_info = {
>  	.asic_family = CHIP_CYAN_SKILLFISH,
>  	.asic_name = "cyan_skillfish",
> +	.gfx_target_version = 100103,
>  	.max_pasid_bits = 16,
>  	.max_no_of_hqd  = 24,
>  	.doorbell_size  = 8,
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
> index 8a5dfda224bf..ab83b0de6b22 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
> @@ -196,6 +196,7 @@ struct kfd_event_interrupt_class {
>  struct kfd_device_info {
>  	enum amd_asic_type asic_family;
>  	const char *asic_name;
> +	uint32_t gfx_target_version;
>  	const struct kfd_event_interrupt_class *event_interrupt_class;
>  	unsigned int max_pasid_bits;
>  	unsigned int max_no_of_hqd;
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
> index ef992dd2da3a..98cca5f2b27f 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
> @@ -478,6 +478,8 @@ static ssize_t node_show(struct kobject *kobj, struct attribute *attr,
>  			      dev->node_props.simd_per_cu);
>  	sysfs_show_32bit_prop(buffer, offs, "max_slots_scratch_cu",
>  			      dev->node_props.max_slots_scratch_cu);
> +	sysfs_show_32bit_prop(buffer, offs, "gfx_target_version",
> +			      dev->node_props.gfx_target_version);
>  	sysfs_show_32bit_prop(buffer, offs, "vendor_id",
>  			      dev->node_props.vendor_id);
>  	sysfs_show_32bit_prop(buffer, offs, "device_id",
> @@ -1360,6 +1362,7 @@ int kfd_topology_add_device(struct kfd_dev *gpu)
>  	dev->node_props.simd_arrays_per_engine =
>  		cu_info.num_shader_arrays_per_engine;
>  
> +	dev->node_props.gfx_target_version = gpu->device_info->gfx_target_version;
>  	dev->node_props.vendor_id = gpu->pdev->vendor;
>  	dev->node_props.device_id = gpu->pdev->device;
>  	dev->node_props.capability |=
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.h b/drivers/gpu/drm/amd/amdkfd/kfd_topology.h
> index 8b48c6692007..a8db017c9b8e 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.h
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.h
> @@ -78,6 +78,7 @@ struct kfd_node_properties {
>  	uint32_t simd_per_cu;
>  	uint32_t max_slots_scratch_cu;
>  	uint32_t engine_id;
> +	uint32_t gfx_target_version;
>  	uint32_t vendor_id;
>  	uint32_t device_id;
>  	uint32_t location_id;

  reply	other threads:[~2021-08-05 15:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-04 18:17 [PATCH] drm/amdkfd: Expose GFXIP engine version to sysfs Graham Sider
2021-08-05 15:33 ` Felix Kuehling [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-07-29 20:25 Graham Sider
2021-07-30 15:14 ` Felix Kuehling

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1ddc1015-208b-c7ef-f2c8-46cdd9f0fe80@amd.com \
    --to=felix.kuehling@amd.com \
    --cc=Graham.Sider@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox