From: "Lazar, Lijo" <lijo.lazar@amd.com>
To: Emily Deng <Emily.Deng@amd.com>, amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH v3 1/2] drm/amdgpu: Add amdgpu_sriov_multi_vf_mode function
Date: Fri, 7 Feb 2025 13:36:26 +0530 [thread overview]
Message-ID: <046323ba-868a-4608-9ea9-aba864dc9b58@amd.com> (raw)
In-Reply-To: <20250207060320.1564404-1-Emily.Deng@amd.com>
On 2/7/2025 11:33 AM, Emily Deng wrote:
> Use amdgpu_sriov_multi_vf_mode to replace amdgpu_sriov_vf(adev) && !amdgpu_sriov_is_pp_one_vf(adev).
>
> Signed-off-by: Emily Deng <Emily.Deng@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Thanks,
Lijo
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 2 +-
> drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h | 2 ++
> drivers/gpu/drm/amd/pm/amdgpu_pm.c | 4 ++--
> drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 8 ++++----
> 4 files changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
> index 49ca8c814455..a1450f13d963 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
> @@ -1990,7 +1990,7 @@ static int amdgpu_debugfs_sclk_set(void *data, u64 val)
> uint32_t max_freq, min_freq;
> struct amdgpu_device *adev = (struct amdgpu_device *)data;
>
> - if (amdgpu_sriov_vf(adev) && !amdgpu_sriov_is_pp_one_vf(adev))
> + if (amdgpu_sriov_multi_vf_mode(adev))
> return -EINVAL;
>
> ret = pm_runtime_get_sync(adev_to_drm(adev)->dev);
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h
> index 5381b8d596e6..b28082084b3a 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h
> @@ -352,6 +352,8 @@ static inline bool is_virtual_machine(void)
>
> #define amdgpu_sriov_is_pp_one_vf(adev) \
> ((adev)->virt.gim_feature & AMDGIM_FEATURE_PP_ONE_VF)
> +#define amdgpu_sriov_multi_vf_mode(adev) \
> + (amdgpu_sriov_vf(adev) && !amdgpu_sriov_is_pp_one_vf(adev))
> #define amdgpu_sriov_is_debug(adev) \
> ((!amdgpu_in_reset(adev)) && adev->virt.tdr_debug)
> #define amdgpu_sriov_is_normal(adev) \
> diff --git a/drivers/gpu/drm/amd/pm/amdgpu_pm.c b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
> index e8ae7681bf0a..9d8119d91f1f 100644
> --- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c
> +++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
> @@ -2009,7 +2009,7 @@ static int pp_od_clk_voltage_attr_update(struct amdgpu_device *adev, struct amdg
> /* Enable pp_od_clk_voltage node for gc 9.4.3 SRIOV/BM support */
> if (gc_ver == IP_VERSION(9, 4, 3) ||
> gc_ver == IP_VERSION(9, 4, 4)) {
> - if (amdgpu_sriov_vf(adev) && !amdgpu_sriov_is_pp_one_vf(adev))
> + if (amdgpu_sriov_multi_vf_mode(adev))
> *states = ATTR_STATE_UNSUPPORTED;
> return 0;
> }
> @@ -2044,7 +2044,7 @@ static int pp_dpm_dcefclk_attr_update(struct amdgpu_device *adev, struct amdgpu_
> * setting should not be allowed from VF if not in one VF mode.
> */
> if (gc_ver >= IP_VERSION(10, 0, 0) ||
> - (amdgpu_sriov_vf(adev) && !amdgpu_sriov_is_pp_one_vf(adev))) {
> + (amdgpu_sriov_multi_vf_mode(adev))) {
> dev_attr->attr.mode &= ~S_IWUGO;
> dev_attr->store = NULL;
> }
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
> index 8ca793c222ff..b4bdad79221e 100644
> --- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
> +++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
> @@ -1825,7 +1825,7 @@ static int smu_hw_init(struct amdgpu_ip_block *ip_block)
> struct amdgpu_device *adev = ip_block->adev;
> struct smu_context *smu = adev->powerplay.pp_handle;
>
> - if (amdgpu_sriov_vf(adev) && !amdgpu_sriov_is_pp_one_vf(adev)) {
> + if (amdgpu_sriov_multi_vf_mode(adev)) {
> smu->pm_enabled = false;
> return 0;
> }
> @@ -2048,7 +2048,7 @@ static int smu_hw_fini(struct amdgpu_ip_block *ip_block)
> struct smu_context *smu = adev->powerplay.pp_handle;
> int i, ret;
>
> - if (amdgpu_sriov_vf(adev) && !amdgpu_sriov_is_pp_one_vf(adev))
> + if (amdgpu_sriov_multi_vf_mode(adev))
> return 0;
>
> for (i = 0; i < adev->vcn.num_vcn_inst; i++)
> @@ -2116,7 +2116,7 @@ static int smu_suspend(struct amdgpu_ip_block *ip_block)
> int ret;
> uint64_t count;
>
> - if (amdgpu_sriov_vf(adev) && !amdgpu_sriov_is_pp_one_vf(adev))
> + if (amdgpu_sriov_multi_vf_mode(adev))
> return 0;
>
> if (!smu->pm_enabled)
> @@ -2152,7 +2152,7 @@ static int smu_resume(struct amdgpu_ip_block *ip_block)
> struct amdgpu_device *adev = ip_block->adev;
> struct smu_context *smu = adev->powerplay.pp_handle;
>
> - if (amdgpu_sriov_vf(adev)&& !amdgpu_sriov_is_pp_one_vf(adev))
> + if (amdgpu_sriov_multi_vf_mode(adev))
> return 0;
>
> if (!smu->pm_enabled)
prev parent reply other threads:[~2025-02-07 8:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-07 6:03 [PATCH v3 1/2] drm/amdgpu: Add amdgpu_sriov_multi_vf_mode function Emily Deng
2025-02-07 6:03 ` [PATCH v3 2/2] drm/amdgpu: set CP_HQD_PQ_DOORBELL_CONTROL.DOORBELL_MODE to 1 for sriov multiple vf Emily Deng
2025-02-07 8:35 ` Lazar, Lijo
2025-02-07 8:06 ` Lazar, Lijo [this message]
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=046323ba-868a-4608-9ea9-aba864dc9b58@amd.com \
--to=lijo.lazar@amd.com \
--cc=Emily.Deng@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.