]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/amdgpu: expand cg_flags from u32 to u64
authorEvan Quan <evan.quan@amd.com>
Fri, 25 Mar 2022 10:00:02 +0000 (18:00 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 8 Apr 2022 21:24:24 +0000 (17:24 -0400)
With this, we can support more CG flags.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
53 files changed:
drivers/gpu/drm/amd/amdgpu/amdgpu.h
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
drivers/gpu/drm/amd/amdgpu/amdgpu_df.h
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
drivers/gpu/drm/amd/amdgpu/amdgpu_hdp.h
drivers/gpu/drm/amd/amdgpu/amdgpu_mmhub.h
drivers/gpu/drm/amd/amdgpu/amdgpu_nbio.h
drivers/gpu/drm/amd/amdgpu/amdgpu_smuio.h
drivers/gpu/drm/amd/amdgpu/athub_v1_0.c
drivers/gpu/drm/amd/amdgpu/athub_v1_0.h
drivers/gpu/drm/amd/amdgpu/athub_v2_0.c
drivers/gpu/drm/amd/amdgpu/athub_v2_0.h
drivers/gpu/drm/amd/amdgpu/athub_v2_1.c
drivers/gpu/drm/amd/amdgpu/athub_v2_1.h
drivers/gpu/drm/amd/amdgpu/df_v1_7.c
drivers/gpu/drm/amd/amdgpu/df_v3_6.c
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c
drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
drivers/gpu/drm/amd/amdgpu/hdp_v4_0.c
drivers/gpu/drm/amd/amdgpu/hdp_v5_0.c
drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c
drivers/gpu/drm/amd/amdgpu/mmhub_v1_7.c
drivers/gpu/drm/amd/amdgpu/mmhub_v2_0.c
drivers/gpu/drm/amd/amdgpu/mmhub_v2_3.c
drivers/gpu/drm/amd/amdgpu/mmhub_v9_4.c
drivers/gpu/drm/amd/amdgpu/navi10_ih.c
drivers/gpu/drm/amd/amdgpu/nbio_v2_3.c
drivers/gpu/drm/amd/amdgpu/nbio_v6_1.c
drivers/gpu/drm/amd/amdgpu/nbio_v7_0.c
drivers/gpu/drm/amd/amdgpu/nbio_v7_2.c
drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c
drivers/gpu/drm/amd/amdgpu/nv.c
drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
drivers/gpu/drm/amd/amdgpu/smuio_v11_0.c
drivers/gpu/drm/amd/amdgpu/smuio_v11_0_6.c
drivers/gpu/drm/amd/amdgpu/smuio_v13_0.c
drivers/gpu/drm/amd/amdgpu/smuio_v9_0.c
drivers/gpu/drm/amd/amdgpu/soc15.c
drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c
drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c
drivers/gpu/drm/amd/amdgpu/vce_v3_0.c
drivers/gpu/drm/amd/amdgpu/vi.c
drivers/gpu/drm/amd/include/amd_shared.h
drivers/gpu/drm/amd/pm/amdgpu_pm.c
drivers/gpu/drm/amd/pm/inc/amdgpu_pm.h

index cdf0818088b3de86633cab519473213fc5c6310a..bffd24845765ff989994311977e8f699cd4c0e07 100644 (file)
@@ -179,7 +179,7 @@ extern int amdgpu_sched_jobs;
 extern int amdgpu_sched_hw_submission;
 extern uint amdgpu_pcie_gen_cap;
 extern uint amdgpu_pcie_lane_cap;
-extern uint amdgpu_cg_mask;
+extern u64 amdgpu_cg_mask;
 extern uint amdgpu_pg_mask;
 extern uint amdgpu_sdma_phase_quantum;
 extern char *amdgpu_disable_cu;
@@ -322,7 +322,7 @@ int amdgpu_device_ip_set_powergating_state(void *dev,
                                           enum amd_ip_block_type block_type,
                                           enum amd_powergating_state state);
 void amdgpu_device_ip_get_clockgating_state(struct amdgpu_device *adev,
-                                           u32 *flags);
+                                           u64 *flags);
 int amdgpu_device_ip_wait_for_idle(struct amdgpu_device *adev,
                                   enum amd_ip_block_type block_type);
 bool amdgpu_device_ip_is_idle(struct amdgpu_device *adev,
@@ -860,7 +860,7 @@ struct amdgpu_device {
        /* powerplay */
        struct amd_powerplay            powerplay;
        struct amdgpu_pm                pm;
-       u32                             cg_flags;
+       u64                             cg_flags;
        u32                             pg_flags;
 
        /* nbio */
index 5d04d24a0d5f15f6ffe7cdcd5eeb9ace1c0e29d1..1db48dc58ae9a9a946464cf2009762da70a3883f 100644 (file)
@@ -758,7 +758,7 @@ static ssize_t amdgpu_debugfs_gca_config_read(struct file *f, char __user *buf,
        /* rev==1 */
        config[no_regs++] = adev->rev_id;
        config[no_regs++] = adev->pg_flags;
-       config[no_regs++] = adev->cg_flags;
+       config[no_regs++] = lower_32_bits(adev->cg_flags);
 
        /* rev==2 */
        config[no_regs++] = adev->family;
@@ -773,6 +773,9 @@ static ssize_t amdgpu_debugfs_gca_config_read(struct file *f, char __user *buf,
        /* rev==4 APU flag */
        config[no_regs++] = adev->flags & AMD_IS_APU ? 1 : 0;
 
+       /* rev==5 CG flag upper 32bit */
+       config[no_regs++] = upper_32_bits(adev->cg_flags);
+
        while (size && (*pos < no_regs * 4)) {
                uint32_t value;
 
index 49f734137f158a6aecc6f362f9d62e1ef601fde1..fb69b4188c8ab0325ef3b69d8ab96bfb248fef3d 100644 (file)
@@ -1703,7 +1703,7 @@ int amdgpu_device_ip_set_powergating_state(void *dev,
  * clockgating is enabled.
  */
 void amdgpu_device_ip_get_clockgating_state(struct amdgpu_device *adev,
-                                           u32 *flags)
+                                           u64 *flags)
 {
        int i;
 
index 6b25837955c40b77251e24fb8396e49f0a4d55dd..1538b2dbfff1a24f070a4ec63c40deb298c73bee 100644 (file)
@@ -40,7 +40,7 @@ struct amdgpu_df_funcs {
        void (*update_medium_grain_clock_gating)(struct amdgpu_device *adev,
                                                 bool enable);
        void (*get_clockgating_state)(struct amdgpu_device *adev,
-                                     u32 *flags);
+                                     u64 *flags);
        void (*enable_ecc_force_par_wr_rmw)(struct amdgpu_device *adev,
                                            bool enable);
        int (*pmc_start)(struct amdgpu_device *adev, uint64_t config,
index 29e9419a914bb1d0cf759d6462613a2acc3800af..4efaa183abcd5fed7c39dc2605e181df0c952679 100644 (file)
@@ -136,7 +136,7 @@ int amdgpu_sched_jobs = 32;
 int amdgpu_sched_hw_submission = 2;
 uint amdgpu_pcie_gen_cap;
 uint amdgpu_pcie_lane_cap;
-uint amdgpu_cg_mask = 0xffffffff;
+u64 amdgpu_cg_mask = 0xffffffffffffffff;
 uint amdgpu_pg_mask = 0xffffffff;
 uint amdgpu_sdma_phase_quantum = 32;
 char *amdgpu_disable_cu = NULL;
@@ -454,12 +454,12 @@ MODULE_PARM_DESC(pcie_lane_cap, "PCIE Lane Caps (0: autodetect (default))");
 module_param_named(pcie_lane_cap, amdgpu_pcie_lane_cap, uint, 0444);
 
 /**
- * DOC: cg_mask (uint)
+ * DOC: cg_mask (ullong)
  * Override Clockgating features enabled on GPU (0 = disable clock gating). See the AMD_CG_SUPPORT flags in
- * drivers/gpu/drm/amd/include/amd_shared.h. The default is 0xffffffff (all enabled).
+ * drivers/gpu/drm/amd/include/amd_shared.h. The default is 0xffffffffffffffff (all enabled).
  */
 MODULE_PARM_DESC(cg_mask, "Clockgating flags mask (0 = disable clock gating)");
-module_param_named(cg_mask, amdgpu_cg_mask, uint, 0444);
+module_param_named(cg_mask, amdgpu_cg_mask, ullong, 0444);
 
 /**
  * DOC: pg_mask (uint)
index 9181c7bef7c67fe1d1c8f8b3d23aceecc93bb0bc..ac5c61d3de2b8bc4e55d579af9880d38eab83a37 100644 (file)
@@ -33,7 +33,7 @@ struct amdgpu_hdp_funcs {
        void (*invalidate_hdp)(struct amdgpu_device *adev,
                               struct amdgpu_ring *ring);
        void (*update_clock_gating)(struct amdgpu_device *adev, bool enable);
-       void (*get_clock_gating_state)(struct amdgpu_device *adev, u32 *flags);
+       void (*get_clock_gating_state)(struct amdgpu_device *adev, u64 *flags);
        void (*init_registers)(struct amdgpu_device *adev);
 };
 
index 9f1540f0ebf9148540115b2d3447d5c4a7d94490..f939395c5914481f916f4ba53068418ba4b0d98f 100644 (file)
@@ -34,7 +34,7 @@ struct amdgpu_mmhub_funcs {
        void (*gart_disable)(struct amdgpu_device *adev);
        int (*set_clockgating)(struct amdgpu_device *adev,
                               enum amd_clockgating_state state);
-       void (*get_clockgating)(struct amdgpu_device *adev, u32 *flags);
+       void (*get_clockgating)(struct amdgpu_device *adev, u64 *flags);
        void (*setup_vm_pt_regs)(struct amdgpu_device *adev, uint32_t vmid,
                                uint64_t page_table_base);
        void (*update_power_gating)(struct amdgpu_device *adev,
index 3d13e601fc35d9bfee1f5bff1a36ae9e92ff10cf..03439083182a2d7c444f5e9d3dff1da64d291f78 100644 (file)
@@ -83,7 +83,7 @@ struct amdgpu_nbio_funcs {
        void (*update_medium_grain_light_sleep)(struct amdgpu_device *adev,
                                                bool enable);
        void (*get_clockgating_state)(struct amdgpu_device *adev,
-                                     u32 *flags);
+                                     u64 *flags);
        void (*ih_control)(struct amdgpu_device *adev);
        void (*init_registers)(struct amdgpu_device *adev);
        void (*remap_hdp_registers)(struct amdgpu_device *adev);
index 484bb3dcec473eb2defd036692fc745caa91bf5f..c7a823f3f2c592fb8a7a6ca75a0ac4122090c909 100644 (file)
@@ -27,7 +27,7 @@ struct amdgpu_smuio_funcs {
        u32 (*get_rom_index_offset)(struct amdgpu_device *adev);
        u32 (*get_rom_data_offset)(struct amdgpu_device *adev);
        void (*update_rom_clock_gating)(struct amdgpu_device *adev, bool enable);
-       void (*get_clock_gating_state)(struct amdgpu_device *adev, u32 *flags);
+       void (*get_clock_gating_state)(struct amdgpu_device *adev, u64 *flags);
        u32 (*get_die_id)(struct amdgpu_device *adev);
        u32 (*get_socket_id)(struct amdgpu_device *adev);
        bool (*is_host_gpu_xgmi_supported)(struct amdgpu_device *adev);
index 88642e7ecdf40254b73a5dd0659dbac3c435b3be..a13c443ea10f4a7675a5938609d19b47cc7cf213 100644 (file)
@@ -87,7 +87,7 @@ int athub_v1_0_set_clockgating(struct amdgpu_device *adev,
        return 0;
 }
 
-void athub_v1_0_get_clockgating(struct amdgpu_device *adev, u32 *flags)
+void athub_v1_0_get_clockgating(struct amdgpu_device *adev, u64 *flags)
 {
        int data;
 
index b279af59e34f7fb837914e09cc7cfd16fa914646..6be0a6704ea78e3d568cc72723c249e32d364276 100644 (file)
@@ -25,6 +25,6 @@
 
 int athub_v1_0_set_clockgating(struct amdgpu_device *adev,
                               enum amd_clockgating_state state);
-void athub_v1_0_get_clockgating(struct amdgpu_device *adev, u32 *flags);
+void athub_v1_0_get_clockgating(struct amdgpu_device *adev, u64 *flags);
 
 #endif
index a720436857b473986fa5f0b6d7b27abd97c92f01..a9521c98e7f76b3cd0518c06e869483d2d34b269 100644 (file)
@@ -93,7 +93,7 @@ int athub_v2_0_set_clockgating(struct amdgpu_device *adev,
        return 0;
 }
 
-void athub_v2_0_get_clockgating(struct amdgpu_device *adev, u32 *flags)
+void athub_v2_0_get_clockgating(struct amdgpu_device *adev, u64 *flags)
 {
        int data;
 
index 02932c1c8babf338d72705578db7d306d01c3d21..8b763f6dfd819933ca97bf1a8679ff1619283a88 100644 (file)
@@ -25,6 +25,6 @@
 
 int athub_v2_0_set_clockgating(struct amdgpu_device *adev,
                               enum amd_clockgating_state state);
-void athub_v2_0_get_clockgating(struct amdgpu_device *adev, u32 *flags);
+void athub_v2_0_get_clockgating(struct amdgpu_device *adev, u64 *flags);
 
 #endif
index ad8e87d3d2cb115365c0597fb47f768cf9478901..78508ae6a670feb866bd48c8ebae95955ff4b735 100644 (file)
@@ -85,7 +85,7 @@ int athub_v2_1_set_clockgating(struct amdgpu_device *adev,
        return 0;
 }
 
-void athub_v2_1_get_clockgating(struct amdgpu_device *adev, u32 *flags)
+void athub_v2_1_get_clockgating(struct amdgpu_device *adev, u64 *flags)
 {
        int data;
 
index 5e6824c0f591daf95a4eb563129b65a87891e59c..b799f14bce03a8e4627897b4db81d000a67b89f0 100644 (file)
@@ -25,6 +25,6 @@
 
 int athub_v2_1_set_clockgating(struct amdgpu_device *adev,
                               enum amd_clockgating_state state);
-void athub_v2_1_get_clockgating(struct amdgpu_device *adev, u32 *flags);
+void athub_v2_1_get_clockgating(struct amdgpu_device *adev, u64 *flags);
 
 #endif
index 2d01ac0d4c11b47ffb2bd7e3cd2632b2559652d0..b991609f46c108167fcc195fd963549a8a2c2ed5 100644 (file)
@@ -99,7 +99,7 @@ static void df_v1_7_update_medium_grain_clock_gating(struct amdgpu_device *adev,
 }
 
 static void df_v1_7_get_clockgating_state(struct amdgpu_device *adev,
-                                         u32 *flags)
+                                         u64 *flags)
 {
        u32 tmp;
 
index f4dfca013ec5122b66d3062822cca8673ff902cf..483a441b46aa1051f78820296095b0a1368b2bc2 100644 (file)
@@ -332,7 +332,7 @@ static void df_v3_6_update_medium_grain_clock_gating(struct amdgpu_device *adev,
 }
 
 static void df_v3_6_get_clockgating_state(struct amdgpu_device *adev,
-                                         u32 *flags)
+                                         u64 *flags)
 {
        u32 tmp;
 
index 9426e252d8aa6c67618b8244d3791e3e37ce0e28..5147358f240069ec663750f1b09e7d89ecfecbec 100644 (file)
@@ -8451,7 +8451,7 @@ static int gfx_v10_0_set_clockgating_state(void *handle,
        return 0;
 }
 
-static void gfx_v10_0_get_clockgating_state(void *handle, u32 *flags)
+static void gfx_v10_0_get_clockgating_state(void *handle, u64 *flags)
 {
        struct amdgpu_device *adev = (struct amdgpu_device *)handle;
        int data;
index 5f112efda634b1ee1c2630cd144b5144dd801489..46d436be74ebdcbe65bbc14d41428926f9a121df 100644 (file)
@@ -5475,7 +5475,7 @@ static int gfx_v8_0_set_powergating_state(void *handle,
        return 0;
 }
 
-static void gfx_v8_0_get_clockgating_state(void *handle, u32 *flags)
+static void gfx_v8_0_get_clockgating_state(void *handle, u64 *flags)
 {
        struct amdgpu_device *adev = (struct amdgpu_device *)handle;
        int data;
index b8cfcc6b1125ccfe99b262fb03ae26dd295f19fa..26535ebec4983ef16642857e501f277d5117c5c2 100644 (file)
@@ -5233,7 +5233,7 @@ static int gfx_v9_0_set_clockgating_state(void *handle,
        return 0;
 }
 
-static void gfx_v9_0_get_clockgating_state(void *handle, u32 *flags)
+static void gfx_v9_0_get_clockgating_state(void *handle, u64 *flags)
 {
        struct amdgpu_device *adev = (struct amdgpu_device *)handle;
        int data;
index 5228421b0f724745f111737d6a79f418cb2f595c..a455e59f41f4b0266c4976bee025be49d11a7a73 100644 (file)
@@ -1161,7 +1161,7 @@ static int gmc_v10_0_set_clockgating_state(void *handle,
                return athub_v2_0_set_clockgating(adev, state);
 }
 
-static void gmc_v10_0_get_clockgating_state(void *handle, u32 *flags)
+static void gmc_v10_0_get_clockgating_state(void *handle, u64 *flags)
 {
        struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 
index 1932a3e4af7e2e75dd530e416459e85993470b04..382dde1ce74c075f90676336c3d854f1dbca6b23 100644 (file)
@@ -1690,7 +1690,7 @@ static int gmc_v8_0_set_powergating_state(void *handle,
        return 0;
 }
 
-static void gmc_v8_0_get_clockgating_state(void *handle, u32 *flags)
+static void gmc_v8_0_get_clockgating_state(void *handle, u64 *flags)
 {
        struct amdgpu_device *adev = (struct amdgpu_device *)handle;
        int data;
index 6009fbfdcc198bcdf82aa5a3bc127163741bd27d..22761a3bb8181e076611ac4eef57eb4182a908c7 100644 (file)
@@ -1948,7 +1948,7 @@ static int gmc_v9_0_set_clockgating_state(void *handle,
        return 0;
 }
 
-static void gmc_v9_0_get_clockgating_state(void *handle, u32 *flags)
+static void gmc_v9_0_get_clockgating_state(void *handle, u64 *flags)
 {
        struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 
index 0462166352625dfe335504a416f6d6f08e6ab23b..adf89680f53eb15eb32d170b9ee7eae188157cad 100644 (file)
@@ -124,7 +124,7 @@ static void hdp_v4_0_update_clock_gating(struct amdgpu_device *adev,
 }
 
 static void hdp_v4_0_get_clockgating_state(struct amdgpu_device *adev,
-                                           u32 *flags)
+                                           u64 *flags)
 {
        int data;
 
index 5793977953cc41dc1016ab432ad50d145abc363b..a9ea23fa0def7f3844094d27ac90080b4b9b0e18 100644 (file)
@@ -181,7 +181,7 @@ static void hdp_v5_0_update_clock_gating(struct amdgpu_device *adev,
 }
 
 static void hdp_v5_0_get_clockgating_state(struct amdgpu_device *adev,
-                                           u32 *flags)
+                                           u64 *flags)
 {
        uint32_t tmp;
 
index 4c9f0c0f31168a61d74dc0f5222142e82ed6c60b..3f44a099c52a419acd877edd40c6ffff5878dccd 100644 (file)
@@ -546,7 +546,7 @@ static int mmhub_v1_0_set_clockgating(struct amdgpu_device *adev,
        return 0;
 }
 
-static void mmhub_v1_0_get_clockgating(struct amdgpu_device *adev, u32 *flags)
+static void mmhub_v1_0_get_clockgating(struct amdgpu_device *adev, u64 *flags)
 {
        int data, data1;
 
index 3b901f941627ef2d0163a99efaa8d1b7443aec13..6fa7090bc6cbe35c92c0843a171c7ea7940e70f6 100644 (file)
@@ -542,7 +542,7 @@ static int mmhub_v1_7_set_clockgating(struct amdgpu_device *adev,
        return 0;
 }
 
-static void mmhub_v1_7_get_clockgating(struct amdgpu_device *adev, u32 *flags)
+static void mmhub_v1_7_get_clockgating(struct amdgpu_device *adev, u64 *flags)
 {
        int data, data1;
 
index 3718ff610ab286e97045b42407aaf519258be3ea..636abd8556865ed71743ebcae18bee3ceafd584a 100644 (file)
@@ -682,7 +682,7 @@ static int mmhub_v2_0_set_clockgating(struct amdgpu_device *adev,
        return 0;
 }
 
-static void mmhub_v2_0_get_clockgating(struct amdgpu_device *adev, u32 *flags)
+static void mmhub_v2_0_get_clockgating(struct amdgpu_device *adev, u64 *flags)
 {
        int data, data1;
 
index 1957fb098c4d5040e7af53956044d577a5c3d09a..ff44c5364a8cd87922336da343de96c072b9624d 100644 (file)
@@ -577,7 +577,7 @@ static int mmhub_v2_3_set_clockgating(struct amdgpu_device *adev,
        return 0;
 }
 
-static void mmhub_v2_3_get_clockgating(struct amdgpu_device *adev, u32 *flags)
+static void mmhub_v2_3_get_clockgating(struct amdgpu_device *adev, u64 *flags)
 {
        int data, data1, data2, data3;
 
index 619106f7d23de9c42e36867759d03318ba5fe592..6e0145b2b408a07dda1c485ba602a5e0961f2c4a 100644 (file)
@@ -647,7 +647,7 @@ static int mmhub_v9_4_set_clockgating(struct amdgpu_device *adev,
        return 0;
 }
 
-static void mmhub_v9_4_get_clockgating(struct amdgpu_device *adev, u32 *flags)
+static void mmhub_v9_4_get_clockgating(struct amdgpu_device *adev, u64 *flags)
 {
        int data, data1;
 
index 8ce5b8ca1fd791133f738372b516b3e01a94a90d..97201ab0965e67916a3237086f0314367a075812 100644 (file)
@@ -685,7 +685,7 @@ static int navi10_ih_set_powergating_state(void *handle,
        return 0;
 }
 
-static void navi10_ih_get_clockgating_state(void *handle, u32 *flags)
+static void navi10_ih_get_clockgating_state(void *handle, u64 *flags)
 {
        struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 
index ee7cab37dfd58a0a76ec658c8bf1e0d06dca37b1..6cd1fb2eb91310676850939f0ac1f15b53b130ed 100644 (file)
@@ -278,7 +278,7 @@ static void nbio_v2_3_update_medium_grain_light_sleep(struct amdgpu_device *adev
 }
 
 static void nbio_v2_3_get_clockgating_state(struct amdgpu_device *adev,
-                                           u32 *flags)
+                                           u64 *flags)
 {
        int data;
 
index 4bbacf1be25a413b9ae1af0c064421333c7e2acb..f7f6ddebd3e49b6ec55f411fda96cf4d35959f33 100644 (file)
@@ -210,7 +210,7 @@ static void nbio_v6_1_update_medium_grain_light_sleep(struct amdgpu_device *adev
 }
 
 static void nbio_v6_1_get_clockgating_state(struct amdgpu_device *adev,
-                                           u32 *flags)
+                                           u64 *flags)
 {
        int data;
 
index 37a4039fdfc53da3b85a4a18bc05e2891bee4671..aa0326d00c7247d3c6509d68bb4b81b21011dcb7 100644 (file)
@@ -205,7 +205,7 @@ static void nbio_v7_0_update_medium_grain_light_sleep(struct amdgpu_device *adev
 }
 
 static void nbio_v7_0_get_clockgating_state(struct amdgpu_device *adev,
-                                           u32 *flags)
+                                           u64 *flags)
 {
        int data;
 
index 6f81de6f3cc49010c589d3584b2559df1f48f191..31776b12e4c45e70fd570a19aa72d93685a16ec1 100644 (file)
@@ -306,7 +306,7 @@ static void nbio_v7_2_update_medium_grain_light_sleep(struct amdgpu_device *adev
 }
 
 static void nbio_v7_2_get_clockgating_state(struct amdgpu_device *adev,
-                                           u32 *flags)
+                                           u64 *flags)
 {
        int data;
 
index c2357e83a8c417dda74a510a7488a1cd71d4a4be..4531761dcf77f32d322a95a17b34d2182588e788 100644 (file)
@@ -273,7 +273,7 @@ static void nbio_v7_4_update_medium_grain_light_sleep(struct amdgpu_device *adev
 }
 
 static void nbio_v7_4_get_clockgating_state(struct amdgpu_device *adev,
-                                           u32 *flags)
+                                           u64 *flags)
 {
        int data;
 
index e19f14c3ef59f7cbefebed55a2ab50a9ea5815b1..0a7946c59a42a1f64cb580c0a84ccc9a30f6f2ce 100644 (file)
@@ -1115,7 +1115,7 @@ static int nv_common_set_powergating_state(void *handle,
        return 0;
 }
 
-static void nv_common_get_clockgating_state(void *handle, u32 *flags)
+static void nv_common_get_clockgating_state(void *handle, u64 *flags)
 {
        struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 
index 4ef4feff5649a7228ec065b0c69904945a3ee2eb..3695374896edac0cd99dd756245b115e0854b8c4 100644 (file)
@@ -1535,7 +1535,7 @@ static int sdma_v3_0_set_powergating_state(void *handle,
        return 0;
 }
 
-static void sdma_v3_0_get_clockgating_state(void *handle, u32 *flags)
+static void sdma_v3_0_get_clockgating_state(void *handle, u64 *flags)
 {
        struct amdgpu_device *adev = (struct amdgpu_device *)handle;
        int data;
index d7e8f72323641cdbcbfe75f27f63f0091bde4284..8589ab1c9800fdd97a525405d59dd5089970f17b 100644 (file)
@@ -2372,7 +2372,7 @@ static int sdma_v4_0_set_powergating_state(void *handle,
        return 0;
 }
 
-static void sdma_v4_0_get_clockgating_state(void *handle, u32 *flags)
+static void sdma_v4_0_get_clockgating_state(void *handle, u64 *flags)
 {
        struct amdgpu_device *adev = (struct amdgpu_device *)handle;
        int data;
index a8d49c005f73d762c9a1b048c05dea2594dfa5b3..775aabde1ae27825a6ae51910c686aab938d0ef7 100644 (file)
@@ -1648,7 +1648,7 @@ static int sdma_v5_0_set_powergating_state(void *handle,
        return 0;
 }
 
-static void sdma_v5_0_get_clockgating_state(void *handle, u32 *flags)
+static void sdma_v5_0_get_clockgating_state(void *handle, u64 *flags)
 {
        struct amdgpu_device *adev = (struct amdgpu_device *)handle;
        int data;
index 824eace698842c0b204c3ebc6a48467abd91277c..ca50857b982d09cab4eaaa4e2f01ab1f5dfc1f41 100644 (file)
@@ -1645,7 +1645,7 @@ static int sdma_v5_2_set_powergating_state(void *handle,
        return 0;
 }
 
-static void sdma_v5_2_get_clockgating_state(void *handle, u32 *flags)
+static void sdma_v5_2_get_clockgating_state(void *handle, u64 *flags)
 {
        struct amdgpu_device *adev = (struct amdgpu_device *)handle;
        int data;
index b6f1322f908cb66fcc1a40795338ea192444d3ae..acdc40f99ab3d474c3ccf979047d6e54043fcef5 100644 (file)
@@ -59,7 +59,7 @@ static void smuio_v11_0_update_rom_clock_gating(struct amdgpu_device *adev, bool
                WREG32_SOC15(SMUIO, 0, mmCGTT_ROM_CLK_CTRL0, data);
 }
 
-static void smuio_v11_0_get_clock_gating_state(struct amdgpu_device *adev, u32 *flags)
+static void smuio_v11_0_get_clock_gating_state(struct amdgpu_device *adev, u64 *flags)
 {
        u32 data;
 
index 3a18dbb55c32815b4ace96a3417f87fa15e7529b..2afeb8b37f624fdcfdd92fff2d6c21d8a7883157 100644 (file)
@@ -56,7 +56,7 @@ static void smuio_v11_0_6_update_rom_clock_gating(struct amdgpu_device *adev, bo
                WREG32_SOC15(SMUIO, 0, mmCGTT_ROM_CLK_CTRL0, data);
 }
 
-static void smuio_v11_0_6_get_clock_gating_state(struct amdgpu_device *adev, u32 *flags)
+static void smuio_v11_0_6_get_clock_gating_state(struct amdgpu_device *adev, u64 *flags)
 {
        u32 data;
 
index 39b7c206770f6304571cee6282a91e728404957b..13e905c225924b681b16032bda12e23a394d057c 100644 (file)
@@ -58,7 +58,7 @@ static void smuio_v13_0_update_rom_clock_gating(struct amdgpu_device *adev, bool
                WREG32_SOC15(SMUIO, 0, regCGTT_ROM_CLK_CTRL0, data);
 }
 
-static void smuio_v13_0_get_clock_gating_state(struct amdgpu_device *adev, u32 *flags)
+static void smuio_v13_0_get_clock_gating_state(struct amdgpu_device *adev, u64 *flags)
 {
        u32 data;
 
index 8417890af22781322131109de20b5c9eaacaa36c..e4e30b9d481b4a098adc94e8365983943d6558cf 100644 (file)
@@ -56,7 +56,7 @@ static void smuio_v9_0_update_rom_clock_gating(struct amdgpu_device *adev, bool
                WREG32_SOC15(SMUIO, 0, mmCGTT_ROM_CLK_CTRL0, data);
 }
 
-static void smuio_v9_0_get_clock_gating_state(struct amdgpu_device *adev, u32 *flags)
+static void smuio_v9_0_get_clock_gating_state(struct amdgpu_device *adev, u64 *flags)
 {
        u32 data;
 
index 3d0251ef8d79a7cdd6d64bd2aec25ebc0b7d1097..3ee7322081d2b6fd6c07607d5178d0d54072f87f 100644 (file)
@@ -1419,7 +1419,7 @@ static int soc15_common_set_clockgating_state(void *handle,
        return 0;
 }
 
-static void soc15_common_get_clockgating_state(void *handle, u32 *flags)
+static void soc15_common_get_clockgating_state(void *handle, u64 *flags)
 {
        struct amdgpu_device *adev = (struct amdgpu_device *)handle;
        int data;
index 563493d1f8306b41b16b0b86a20aab88a1723f30..d7e31e48a2b8de27e75fcbf703e9f6eb547b77a9 100644 (file)
@@ -833,7 +833,7 @@ out:
        return ret;
 }
 
-static void uvd_v5_0_get_clockgating_state(void *handle, u32 *flags)
+static void uvd_v5_0_get_clockgating_state(void *handle, u64 *flags)
 {
        struct amdgpu_device *adev = (struct amdgpu_device *)handle;
        int data;
index 2d558c2f417df5afd5c5bff5e333298e3bb32b7b..375c440957dc507ca0d43c4790eb83f0ba00bef9 100644 (file)
@@ -1494,7 +1494,7 @@ out:
        return ret;
 }
 
-static void uvd_v6_0_get_clockgating_state(void *handle, u32 *flags)
+static void uvd_v6_0_get_clockgating_state(void *handle, u64 *flags)
 {
        struct amdgpu_device *adev = (struct amdgpu_device *)handle;
        int data;
index 142e291983b4548cf1913190d93911d87ba6b382..8def62c83ffde4889418009c53b640817b34d7b5 100644 (file)
@@ -831,7 +831,7 @@ out:
        return ret;
 }
 
-static void vce_v3_0_get_clockgating_state(void *handle, u32 *flags)
+static void vce_v3_0_get_clockgating_state(void *handle, u64 *flags)
 {
        struct amdgpu_device *adev = (struct amdgpu_device *)handle;
        int data;
index 039b90cdc3bcac9f22167d7d25489a3ffa113535..c5b88d15a6df1fd6489f5ccaeb46c502abc49e85 100644 (file)
@@ -2033,7 +2033,7 @@ static int vi_common_set_powergating_state(void *handle,
        return 0;
 }
 
-static void vi_common_get_clockgating_state(void *handle, u32 *flags)
+static void vi_common_get_clockgating_state(void *handle, u64 *flags)
 {
        struct amdgpu_device *adev = (struct amdgpu_device *)handle;
        int data;
index fe4e585781bb5039f4dd47d700d0051de50ff42b..741dae17562a580d951ae555bdd3c9aa9b200a31 100644 (file)
@@ -116,38 +116,38 @@ enum amd_powergating_state {
 
 
 /* CG flags */
-#define AMD_CG_SUPPORT_GFX_MGCG                        (1 << 0)
-#define AMD_CG_SUPPORT_GFX_MGLS                        (1 << 1)
-#define AMD_CG_SUPPORT_GFX_CGCG                        (1 << 2)
-#define AMD_CG_SUPPORT_GFX_CGLS                        (1 << 3)
-#define AMD_CG_SUPPORT_GFX_CGTS                        (1 << 4)
-#define AMD_CG_SUPPORT_GFX_CGTS_LS             (1 << 5)
-#define AMD_CG_SUPPORT_GFX_CP_LS               (1 << 6)
-#define AMD_CG_SUPPORT_GFX_RLC_LS              (1 << 7)
-#define AMD_CG_SUPPORT_MC_LS                   (1 << 8)
-#define AMD_CG_SUPPORT_MC_MGCG                 (1 << 9)
-#define AMD_CG_SUPPORT_SDMA_LS                 (1 << 10)
-#define AMD_CG_SUPPORT_SDMA_MGCG               (1 << 11)
-#define AMD_CG_SUPPORT_BIF_LS                  (1 << 12)
-#define AMD_CG_SUPPORT_UVD_MGCG                        (1 << 13)
-#define AMD_CG_SUPPORT_VCE_MGCG                        (1 << 14)
-#define AMD_CG_SUPPORT_HDP_LS                  (1 << 15)
-#define AMD_CG_SUPPORT_HDP_MGCG                        (1 << 16)
-#define AMD_CG_SUPPORT_ROM_MGCG                        (1 << 17)
-#define AMD_CG_SUPPORT_DRM_LS                  (1 << 18)
-#define AMD_CG_SUPPORT_BIF_MGCG                        (1 << 19)
-#define AMD_CG_SUPPORT_GFX_3D_CGCG             (1 << 20)
-#define AMD_CG_SUPPORT_GFX_3D_CGLS             (1 << 21)
-#define AMD_CG_SUPPORT_DRM_MGCG                        (1 << 22)
-#define AMD_CG_SUPPORT_DF_MGCG                 (1 << 23)
-#define AMD_CG_SUPPORT_VCN_MGCG                        (1 << 24)
-#define AMD_CG_SUPPORT_HDP_DS                  (1 << 25)
-#define AMD_CG_SUPPORT_HDP_SD                  (1 << 26)
-#define AMD_CG_SUPPORT_IH_CG                   (1 << 27)
-#define AMD_CG_SUPPORT_ATHUB_LS                        (1 << 28)
-#define AMD_CG_SUPPORT_ATHUB_MGCG              (1 << 29)
-#define AMD_CG_SUPPORT_JPEG_MGCG               (1 << 30)
-#define AMD_CG_SUPPORT_GFX_FGCG                        (1 << 31)
+#define AMD_CG_SUPPORT_GFX_MGCG                        (1ULL << 0)
+#define AMD_CG_SUPPORT_GFX_MGLS                        (1ULL << 1)
+#define AMD_CG_SUPPORT_GFX_CGCG                        (1ULL << 2)
+#define AMD_CG_SUPPORT_GFX_CGLS                        (1ULL << 3)
+#define AMD_CG_SUPPORT_GFX_CGTS                        (1ULL << 4)
+#define AMD_CG_SUPPORT_GFX_CGTS_LS             (1ULL << 5)
+#define AMD_CG_SUPPORT_GFX_CP_LS               (1ULL << 6)
+#define AMD_CG_SUPPORT_GFX_RLC_LS              (1ULL << 7)
+#define AMD_CG_SUPPORT_MC_LS                   (1ULL << 8)
+#define AMD_CG_SUPPORT_MC_MGCG                 (1ULL << 9)
+#define AMD_CG_SUPPORT_SDMA_LS                 (1ULL << 10)
+#define AMD_CG_SUPPORT_SDMA_MGCG               (1ULL << 11)
+#define AMD_CG_SUPPORT_BIF_LS                  (1ULL << 12)
+#define AMD_CG_SUPPORT_UVD_MGCG                        (1ULL << 13)
+#define AMD_CG_SUPPORT_VCE_MGCG                        (1ULL << 14)
+#define AMD_CG_SUPPORT_HDP_LS                  (1ULL << 15)
+#define AMD_CG_SUPPORT_HDP_MGCG                        (1ULL << 16)
+#define AMD_CG_SUPPORT_ROM_MGCG                        (1ULL << 17)
+#define AMD_CG_SUPPORT_DRM_LS                  (1ULL << 18)
+#define AMD_CG_SUPPORT_BIF_MGCG                        (1ULL << 19)
+#define AMD_CG_SUPPORT_GFX_3D_CGCG             (1ULL << 20)
+#define AMD_CG_SUPPORT_GFX_3D_CGLS             (1ULL << 21)
+#define AMD_CG_SUPPORT_DRM_MGCG                        (1ULL << 22)
+#define AMD_CG_SUPPORT_DF_MGCG                 (1ULL << 23)
+#define AMD_CG_SUPPORT_VCN_MGCG                        (1ULL << 24)
+#define AMD_CG_SUPPORT_HDP_DS                  (1ULL << 25)
+#define AMD_CG_SUPPORT_HDP_SD                  (1ULL << 26)
+#define AMD_CG_SUPPORT_IH_CG                   (1ULL << 27)
+#define AMD_CG_SUPPORT_ATHUB_LS                        (1ULL << 28)
+#define AMD_CG_SUPPORT_ATHUB_MGCG              (1ULL << 29)
+#define AMD_CG_SUPPORT_JPEG_MGCG               (1ULL << 30)
+#define AMD_CG_SUPPORT_GFX_FGCG                        (1ULL << 31)
 /* PG flags */
 #define AMD_PG_SUPPORT_GFX_PG                  (1 << 0)
 #define AMD_PG_SUPPORT_GFX_SMG                 (1 << 1)
@@ -298,7 +298,7 @@ struct amd_ip_funcs {
                                     enum amd_clockgating_state state);
        int (*set_powergating_state)(void *handle,
                                     enum amd_powergating_state state);
-       void (*get_clockgating_state)(void *handle, u32 *flags);
+       void (*get_clockgating_state)(void *handle, u64 *flags);
 };
 
 
index ec4ea141bfdad1e473626ec294c5e3ad7390bc8c..78ec9b71197da8a6a6a32d820d078da88b5e1ebf 100644 (file)
@@ -3526,7 +3526,7 @@ static int amdgpu_debugfs_pm_info_pp(struct seq_file *m, struct amdgpu_device *a
        return 0;
 }
 
-static void amdgpu_parse_cg_state(struct seq_file *m, u32 flags)
+static void amdgpu_parse_cg_state(struct seq_file *m, u64 flags)
 {
        int i;
 
@@ -3539,7 +3539,7 @@ static int amdgpu_debugfs_pm_info_show(struct seq_file *m, void *unused)
 {
        struct amdgpu_device *adev = (struct amdgpu_device *)m->private;
        struct drm_device *dev = adev_to_drm(adev);
-       u32 flags = 0;
+       u64 flags = 0;
        int r;
 
        if (amdgpu_in_reset(adev))
@@ -3561,7 +3561,7 @@ static int amdgpu_debugfs_pm_info_show(struct seq_file *m, void *unused)
 
        amdgpu_device_ip_get_clockgating_state(adev, &flags);
 
-       seq_printf(m, "Clock Gating Flags Mask: 0x%x\n", flags);
+       seq_printf(m, "Clock Gating Flags Mask: 0x%llx\n", flags);
        amdgpu_parse_cg_state(m, flags);
        seq_printf(m, "\n");
 
index a920515e22744279700b09d32edce2ed91c91761..52045ad59beda8838e76d5eb3110167a72ba41c4 100644 (file)
@@ -26,7 +26,7 @@
 
 struct cg_flag_name
 {
-       u32 flag;
+       u64 flag;
        const char *name;
 };