Skip to contentSkip to conversation

Update DCN 3.1 support for 3.1.5

PATCH New Alex Deucher 1 participant 12 messages Feb 18, 2022

Subsystems (3)
lore
Share & tools
lore

Alex Deucher

author maintainer
#0 lore raw

cover Update DCN 3.1 support for 3.1.5

Update DCN 3.1 for 3.1.5. This is a minor update
to DCN 3.1 display support in amdgpu.

The first two patches are register headers so I did not send them out due to size.

Qingqing Zhuo (11):
drm/amd/include: add DCN 3.1.5 registers drm/amd/display: Add DCN315 family information drm/amd/display: Add DCN315 CLK_MGR drm/amd/display: Add DCN315 GPIO drm/amd/display: Add DCN315 IRQ drm/amd/display: Add DCN315 DMUB drm/amd/display: Add DCN315 Resource drm/amd/display: Add DCN315 Command Table Helper drm/amd/display: Add DCN315 blocks to Makefile drm/amd/display: Add DCN315 CORE drm/amd/display: Add DCN315 DM Support

Yifan Zhang (2):
drm/amdgpu: add mp 13.0.5 header files
drm/amdgpu: add dm ip block for dcn 3.1.5

 drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c |      1 +
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |     14 +-
 .../amd/display/amdgpu_dm/amdgpu_dm_hdcp.c    |      1 +
 drivers/gpu/drm/amd/display/dc/Makefile       |      1 +
 .../display/dc/bios/command_table_helper2.c   |      1 +
 .../gpu/drm/amd/display/dc/clk_mgr/Makefile   |      9 +
 .../gpu/drm/amd/display/dc/clk_mgr/clk_mgr.c  |     23 +-
 .../dc/clk_mgr/dcn315/dcn315_clk_mgr.c        |    607 +
 .../dc/clk_mgr/dcn315/dcn315_clk_mgr.h        |     49 +
 .../display/dc/clk_mgr/dcn315/dcn315_smu.c    |    329 +
 .../display/dc/clk_mgr/dcn315/dcn315_smu.h    |    126 +
 drivers/gpu/drm/amd/display/dc/core/dc_link.c |     13 +-
 .../gpu/drm/amd/display/dc/core/dc_resource.c |      8 +
 .../gpu/drm/amd/display/dc/dcn315/Makefile    |     56 +
 .../amd/display/dc/dcn315/dcn315_resource.c   |   2302 +
 .../amd/display/dc/dcn315/dcn315_resource.h   |     42 +
 drivers/gpu/drm/amd/display/dc/gpio/Makefile  |      8 +
 .../dc/gpio/dcn315/hw_factory_dcn315.c        |    260 +
 .../dc/gpio/dcn315/hw_factory_dcn315.h        |     31 +
 .../dc/gpio/dcn315/hw_translate_dcn315.c      |    374 +
 .../dc/gpio/dcn315/hw_translate_dcn315.h      |     33 +
 .../gpu/drm/amd/display/dc/gpio/hw_factory.c  |      4 +
 .../drm/amd/display/dc/gpio/hw_translate.c    |      4 +
 drivers/gpu/drm/amd/display/dc/irq/Makefile   |      8 +
 .../dc/irq/dcn315/irq_service_dcn315.c        |    438 +
 .../dc/irq/dcn315/irq_service_dcn315.h        |     34 +
 drivers/gpu/drm/amd/display/dmub/dmub_srv.h   |      1 +
 drivers/gpu/drm/amd/display/dmub/src/Makefile |      4 +-
 .../drm/amd/display/dmub/src/dmub_dcn315.c    |     62 +
 .../drm/amd/display/dmub/src/dmub_dcn315.h    |     68 +
 .../gpu/drm/amd/display/dmub/src/dmub_srv.c   |      9 +-
 .../gpu/drm/amd/display/include/dal_asic_id.h |      6 +
 .../gpu/drm/amd/display/include/dal_types.h   |      1 +
 .../include/asic_reg/dcn/dcn_3_1_5_offset.h   |  15191 +++
 .../include/asic_reg/dcn/dcn_3_1_5_sh_mask.h  |  62061 +++++++++
 .../include/asic_reg/dpcs/dpcs_4_2_2_offset.h |  11957 ++
 .../asic_reg/dpcs/dpcs_4_2_2_sh_mask.h        | 103633 +++++++++++++++
 .../include/asic_reg/mp/mp_13_0_5_offset.h    |    455 +
 .../include/asic_reg/mp/mp_13_0_5_sh_mask.h   |    672 +
 39 files changed, 198885 insertions(+), 11 deletions(-)
 create mode 100644 drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_clk_mgr.c
 create mode 100644 drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_clk_mgr.h
 create mode 100644 drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_smu.c
 create mode 100644 drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_smu.h
 create mode 100644 drivers/gpu/drm/amd/display/dc/dcn315/Makefile
 create mode 100644 drivers/gpu/drm/amd/display/dc/dcn315/dcn315_resource.c
 create mode 100644 drivers/gpu/drm/amd/display/dc/dcn315/dcn315_resource.h
 create mode 100644 drivers/gpu/drm/amd/display/dc/gpio/dcn315/hw_factory_dcn315.c
 create mode 100644 drivers/gpu/drm/amd/display/dc/gpio/dcn315/hw_factory_dcn315.h
 create mode 100644 drivers/gpu/drm/amd/display/dc/gpio/dcn315/hw_translate_dcn315.c
 create mode 100644 drivers/gpu/drm/amd/display/dc/gpio/dcn315/hw_translate_dcn315.h
 create mode 100644 drivers/gpu/drm/amd/display/dc/irq/dcn315/irq_service_dcn315.c
 create mode 100644 drivers/gpu/drm/amd/display/dc/irq/dcn315/irq_service_dcn315.h
 create mode 100644 drivers/gpu/drm/amd/display/dmub/src/dmub_dcn315.c
 create mode 100644 drivers/gpu/drm/amd/display/dmub/src/dmub_dcn315.h
 create mode 100644 drivers/gpu/drm/amd/include/asic_reg/dcn/dcn_3_1_5_offset.h
 create mode 100644 drivers/gpu/drm/amd/include/asic_reg/dcn/dcn_3_1_5_sh_mask.h
 create mode 100644 drivers/gpu/drm/amd/include/asic_reg/dpcs/dpcs_4_2_2_offset.h
 create mode 100644 drivers/gpu/drm/amd/include/asic_reg/dpcs/dpcs_4_2_2_sh_mask.h
 create mode 100644 drivers/gpu/drm/amd/include/asic_reg/mp/mp_13_0_5_offset.h
 create mode 100644 drivers/gpu/drm/amd/include/asic_reg/mp/mp_13_0_5_sh_mask.h
