Skip to contentSkip to conversation

Add HDP v6.0 support

PATCH New Alex Deucher 1 participant 3 messages Apr 27, 2022

Subsystems (2)
lore
Share & tools
lore

Alex Deucher

author maintainer
#0 lore raw

cover Add HDP v6.0 support

This patch set adds support for Host Data Port version 6.0. This block provides the interface from the CPU to VRAM (e.g., the PCI BAR). The first patch is register headers and is too large for the mailing list.

Hawking Zhang (1):
drm/amdgpu: add hdp v6_0_0 ip headers v4

Likun Gao (2):
drm/amdgpu: add hdp version 6 functions
drm/amdgpu/discovery: add HDP v6

 drivers/gpu/drm/amd/amdgpu/Makefile           |   2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu.h           |   3 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c |   4 +
 drivers/gpu/drm/amd/amdgpu/hdp_v6_0.c         | 100 +++
 drivers/gpu/drm/amd/amdgpu/hdp_v6_0.h         |  31 +
 .../include/asic_reg/hdp/hdp_6_0_0_offset.h   | 209 ++++++
 .../include/asic_reg/hdp/hdp_6_0_0_sh_mask.h  | 646 ++++++++++++++++++
 7 files changed, 993 insertions(+), 2 deletions(-)
 create mode 100644 drivers/gpu/drm/amd/amdgpu/hdp_v6_0.c
 create mode 100644 drivers/gpu/drm/amd/amdgpu/hdp_v6_0.h
 create mode 100644 drivers/gpu/drm/amd/include/asic_reg/hdp/hdp_6_0_0_offset.h
 create mode 100644 drivers/gpu/drm/amd/include/asic_reg/hdp/hdp_6_0_0_sh_mask.h
Signature · 1 line
2.35.1
author maintainer
#1 lore raw

PATCH 2/3 drm/amdgpu: add hdp version 6 functions

From: Likun Gao <[email protected]>

Unify hdp related function into hdp structure for hdp version 6.
V2: Remove hdp invalidate function as hdp v6 doesn't have read cache.

---
 drivers/gpu/drm/amd/amdgpu/Makefile   |   2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu.h   |   3 +-
 drivers/gpu/drm/amd/amdgpu/hdp_v6_0.c | 100 ++++++++++++++++++++++++++
 drivers/gpu/drm/amd/amdgpu/hdp_v6_0.h |  31 ++++++++
 4 files changed, 134 insertions(+), 2 deletions(-)
 create mode 100644 drivers/gpu/drm/amd/amdgpu/hdp_v6_0.c
 create mode 100644 drivers/gpu/drm/amd/amdgpu/hdp_v6_0.h
drivers/gpu/drm/amd/amdgpu/Makefile +1 -1
index 244f53cc7c46..b10ba2b36ca9 100644
@@ -75,7 +75,7 @@ amdgpu-y += \
 	vi.o mxgpu_vi.o nbio_v6_1.o soc15.o emu_soc.o mxgpu_ai.o nbio_v7_0.o vega10_reg_init.o \
 	vega20_reg_init.o nbio_v7_4.o nbio_v2_3.o nv.o arct_reg_init.o mxgpu_nv.o \
 	nbio_v7_2.o hdp_v4_0.o hdp_v5_0.o aldebaran_reg_init.o aldebaran.o soc21.o \
-	nbio_v4_3.o
+	nbio_v4_3.o hdp_v6_0.o
 
 # add DF block
 amdgpu-y += \
drivers/gpu/drm/amd/amdgpu/amdgpu.h +2 -1
index aa5b944956d8..05358c587783 100644
@@ -1188,7 +1188,8 @@ int emu_soc_asic_init(struct amdgpu_device *adev);
 #define amdgpu_asic_flush_hdp(adev, r) \
 	((adev)->asic_funcs->flush_hdp ? (adev)->asic_funcs->flush_hdp((adev), (r)) : (adev)->hdp.funcs->flush_hdp((adev), (r)))
 #define amdgpu_asic_invalidate_hdp(adev, r) \
-	((adev)->asic_funcs->invalidate_hdp ? (adev)->asic_funcs->invalidate_hdp((adev), (r)) : (adev)->hdp.funcs->invalidate_hdp((adev), (r)))
+	((adev)->asic_funcs->invalidate_hdp ? (adev)->asic_funcs->invalidate_hdp((adev), (r)) : \
+	 ((adev)->hdp.funcs->invalidate_hdp ? (adev)->hdp.funcs->invalidate_hdp((adev), (r)) : 0))
 #define amdgpu_asic_need_full_reset(adev) (adev)->asic_funcs->need_full_reset((adev))
 #define amdgpu_asic_init_doorbell_index(adev) (adev)->asic_funcs->init_doorbell_index((adev))
 #define amdgpu_asic_get_pcie_usage(adev, cnt0, cnt1) ((adev)->asic_funcs->get_pcie_usage((adev), (cnt0), (cnt1)))
drivers/gpu/drm/amd/amdgpu/hdp_v6_0.c new file +100 -0

100 lines not on this page · raw message

drivers/gpu/drm/amd/amdgpu/hdp_v6_0.h new file +31 -0
new file mode 100644
index 000000000000..533ecd8c0800
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2020 Advanced Micro Devices, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#ifndef __HDP_V6_0_H__
+#define __HDP_V6_0_H__
+
+#include "soc15_common.h"
+
+extern const struct amdgpu_hdp_funcs hdp_v6_0_funcs;
+
+#endif
Signature · 1 line
2.35.1
author maintainer
#2 lore raw

PATCH 3/3 drm/amdgpu/discovery: add HDP v6

In reply to Alex Deucher

From: Likun Gao <[email protected]>

Enable HDP v6 on asics where it is present.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +4 -0
index 8c89e02ee1ce..834354597cb1 100644
@@ -53,6 +53,7 @@
 #include "nbio_v4_3.h"
 #include "nbio_v7_2.h"
 #include "hdp_v5_0.h"
+#include "hdp_v6_0.h"
 #include "nv.h"
 #include "soc21.h"
 #include "navi10_ih.h"
@@ -2176,6 +2177,9 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev)
 	case IP_VERSION(5, 2, 0):
 		adev->hdp.funcs = &hdp_v5_0_funcs;
 		break;
+	case IP_VERSION(6, 0, 0):
+		adev->hdp.funcs = &hdp_v6_0_funcs;
+		break;
 	default:
 		break;
 	}
Signature · 1 line
2.35.1