[PATCH] drm/amdgpu: Set the bit of ip_block_mask correspond to the IP block define

Liu, Shaoyun Shaoyun.Liu at amd.com
Thu Feb 1 20:32:43 UTC 2018


Can you provide the example of which different block with the same type and why we want to do that ? 
With the old implementation , the bit mask is depends on the order that driver call the  amdgpu_device_ip_block_add(),  they are not fixed .  With this change ,at least developer can count out how to set the  bit mask after check the ip type defines and  they are fixed for amdgpu driver . 

Regards
Shaoyun.liu


-----Original Message-----
From: Christian König [mailto:ckoenig.leichtzumerken at gmail.com] 
Sent: Thursday, February 01, 2018 3:17 PM
To: Liu, Shaoyun; amd-gfx at lists.freedesktop.org
Subject: Re: [PATCH] drm/amdgpu: Set the bit of ip_block_mask correspond to the IP block define

NAK, there might be different blocks with the same type and we want to be able to disable/enable them individually.

But we could improve a bit printing which block has which number during startup.

Regards,
Christian.

Am 01.02.2018 um 21:10 schrieb Shaoyun Liu:
> Change-Id: I4bdc6dbcd82f32416f65e0a38fb9c3cb580684bf
> Signed-off-by: Shaoyun Liu <Shaoyun.Liu at amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index 21be5e5..05bf9b6 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -1297,7 +1297,8 @@ static int amdgpu_device_ip_early_init(struct amdgpu_device *adev)
>   	}
>   
>   	for (i = 0; i < adev->num_ip_blocks; i++) {
> -		if ((amdgpu_ip_block_mask & (1 << i)) == 0) {
> +		if ((amdgpu_ip_block_mask &
> +			(1 << adev->ip_blocks[i].version->type)) == 0) {
>   			DRM_ERROR("disabled ip block: %d <%s>\n",
>   				  i, adev->ip_blocks[i].version->funcs->name);
>   			adev->ip_blocks[i].status.valid = false;



More information about the amd-gfx mailing list