Signature · 1 line
2.35.1
author maintainer
#1 lore raw

PATCH 3/13 drm/amd/display: Add DCN315 family information

From: Qingqing Zhuo <[email protected]>

---
 drivers/gpu/drm/amd/display/include/dal_asic_id.h | 6 ++++++
 drivers/gpu/drm/amd/display/include/dal_types.h   | 1 +
 2 files changed, 7 insertions(+)
drivers/gpu/drm/amd/display/include/dal_asic_id.h +6 -0
index 9646dc83941f..42bc04377ada 100644
@@ -235,6 +235,12 @@ enum {
 #define ASICREV_IS_YELLOW_CARP(eChipRev) ((eChipRev >= YELLOW_CARP_A0) && (eChipRev < YELLOW_CARP_UNKNOWN))
 #endif
 
+#define AMDGPU_FAMILY_GC_10_3_6                     149
+#define GC_10_3_6_A0            0x01
+#define GC_10_3_6_UNKNOWN       0xFF
+
+#define ASICREV_IS_GC_10_3_6(eChipRev) ((eChipRev >= GC_10_3_6_A0) && (eChipRev < GC_10_3_6_UNKNOWN))
+
 #define AMDGPU_FAMILY_GC_10_3_7                151
 #define GC_10_3_7_A0 0x01
 #define GC_10_3_7_UNKNOWN 0xFF
drivers/gpu/drm/amd/display/include/dal_types.h +1 -0
index 8ddb25519880..bf9085fc5105 100644
@@ -57,6 +57,7 @@ enum dce_version {
 	DCN_VERSION_3_02,
 	DCN_VERSION_3_03,
 	DCN_VERSION_3_1,
+	DCN_VERSION_3_15,
 	DCN_VERSION_3_16,
 	DCN_VERSION_MAX
 };
Signature · 1 line
2.35.1
author maintainer
#2 lore raw

PATCH 4/13 drm/amd/display: Add DCN315 CLK_MGR

In reply to Alex Deucher

From: Qingqing Zhuo <[email protected]>

Clk and SMU interfaces for DCN 3.1.5.

---
 .../gpu/drm/amd/display/dc/clk_mgr/Makefile   |   9 +
 .../gpu/drm/amd/display/dc/clk_mgr/clk_mgr.c  |  23 +-
 .../dc/clk_mgr/dcn315/dcn315_clk_mgr.c        | 607 ++++++++++++++++++
 .../dc/clk_mgr/dcn315/dcn315_clk_mgr.h        |  49 ++
 .../display/dc/clk_mgr/dcn315/dcn315_smu.c    | 329 ++++++++++
 .../display/dc/clk_mgr/dcn315/dcn315_smu.h    | 126 ++++
 6 files changed, 1141 insertions(+), 2 deletions(-)
 create mode 100644 drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_clk_mgr.c
 create mode 100644 drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_clk_mgr.h
 create mode 100644 drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_smu.c
 create mode 100644 drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_smu.h
drivers/gpu/drm/amd/display/dc/clk_mgr/Makefile +9 -0
index 3bf8ef9373e8..817871917632 100644
@@ -154,6 +154,15 @@ AMD_DAL_CLK_MGR_DCN31 = $(addprefix $(AMDDALPATH)/dc/clk_mgr/dcn31/,$(CLK_MGR_DC
 
 AMD_DISPLAY_FILES += $(AMD_DAL_CLK_MGR_DCN31)
 
+###############################################################################
+# DCN315
+###############################################################################
+CLK_MGR_DCN315 = dcn315_smu.o dcn315_clk_mgr.o
+
+AMD_DAL_CLK_MGR_DCN315 = $(addprefix $(AMDDALPATH)/dc/clk_mgr/dcn315/,$(CLK_MGR_DCN315))
+
+AMD_DISPLAY_FILES += $(AMD_DAL_CLK_MGR_DCN315)
+
 ###############################################################################
 # DCN316
 ###############################################################################
drivers/gpu/drm/amd/display/dc/clk_mgr/clk_mgr.c +21 -2
index 0a608bd4bd61..772bffda68cc 100644
@@ -43,6 +43,7 @@
 #include "dcn30/dcn30_clk_mgr.h"
 #include "dcn301/vg_clk_mgr.h"
 #include "dcn31/dcn31_clk_mgr.h"
+#include "dcn315/dcn315_clk_mgr.h"
 #include "dcn316/dcn316_clk_mgr.h"
 
 
@@ -290,6 +291,19 @@ struct clk_mgr *dc_clk_mgr_create(struct dc_context *ctx, struct pp_smu_funcs *p
 		dcn31_clk_mgr_construct(ctx, clk_mgr, pp_smu, dccg);
 		return &clk_mgr->base.base;
 	}
+		break;
+	case AMDGPU_FAMILY_GC_10_3_6: {
+		struct clk_mgr_dcn315 *clk_mgr = kzalloc(sizeof(*clk_mgr), GFP_KERNEL);
+
+		if (clk_mgr == NULL) {
+			BREAK_TO_DEBUGGER();
+			return NULL;
+		}
+
+		dcn315_clk_mgr_construct(ctx, clk_mgr, pp_smu, dccg);
+		return &clk_mgr->base.base;
+	}
+		break;
 	case AMDGPU_FAMILY_GC_10_3_7: {
 		struct clk_mgr_dcn316 *clk_mgr = kzalloc(sizeof(*clk_mgr), GFP_KERNEL);
 
@@ -301,6 +315,7 @@ struct clk_mgr *dc_clk_mgr_create(struct dc_context *ctx, struct pp_smu_funcs *p
 		dcn316_clk_mgr_construct(ctx, clk_mgr, pp_smu, dccg);
 		return &clk_mgr->base.base;
 	}
+		break;
 #endif
 
 	default:
@@ -334,11 +349,15 @@ void dc_destroy_clk_mgr(struct clk_mgr *clk_mgr_base)
 		break;
 
 	case FAMILY_YELLOW_CARP:
-			dcn31_clk_mgr_destroy(clk_mgr);
+		dcn31_clk_mgr_destroy(clk_mgr);
+		break;
+
+	case AMDGPU_FAMILY_GC_10_3_6:
+		dcn315_clk_mgr_destroy(clk_mgr);
 		break;
 
 	case AMDGPU_FAMILY_GC_10_3_7:
-			dcn316_clk_mgr_destroy(clk_mgr);
+		dcn316_clk_mgr_destroy(clk_mgr);
 		break;
 
 	default:
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_clk_mgr.c new file +607 -0

607 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_clk_mgr.h new file +49 -0

49 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_smu.c new file +329 -0

329 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_smu.h new file +126 -0

126 lines not on this page · raw message

Signature · 1 line
2.35.1
author maintainer
#3 lore raw

PATCH 5/13 drm/amd/display: Add DCN315 GPIO

In reply to Alex Deucher

From: Qingqing Zhuo <[email protected]>

Add GPIO interfaces for DCN 3.1.5.

---
 drivers/gpu/drm/amd/display/dc/gpio/Makefile  |   8 +
 .../dc/gpio/dcn315/hw_factory_dcn315.c        | 260 ++++++++++++
 .../dc/gpio/dcn315/hw_factory_dcn315.h        |  31 ++
 .../dc/gpio/dcn315/hw_translate_dcn315.c      | 374 ++++++++++++++++++
 .../dc/gpio/dcn315/hw_translate_dcn315.h      |  33 ++
 .../gpu/drm/amd/display/dc/gpio/hw_factory.c  |   4 +
 .../drm/amd/display/dc/gpio/hw_translate.c    |   4 +
 7 files changed, 714 insertions(+)
 create mode 100644 drivers/gpu/drm/amd/display/dc/gpio/dcn315/hw_factory_dcn315.c
 create mode 100644 drivers/gpu/drm/amd/display/dc/gpio/dcn315/hw_factory_dcn315.h
 create mode 100644 drivers/gpu/drm/amd/display/dc/gpio/dcn315/hw_translate_dcn315.c
 create mode 100644 drivers/gpu/drm/amd/display/dc/gpio/dcn315/hw_translate_dcn315.h
drivers/gpu/drm/amd/display/dc/gpio/Makefile +8 -0
index a1bf2128feba..e2ab98228a79 100644
@@ -107,6 +107,14 @@ AMD_DAL_GPIO_DCN30 = $(addprefix $(AMDDALPATH)/dc/gpio/dcn30/,$(GPIO_DCN30))
 
 AMD_DISPLAY_FILES += $(AMD_DAL_GPIO_DCN30)
 
+###############################################################################
+# DCN 3.15
+###############################################################################
+GPIO_DCN315 = hw_translate_dcn315.o hw_factory_dcn315.o
+
+AMD_DAL_GPIO_DCN315 = $(addprefix $(AMDDALPATH)/dc/gpio/dcn315/,$(GPIO_DCN315))
+
+AMD_DISPLAY_FILES += $(AMD_DAL_GPIO_DCN315)
 endif
 ###############################################################################
 # Diagnostics on FPGA
drivers/gpu/drm/amd/display/dc/gpio/dcn315/hw_factory_dcn315.c new file +260 -0

260 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/gpio/dcn315/hw_factory_dcn315.h new file +31 -0
new file mode 100644
index 000000000000..ffa71fa41cd4
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2021 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.
+ *
+ * Authors: AMD
+ *
+ */
+#ifndef __DAL_HW_FACTORY_DCN315_H__
+#define __DAL_HW_FACTORY_DCN315_H__
+
+/* Initialize HW factory function pointers and pin info */
+void dal_hw_factory_dcn315_init(struct hw_factory *factory);
+
+#endif /* __DAL_HW_FACTORY_DCN315_H__ */
drivers/gpu/drm/amd/display/dc/gpio/dcn315/hw_translate_dcn315.c new file +374 -0

374 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/gpio/dcn315/hw_translate_dcn315.h new file +33 -0
new file mode 100644
index 000000000000..d58def4884b2
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2021 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.
+ *
+ * Authors: AMD
+ *
+ */
+#ifndef __DAL_HW_TRANSLATE_DCN315_H__
+#define __DAL_HW_TRANSLATE_DCN315_H__
+
+struct hw_translate;
+
+/* Initialize Hw translate function pointers */
+void dal_hw_translate_dcn315_init(struct hw_translate *tr);
+
+#endif /* __DAL_HW_TRANSLATE_DCN315_H__ */
drivers/gpu/drm/amd/display/dc/gpio/hw_factory.c +4 -0
index c9ee212b2e80..5c00ffde3996 100644
@@ -53,6 +53,7 @@
 #include "dcn20/hw_factory_dcn20.h"
 #include "dcn21/hw_factory_dcn21.h"
 #include "dcn30/hw_factory_dcn30.h"
+#include "dcn315/hw_factory_dcn315.h"
 #endif
 
 #include "diagnostics/hw_factory_diag.h"
@@ -117,6 +118,9 @@ bool dal_hw_factory_init(
 	case DCN_VERSION_3_16:
 		dal_hw_factory_dcn30_init(factory);
 		return true;
+	case DCN_VERSION_3_15:
+		dal_hw_factory_dcn315_init(factory);
+		return true;
 #endif
 	default:
 		ASSERT_CRITICAL(false);
drivers/gpu/drm/amd/display/dc/gpio/hw_translate.c +4 -0
index 42adba630125..7a39cbc01f63 100644
@@ -51,6 +51,7 @@
 #include "dcn20/hw_translate_dcn20.h"
 #include "dcn21/hw_translate_dcn21.h"
 #include "dcn30/hw_translate_dcn30.h"
+#include "dcn315/hw_translate_dcn315.h"
 #endif
 
 #include "diagnostics/hw_translate_diag.h"
@@ -112,6 +113,9 @@ bool dal_hw_translate_init(
 	case DCN_VERSION_3_16:
 		dal_hw_translate_dcn30_init(translate);
 		return true;
+	case DCN_VERSION_3_15:
+		dal_hw_translate_dcn315_init(translate);
+		return true;
 #endif
 
 	default:
Signature · 1 line
2.35.1
author maintainer
#4 lore raw

PATCH 6/13 drm/amd/display: Add DCN315 IRQ

In reply to Alex Deucher

From: Qingqing Zhuo <[email protected]>

Add irq interfaces for DCN 3.1.5.

---
 drivers/gpu/drm/amd/display/dc/irq/Makefile   |   8 +
 .../dc/irq/dcn315/irq_service_dcn315.c        | 438 ++++++++++++++++++
 .../dc/irq/dcn315/irq_service_dcn315.h        |  34 ++
 3 files changed, 480 insertions(+)
 create mode 100644 drivers/gpu/drm/amd/display/dc/irq/dcn315/irq_service_dcn315.c
 create mode 100644 drivers/gpu/drm/amd/display/dc/irq/dcn315/irq_service_dcn315.h
drivers/gpu/drm/amd/display/dc/irq/Makefile +8 -0
index fd739aecf104..f305d4c9a122 100644
@@ -137,3 +137,11 @@ AMD_DAL_IRQ_DCN31= $(addprefix $(AMDDALPATH)/dc/irq/dcn31/,$(IRQ_DCN31))
 
 AMD_DISPLAY_FILES += $(AMD_DAL_IRQ_DCN31)
 endif
+###############################################################################
+# DCN 315
+###############################################################################
+IRQ_DCN315 = irq_service_dcn315.o
+
+AMD_DAL_IRQ_DCN315= $(addprefix $(AMDDALPATH)/dc/irq/dcn315/,$(IRQ_DCN315))
+
+AMD_DISPLAY_FILES += $(AMD_DAL_IRQ_DCN315)
drivers/gpu/drm/amd/display/dc/irq/dcn315/irq_service_dcn315.c new file +438 -0

438 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/irq/dcn315/irq_service_dcn315.h new file +34 -0
new file mode 100644
index 000000000000..a5a80486a8d6
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2021 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.
+ *
+ * Authors: AMD
+ *
+ */
+
+#ifndef __DAL_IRQ_SERVICE_DCN315_H__
+#define __DAL_IRQ_SERVICE_DCN315_H__
+
+#include "../irq_service.h"
+
+struct irq_service *dal_irq_service_dcn315_create(
+	struct irq_service_init_data *init_data);
+
+#endif /* __DAL_IRQ_SERVICE_DCN315_H__ */
Signature · 1 line
2.35.1
author maintainer
#5 lore raw

PATCH 7/13 drm/amd/display: Add DCN315 DMUB

In reply to Alex Deucher

From: Qingqing Zhuo <[email protected]>

Add support for the DMUB firmware for DCN 3.1.5.

---
 drivers/gpu/drm/amd/display/dmub/dmub_srv.h   |  1 +
 drivers/gpu/drm/amd/display/dmub/src/Makefile |  4 +-
 .../drm/amd/display/dmub/src/dmub_dcn315.c    | 62 +++++++++++++++++
 .../drm/amd/display/dmub/src/dmub_dcn315.h    | 68 +++++++++++++++++++
 .../gpu/drm/amd/display/dmub/src/dmub_srv.c   |  9 ++-
 5 files changed, 139 insertions(+), 5 deletions(-)
 create mode 100644 drivers/gpu/drm/amd/display/dmub/src/dmub_dcn315.c
 create mode 100644 drivers/gpu/drm/amd/display/dmub/src/dmub_dcn315.h
drivers/gpu/drm/amd/display/dmub/dmub_srv.h +1 -0
index 821d3fb1f824..56757a286a03 100644
@@ -98,6 +98,7 @@ enum dmub_asic {
 	DMUB_ASIC_DCN303,
 	DMUB_ASIC_DCN31,
 	DMUB_ASIC_DCN31B,
+	DMUB_ASIC_DCN315,
 	DMUB_ASIC_DCN316,
 	DMUB_ASIC_MAX,
 };
drivers/gpu/drm/amd/display/dmub/src/Makefile +1 -3
index 21e818862072..856c7f48de7a 100644
@@ -22,9 +22,7 @@
 
 DMUB = dmub_srv.o dmub_srv_stat.o dmub_reg.o dmub_dcn20.o dmub_dcn21.o
 DMUB += dmub_dcn30.o dmub_dcn301.o dmub_dcn302.o dmub_dcn303.o
-
-DMUB += dmub_dcn31.o
-DMUB += dmub_dcn316.o
+DMUB += dmub_dcn31.o dmub_dcn315.o dmub_dcn316.o
 
 AMD_DAL_DMUB = $(addprefix $(AMDDALPATH)/dmub/src/,$(DMUB))
 
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn315.c new file +62 -0

62 lines not on this page · raw message

drivers/gpu/drm/amd/display/dmub/src/dmub_dcn315.h new file +68 -0

68 lines not on this page · raw message

drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c +7 -2
index db2802a14f95..66db5e538c7f 100644
@@ -32,6 +32,7 @@
 #include "dmub_dcn302.h"
 #include "dmub_dcn303.h"
 #include "dmub_dcn31.h"
+#include "dmub_dcn315.h"
 #include "dmub_dcn316.h"
 #include "os_types.h"
 /*
@@ -221,10 +222,14 @@ static bool dmub_srv_hw_setup(struct dmub_srv *dmub, enum dmub_asic asic)
 
 	case DMUB_ASIC_DCN31:
 	case DMUB_ASIC_DCN31B:
+	case DMUB_ASIC_DCN315:
 	case DMUB_ASIC_DCN316:
-		dmub->regs_dcn31 = &dmub_srv_dcn31_regs;
-		if (asic == DMUB_ASIC_DCN316)
+		if (asic == DMUB_ASIC_DCN315)
+			dmub->regs_dcn31 = &dmub_srv_dcn315_regs;
+		else if (asic == DMUB_ASIC_DCN316)
 			dmub->regs_dcn31 = &dmub_srv_dcn316_regs;
+		else
+			dmub->regs_dcn31 = &dmub_srv_dcn31_regs;
 		funcs->reset = dmub_dcn31_reset;
 		funcs->reset_release = dmub_dcn31_reset_release;
 		funcs->backdoor_load = dmub_dcn31_backdoor_load;
Signature · 1 line
2.35.1
author maintainer
#6 lore raw

PATCH 8/13 drm/amd/display: Add DCN315 Resource

In reply to Alex Deucher

From: Qingqing Zhuo <[email protected]>

Add display resource management for DCN 3.1.5.

---
 .../gpu/drm/amd/display/dc/dcn315/Makefile    |   56 +
 .../amd/display/dc/dcn315/dcn315_resource.c   | 2302 +++++++++++++++++
 .../amd/display/dc/dcn315/dcn315_resource.h   |   42 +
 3 files changed, 2400 insertions(+)
 create mode 100644 drivers/gpu/drm/amd/display/dc/dcn315/Makefile
 create mode 100644 drivers/gpu/drm/amd/display/dc/dcn315/dcn315_resource.c
 create mode 100644 drivers/gpu/drm/amd/display/dc/dcn315/dcn315_resource.h
drivers/gpu/drm/amd/display/dc/dcn315/Makefile new file +56 -0
new file mode 100644
index 000000000000..c831ad46e81c
@@ -0,0 +1,56 @@
+#
+# Copyright © 2021 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.
+#
+# Authors: AMD
+#
+# Makefile for dcn315.
+
+DCN315 = dcn315_resource.o
+
+ifdef CONFIG_X86
+CFLAGS_$(AMDDALPATH)/dc/dcn315/dcn315_resource.o := -msse
+endif
+
+ifdef CONFIG_PPC64
+CFLAGS_$(AMDDALPATH)/dc/dcn315/dcn315_resource.o := -mhard-float -maltivec
+endif
+
+ifdef CONFIG_CC_IS_GCC
+ifeq ($(call cc-ifversion, -lt, 0701, y), y)
+IS_OLD_GCC = 1
+endif
+CFLAGS_$(AMDDALPATH)/dc/dcn315/dcn315_resource.o += -mhard-float
+endif
+
+ifdef CONFIG_X86
+ifdef IS_OLD_GCC
+# Stack alignment mismatch, proceed with caution.
+# GCC < 7.1 cannot compile code using `double` and -mpreferred-stack-boundary=3
+# (8B stack alignment).
+CFLAGS_$(AMDDALPATH)/dc/dcn315/dcn315_resource.o += -mpreferred-stack-boundary=4
+else
+CFLAGS_$(AMDDALPATH)/dc/dcn315/dcn315_resource.o += -msse2
+endif
+endif
+
+AMD_DAL_DCN315 = $(addprefix $(AMDDALPATH)/dc/dcn315/,$(DCN315))
+
+AMD_DISPLAY_FILES += $(AMD_DAL_DCN315)
drivers/gpu/drm/amd/display/dc/dcn315/dcn315_resource.c new file +2302 -0

2,302 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/dcn315/dcn315_resource.h new file +42 -0

42 lines not on this page · raw message

Signature · 1 line
2.35.1
author maintainer
#7 lore raw

PATCH 9/13 drm/amd/display: Add DCN315 Command Table Helper

In reply to Alex Deucher

From: Qingqing Zhuo <[email protected]>

Add vbios table support for DCN 3.1.5.

---
 drivers/gpu/drm/amd/display/dc/bios/command_table_helper2.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/dc/bios/command_table_helper2.c +1 -0
index d0fcfb158436..dd9704ef4ccc 100644
@@ -76,6 +76,7 @@ bool dal_bios_parser_init_cmd_tbl_helper2(
 	case DCN_VERSION_3_02:
 	case DCN_VERSION_3_03:
 	case DCN_VERSION_3_1:
+	case DCN_VERSION_3_15:
 	case DCN_VERSION_3_16:
 		*h = dal_cmd_tbl_helper_dce112_get_table2();
 		return true;
Signature · 1 line
2.35.1
author maintainer
#8 lore raw

PATCH 10/13 drm/amd/display: Add DCN315 blocks to Makefile

In reply to Alex Deucher

From: Qingqing Zhuo <[email protected]>

---
 drivers/gpu/drm/amd/display/dc/Makefile | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/dc/Makefile +1 -0
index 30d0286b2291..f05ab2bf20c5 100644
@@ -36,6 +36,7 @@ DC_LIBS += dcn301
 DC_LIBS += dcn302
 DC_LIBS += dcn303
 DC_LIBS += dcn31
+DC_LIBS += dcn315
 DC_LIBS += dcn316
 endif
 
Signature · 1 line
2.35.1
author maintainer
#9 lore raw

PATCH 11/13 drm/amd/display: Add DCN315 CORE

In reply to Alex Deucher

From: Qingqing Zhuo <[email protected]>

DC core changes for DCN 3.1.5.

---
 drivers/gpu/drm/amd/display/dc/core/dc_link.c     | 13 ++++++++++---
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c |  8 ++++++++
 2 files changed, 18 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +10 -3
index 48858e31b092..417976426bbf 100644
@@ -3236,9 +3236,16 @@ bool dc_link_setup_psr(struct dc_link *link,
 	/*skip power down the single pipe since it blocks the cstate*/
 #if defined(CONFIG_DRM_AMD_DC_DCN)
 	if (link->ctx->asic_id.chip_family >= FAMILY_RV) {
-		psr_context->psr_level.bits.SKIP_CRTC_DISABLE = true;
-		if (link->ctx->asic_id.chip_family == FAMILY_YELLOW_CARP && !dc->debug.disable_z10)
-			psr_context->psr_level.bits.SKIP_CRTC_DISABLE = false;
+		switch(link->ctx->asic_id.chip_family) {
+		case FAMILY_YELLOW_CARP:
+		case AMDGPU_FAMILY_GC_10_3_6:
+			if(!dc->debug.disable_z10)
+				psr_context->psr_level.bits.SKIP_CRTC_DISABLE = false;
+			break;
+		default:
+			psr_context->psr_level.bits.SKIP_CRTC_DISABLE = true;
+			break;
+		}
 	}
 #else
 	if (link->ctx->asic_id.chip_family >= FAMILY_RV)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +8 -0
index 004a299228ab..d266253a78a2 100644
@@ -66,6 +66,7 @@
 #include "dcn302/dcn302_resource.h"
 #include "dcn303/dcn303_resource.h"
 #include "dcn31/dcn31_resource.h"
+#include "dcn315/dcn315_resource.h"
 #include "dcn316/dcn316_resource.h"
 #endif
 
@@ -156,6 +157,10 @@ enum dce_version resource_parse_asic_id(struct hw_asic_id asic_id)
 		if (ASICREV_IS_YELLOW_CARP(asic_id.hw_internal_rev))
 			dc_version = DCN_VERSION_3_1;
 		break;
+	case AMDGPU_FAMILY_GC_10_3_6:
+		if (ASICREV_IS_GC_10_3_6(asic_id.hw_internal_rev))
+			dc_version = DCN_VERSION_3_15;
+		break;
 	case AMDGPU_FAMILY_GC_10_3_7:
 		if (ASICREV_IS_GC_10_3_7(asic_id.hw_internal_rev))
 			dc_version = DCN_VERSION_3_16;
@@ -251,6 +256,9 @@ struct resource_pool *dc_create_resource_pool(struct dc  *dc,
 	case DCN_VERSION_3_1:
 		res_pool = dcn31_create_resource_pool(init_data, dc);
 		break;
+	case DCN_VERSION_3_15:
+		res_pool = dcn315_create_resource_pool(init_data, dc);
+		break;
 	case DCN_VERSION_3_16:
 		res_pool = dcn316_create_resource_pool(init_data, dc);
 		break;
Signature · 1 line
2.35.1
author maintainer
#10 lore raw

PATCH 12/13 drm/amd/display: Add DCN315 DM Support

In reply to Alex Deucher

From: Qingqing Zhuo <[email protected]>

Add display manager support for DCN 3.1.5.

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c  | 14 +++++++++++++-
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c |  1 +
 2 files changed, 14 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +13 -1
index 38f57fe540ea..e8dec724d8ef 100644
@@ -114,6 +114,8 @@ MODULE_FIRMWARE(FIRMWARE_DIMGREY_CAVEFISH_DMUB);
 MODULE_FIRMWARE(FIRMWARE_BEIGE_GOBY_DMUB);
 #define FIRMWARE_YELLOW_CARP_DMUB "amdgpu/yellow_carp_dmcub.bin"
 MODULE_FIRMWARE(FIRMWARE_YELLOW_CARP_DMUB);
+#define FIRMWARE_DCN_315_DMUB "amdgpu/dcn_3_1_5_dmcub.bin"
+MODULE_FIRMWARE(FIRMWARE_DCN_315_DMUB);
 #define FIRMWARE_DCN316_DMUB "amdgpu/dcn_3_1_6_dmcub.bin"
 MODULE_FIRMWARE(FIRMWARE_DCN316_DMUB);
 
@@ -1465,6 +1467,7 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
 		case IP_VERSION(3, 0, 1):
 		case IP_VERSION(3, 1, 2):
 		case IP_VERSION(3, 1, 3):
+		case IP_VERSION(3, 1, 5):
 			init_data.flags.gpu_vm_support = true;
 			break;
 		case IP_VERSION(2, 0, 3):
@@ -1803,6 +1806,7 @@ static int load_dmcu_fw(struct amdgpu_device *adev)
 		case IP_VERSION(3, 0, 1):
 		case IP_VERSION(3, 1, 2):
 		case IP_VERSION(3, 1, 3):
+		case IP_VERSION(3, 1, 5):
 		case IP_VERSION(3, 1, 6):
 			return 0;
 		default:
@@ -1919,11 +1923,14 @@ static int dm_dmub_sw_init(struct amdgpu_device *adev)
 		dmub_asic = (adev->external_rev_id == YELLOW_CARP_B0) ? DMUB_ASIC_DCN31B : DMUB_ASIC_DCN31;
 		fw_name_dmub = FIRMWARE_YELLOW_CARP_DMUB;
 		break;
+	case IP_VERSION(3, 1, 5):
+		dmub_asic = DMUB_ASIC_DCN315;
+		fw_name_dmub = FIRMWARE_DCN_315_DMUB;
+		break;
 	case IP_VERSION(3, 1, 6):
 		dmub_asic = DMUB_ASIC_DCN316;
 		fw_name_dmub = FIRMWARE_DCN316_DMUB;
 		break;
-
 	default:
 		/* ASIC doesn't support DMUB. */
 		return 0;
@@ -4231,6 +4238,7 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)
 	case IP_VERSION(3, 0, 0):
 	case IP_VERSION(3, 1, 2):
 	case IP_VERSION(3, 1, 3):
+	case IP_VERSION(3, 1, 5):
 	case IP_VERSION(3, 1, 6):
 	case IP_VERSION(2, 1, 0):
 		if (register_outbox_irq_handlers(dm->adev)) {
@@ -4248,6 +4256,7 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)
 		switch (adev->ip_versions[DCE_HWIP][0]) {
 		case IP_VERSION(3, 1, 2):
 		case IP_VERSION(3, 1, 3):
+		case IP_VERSION(3, 1, 5):
 		case IP_VERSION(3, 1, 6):
 			psr_feature_enabled = true;
 			break;
@@ -4366,6 +4375,7 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)
 		case IP_VERSION(3, 0, 1):
 		case IP_VERSION(3, 1, 2):
 		case IP_VERSION(3, 1, 3):
+		case IP_VERSION(3, 1, 5):
 		case IP_VERSION(3, 1, 6):
 			if (dcn10_register_irq_handlers(dm->adev)) {
 				DRM_ERROR("DM: Failed to initialize IRQ\n");
@@ -4552,6 +4562,7 @@ static int dm_early_init(void *handle)
 		case IP_VERSION(2, 1, 0):
 		case IP_VERSION(3, 1, 2):
 		case IP_VERSION(3, 1, 3):
+		case IP_VERSION(3, 1, 5):
 		case IP_VERSION(3, 1, 6):
 			adev->mode_info.num_crtc = 4;
 			adev->mode_info.num_hpd = 4;
@@ -5225,6 +5236,7 @@ get_plane_modifiers(const struct amdgpu_device *adev, unsigned int plane_type, u
 	case AMDGPU_FAMILY_NV:
 	case AMDGPU_FAMILY_VGH:
 	case AMDGPU_FAMILY_YC:
+	case AMDGPU_FAMILY_GC_10_3_6:
 	case AMDGPU_FAMILY_GC_10_3_7:
 		if (adev->ip_versions[GC_HWIP][0] >= IP_VERSION(10, 3, 0))
 			add_gfx10_3_modifiers(adev, mods, &size, &capacity);
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c +1 -0
index 8709827b69ad..bf0d50277f8f 100644
@@ -664,6 +664,7 @@ struct hdcp_workqueue *hdcp_create_workqueue(struct amdgpu_device *adev, struct
 
 		hdcp_work[i].hdcp.config.psp.handle = &adev->psp;
 		if (dc->ctx->dce_version == DCN_VERSION_3_1 ||
+		    dc->ctx->dce_version == DCN_VERSION_3_15 ||
 		    dc->ctx->dce_version == DCN_VERSION_3_16)
 			hdcp_work[i].hdcp.config.psp.caps.dtm_v3_supported = 1;
 		hdcp_work[i].hdcp.config.ddc.handle = dc_get_link_at_index(dc, i);
Signature · 1 line
2.35.1
author maintainer
#11 lore raw

PATCH 13/13 drm/amdgpu: add dm ip block for dcn 3.1.5

In reply to Alex Deucher

From: Yifan Zhang <[email protected]>

this patch adds dm ip block for dcn 3.1.5.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +1 -0
index 9ec7f723242b..86fb4a761fe4 100644
@@ -1378,6 +1378,7 @@ static int amdgpu_discovery_set_display_ip_blocks(struct amdgpu_device *adev)
 		case IP_VERSION(3, 0, 1):
 		case IP_VERSION(3, 1, 2):
 		case IP_VERSION(3, 1, 3):
+		case IP_VERSION(3, 1, 5):
 		case IP_VERSION(3, 1, 6):
 			amdgpu_device_ip_block_add(adev, &dm_ip_block);
 			break;
Signature · 1 line
2.35.1