drm/amdgpu: remove redundant logic related HDP
authorLikun Gao <Likun.Gao@amd.com>
Mon, 28 Dec 2020 09:04:06 +0000 (17:04 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 5 Jan 2021 16:33:14 +0000 (11:33 -0500)
Remove hdp_flush function from amdgpu_nbio struct as it have been unified
into hdp struct.
Remove the include about hdp register which was not used.
V2: Remove hdp golden setting which is unnecessary.

Signed-off-by: Likun Gao <Likun.Gao@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 files changed:
drivers/gpu/drm/amd/amdgpu/amdgpu_nbio.h
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.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/sdma_v4_0.c
drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c

index e62cc0e..4ba0024 100644 (file)
@@ -57,7 +57,6 @@ struct amdgpu_nbio_funcs {
        u32 (*get_pcie_port_data_offset)(struct amdgpu_device *adev);
        u32 (*get_rev_id)(struct amdgpu_device *adev);
        void (*mc_access_enable)(struct amdgpu_device *adev, bool enable);
-       void (*hdp_flush)(struct amdgpu_device *adev, struct amdgpu_ring *ring);
        u32 (*get_memsize)(struct amdgpu_device *adev);
        void (*sdma_doorbell_range)(struct amdgpu_device *adev, int instance,
                        bool use_doorbell, int doorbell_index, int doorbell_size);
index 5f4805e..a896e3d 100644 (file)
@@ -38,7 +38,6 @@
 #include "gc/gc_9_0_sh_mask.h"
 
 #include "vega10_enum.h"
-#include "hdp/hdp_4_0_offset.h"
 
 #include "soc15_common.h"
 #include "clearstate_gfx9.h"
index 7b1f50f..aedef90 100644 (file)
@@ -281,20 +281,6 @@ static const char *mmhub_client_ids_arcturus[][2] = {
        [224+15][1] = "SDMA7",
 };
 
-static const u32 golden_settings_vega10_hdp[] =
-{
-       0xf64, 0x0fffffff, 0x00000000,
-       0xf65, 0x0fffffff, 0x00000000,
-       0xf66, 0x0fffffff, 0x00000000,
-       0xf67, 0x0fffffff, 0x00000000,
-       0xf68, 0x0fffffff, 0x00000000,
-       0xf6a, 0x0fffffff, 0x00000000,
-       0xf6b, 0x0fffffff, 0x00000000,
-       0xf6c, 0x0fffffff, 0x00000000,
-       0xf6d, 0x0fffffff, 0x00000000,
-       0xf6e, 0x0fffffff, 0x00000000,
-};
-
 static const struct soc15_reg_golden golden_settings_mmhub_1_0_0[] =
 {
        SOC15_REG_GOLDEN_VALUE(MMHUB, 0, mmDAGB1_WRCLI2, 0x00000007, 0xfe5fe0fa),
@@ -1580,10 +1566,6 @@ static int gmc_v9_0_hw_init(void *handle)
                WREG32_FIELD15(DCE, 0, VGA_RENDER_CONTROL, VGA_VSTATUS_CNTL, 0);
        }
 
-       amdgpu_device_program_register_sequence(adev,
-                                               golden_settings_vega10_hdp,
-                                               ARRAY_SIZE(golden_settings_vega10_hdp));
-
        if (adev->mmhub.funcs->update_power_gating)
                adev->mmhub.funcs->update_power_gating(adev, true);
 
index b5c3db1..b860f1c 100644 (file)
@@ -80,15 +80,6 @@ static void nbio_v2_3_mc_access_enable(struct amdgpu_device *adev, bool enable)
                WREG32_SOC15(NBIO, 0, mmBIF_FB_EN, 0);
 }
 
-static void nbio_v2_3_hdp_flush(struct amdgpu_device *adev,
-                               struct amdgpu_ring *ring)
-{
-       if (!ring || !ring->funcs->emit_wreg)
-               WREG32_NO_KIQ((adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL) >> 2, 0);
-       else
-               amdgpu_ring_emit_wreg(ring, (adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL) >> 2, 0);
-}
-
 static u32 nbio_v2_3_get_memsize(struct amdgpu_device *adev)
 {
        return RREG32_SOC15(NBIO, 0, mmRCC_DEV0_EPF0_RCC_CONFIG_MEMSIZE);
@@ -366,7 +357,6 @@ const struct amdgpu_nbio_funcs nbio_v2_3_funcs = {
        .get_pcie_data_offset = nbio_v2_3_get_pcie_data_offset,
        .get_rev_id = nbio_v2_3_get_rev_id,
        .mc_access_enable = nbio_v2_3_mc_access_enable,
-       .hdp_flush = nbio_v2_3_hdp_flush,
        .get_memsize = nbio_v2_3_get_memsize,
        .sdma_doorbell_range = nbio_v2_3_sdma_doorbell_range,
        .vcn_doorbell_range = nbio_v2_3_vcn_doorbell_range,
index 7fc5043..83ea063 100644 (file)
@@ -59,18 +59,6 @@ static void nbio_v6_1_mc_access_enable(struct amdgpu_device *adev, bool enable)
                WREG32_SOC15(NBIO, 0, mmBIF_FB_EN, 0);
 }
 
-static void nbio_v6_1_hdp_flush(struct amdgpu_device *adev,
-                               struct amdgpu_ring *ring)
-{
-       if (!ring || !ring->funcs->emit_wreg)
-               WREG32_SOC15_NO_KIQ(NBIO, 0,
-                                   mmBIF_BX_PF0_HDP_MEM_COHERENCY_FLUSH_CNTL,
-                                   0);
-       else
-               amdgpu_ring_emit_wreg(ring, SOC15_REG_OFFSET(
-                       NBIO, 0, mmBIF_BX_PF0_HDP_MEM_COHERENCY_FLUSH_CNTL), 0);
-}
-
 static u32 nbio_v6_1_get_memsize(struct amdgpu_device *adev)
 {
        return RREG32_SOC15(NBIO, 0, mmRCC_PF_0_0_RCC_CONFIG_MEMSIZE);
@@ -275,7 +263,6 @@ const struct amdgpu_nbio_funcs nbio_v6_1_funcs = {
        .get_pcie_data_offset = nbio_v6_1_get_pcie_data_offset,
        .get_rev_id = nbio_v6_1_get_rev_id,
        .mc_access_enable = nbio_v6_1_mc_access_enable,
-       .hdp_flush = nbio_v6_1_hdp_flush,
        .get_memsize = nbio_v6_1_get_memsize,
        .sdma_doorbell_range = nbio_v6_1_sdma_doorbell_range,
        .enable_doorbell_aperture = nbio_v6_1_enable_doorbell_aperture,
index ae68581..3c00666 100644 (file)
@@ -60,15 +60,6 @@ static void nbio_v7_0_mc_access_enable(struct amdgpu_device *adev, bool enable)
                WREG32_SOC15(NBIO, 0, mmBIF_FB_EN, 0);
 }
 
-static void nbio_v7_0_hdp_flush(struct amdgpu_device *adev,
-                               struct amdgpu_ring *ring)
-{
-       if (!ring || !ring->funcs->emit_wreg)
-               WREG32_NO_KIQ((adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL) >> 2, 0);
-       else
-               amdgpu_ring_emit_wreg(ring, (adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL) >> 2, 0);
-}
-
 static u32 nbio_v7_0_get_memsize(struct amdgpu_device *adev)
 {
        return RREG32_SOC15(NBIO, 0, mmRCC_CONFIG_MEMSIZE);
@@ -292,7 +283,6 @@ const struct amdgpu_nbio_funcs nbio_v7_0_funcs = {
        .get_pcie_data_offset = nbio_v7_0_get_pcie_data_offset,
        .get_rev_id = nbio_v7_0_get_rev_id,
        .mc_access_enable = nbio_v7_0_mc_access_enable,
-       .hdp_flush = nbio_v7_0_hdp_flush,
        .get_memsize = nbio_v7_0_get_memsize,
        .sdma_doorbell_range = nbio_v7_0_sdma_doorbell_range,
        .vcn_doorbell_range = nbio_v7_0_vcn_doorbell_range,
index aa36022..598ce0e 100644 (file)
@@ -56,15 +56,6 @@ static void nbio_v7_2_mc_access_enable(struct amdgpu_device *adev, bool enable)
                WREG32_SOC15(NBIO, 0, regBIF_BX0_BIF_FB_EN, 0);
 }
 
-static void nbio_v7_2_hdp_flush(struct amdgpu_device *adev,
-                               struct amdgpu_ring *ring)
-{
-       if (!ring || !ring->funcs->emit_wreg)
-               WREG32_NO_KIQ((adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL) >> 2, 0);
-       else
-               amdgpu_ring_emit_wreg(ring, (adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL) >> 2, 0);
-}
-
 static u32 nbio_v7_2_get_memsize(struct amdgpu_device *adev)
 {
        return RREG32_SOC15(NBIO, 0, regRCC_DEV0_EPF0_0_RCC_CONFIG_MEMSIZE);
@@ -325,7 +316,6 @@ const struct amdgpu_nbio_funcs nbio_v7_2_funcs = {
        .get_pcie_port_data_offset = nbio_v7_2_get_pcie_port_data_offset,
        .get_rev_id = nbio_v7_2_get_rev_id,
        .mc_access_enable = nbio_v7_2_mc_access_enable,
-       .hdp_flush = nbio_v7_2_hdp_flush,
        .get_memsize = nbio_v7_2_get_memsize,
        .sdma_doorbell_range = nbio_v7_2_sdma_doorbell_range,
        .vcn_doorbell_range = nbio_v7_2_vcn_doorbell_range,
index eadc952..4bc1d14 100644 (file)
@@ -82,15 +82,6 @@ static void nbio_v7_4_mc_access_enable(struct amdgpu_device *adev, bool enable)
                WREG32_SOC15(NBIO, 0, mmBIF_FB_EN, 0);
 }
 
-static void nbio_v7_4_hdp_flush(struct amdgpu_device *adev,
-                               struct amdgpu_ring *ring)
-{
-       if (!ring || !ring->funcs->emit_wreg)
-               WREG32_NO_KIQ((adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL) >> 2, 0);
-       else
-               amdgpu_ring_emit_wreg(ring, (adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL) >> 2, 0);
-}
-
 static u32 nbio_v7_4_get_memsize(struct amdgpu_device *adev)
 {
        return RREG32_SOC15(NBIO, 0, mmRCC_CONFIG_MEMSIZE);
@@ -541,7 +532,6 @@ const struct amdgpu_nbio_funcs nbio_v7_4_funcs = {
        .get_pcie_data_offset = nbio_v7_4_get_pcie_data_offset,
        .get_rev_id = nbio_v7_4_get_rev_id,
        .mc_access_enable = nbio_v7_4_mc_access_enable,
-       .hdp_flush = nbio_v7_4_hdp_flush,
        .get_memsize = nbio_v7_4_get_memsize,
        .sdma_doorbell_range = nbio_v7_4_sdma_doorbell_range,
        .vcn_doorbell_range = nbio_v7_4_vcn_doorbell_range,
index ce56e93..c8c22c1 100644 (file)
@@ -46,7 +46,6 @@
 #include "sdma6/sdma6_4_2_2_sh_mask.h"
 #include "sdma7/sdma7_4_2_2_offset.h"
 #include "sdma7/sdma7_4_2_2_sh_mask.h"
-#include "hdp/hdp_4_0_offset.h"
 #include "sdma0/sdma0_4_1_default.h"
 
 #include "soc15_common.h"
index b208b81..d345e32 100644 (file)
@@ -32,7 +32,6 @@
 
 #include "gc/gc_10_1_0_offset.h"
 #include "gc/gc_10_1_0_sh_mask.h"
-#include "hdp/hdp_5_0_0_offset.h"
 #include "ivsrcid/sdma0/irqsrcs_sdma0_5_0.h"
 #include "ivsrcid/sdma1/irqsrcs_sdma1_5_0.h"
 
index 312ecf6..7cd67cb 100644 (file)
@@ -36,7 +36,6 @@
 #include "vce/vce_4_0_default.h"
 #include "vce/vce_4_0_sh_mask.h"
 #include "nbif/nbif_6_1_offset.h"
-#include "hdp/hdp_4_0_offset.h"
 #include "mmhub/mmhub_1_0_offset.h"
 #include "mmhub/mmhub_1_0_sh_mask.h"
 #include "ivsrcid/uvd/irqsrcs_uvd_7_0.h"
index c734e31..6117931 100644 (file)
@@ -32,7 +32,6 @@
 
 #include "vcn/vcn_1_0_offset.h"
 #include "vcn/vcn_1_0_sh_mask.h"
-#include "hdp/hdp_4_0_offset.h"
 #include "mmhub/mmhub_9_1_offset.h"
 #include "mmhub/mmhub_9_1_sh_mask.h"