drm/amdgpu: rename amdgpu_ip_funcs to amd_ip_funcs (v2)
authoryanyang1 <young.yang@amd.com>
Fri, 22 May 2015 18:39:35 +0000 (14:39 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 4 Jun 2015 01:03:51 +0000 (21:03 -0400)
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 <Jammy.Zhou@amd.com>
Signed-off-by: yanyang1 <young.yang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
55 files changed:
drivers/gpu/drm/amd/amdgpu/Makefile
drivers/gpu/drm/amd/amdgpu/amdgpu.h
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
drivers/gpu/drm/amd/amdgpu/ci_dpm.c
drivers/gpu/drm/amd/amdgpu/cik.c
drivers/gpu/drm/amd/amdgpu/cik.h
drivers/gpu/drm/amd/amdgpu/cik_dpm.h
drivers/gpu/drm/amd/amdgpu/cik_ih.c
drivers/gpu/drm/amd/amdgpu/cik_ih.h
drivers/gpu/drm/amd/amdgpu/cik_sdma.c
drivers/gpu/drm/amd/amdgpu/cik_sdma.h
drivers/gpu/drm/amd/amdgpu/cz_dpm.c
drivers/gpu/drm/amd/amdgpu/cz_ih.c
drivers/gpu/drm/amd/amdgpu/cz_ih.h
drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
drivers/gpu/drm/amd/amdgpu/dce_v10_0.h
drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
drivers/gpu/drm/amd/amdgpu/dce_v11_0.h
drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
drivers/gpu/drm/amd/amdgpu/dce_v8_0.h
drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
drivers/gpu/drm/amd/amdgpu/gfx_v7_0.h
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.h
drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
drivers/gpu/drm/amd/amdgpu/gmc_v7_0.h
drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
drivers/gpu/drm/amd/amdgpu/gmc_v8_0.h
drivers/gpu/drm/amd/amdgpu/iceland_dpm.c
drivers/gpu/drm/amd/amdgpu/iceland_ih.c
drivers/gpu/drm/amd/amdgpu/iceland_ih.h
drivers/gpu/drm/amd/amdgpu/kv_dpm.c
drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
drivers/gpu/drm/amd/amdgpu/sdma_v2_4.h
drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
drivers/gpu/drm/amd/amdgpu/sdma_v3_0.h
drivers/gpu/drm/amd/amdgpu/tonga_dpm.c
drivers/gpu/drm/amd/amdgpu/tonga_ih.c
drivers/gpu/drm/amd/amdgpu/tonga_ih.h
drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c
drivers/gpu/drm/amd/amdgpu/uvd_v4_2.h
drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c
drivers/gpu/drm/amd/amdgpu/uvd_v5_0.h
drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c
drivers/gpu/drm/amd/amdgpu/uvd_v6_0.h
drivers/gpu/drm/amd/amdgpu/vce_v2_0.c
drivers/gpu/drm/amd/amdgpu/vce_v2_0.h
drivers/gpu/drm/amd/amdgpu/vce_v3_0.c
drivers/gpu/drm/amd/amdgpu/vce_v3_0.h
drivers/gpu/drm/amd/amdgpu/vi.c
drivers/gpu/drm/amd/amdgpu/vi.h
drivers/gpu/drm/amd/amdgpu/vi_dpm.h
drivers/gpu/drm/amd/include/amd_shared.h [new file with mode: 0644]

index 9a573e8..616dfd4 100644 (file)
@@ -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
 
index 411cfb9..80f0bea 100644 (file)
@@ -44,6 +44,7 @@
 
 #include <drm/drm_gem.h>
 
+#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 {
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge