[PATCH] drm/amdgpu: rework IP block registration

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am 13.10.2016 um 23:58 schrieb Alex Deucher:
> This makes it easier to replace specific IP blocks on
> asics for handling virtual_dce, DAL, etc. and for building
> IP lists for hw or tables.  This also stored the status
> information in the same structure.
>
> Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
...
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.h
> index da5cf47..c0c4bfd 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.h
> @@ -23,11 +23,11 @@
>    *
>    */
>   
> -#ifndef __AMDGPU_POPWERPLAY_H__
> -#define __AMDGPU_POPWERPLAY_H__
> +#ifndef __AMDGPU_POWERPLAY_H__
> +#define __AMDGPU_POWERPLAY_H__

Would be nice to have that in a separate patch.

> +int cik_set_ip_blocks(struct amdgpu_device *adev)
> +{
> +	switch (adev->asic_type) {
> +	case CHIP_BONAIRE:
> +		adev->ip_blocks[adev->num_ip_blocks++].version = &cik_common_ip_block;
> +		adev->ip_blocks[adev->num_ip_blocks++].version = &gmc_v7_0_ip_block;
> +		adev->ip_blocks[adev->num_ip_blocks++].version = &cik_ih_ip_block;
> +		adev->ip_blocks[adev->num_ip_blocks++].version = &amdgpu_pp_ip_block;
> +		if (adev->enable_virtual_display)
> +			adev->ip_blocks[adev->num_ip_blocks++].version = &dce_virtual_ip_block;
> +		else
> +			adev->ip_blocks[adev->num_ip_blocks++].version = &dce_v8_2_ip_block;
> +		adev->ip_blocks[adev->num_ip_blocks++].version = &gfx_v7_2_ip_block;
> +		adev->ip_blocks[adev->num_ip_blocks++].version = &cik_sdma_ip_block;
> +		adev->ip_blocks[adev->num_ip_blocks++].version = &uvd_v4_2_ip_block;
> +		adev->ip_blocks[adev->num_ip_blocks++].version = &vce_v2_0_ip_block;
> +		break;

I would add a function for the 
"adev->ip_blocks[adev->num_ip_blocks++].version = " part.

Maybe we will need to init some more fields in the ip_blocks in the 
future when it is registered, but at least it would look a bit cleaner.

Apart from that the patch looks good to me.

Christian.


[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux