AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Lazar, Lijo" <lijo.lazar@amd.com>
To: Alex Deucher <alexander.deucher@amd.com>, amd-gfx@lists.freedesktop.org
Cc: James Zhu <James.Zhu@amd.com>
Subject: Re: [PATCH] drm/amdgpu: handle VCN instances when harvesting (v2)
Date: Tue, 10 Aug 2021 17:34:14 +0530	[thread overview]
Message-ID: <7630c832-caea-b78d-8e3f-a945a8a5afa9@amd.com> (raw)
In-Reply-To: <20210810030313.997451-1-alexander.deucher@amd.com>



On 8/10/2021 8:33 AM, Alex Deucher wrote:
> There may be multiple instances and only one is harvested.
> 
> v2: fix typo in commit message
> 
> Fixes: 83a0b8639185 ("drm/amdgpu: add judgement when add ip blocks (v2)")
> Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1673
> Reviewed-by: James Zhu <James.Zhu@amd.com>
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 12 +++++++++---
>   1 file changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
> index 43e7b61d1c5c..ada7bc19118a 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
> @@ -299,6 +299,9 @@ int amdgpu_discovery_reg_base_init(struct amdgpu_device *adev)
>   				  ip->major, ip->minor,
>   				  ip->revision);
>   
> +			if (le16_to_cpu(ip->hw_id) == VCN_HWID)
> +				adev->vcn.num_vcn_inst++;
> +
>   			for (k = 0; k < num_base_address; k++) {
>   				/*
>   				 * convert the endianness of base addresses in place,
> @@ -385,7 +388,7 @@ void amdgpu_discovery_harvest_ip(struct amdgpu_device *adev)
>   {
>   	struct binary_header *bhdr;
>   	struct harvest_table *harvest_info;
> -	int i;
> +	int i, vcn_harvest_count = 0;
>   
>   	bhdr = (struct binary_header *)adev->mman.discovery_bin;
>   	harvest_info = (struct harvest_table *)(adev->mman.discovery_bin +
> @@ -397,8 +400,7 @@ void amdgpu_discovery_harvest_ip(struct amdgpu_device *adev)
>   
>   		switch (le32_to_cpu(harvest_info->list[i].hw_id)) {
>   		case VCN_HWID:
> -			adev->harvest_ip_mask |= AMD_HARVEST_IP_VCN_MASK;
> -			adev->harvest_ip_mask |= AMD_HARVEST_IP_JPEG_MASK;
> +			vcn_harvest_count++;
>   			break;
>   		case DMU_HWID:
>   			adev->harvest_ip_mask |= AMD_HARVEST_IP_DMU_MASK;
> @@ -407,6 +409,10 @@ void amdgpu_discovery_harvest_ip(struct amdgpu_device *adev)
>   			break;
>   		}
>   	}
> +	if (vcn_harvest_count == adev->vcn.num_vcn_inst) {
> +		adev->harvest_ip_mask |= AMD_HARVEST_IP_VCN_MASK;
> +		adev->harvest_ip_mask |= AMD_HARVEST_IP_JPEG_MASK;
> +	}

If there is only one out of two harvested, I think we should add 
something like
	adev->vcn.num_vcn_inst -= vcn_harvest_count;

at the end to reflect the actual number of VCN instances available.

Thanks,
Lijo

>   }
>   
>   int amdgpu_discovery_get_gfx_info(struct amdgpu_device *adev)
> 

  parent reply	other threads:[~2021-08-10 12:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-10  3:03 [PATCH] drm/amdgpu: handle VCN instances when harvesting (v2) Alex Deucher
2021-08-10  3:06 ` Chen, Guchun
2021-08-10 12:04 ` Lazar, Lijo [this message]
2021-08-10 12:13   ` Lazar, Lijo

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=7630c832-caea-b78d-8e3f-a945a8a5afa9@amd.com \
    --to=lijo.lazar@amd.com \
    --cc=James.Zhu@amd.com \
    --cc=alexander.deucher@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