<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Acked-by: Alex Deucher <alexander.deucher@amd.com><br>
</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Christian König <ckoenig.leichtzumerken@gmail.com><br>
<b>Sent:</b> Tuesday, May 8, 2018 6:30:06 AM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org<br>
<b>Subject:</b> [PATCH] drm/amdgpu: add HDP flush dummy for UVD 6/7</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">The UVD firmware doesn't seem to like the HDP flush here.<br>
<br>
This worked for years without HDP flush, so just skip it.<br>
<br>
Signed-off-by: Christian König <christian.koenig@amd.com><br>
---<br>
drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c | 16 ++++++++++++++--<br>
drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c | 13 ++++++++++++-<br>
2 files changed, 26 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c b/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c<br>
index 6d3359889c0b..8041b26a7a21 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c<br>
@@ -963,6 +963,16 @@ static void uvd_v6_0_enc_ring_emit_fence(struct amdgpu_ring *ring, u64 addr,<br>
amdgpu_ring_write(ring, HEVC_ENC_CMD_TRAP);<br>
}<br>
<br>
+/**<br>
+ * uvd_v6_0_ring_emit_hdp_flush - skip HDP flushing<br>
+ *<br>
+ * @ring: amdgpu_ring pointer<br>
+ */<br>
+static void uvd_v6_0_ring_emit_hdp_flush(struct amdgpu_ring *ring)<br>
+{<br>
+ /* The firmware doesn't seem to like touching registers at this point. */<br>
+}<br>
+<br>
/**<br>
* uvd_v6_0_ring_test_ring - register write test<br>
*<br>
@@ -1528,12 +1538,13 @@ static const struct amdgpu_ring_funcs uvd_v6_0_ring_phys_funcs = {<br>
.set_wptr = uvd_v6_0_ring_set_wptr,<br>
.parse_cs = amdgpu_uvd_ring_parse_cs,<br>
.emit_frame_size =<br>
- 6 + 6 + /* hdp flush / invalidate */<br>
+ 6 + /* hdp invalidate */<br>
10 + /* uvd_v6_0_ring_emit_pipeline_sync */<br>
14, /* uvd_v6_0_ring_emit_fence x1 no user fence */<br>
.emit_ib_size = 8, /* uvd_v6_0_ring_emit_ib */<br>
.emit_ib = uvd_v6_0_ring_emit_ib,<br>
.emit_fence = uvd_v6_0_ring_emit_fence,<br>
+ .emit_hdp_flush = uvd_v6_0_ring_emit_hdp_flush,<br>
.test_ring = uvd_v6_0_ring_test_ring,<br>
.test_ib = amdgpu_uvd_ring_test_ib,<br>
.insert_nop = amdgpu_ring_insert_nop,<br>
@@ -1552,7 +1563,7 @@ static const struct amdgpu_ring_funcs uvd_v6_0_ring_vm_funcs = {<br>
.get_wptr = uvd_v6_0_ring_get_wptr,<br>
.set_wptr = uvd_v6_0_ring_set_wptr,<br>
.emit_frame_size =<br>
- 6 + 6 + /* hdp flush / invalidate */<br>
+ 6 + /* hdp invalidate */<br>
10 + /* uvd_v6_0_ring_emit_pipeline_sync */<br>
VI_FLUSH_GPU_TLB_NUM_WREG * 6 + 8 + /* uvd_v6_0_ring_emit_vm_flush */<br>
14 + 14, /* uvd_v6_0_ring_emit_fence x2 vm fence */<br>
@@ -1561,6 +1572,7 @@ static const struct amdgpu_ring_funcs uvd_v6_0_ring_vm_funcs = {<br>
.emit_fence = uvd_v6_0_ring_emit_fence,<br>
.emit_vm_flush = uvd_v6_0_ring_emit_vm_flush,<br>
.emit_pipeline_sync = uvd_v6_0_ring_emit_pipeline_sync,<br>
+ .emit_hdp_flush = uvd_v6_0_ring_emit_hdp_flush,<br>
.test_ring = uvd_v6_0_ring_test_ring,<br>
.test_ib = amdgpu_uvd_ring_test_ib,<br>
.insert_nop = amdgpu_ring_insert_nop,<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c b/drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c<br>
index 2251db4048f5..b0de1e04093b 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c<br>
@@ -1135,6 +1135,16 @@ static void uvd_v7_0_enc_ring_emit_fence(struct amdgpu_ring *ring, u64 addr,<br>
amdgpu_ring_write(ring, HEVC_ENC_CMD_TRAP);<br>
}<br>
<br>
+/**<br>
+ * uvd_v7_0_ring_emit_hdp_flush - skip HDP flushing<br>
+ *<br>
+ * @ring: amdgpu_ring pointer<br>
+ */<br>
+static void uvd_v7_0_ring_emit_hdp_flush(struct amdgpu_ring *ring)<br>
+{<br>
+ /* The firmware doesn't seem to like touching registers at this point. */<br>
+}<br>
+<br>
/**<br>
* uvd_v7_0_ring_test_ring - register write test<br>
*<br>
@@ -1654,7 +1664,7 @@ static const struct amdgpu_ring_funcs uvd_v7_0_ring_vm_funcs = {<br>
.get_wptr = uvd_v7_0_ring_get_wptr,<br>
.set_wptr = uvd_v7_0_ring_set_wptr,<br>
.emit_frame_size =<br>
- 6 + 6 + /* hdp flush / invalidate */<br>
+ 6 + /* hdp invalidate */<br>
SOC15_FLUSH_GPU_TLB_NUM_WREG * 6 +<br>
SOC15_FLUSH_GPU_TLB_NUM_REG_WAIT * 8 +<br>
8 + /* uvd_v7_0_ring_emit_vm_flush */<br>
@@ -1663,6 +1673,7 @@ static const struct amdgpu_ring_funcs uvd_v7_0_ring_vm_funcs = {<br>
.emit_ib = uvd_v7_0_ring_emit_ib,<br>
.emit_fence = uvd_v7_0_ring_emit_fence,<br>
.emit_vm_flush = uvd_v7_0_ring_emit_vm_flush,<br>
+ .emit_hdp_flush = uvd_v7_0_ring_emit_hdp_flush,<br>
.test_ring = uvd_v7_0_ring_test_ring,<br>
.test_ib = amdgpu_uvd_ring_test_ib,<br>
.insert_nop = uvd_v7_0_ring_insert_nop,<br>
-- <br>
2.14.1<br>
<br>
_______________________________________________<br>
amd-gfx mailing list<br>
amd-gfx@lists.freedesktop.org<br>
<a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><br>
</div>
</span></font></div>
</body>
</html>