Skip to content

Commit e8614fc

Browse files
committed
Revert "drm/amdgpu: Use generic hdp flush function"
This reverts commit 18a878f. Revert this temporarily to make it easier to fix a regression in the HDP handling. Reviewed-by: Felix Kuehling <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 4c83d45 commit e8614fc

File tree

6 files changed

+48
-27
lines changed

6 files changed

+48
-27
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_hdp.c

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
*/
2323
#include "amdgpu.h"
2424
#include "amdgpu_ras.h"
25-
#include <uapi/linux/kfd_ioctl.h>
2625

2726
int amdgpu_hdp_ras_sw_init(struct amdgpu_device *adev)
2827
{
@@ -47,23 +46,3 @@ int amdgpu_hdp_ras_sw_init(struct amdgpu_device *adev)
4746
/* hdp ras follows amdgpu_ras_block_late_init_default for late init */
4847
return 0;
4948
}
50-
51-
void amdgpu_hdp_generic_flush(struct amdgpu_device *adev,
52-
struct amdgpu_ring *ring)
53-
{
54-
if (!ring || !ring->funcs->emit_wreg) {
55-
WREG32((adev->rmmio_remap.reg_offset +
56-
KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL) >>
57-
2,
58-
0);
59-
RREG32((adev->rmmio_remap.reg_offset +
60-
KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL) >>
61-
2);
62-
} else {
63-
amdgpu_ring_emit_wreg(ring,
64-
(adev->rmmio_remap.reg_offset +
65-
KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL) >>
66-
2,
67-
0);
68-
}
69-
}

drivers/gpu/drm/amd/amdgpu/amdgpu_hdp.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,4 @@ struct amdgpu_hdp {
4444
};
4545

4646
int amdgpu_hdp_ras_sw_init(struct amdgpu_device *adev);
47-
void amdgpu_hdp_generic_flush(struct amdgpu_device *adev,
48-
struct amdgpu_ring *ring);
4947
#endif /* __AMDGPU_HDP_H__ */

drivers/gpu/drm/amd/amdgpu/hdp_v4_0.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,17 @@
3636
#define HDP_MEM_POWER_CTRL__RC_MEM_POWER_LS_EN_MASK 0x00020000L
3737
#define mmHDP_MEM_POWER_CTRL_BASE_IDX 0
3838

39+
static void hdp_v4_0_flush_hdp(struct amdgpu_device *adev,
40+
struct amdgpu_ring *ring)
41+
{
42+
if (!ring || !ring->funcs->emit_wreg) {
43+
WREG32((adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL) >> 2, 0);
44+
RREG32((adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL) >> 2);
45+
} else {
46+
amdgpu_ring_emit_wreg(ring, (adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL) >> 2, 0);
47+
}
48+
}
49+
3950
static void hdp_v4_0_invalidate_hdp(struct amdgpu_device *adev,
4051
struct amdgpu_ring *ring)
4152
{
@@ -169,7 +180,7 @@ struct amdgpu_hdp_ras hdp_v4_0_ras = {
169180
};
170181

171182
const struct amdgpu_hdp_funcs hdp_v4_0_funcs = {
172-
.flush_hdp = amdgpu_hdp_generic_flush,
183+
.flush_hdp = hdp_v4_0_flush_hdp,
173184
.invalidate_hdp = hdp_v4_0_invalidate_hdp,
174185
.update_clock_gating = hdp_v4_0_update_clock_gating,
175186
.get_clock_gating_state = hdp_v4_0_get_clockgating_state,

drivers/gpu/drm/amd/amdgpu/hdp_v5_0.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,17 @@
2727
#include "hdp/hdp_5_0_0_sh_mask.h"
2828
#include <uapi/linux/kfd_ioctl.h>
2929

30+
static void hdp_v5_0_flush_hdp(struct amdgpu_device *adev,
31+
struct amdgpu_ring *ring)
32+
{
33+
if (!ring || !ring->funcs->emit_wreg) {
34+
WREG32((adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL) >> 2, 0);
35+
RREG32((adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL) >> 2);
36+
} else {
37+
amdgpu_ring_emit_wreg(ring, (adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL) >> 2, 0);
38+
}
39+
}
40+
3041
static void hdp_v5_0_invalidate_hdp(struct amdgpu_device *adev,
3142
struct amdgpu_ring *ring)
3243
{
@@ -206,7 +217,7 @@ static void hdp_v5_0_init_registers(struct amdgpu_device *adev)
206217
}
207218

208219
const struct amdgpu_hdp_funcs hdp_v5_0_funcs = {
209-
.flush_hdp = amdgpu_hdp_generic_flush,
220+
.flush_hdp = hdp_v5_0_flush_hdp,
210221
.invalidate_hdp = hdp_v5_0_invalidate_hdp,
211222
.update_clock_gating = hdp_v5_0_update_clock_gating,
212223
.get_clock_gating_state = hdp_v5_0_get_clockgating_state,

drivers/gpu/drm/amd/amdgpu/hdp_v6_0.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,17 @@
3030
#define regHDP_CLK_CNTL_V6_1 0xd5
3131
#define regHDP_CLK_CNTL_V6_1_BASE_IDX 0
3232

33+
static void hdp_v6_0_flush_hdp(struct amdgpu_device *adev,
34+
struct amdgpu_ring *ring)
35+
{
36+
if (!ring || !ring->funcs->emit_wreg) {
37+
WREG32((adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL) >> 2, 0);
38+
RREG32((adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL) >> 2);
39+
} else {
40+
amdgpu_ring_emit_wreg(ring, (adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL) >> 2, 0);
41+
}
42+
}
43+
3344
static void hdp_v6_0_update_clock_gating(struct amdgpu_device *adev,
3445
bool enable)
3546
{
@@ -138,7 +149,7 @@ static void hdp_v6_0_get_clockgating_state(struct amdgpu_device *adev,
138149
}
139150

140151
const struct amdgpu_hdp_funcs hdp_v6_0_funcs = {
141-
.flush_hdp = amdgpu_hdp_generic_flush,
152+
.flush_hdp = hdp_v6_0_flush_hdp,
142153
.update_clock_gating = hdp_v6_0_update_clock_gating,
143154
.get_clock_gating_state = hdp_v6_0_get_clockgating_state,
144155
};

drivers/gpu/drm/amd/amdgpu/hdp_v7_0.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,17 @@
2727
#include "hdp/hdp_7_0_0_sh_mask.h"
2828
#include <uapi/linux/kfd_ioctl.h>
2929

30+
static void hdp_v7_0_flush_hdp(struct amdgpu_device *adev,
31+
struct amdgpu_ring *ring)
32+
{
33+
if (!ring || !ring->funcs->emit_wreg) {
34+
WREG32((adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL) >> 2, 0);
35+
RREG32((adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL) >> 2);
36+
} else {
37+
amdgpu_ring_emit_wreg(ring, (adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL) >> 2, 0);
38+
}
39+
}
40+
3041
static void hdp_v7_0_update_clock_gating(struct amdgpu_device *adev,
3142
bool enable)
3243
{
@@ -126,7 +137,7 @@ static void hdp_v7_0_get_clockgating_state(struct amdgpu_device *adev,
126137
}
127138

128139
const struct amdgpu_hdp_funcs hdp_v7_0_funcs = {
129-
.flush_hdp = amdgpu_hdp_generic_flush,
140+
.flush_hdp = hdp_v7_0_flush_hdp,
130141
.update_clock_gating = hdp_v7_0_update_clock_gating,
131142
.get_clock_gating_state = hdp_v7_0_get_clockgating_state,
132143
};

0 commit comments

Comments
 (0)