drm/amdgpu: move get_gpu_clock_counter into the gfx struct
[cascardo/linux.git] / drivers / gpu / drm / amd / amdgpu / gfx_v7_0.c
index bbce38e..fe90acf 100644 (file)
@@ -4138,7 +4138,7 @@ static void gfx_v7_0_fini_pg(struct amdgpu_device *adev)
  * Fetches a GPU clock counter snapshot (SI).
  * Returns the 64 bit clock counter snapshot.
  */
-uint64_t gfx_v7_0_get_gpu_clock_counter(struct amdgpu_device *adev)
+static uint64_t gfx_v7_0_get_gpu_clock_counter(struct amdgpu_device *adev)
 {
        uint64_t clock;
 
@@ -4198,12 +4198,17 @@ static void gfx_v7_0_ring_emit_gds_switch(struct amdgpu_ring *ring,
        amdgpu_ring_write(ring, (1 << (oa_size + oa_base)) - (1 << oa_base));
 }
 
+static const struct amdgpu_gfx_funcs gfx_v7_0_gfx_funcs = {
+       .get_gpu_clock_counter = &gfx_v7_0_get_gpu_clock_counter,
+};
+
 static int gfx_v7_0_early_init(void *handle)
 {
        struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 
        adev->gfx.num_gfx_rings = GFX7_NUM_GFX_RINGS;
        adev->gfx.num_compute_rings = GFX7_NUM_COMPUTE_RINGS;
+       adev->gfx.funcs = &gfx_v7_0_gfx_funcs;
        gfx_v7_0_set_ring_funcs(adev);
        gfx_v7_0_set_irq_funcs(adev);
        gfx_v7_0_set_gds_init(adev);