From: yanyang1 Date: Fri, 22 May 2015 18:39:35 +0000 (-0400) Subject: drm/amdgpu: rename amdgpu_ip_funcs to amd_ip_funcs (v2) X-Git-Tag: omap-for-v4.2/fixes-rc1^2~17^2~25^2~19 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5fc3aeeb9e553a20ce62544f7176c6c4aca52d71;p=pandora-kernel.git drm/amdgpu: rename amdgpu_ip_funcs to amd_ip_funcs (v2) The structure is renamed and moved to amd_shared.h to make the component independent. This makes it easier to add new components in the future. v2: fix include path Reviewed-by: Jammy Zhou Signed-off-by: yanyang1 Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdgpu/Makefile b/drivers/gpu/drm/amd/amdgpu/Makefile index 9a573e87cdd3..616dfd4a1398 100644 --- a/drivers/gpu/drm/amd/amdgpu/Makefile +++ b/drivers/gpu/drm/amd/amdgpu/Makefile @@ -2,7 +2,8 @@ # Makefile for the drm device driver. This driver provides support for the # Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher. -ccflags-y := -Iinclude/drm -Idrivers/gpu/drm/amd/include/asic_reg +ccflags-y := -Iinclude/drm -Idrivers/gpu/drm/amd/include/asic_reg \ + -Idrivers/gpu/drm/amd/include amdgpu-y := amdgpu_drv.o diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index 411cfb91170f..80f0bea52e33 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h @@ -44,6 +44,7 @@ #include +#include "amd_shared.h" #include "amdgpu_family.h" #include "amdgpu_mode.h" #include "amdgpu_ih.h" @@ -205,86 +206,28 @@ enum amdgpu_thermal_irq { AMDGPU_THERMAL_IRQ_LAST }; -/* - * IP block functions - */ -enum amdgpu_ip_block_type { - AMDGPU_IP_BLOCK_TYPE_COMMON, - AMDGPU_IP_BLOCK_TYPE_GMC, - AMDGPU_IP_BLOCK_TYPE_IH, - AMDGPU_IP_BLOCK_TYPE_SMC, - AMDGPU_IP_BLOCK_TYPE_DCE, - AMDGPU_IP_BLOCK_TYPE_GFX, - AMDGPU_IP_BLOCK_TYPE_SDMA, - AMDGPU_IP_BLOCK_TYPE_UVD, - AMDGPU_IP_BLOCK_TYPE_VCE, -}; - -enum amdgpu_clockgating_state { - AMDGPU_CG_STATE_GATE = 0, - AMDGPU_CG_STATE_UNGATE, -}; - -enum amdgpu_powergating_state { - AMDGPU_PG_STATE_GATE = 0, - AMDGPU_PG_STATE_UNGATE, -}; - -struct amdgpu_ip_funcs { - /* sets up early driver state (pre sw_init), does not configure hw - Optional */ - int (*early_init)(struct amdgpu_device *adev); - /* sets up late driver/hw state (post hw_init) - Optional */ - int (*late_init)(struct amdgpu_device *adev); - /* sets up driver state, does not configure hw */ - int (*sw_init)(struct amdgpu_device *adev); - /* tears down driver state, does not configure hw */ - int (*sw_fini)(struct amdgpu_device *adev); - /* sets up the hw state */ - int (*hw_init)(struct amdgpu_device *adev); - /* tears down the hw state */ - int (*hw_fini)(struct amdgpu_device *adev); - /* handles IP specific hw/sw changes for suspend */ - int (*suspend)(struct amdgpu_device *adev); - /* handles IP specific hw/sw changes for resume */ - int (*resume)(struct amdgpu_device *adev); - /* returns current IP block idle status */ - bool (*is_idle)(struct amdgpu_device *adev); - /* poll for idle */ - int (*wait_for_idle)(struct amdgpu_device *adev); - /* soft reset the IP block */ - int (*soft_reset)(struct amdgpu_device *adev); - /* dump the IP block status registers */ - void (*print_status)(struct amdgpu_device *adev); - /* enable/disable cg for the IP block */ - int (*set_clockgating_state)(struct amdgpu_device *adev, - enum amdgpu_clockgating_state state); - /* enable/disable pg for the IP block */ - int (*set_powergating_state)(struct amdgpu_device *adev, - enum amdgpu_powergating_state state); -}; - int amdgpu_set_clockgating_state(struct amdgpu_device *adev, - enum amdgpu_ip_block_type block_type, - enum amdgpu_clockgating_state state); + enum amd_ip_block_type block_type, + enum amd_clockgating_state state); int amdgpu_set_powergating_state(struct amdgpu_device *adev, - enum amdgpu_ip_block_type block_type, - enum amdgpu_powergating_state state); + enum amd_ip_block_type block_type, + enum amd_powergating_state state); struct amdgpu_ip_block_version { - enum amdgpu_ip_block_type type; + enum amd_ip_block_type type; u32 major; u32 minor; u32 rev; - const struct amdgpu_ip_funcs *funcs; + const struct amd_ip_funcs *funcs; }; int amdgpu_ip_block_version_cmp(struct amdgpu_device *adev, - enum amdgpu_ip_block_type type, + enum amd_ip_block_type type, u32 major, u32 minor); const struct amdgpu_ip_block_version * amdgpu_get_ip_block( struct amdgpu_device *adev, - enum amdgpu_ip_block_type type); + enum amd_ip_block_type type); /* provided by hw blocks that can move/clear data. e.g., gfx or sdma */ struct amdgpu_buffer_funcs { Reading git-diff-tree failed