Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jnettlet/dfb3da77f9bfb5bd966e623805266847 to your computer and use it in GitHub Desktop.
Save jnettlet/dfb3da77f9bfb5bd966e623805266847 to your computer and use it in GitHub Desktop.
Arm64 Navi support for amdgpu
From ea5c8b0792ed73fcd50d368b439e1b90b39fb0f6 Mon Sep 17 00:00:00 2001
From: Jon Nettleton <[email protected]>
Date: Tue, 18 Oct 2022 20:52:26 +0200
Subject: [PATCH] drm/amd/display: Re-enable Arm64 support for Navi and newer
GPUs
This is a WIP patch working on enabling Navi and newer support
for Arm64. It requires breaking out all code that use floating point
and compiling those targets with -mgeneral-regs-only. Then all the
calling targets or called functions are wrapped in DC_FP_START()
and DC_FP_END().
Note: This is an experimental patchset and it is possible there
are other functions that need to be cleaned up and wrapped.
Signed-off-by: Jon Nettleton <[email protected]>
---
drivers/gpu/drm/amd/display/Kconfig | 2 +-
.../gpu/drm/amd/display/amdgpu_dm/dc_fpu.c | 6 +
drivers/gpu/drm/amd/display/dc/dcn10/Makefile | 11 +-
.../drm/amd/display/dc/dcn10/dcn10_resource.c | 45 +----
.../drm/amd/display/dc/dcn10/dcn10_resource.h | 2 +
.../amd/display/dc/dcn10/dcn10_resource_fpu.c | 65 +++++++
.../drm/amd/display/dc/dcn30/dcn30_resource.c | 2 +
drivers/gpu/drm/amd/display/dc/dcn32/Makefile | 7 +-
.../drm/amd/display/dc/dcn32/dcn32_resource.c | 129 +-------------
.../drm/amd/display/dc/dcn32/dcn32_resource.h | 4 +
.../amd/display/dc/dcn32/dcn32_resource_fpu.c | 161 ++++++++++++++++++
drivers/gpu/drm/amd/display/dc/dml/Makefile | 22 ++-
.../dc/dml/dcn20/display_mode_vba_20.c | 4 +
.../dc/dml/dcn20/display_mode_vba_20v2.c | 4 +
.../dc/dml/dcn20/display_rq_dlg_calc_20.c | 5 +
.../dc/dml/dcn20/display_rq_dlg_calc_20v2.c | 4 +
.../dc/dml/dcn21/display_mode_vba_21.c | 4 +
.../dc/dml/dcn21/display_rq_dlg_calc_21.c | 4 +
.../dc/dml/dcn30/display_mode_vba_30.c | 4 +
.../dc/dml/dcn30/display_rq_dlg_calc_30.c | 4 +
.../dc/dml/dcn31/display_mode_vba_31.c | 4 +
.../dc/dml/dcn31/display_rq_dlg_calc_31.c | 4 +
.../dc/dml/dcn314/display_mode_vba_314.c | 4 +
.../dc/dml/dcn314/display_rq_dlg_calc_314.c | 4 +
.../dc/dml/dcn32/display_mode_vba_32.c | 4 +
.../dc/dml/dcn32/display_rq_dlg_calc_32.c | 4 +
.../drm/amd/display/dc/dml/display_mode_lib.c | 129 +-------------
.../amd/display/dc/dml/display_mode_lib_fpu.c | 154 +++++++++++++++++
.../gpu/drm/amd/display/dc/dml/dml_wrapper.c | 2 +
29 files changed, 497 insertions(+), 301 deletions(-)
create mode 100644 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource_fpu.c
create mode 100644 drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_fpu.c
create mode 100644 drivers/gpu/drm/amd/display/dc/dml/display_mode_lib_fpu.c
diff --git a/drivers/gpu/drm/amd/display/Kconfig b/drivers/gpu/drm/amd/display/Kconfig
index 413d8c6d592f..ca5b7f1def43 100644
--- a/drivers/gpu/drm/amd/display/Kconfig
+++ b/drivers/gpu/drm/amd/display/Kconfig
@@ -6,7 +6,7 @@ config DRM_AMD_DC
bool "AMD DC - Enable new display engine"
default y
select SND_HDA_COMPONENT if SND_HDA_CORE
- select DRM_AMD_DC_DCN if (X86 || PPC_LONG_DOUBLE_128)
+ select DRM_AMD_DC_DCN if (X86 || PPC_LONG_DOUBLE_128 || (ARM64 && KERNEL_MODE_NEON))
help
Choose this option if you want to use the new display engine
support for AMDGPU. This adds required support for Vega and
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/dc_fpu.c b/drivers/gpu/drm/amd/display/amdgpu_dm/dc_fpu.c
index ab0c6d191038..1743ca0a3641 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/dc_fpu.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/dc_fpu.c
@@ -31,6 +31,8 @@
#elif defined(CONFIG_PPC64)
#include <asm/switch_to.h>
#include <asm/cputable.h>
+#elif defined(CONFIG_ARM64)
+#include <asm/neon.h>
#endif
/**
@@ -99,6 +101,8 @@ void dc_fpu_begin(const char *function_name, const int line)
preempt_disable();
enable_kernel_fp();
}
+#elif defined(CONFIG_ARM64)
+ kernel_neon_begin();
#endif
}
@@ -136,6 +140,8 @@ void dc_fpu_end(const char *function_name, const int line)
disable_kernel_fp();
preempt_enable();
}
+#elif defined(CONFIG_ARM64)
+ kernel_neon_end();
#endif
}
diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/Makefile b/drivers/gpu/drm/amd/display/dc/dcn10/Makefile
index 62ad1a11bff9..f9183bb41021 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn10/Makefile
+++ b/drivers/gpu/drm/amd/display/dc/dcn10/Makefile
@@ -21,14 +21,23 @@
#
#
# Makefile for DCN.
+#
+ifdef CONFIG_ARM64
+dcn10_rcflags := -mgeneral-regs-only
+endif
+
+CFLAGS_REMOVE_$(AMDDALPATH)/dc/dcn10/dcn10_resource_fpu.o := $(dcn10_rcflags)
-DCN10 = dcn10_init.o dcn10_resource.o dcn10_ipp.o dcn10_hw_sequencer.o \
+DCN10 = dcn10_init.o dcn10_resource.o dcn10_resource_fpu.o \
+ dcn10_ipp.o dcn10_hw_sequencer.o \
dcn10_hw_sequencer_debug.o \
dcn10_dpp.o dcn10_opp.o dcn10_optc.o \
dcn10_hubp.o dcn10_mpc.o \
dcn10_dpp_dscl.o dcn10_dpp_cm.o dcn10_cm_common.o \
dcn10_hubbub.o dcn10_stream_encoder.o dcn10_link_encoder.o
+
+
AMD_DAL_DCN10 = $(addprefix $(AMDDALPATH)/dc/dcn10/,$(DCN10))
AMD_DISPLAY_FILES += $(AMD_DAL_DCN10)
diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c
index 174eebbe8b4f..86b6a5706720 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c
@@ -1295,47 +1295,6 @@ static uint32_t read_pipe_fuses(struct dc_context *ctx)
return value;
}
-/*
- * Some architectures don't support soft-float (e.g. aarch64), on those
- * this function has to be called with hardfloat enabled, make sure not
- * to inline it so whatever fp stuff is done stays inside
- */
-static noinline void dcn10_resource_construct_fp(
- struct dc *dc)
-{
- if (dc->ctx->dce_version == DCN_VERSION_1_01) {
- struct dcn_soc_bounding_box *dcn_soc = dc->dcn_soc;
- struct dcn_ip_params *dcn_ip = dc->dcn_ip;
- struct display_mode_lib *dml = &dc->dml;
-
- dml->ip.max_num_dpp = 3;
- /* TODO how to handle 23.84? */
- dcn_soc->dram_clock_change_latency = 23;
- dcn_ip->max_num_dpp = 3;
- }
- if (ASICREV_IS_RV1_F0(dc->ctx->asic_id.hw_internal_rev)) {
- dc->dcn_soc->urgent_latency = 3;
- dc->debug.disable_dmcu = true;
- dc->dcn_soc->fabric_and_dram_bandwidth_vmax0p9 = 41.60f;
- }
-
-
- dc->dcn_soc->number_of_channels = dc->ctx->asic_id.vram_width / ddr4_dram_width;
- ASSERT(dc->dcn_soc->number_of_channels < 3);
- if (dc->dcn_soc->number_of_channels == 0)/*old sbios bug*/
- dc->dcn_soc->number_of_channels = 2;
-
- if (dc->dcn_soc->number_of_channels == 1) {
- dc->dcn_soc->fabric_and_dram_bandwidth_vmax0p9 = 19.2f;
- dc->dcn_soc->fabric_and_dram_bandwidth_vnom0p8 = 17.066f;
- dc->dcn_soc->fabric_and_dram_bandwidth_vmid0p72 = 14.933f;
- dc->dcn_soc->fabric_and_dram_bandwidth_vmin0p65 = 12.8f;
- if (ASICREV_IS_RV1_F0(dc->ctx->asic_id.hw_internal_rev)) {
- dc->dcn_soc->fabric_and_dram_bandwidth_vmax0p9 = 20.80f;
- }
- }
-}
-
static bool dcn10_resource_construct(
uint8_t num_virtual_links,
struct dc *dc,
@@ -1493,7 +1452,9 @@ static bool dcn10_resource_construct(
memcpy(dc->dcn_soc, &dcn10_soc_defaults, sizeof(dcn10_soc_defaults));
/* Other architectures we build for build this with soft-float */
- dcn10_resource_construct_fp(dc);
+ DC_FP_START();
+ dcn10_resource_construct_fpu(dc);
+ DC_FP_END();
pool->base.pp_smu = dcn10_pp_smu_create(ctx);
diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.h b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.h
index bf8e33cd8147..036556bb5949 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.h
+++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.h
@@ -51,6 +51,8 @@ struct stream_encoder *dcn10_find_first_free_match_stream_enc_for_link(
const struct resource_pool *pool,
struct dc_stream_state *stream);
+noinline void dcn10_resource_construct_fpu(struct dc *dc);
+
#endif /* __DC_RESOURCE_DCN10_H__ */
diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource_fpu.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource_fpu.c
new file mode 100644
index 000000000000..5363e0121858
--- /dev/null
+++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource_fpu.c
@@ -0,0 +1,65 @@
+/*
+* Copyright 2016 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
+ *
+ */
+
+#include "resource.h"
+#include "dcn10_resource.h"
+
+noinline void dcn10_resource_construct_fpu(
+ struct dc *dc)
+{
+ if (dc->ctx->dce_version == DCN_VERSION_1_01) {
+ struct dcn_soc_bounding_box *dcn_soc = dc->dcn_soc;
+ struct dcn_ip_params *dcn_ip = dc->dcn_ip;
+ struct display_mode_lib *dml = &dc->dml;
+
+ dml->ip.max_num_dpp = 3;
+ /* TODO how to handle 23.84? */
+ dcn_soc->dram_clock_change_latency = 23;
+ dcn_ip->max_num_dpp = 3;
+ }
+ if (ASICREV_IS_RV1_F0(dc->ctx->asic_id.hw_internal_rev)) {
+ dc->dcn_soc->urgent_latency = 3;
+ dc->debug.disable_dmcu = true;
+ dc->dcn_soc->fabric_and_dram_bandwidth_vmax0p9 = 41.60f;
+ }
+
+
+ dc->dcn_soc->number_of_channels = dc->ctx->asic_id.vram_width / ddr4_dram_width;
+ ASSERT(dc->dcn_soc->number_of_channels < 3);
+ if (dc->dcn_soc->number_of_channels == 0)/*old sbios bug*/
+ dc->dcn_soc->number_of_channels = 2;
+
+ if (dc->dcn_soc->number_of_channels == 1) {
+ dc->dcn_soc->fabric_and_dram_bandwidth_vmax0p9 = 19.2f;
+ dc->dcn_soc->fabric_and_dram_bandwidth_vnom0p8 = 17.066f;
+ dc->dcn_soc->fabric_and_dram_bandwidth_vmid0p72 = 14.933f;
+ dc->dcn_soc->fabric_and_dram_bandwidth_vmin0p65 = 12.8f;
+ if (ASICREV_IS_RV1_F0(dc->ctx->asic_id.hw_internal_rev)) {
+ dc->dcn_soc->fabric_and_dram_bandwidth_vmax0p9 = 20.80f;
+ }
+ }
+}
+
+
diff --git a/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c b/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c
index 64320e0ca446..f7b3f8876a46 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c
@@ -1662,7 +1662,9 @@ noinline bool dcn30_internal_validate_bw(
goto validate_out;
}
+ DC_FP_START();
dml_log_pipe_params(&context->bw_ctx.dml, pipes, pipe_cnt);
+ DC_FP_END();
if (!fast_validate) {
/*
diff --git a/drivers/gpu/drm/amd/display/dc/dcn32/Makefile b/drivers/gpu/drm/amd/display/dc/dcn32/Makefile
index e943b643ab6b..646d002ea412 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn32/Makefile
+++ b/drivers/gpu/drm/amd/display/dc/dcn32/Makefile
@@ -9,8 +9,13 @@
# Authors: AMD
#
# Makefile for dcn32.
+ifdef CONFIG_ARM64
+dcn32_rcflags := -mgeneral-regs-only
+endif
-DCN32 = dcn32_resource.o dcn32_hubbub.o dcn32_hwseq.o dcn32_init.o \
+CFLAGS_REMOVE_$(AMDDALPATH)/dc/dcn32/dcn32_resource_fpu.o := $(dcn32_rcflags)
+
+DCN32 = dcn32_resource.o dcn32_resource_fpu.o dcn32_hubbub.o dcn32_hwseq.o dcn32_init.o \
dcn32_dccg.o dcn32_optc.o dcn32_mmhubbub.o dcn32_hubp.o dcn32_dpp.o \
dcn32_dio_stream_encoder.o dcn32_dio_link_encoder.o dcn32_hpo_dp_link_encoder.o \
dcn32_resource_helpers.o dcn32_mpc.o
diff --git a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c
index c3b783cea8a0..e3c8cc029ff7 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c
@@ -1808,139 +1808,18 @@ bool dcn32_validate_bandwidth(struct dc *dc,
return out;
}
-
-static bool is_dual_plane(enum surface_pixel_format format)
-{
- return format >= SURFACE_PIXEL_FORMAT_VIDEO_BEGIN || format == SURFACE_PIXEL_FORMAT_GRPH_RGBE_ALPHA;
-}
-
int dcn32_populate_dml_pipes_from_context(
struct dc *dc, struct dc_state *context,
display_e2e_pipe_params_st *pipes,
bool fast_validate)
{
- int i, pipe_cnt;
- struct resource_context *res_ctx = &context->res_ctx;
- struct pipe_ctx *pipe;
- bool subvp_in_use = false, is_pipe_split_expected[MAX_PIPES];
- int plane_count = 0;
- struct dc_crtc_timing *timing;
+ int pipe_cnt;
dcn20_populate_dml_pipes_from_context(dc, context, pipes, fast_validate);
- for (i = 0, pipe_cnt = 0; i < dc->res_pool->pipe_count; i++) {
-
- if (!res_ctx->pipe_ctx[i].stream)
- continue;
- pipe = &res_ctx->pipe_ctx[i];
- timing = &pipe->stream->timing;
-
- pipes[pipe_cnt].pipe.src.gpuvm = true;
- pipes[pipe_cnt].pipe.src.dcc_fraction_of_zs_req_luma = 0;
- pipes[pipe_cnt].pipe.src.dcc_fraction_of_zs_req_chroma = 0;
- pipes[pipe_cnt].pipe.dest.vfront_porch = timing->v_front_porch;
- pipes[pipe_cnt].pipe.src.gpuvm_min_page_size_kbytes = 256; // according to spreadsheet
- pipes[pipe_cnt].pipe.src.unbounded_req_mode = false;
- pipes[pipe_cnt].pipe.scale_ratio_depth.lb_depth = dm_lb_19;
-
- switch (pipe->stream->mall_stream_config.type) {
- case SUBVP_MAIN:
- pipes[pipe_cnt].pipe.src.use_mall_for_pstate_change = dm_use_mall_pstate_change_sub_viewport;
- subvp_in_use = true;
- break;
- case SUBVP_PHANTOM:
- pipes[pipe_cnt].pipe.src.use_mall_for_pstate_change = dm_use_mall_pstate_change_phantom_pipe;
- pipes[pipe_cnt].pipe.src.use_mall_for_static_screen = dm_use_mall_static_screen_disable;
- // Disallow unbounded req for SubVP according to DCHUB programming guide
- pipes[pipe_cnt].pipe.src.unbounded_req_mode = false;
- break;
- case SUBVP_NONE:
- pipes[pipe_cnt].pipe.src.use_mall_for_pstate_change = dm_use_mall_pstate_change_disable;
- pipes[pipe_cnt].pipe.src.use_mall_for_static_screen = dm_use_mall_static_screen_disable;
- break;
- default:
- break;
- }
-
- pipes[pipe_cnt].dout.dsc_input_bpc = 0;
- if (pipes[pipe_cnt].dout.dsc_enable) {
- switch (timing->display_color_depth) {
- case COLOR_DEPTH_888:
- pipes[pipe_cnt].dout.dsc_input_bpc = 8;
- break;
- case COLOR_DEPTH_101010:
- pipes[pipe_cnt].dout.dsc_input_bpc = 10;
- break;
- case COLOR_DEPTH_121212:
- pipes[pipe_cnt].dout.dsc_input_bpc = 12;
- break;
- default:
- ASSERT(0);
- break;
- }
- }
-
- /* Calculate the number of planes we have so we can determine
- * whether to apply ODM 2to1 policy or not
- */
- if (pipe->stream && !pipe->prev_odm_pipe &&
- (!pipe->top_pipe || pipe->top_pipe->plane_state != pipe->plane_state))
- ++plane_count;
-
- DC_FP_START();
- is_pipe_split_expected[i] = dcn32_predict_pipe_split(context, pipes[i].pipe, i);
- DC_FP_END();
-
- pipe_cnt++;
- }
-
- /* Determine whether we will apply ODM 2to1 policy
- * Applies to single display and where the number of planes is less than 3
- * For 3 plane case ( 2 MPO planes ), we will not set the policy for the MPO pipes
- */
- for (i = 0, pipe_cnt = 0; i < dc->res_pool->pipe_count; i++) {
- if (!res_ctx->pipe_ctx[i].stream)
- continue;
- pipe = &res_ctx->pipe_ctx[i];
- timing = &pipe->stream->timing;
-
- pipes[pipe_cnt].pipe.dest.odm_combine_policy = dm_odm_combine_policy_dal;
- res_ctx->pipe_ctx[i].stream->odm_2to1_policy_applied = false;
- if (context->stream_count == 1 && timing->dsc_cfg.num_slices_h != 1) {
- if (dc->debug.enable_single_display_2to1_odm_policy) {
- if (!((plane_count > 2) && pipe->top_pipe))
- pipes[pipe_cnt].pipe.dest.odm_combine_policy = dm_odm_combine_policy_2to1;
- }
- res_ctx->pipe_ctx[i].stream->odm_2to1_policy_applied = true;
- }
- pipe_cnt++;
- }
-
- /* For DET allocation, we don't want to use DML policy (not optimal for utilizing all
- * the DET available for each pipe). Use the DET override input to maintain our driver
- * policy.
- */
- if (pipe_cnt == 1 && !is_pipe_split_expected[0]) {
- pipes[0].pipe.src.det_size_override = DCN3_2_MAX_DET_SIZE;
- if (pipe->plane_state && !dc->debug.disable_z9_mpc) {
- if (!is_dual_plane(pipe->plane_state->format)) {
- pipes[0].pipe.src.det_size_override = DCN3_2_DEFAULT_DET_SIZE;
- pipes[0].pipe.src.unbounded_req_mode = true;
- if (pipe->plane_state->src_rect.width >= 5120 &&
- pipe->plane_state->src_rect.height >= 2880)
- pipes[0].pipe.src.det_size_override = 320; // 5K or higher
- }
- }
- } else
- dcn32_determine_det_override(context, pipes, is_pipe_split_expected, dc->res_pool->pipe_count);
-
- // In general cases we want to keep the dram clock change requirement
- // (prefer configs that support MCLK switch). Only override to false
- // for SubVP
- if (subvp_in_use)
- context->bw_ctx.dml.soc.dram_clock_change_requirement_final = false;
- else
- context->bw_ctx.dml.soc.dram_clock_change_requirement_final = true;
+ DC_FP_START();
+ pipe_cnt = dcn32_populate_dml_pipes_from_context_fpu(dc, context, pipes);
+ DC_FP_END();
return pipe_cnt;
}
diff --git a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.h b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.h
index cf15d0e5e9b4..8885063800ea 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.h
+++ b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.h
@@ -82,6 +82,10 @@ int dcn32_populate_dml_pipes_from_context(
display_e2e_pipe_params_st *pipes,
bool fast_validate);
+noinline int dcn32_populate_dml_pipes_from_context_fpu(
+ struct dc *dc, struct dc_state *context,
+ display_e2e_pipe_params_st *pipes);
+
void dcn32_calculate_wm_and_dlg(
struct dc *dc, struct dc_state *context,
display_e2e_pipe_params_st *pipes,
diff --git a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_fpu.c b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_fpu.c
new file mode 100644
index 000000000000..4de30b7fa3d8
--- /dev/null
+++ b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_fpu.c
@@ -0,0 +1,161 @@
+// SPDX-License-Identifier: MIT
+/*
+ * Copyright 2022 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
+ *
+ */
+
+#include "resource.h"
+#include "dcn32_resource.h"
+
+#include "dml/dcn32/dcn32_fpu.h"
+
+static bool is_dual_plane(enum surface_pixel_format format)
+{
+ return format >= SURFACE_PIXEL_FORMAT_VIDEO_BEGIN || format == SURFACE_PIXEL_FORMAT_GRPH_RGBE_ALPHA;
+}
+
+noinline int dcn32_populate_dml_pipes_from_context_fpu(
+ struct dc *dc, struct dc_state *context,
+ display_e2e_pipe_params_st *pipes)
+{
+ int i, pipe_cnt;
+ struct resource_context *res_ctx = &context->res_ctx;
+ struct pipe_ctx *pipe;
+ bool subvp_in_use = false, is_pipe_split_expected[MAX_PIPES];
+ int plane_count = 0;
+ struct dc_crtc_timing *timing;
+
+ for (i = 0, pipe_cnt = 0; i < dc->res_pool->pipe_count; i++) {
+
+ if (!res_ctx->pipe_ctx[i].stream)
+ continue;
+ pipe = &res_ctx->pipe_ctx[i];
+ timing = &pipe->stream->timing;
+
+ pipes[pipe_cnt].pipe.src.gpuvm = true;
+ pipes[pipe_cnt].pipe.src.dcc_fraction_of_zs_req_luma = 0;
+ pipes[pipe_cnt].pipe.src.dcc_fraction_of_zs_req_chroma = 0;
+ pipes[pipe_cnt].pipe.dest.vfront_porch = timing->v_front_porch;
+ pipes[pipe_cnt].pipe.src.gpuvm_min_page_size_kbytes = 256; // according to spreadsheet
+ pipes[pipe_cnt].pipe.src.unbounded_req_mode = false;
+ pipes[pipe_cnt].pipe.scale_ratio_depth.lb_depth = dm_lb_19;
+
+ switch (pipe->stream->mall_stream_config.type) {
+ case SUBVP_MAIN:
+ pipes[pipe_cnt].pipe.src.use_mall_for_pstate_change = dm_use_mall_pstate_change_sub_viewport;
+ subvp_in_use = true;
+ break;
+ case SUBVP_PHANTOM:
+ pipes[pipe_cnt].pipe.src.use_mall_for_pstate_change = dm_use_mall_pstate_change_phantom_pipe;
+ pipes[pipe_cnt].pipe.src.use_mall_for_static_screen = dm_use_mall_static_screen_disable;
+ // Disallow unbounded req for SubVP according to DCHUB programming guide
+ pipes[pipe_cnt].pipe.src.unbounded_req_mode = false;
+ break;
+ case SUBVP_NONE:
+ pipes[pipe_cnt].pipe.src.use_mall_for_pstate_change = dm_use_mall_pstate_change_disable;
+ pipes[pipe_cnt].pipe.src.use_mall_for_static_screen = dm_use_mall_static_screen_disable;
+ break;
+ default:
+ break;
+ }
+
+ pipes[pipe_cnt].dout.dsc_input_bpc = 0;
+ if (pipes[pipe_cnt].dout.dsc_enable) {
+ switch (timing->display_color_depth) {
+ case COLOR_DEPTH_888:
+ pipes[pipe_cnt].dout.dsc_input_bpc = 8;
+ break;
+ case COLOR_DEPTH_101010:
+ pipes[pipe_cnt].dout.dsc_input_bpc = 10;
+ break;
+ case COLOR_DEPTH_121212:
+ pipes[pipe_cnt].dout.dsc_input_bpc = 12;
+ break;
+ default:
+ ASSERT(0);
+ break;
+ }
+ }
+
+ /* Calculate the number of planes we have so we can determine
+ * whether to apply ODM 2to1 policy or not
+ */
+ if (pipe->stream && !pipe->prev_odm_pipe &&
+ (!pipe->top_pipe || pipe->top_pipe->plane_state != pipe->plane_state))
+ ++plane_count;
+
+ is_pipe_split_expected[i] = dcn32_predict_pipe_split(context, pipes[i].pipe, i);
+
+ pipe_cnt++;
+ }
+
+ /* Determine whether we will apply ODM 2to1 policy
+ * Applies to single display and where the number of planes is less than 3
+ * For 3 plane case ( 2 MPO planes ), we will not set the policy for the MPO pipes
+ */
+ for (i = 0, pipe_cnt = 0; i < dc->res_pool->pipe_count; i++) {
+ if (!res_ctx->pipe_ctx[i].stream)
+ continue;
+ pipe = &res_ctx->pipe_ctx[i];
+ timing = &pipe->stream->timing;
+
+ pipes[pipe_cnt].pipe.dest.odm_combine_policy = dm_odm_combine_policy_dal;
+ res_ctx->pipe_ctx[i].stream->odm_2to1_policy_applied = false;
+ if (context->stream_count == 1 && timing->dsc_cfg.num_slices_h != 1) {
+ if (dc->debug.enable_single_display_2to1_odm_policy) {
+ if (!((plane_count > 2) && pipe->top_pipe))
+ pipes[pipe_cnt].pipe.dest.odm_combine_policy = dm_odm_combine_policy_2to1;
+ }
+ res_ctx->pipe_ctx[i].stream->odm_2to1_policy_applied = true;
+ }
+ pipe_cnt++;
+ }
+
+ /* For DET allocation, we don't want to use DML policy (not optimal for utilizing all
+ * the DET available for each pipe). Use the DET override input to maintain our driver
+ * policy.
+ */
+ if (pipe_cnt == 1 && !is_pipe_split_expected[0]) {
+ pipes[0].pipe.src.det_size_override = DCN3_2_MAX_DET_SIZE;
+ if (pipe->plane_state && !dc->debug.disable_z9_mpc) {
+ if (!is_dual_plane(pipe->plane_state->format)) {
+ pipes[0].pipe.src.det_size_override = DCN3_2_DEFAULT_DET_SIZE;
+ pipes[0].pipe.src.unbounded_req_mode = true;
+ if (pipe->plane_state->src_rect.width >= 5120 &&
+ pipe->plane_state->src_rect.height >= 2880)
+ pipes[0].pipe.src.det_size_override = 320; // 5K or higher
+ }
+ }
+ } else
+ dcn32_determine_det_override(context, pipes, is_pipe_split_expected, dc->res_pool->pipe_count);
+
+ // In general cases we want to keep the dram clock change requirement
+ // (prefer configs that support MCLK switch). Only override to false
+ // for SubVP
+ if (subvp_in_use)
+ context->bw_ctx.dml.soc.dram_clock_change_requirement_final = false;
+ else
+ context->bw_ctx.dml.soc.dram_clock_change_requirement_final = true;
+
+ return pipe_cnt;
+}
diff --git a/drivers/gpu/drm/amd/display/dc/dml/Makefile b/drivers/gpu/drm/amd/display/dc/dml/Makefile
index cb81ed2fbd53..8fb3ffd19956 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/Makefile
+++ b/drivers/gpu/drm/amd/display/dc/dml/Makefile
@@ -33,6 +33,10 @@ ifdef CONFIG_PPC64
dml_ccflags := -mhard-float -maltivec
endif
+ifdef CONFIG_ARM64
+dml_rcflags := -mgeneral-regs-only
+endif
+
ifdef CONFIG_CC_IS_GCC
ifeq ($(call cc-ifversion, -lt, 0701, y), y)
IS_OLD_GCC = 1
@@ -87,8 +91,11 @@ CFLAGS_$(AMDDALPATH)/dc/dml/dsc/rc_calc_fpu.o := $(dml_ccflags)
CFLAGS_$(AMDDALPATH)/dc/dml/calcs/dcn_calcs.o := $(dml_ccflags)
CFLAGS_$(AMDDALPATH)/dc/dml/calcs/dcn_calc_auto.o := $(dml_ccflags)
CFLAGS_$(AMDDALPATH)/dc/dml/calcs/dcn_calc_math.o := $(dml_ccflags) -Wno-tautological-compare
+CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/display_mode_lib_fpu.o := $(dml_rcflags)
CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/display_mode_vba.o := $(dml_rcflags)
-CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn2x/dcn2x.o := $(dml_rcflags)
+CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn10/dcn10_fpu.o := $(dml_rcflags)
+CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn20/dcn20_fpu.o := $(dml_rcflags)
+CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn30/dcn30_fpu.o := $(dml_rcflags)
CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn20/display_mode_vba_20.o := $(dml_rcflags)
CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn20/display_rq_dlg_calc_20.o := $(dml_rcflags)
CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn20/display_mode_vba_20v2.o := $(dml_rcflags)
@@ -97,13 +104,21 @@ CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn21/display_mode_vba_21.o := $(dml_rcflags)
CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn21/display_rq_dlg_calc_21.o := $(dml_rcflags)
CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn30/display_mode_vba_30.o := $(dml_rcflags)
CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn30/display_rq_dlg_calc_30.o := $(dml_rcflags)
+CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn31/dcn31_fpu.o := $(dml_rcflags)
CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn31/display_mode_vba_31.o := $(dml_rcflags)
CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn31/display_rq_dlg_calc_31.o := $(dml_rcflags)
+CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn32/dcn32_fpu.o := $(dml_rcflags)
CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn32/display_mode_vba_32.o := $(dml_rcflags)
CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn32/display_rq_dlg_calc_32.o := $(dml_rcflags)
CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn32/display_mode_vba_util_32.o := $(dml_rcflags)
CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn301/dcn301_fpu.o := $(dml_rcflags)
-CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/display_mode_lib.o := $(dml_rcflags)
+CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn302/dcn302_fpu.o := $(dml_rcflags)
+CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn303/dcn303_fpu.o := $(dml_rcflags)
+CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn309/dcn309_fpu.o := $(dml_rcflags)
+CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn314/dcn314_fpu.o := $(dml_rcflags)
+CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn314/display_mode_vba_314.o := $(dml_rcflags)
+CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn314/display_rq_dlg_calc_314.o := $(dml_rcflags)
+CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn321/dcn321_fpu.o := $(dml_rcflags)
CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dsc/rc_calc_fpu.o := $(dml_rcflags)
endif
CFLAGS_$(AMDDALPATH)/dc/dml/dml1_display_rq_dlg_calc.o := $(dml_ccflags)
@@ -117,7 +132,8 @@ CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/calcs/dcn_calc_math.o := $(dml_rcflags)
DML = calcs/dce_calcs.o calcs/custom_float.o calcs/bw_fixed.o
ifdef CONFIG_DRM_AMD_DC_DCN
-DML += display_mode_lib.o display_rq_dlg_helpers.o dml1_display_rq_dlg_calc.o
+DML += display_mode_lib.o display_mode_lib_fpu.o
+DML += display_rq_dlg_helpers.o dml1_display_rq_dlg_calc.o
DML += dcn10/dcn10_fpu.o
DML += dcn20/dcn20_fpu.o
DML += display_mode_vba.o dcn20/display_rq_dlg_calc_20.o dcn20/display_mode_vba_20.o
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20.c b/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20.c
index d3b5b6fedf04..3719ea10e1e1 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20.c
@@ -233,6 +233,7 @@ static void dml20_DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPer
void dml20_recalculate(struct display_mode_lib *mode_lib)
{
+ DC_FP_START();
ModeSupportAndSystemConfiguration(mode_lib);
mode_lib->vba.FabricAndDRAMBandwidth = dml_min(
mode_lib->vba.DRAMSpeed * mode_lib->vba.NumberOfChannels * mode_lib->vba.DRAMChannelWidth,
@@ -240,6 +241,7 @@ void dml20_recalculate(struct display_mode_lib *mode_lib)
PixelClockAdjustmentForProgressiveToInterlaceUnit(mode_lib);
dml20_DisplayPipeConfiguration(mode_lib);
dml20_DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation(mode_lib);
+ DC_FP_END();
}
static double adjust_ReturnBW(
@@ -3290,6 +3292,7 @@ void dml20_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l
int i;
unsigned int j, k, m;
+ DC_FP_START();
/*MODE SUPPORT, VOLTAGE STATE AND SOC CONFIGURATION*/
/*Scale Ratio, taps Support Check*/
@@ -5111,4 +5114,5 @@ void dml20_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l
mode_lib->vba.OutputBpp[k] =
locals->OutputBppPerState[mode_lib->vba.VoltageLevel][k];
}
+ DC_FP_END();
}
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20v2.c b/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20v2.c
index 63bbdf8b8678..f1e6cb4d8d91 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20v2.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20v2.c
@@ -257,6 +257,7 @@ static void dml20v2_DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndP
void dml20v2_recalculate(struct display_mode_lib *mode_lib)
{
+ DC_FP_START();
ModeSupportAndSystemConfiguration(mode_lib);
mode_lib->vba.FabricAndDRAMBandwidth = dml_min(
mode_lib->vba.DRAMSpeed * mode_lib->vba.NumberOfChannels * mode_lib->vba.DRAMChannelWidth,
@@ -264,6 +265,7 @@ void dml20v2_recalculate(struct display_mode_lib *mode_lib)
PixelClockAdjustmentForProgressiveToInterlaceUnit(mode_lib);
dml20v2_DisplayPipeConfiguration(mode_lib);
dml20v2_DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation(mode_lib);
+ DC_FP_END();
}
static double adjust_ReturnBW(
@@ -3397,6 +3399,7 @@ void dml20v2_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode
int i;
unsigned int j, k, m;
+ DC_FP_START();
/*MODE SUPPORT, VOLTAGE STATE AND SOC CONFIGURATION*/
/*Scale Ratio, taps Support Check*/
@@ -5231,4 +5234,5 @@ void dml20v2_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode
mode_lib->vba.OutputBpp[k] =
locals->OutputBppPerState[mode_lib->vba.VoltageLevel][k];
}
+ DC_FP_END();
}
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_rq_dlg_calc_20.c b/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_rq_dlg_calc_20.c
index 548cdef8a8ad..df103c6bda47 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_rq_dlg_calc_20.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_rq_dlg_calc_20.c
@@ -771,10 +771,12 @@ void dml20_rq_dlg_get_rq_reg(struct display_mode_lib *mode_lib,
const display_pipe_params_st *pipe_param)
{
display_rq_params_st rq_param = {0};
+ DC_FP_START();
memset(rq_regs, 0, sizeof(*rq_regs));
dml20_rq_dlg_get_rq_params(mode_lib, &rq_param, &pipe_param->src);
extract_rq_regs(mode_lib, rq_regs, &rq_param);
+ DC_FP_END();
print__rq_regs_st(mode_lib, rq_regs);
}
@@ -1561,6 +1563,8 @@ void dml20_rq_dlg_get_dlg_reg(struct display_mode_lib *mode_lib,
display_rq_params_st rq_param = {0};
display_dlg_sys_params_st dlg_sys_param = {0};
+ DC_FP_START();
+
// Get watermark and Tex.
dlg_sys_param.t_urg_wm_us = get_wm_urgent(mode_lib, e2e_pipe_param, num_pipes);
dlg_sys_param.deepsleep_dcfclk_mhz = get_clk_dcf_deepsleep(mode_lib,
@@ -1594,6 +1598,7 @@ void dml20_rq_dlg_get_dlg_reg(struct display_mode_lib *mode_lib,
cstate_en,
pstate_en);
dml_print("DML_DLG: Calculation for pipe[%d] end\n", pipe_idx);
+ DC_FP_END();
}
static void calculate_ttu_cursor(struct display_mode_lib *mode_lib,
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_rq_dlg_calc_20v2.c b/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_rq_dlg_calc_20v2.c
index 0fc9f3e3ffae..3472dfe4daa6 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_rq_dlg_calc_20v2.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_rq_dlg_calc_20v2.c
@@ -771,10 +771,12 @@ void dml20v2_rq_dlg_get_rq_reg(struct display_mode_lib *mode_lib,
const display_pipe_params_st *pipe_param)
{
display_rq_params_st rq_param = {0};
+ DC_FP_START();
memset(rq_regs, 0, sizeof(*rq_regs));
dml20v2_rq_dlg_get_rq_params(mode_lib, &rq_param, &pipe_param->src);
extract_rq_regs(mode_lib, rq_regs, &rq_param);
+ DC_FP_END();
print__rq_regs_st(mode_lib, rq_regs);
}
@@ -1562,6 +1564,7 @@ void dml20v2_rq_dlg_get_dlg_reg(struct display_mode_lib *mode_lib,
display_rq_params_st rq_param = {0};
display_dlg_sys_params_st dlg_sys_param = {0};
+ DC_FP_START();
// Get watermark and Tex.
dlg_sys_param.t_urg_wm_us = get_wm_urgent(mode_lib, e2e_pipe_param, num_pipes);
dlg_sys_param.deepsleep_dcfclk_mhz = get_clk_dcf_deepsleep(mode_lib,
@@ -1595,6 +1598,7 @@ void dml20v2_rq_dlg_get_dlg_reg(struct display_mode_lib *mode_lib,
cstate_en,
pstate_en);
dml_print("DML_DLG: Calculation for pipe[%d] end\n", pipe_idx);
+ DC_FP_END();
}
static void calculate_ttu_cursor(struct display_mode_lib *mode_lib,
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn21/display_mode_vba_21.c b/drivers/gpu/drm/amd/display/dc/dml/dcn21/display_mode_vba_21.c
index 8a7485e21d53..cc4877f744c6 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn21/display_mode_vba_21.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn21/display_mode_vba_21.c
@@ -486,10 +486,12 @@ static double CalculateExtraLatency(
void dml21_recalculate(struct display_mode_lib *mode_lib)
{
+ DC_FP_START();
ModeSupportAndSystemConfiguration(mode_lib);
PixelClockAdjustmentForProgressiveToInterlaceUnit(mode_lib);
DisplayPipeConfiguration(mode_lib);
DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation(mode_lib);
+ DC_FP_END();
}
static unsigned int dscceComputeDelay(
@@ -3522,6 +3524,7 @@ void dml21_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l
int i;
unsigned int j, k, m;
+ DC_FP_START();
/*MODE SUPPORT, VOLTAGE STATE AND SOC CONFIGURATION*/
/*Scale Ratio, taps Support Check*/
@@ -5235,6 +5238,7 @@ void dml21_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l
mode_lib->vba.OutputBpp[k] =
locals->OutputBppPerState[mode_lib->vba.VoltageLevel][k];
}
+ DC_FP_END();
}
static void CalculateWatermarksAndDRAMSpeedChangeSupport(
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn21/display_rq_dlg_calc_21.c b/drivers/gpu/drm/amd/display/dc/dml/dcn21/display_rq_dlg_calc_21.c
index 618f4b682ab1..6fdcda8df066 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn21/display_rq_dlg_calc_21.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn21/display_rq_dlg_calc_21.c
@@ -816,10 +816,12 @@ void dml21_rq_dlg_get_rq_reg(
const display_pipe_params_st *pipe_param)
{
display_rq_params_st rq_param = {0};
+ DC_FP_START();
memset(rq_regs, 0, sizeof(*rq_regs));
dml_rq_dlg_get_rq_params(mode_lib, &rq_param, pipe_param);
extract_rq_regs(mode_lib, rq_regs, &rq_param);
+ DC_FP_END();
print__rq_regs_st(mode_lib, rq_regs);
}
@@ -1670,6 +1672,7 @@ void dml21_rq_dlg_get_dlg_reg(
display_rq_params_st rq_param = {0};
display_dlg_sys_params_st dlg_sys_param = {0};
+ DC_FP_START();
// Get watermark and Tex.
dlg_sys_param.t_urg_wm_us = get_wm_urgent(mode_lib, e2e_pipe_param, num_pipes);
dlg_sys_param.deepsleep_dcfclk_mhz = get_clk_dcf_deepsleep(
@@ -1707,6 +1710,7 @@ void dml21_rq_dlg_get_dlg_reg(
cstate_en,
pstate_en);
dml_print("DML_DLG: Calculation for pipe[%d] end\n", pipe_idx);
+ DC_FP_END();
}
static void calculate_ttu_cursor(
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn30/display_mode_vba_30.c b/drivers/gpu/drm/amd/display/dc/dml/dcn30/display_mode_vba_30.c
index 1cb858dd6ea0..de286bd7be8e 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn30/display_mode_vba_30.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn30/display_mode_vba_30.c
@@ -714,10 +714,12 @@ static double CalculateUrgentLatency(
void dml30_recalculate(struct display_mode_lib *mode_lib)
{
+ DC_FP_START();
ModeSupportAndSystemConfiguration(mode_lib);
PixelClockAdjustmentForProgressiveToInterlaceUnit(mode_lib);
DisplayPipeConfiguration(mode_lib);
DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation(mode_lib);
+ DC_FP_END();
}
static unsigned int dscceComputeDelay(
@@ -3606,6 +3608,7 @@ void dml30_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l
long ReorderingBytes = 0;
bool NotUrgentLatencyHiding[DC__NUM_DPP__MAX] = { 0 };
+ DC_FP_START();
/*MODE SUPPORT, VOLTAGE STATE AND SOC CONFIGURATION*/
CalculateMinAndMaxPrefetchMode(
@@ -5295,6 +5298,7 @@ void dml30_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l
v->ReturnBW = v->ReturnBWPerState[v->VoltageLevel][MaximumMPCCombine];
v->maxMpcComb = MaximumMPCCombine;
}
+ DC_FP_END();
}
static void CalculateWatermarksAndDRAMSpeedChangeSupport(
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn30/display_rq_dlg_calc_30.c b/drivers/gpu/drm/amd/display/dc/dml/dcn30/display_rq_dlg_calc_30.c
index 8179be1f34bb..43a929a28a78 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn30/display_rq_dlg_calc_30.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn30/display_rq_dlg_calc_30.c
@@ -791,10 +791,12 @@ void dml30_rq_dlg_get_rq_reg(struct display_mode_lib *mode_lib,
const display_pipe_params_st *pipe_param)
{
display_rq_params_st rq_param = { 0 };
+ DC_FP_START();
memset(rq_regs, 0, sizeof(*rq_regs));
dml_rq_dlg_get_rq_params(mode_lib, &rq_param, pipe_param);
extract_rq_regs(mode_lib, rq_regs, &rq_param);
+ DC_FP_END();
print__rq_regs_st(mode_lib, rq_regs);
}
@@ -1754,6 +1756,7 @@ void dml30_rq_dlg_get_dlg_reg(struct display_mode_lib *mode_lib,
display_rq_params_st rq_param = { 0 };
display_dlg_sys_params_st dlg_sys_param = { 0 };
+ DC_FP_START();
// Get watermark and Tex.
dlg_sys_param.t_urg_wm_us = get_wm_urgent(mode_lib, e2e_pipe_param, num_pipes);
dlg_sys_param.deepsleep_dcfclk_mhz = get_clk_dcf_deepsleep(mode_lib,
@@ -1790,6 +1793,7 @@ void dml30_rq_dlg_get_dlg_reg(struct display_mode_lib *mode_lib,
ignore_viewport_pos,
immediate_flip_support);
dml_print("DML_DLG: Calculation for pipe[%d] end\n", pipe_idx);
+ DC_FP_END();
}
#endif
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c b/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c
index 8ca66f1644dc..9ca348cbb31c 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c
@@ -656,6 +656,7 @@ static bool UnboundedRequest(enum unbounded_requesting_policy UseUnboundedReques
void dml31_recalculate(struct display_mode_lib *mode_lib)
{
+ DC_FP_START();
ModeSupportAndSystemConfiguration(mode_lib);
PixelClockAdjustmentForProgressiveToInterlaceUnit(mode_lib);
DisplayPipeConfiguration(mode_lib);
@@ -663,6 +664,7 @@ void dml31_recalculate(struct display_mode_lib *mode_lib)
dml_print("DML::%s: Calling DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation\n", __func__);
#endif
DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation(mode_lib);
+ DC_FP_END();
}
static unsigned int dscceComputeDelay(
@@ -3792,6 +3794,7 @@ void dml31_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l
bool ViewportExceedsSurface = false;
bool FMTBufferExceeded = false;
+ DC_FP_START();
/*MODE SUPPORT, VOLTAGE STATE AND SOC CONFIGURATION*/
CalculateMinAndMaxPrefetchMode(
@@ -5375,6 +5378,7 @@ void dml31_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l
v->ReturnBW = v->ReturnBWPerState[v->VoltageLevel][MaximumMPCCombine];
v->maxMpcComb = MaximumMPCCombine;
}
+ DC_FP_END();
}
static void CalculateWatermarksAndDRAMSpeedChangeSupport(
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_rq_dlg_calc_31.c b/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_rq_dlg_calc_31.c
index 35d10b4d018b..bd2c32b62e9e 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_rq_dlg_calc_31.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_rq_dlg_calc_31.c
@@ -770,9 +770,11 @@ void dml31_rq_dlg_get_rq_reg(struct display_mode_lib *mode_lib, display_rq_regs_
{
display_rq_params_st rq_param = {0};
+ DC_FP_START();
memset(rq_regs, 0, sizeof(*rq_regs));
dml_rq_dlg_get_rq_params(mode_lib, &rq_param, pipe_param);
extract_rq_regs(mode_lib, rq_regs, &rq_param);
+ DC_FP_END();
print__rq_regs_st(mode_lib, rq_regs);
}
@@ -1584,6 +1586,7 @@ void dml31_rq_dlg_get_dlg_reg(
display_rq_params_st rq_param = {0};
display_dlg_sys_params_st dlg_sys_param = {0};
+ DC_FP_START();
// Get watermark and Tex.
dlg_sys_param.t_urg_wm_us = get_wm_urgent(mode_lib, e2e_pipe_param, num_pipes);
dlg_sys_param.deepsleep_dcfclk_mhz = get_clk_dcf_deepsleep(mode_lib, e2e_pipe_param, num_pipes);
@@ -1615,5 +1618,6 @@ void dml31_rq_dlg_get_dlg_reg(
ignore_viewport_pos,
immediate_flip_support);
dml_print("DML_DLG: Calculation for pipe[%d] end\n", pipe_idx);
+ DC_FP_END();
}
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c b/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c
index ee821c4fb5dd..495586f753ec 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c
@@ -680,6 +680,7 @@ static unsigned int CalculateMaxVStartup(
void dml314_recalculate(struct display_mode_lib *mode_lib)
{
+ DC_FP_START();
ModeSupportAndSystemConfiguration(mode_lib);
PixelClockAdjustmentForProgressiveToInterlaceUnit(mode_lib);
DisplayPipeConfiguration(mode_lib);
@@ -687,6 +688,7 @@ void dml314_recalculate(struct display_mode_lib *mode_lib)
dml_print("DML::%s: Calling DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation\n", __func__);
#endif
DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation(mode_lib);
+ DC_FP_END();
}
static unsigned int dscceComputeDelay(
@@ -3904,6 +3906,7 @@ void dml314_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_
bool ViewportExceedsSurface = false;
bool FMTBufferExceeded = false;
+ DC_FP_START();
/*MODE SUPPORT, VOLTAGE STATE AND SOC CONFIGURATION*/
CalculateMinAndMaxPrefetchMode(
@@ -5488,6 +5491,7 @@ void dml314_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_
v->ReturnBW = v->ReturnBWPerState[v->VoltageLevel][MaximumMPCCombine];
v->maxMpcComb = MaximumMPCCombine;
}
+ DC_FP_END();
}
static void CalculateWatermarksAndDRAMSpeedChangeSupport(
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_rq_dlg_calc_314.c b/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_rq_dlg_calc_314.c
index 61ee9ba063a7..c9f9d41d0880 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_rq_dlg_calc_314.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_rq_dlg_calc_314.c
@@ -856,10 +856,12 @@ static void dml_rq_dlg_get_rq_params(struct display_mode_lib *mode_lib, display_
void dml314_rq_dlg_get_rq_reg(struct display_mode_lib *mode_lib, display_rq_regs_st *rq_regs, const display_pipe_params_st *pipe_param)
{
display_rq_params_st rq_param = {0};
+ DC_FP_START();
memset(rq_regs, 0, sizeof(*rq_regs));
dml_rq_dlg_get_rq_params(mode_lib, &rq_param, pipe_param);
extract_rq_regs(mode_lib, rq_regs, &rq_param);
+ DC_FP_END();
print__rq_regs_st(mode_lib, rq_regs);
}
@@ -1699,6 +1701,7 @@ void dml314_rq_dlg_get_dlg_reg(
display_rq_params_st rq_param = {0};
display_dlg_sys_params_st dlg_sys_param = {0};
+ DC_FP_START();
// Get watermark and Tex.
dlg_sys_param.t_urg_wm_us = get_wm_urgent(mode_lib, e2e_pipe_param, num_pipes);
dlg_sys_param.deepsleep_dcfclk_mhz = get_clk_dcf_deepsleep(mode_lib, e2e_pipe_param, num_pipes);
@@ -1730,4 +1733,5 @@ void dml314_rq_dlg_get_dlg_reg(
ignore_viewport_pos,
immediate_flip_support);
dml_print("DML_DLG: Calculation for pipe[%d] end\n", pipe_idx);
+ DC_FP_END();
}
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.c b/drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.c
index 6980f698eb23..446c3fbe203a 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.c
@@ -37,6 +37,7 @@ void dml32_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l
void dml32_recalculate(struct display_mode_lib *mode_lib)
{
+ DC_FP_START();
ModeSupportAndSystemConfiguration(mode_lib);
dml32_CalculateMaxDETAndMinCompressedBufferSize(mode_lib->vba.ConfigReturnBufferSizeInKByte,
@@ -54,6 +55,7 @@ void dml32_recalculate(struct display_mode_lib *mode_lib)
dml_print("DML::%s: Calling DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation\n", __func__);
#endif
DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation(mode_lib);
+ DC_FP_END();
}
static void DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation(
@@ -1691,6 +1693,7 @@ void dml32_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l
dml_print("DML::%s: called\n", __func__);
#endif
+ DC_FP_START();
/*MODE SUPPORT, VOLTAGE STATE AND SOC CONFIGURATION*/
/*Scale Ratio, taps Support Check*/
@@ -3677,6 +3680,7 @@ void dml32_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l
mode_lib->vba.DRAMClockChangeWatermark = mode_lib->vba.Watermark.DRAMClockChangeWatermark;
mode_lib->vba.UrgentLatency = mode_lib->vba.UrgLatency[mode_lib->vba.VoltageLevel];
mode_lib->vba.DCFCLKDeepSleep = mode_lib->vba.ProjectedDCFCLKDeepSleep[mode_lib->vba.VoltageLevel][MaximumMPCCombine];
+ DC_FP_END();
/* VBA has Error type to Error Msg output here, but not necessary for DML-C */
} // ModeSupportAndSystemConfigurationFull
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn32/display_rq_dlg_calc_32.c b/drivers/gpu/drm/amd/display/dc/dml/dcn32/display_rq_dlg_calc_32.c
index a1276f6b9581..31f83812a78a 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn32/display_rq_dlg_calc_32.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn32/display_rq_dlg_calc_32.c
@@ -69,6 +69,7 @@ void dml32_rq_dlg_get_rq_reg(display_rq_regs_st *rq_regs,
unsigned int detile_buf_plane1_addr;
unsigned int pte_row_height_linear;
+ DC_FP_START();
memset(rq_regs, 0, sizeof(*rq_regs));
dml_print("DML_DLG::%s: Calculation for pipe[%d] start, num_pipes=%d\n", __func__, pipe_idx, num_pipes);
@@ -201,6 +202,7 @@ void dml32_rq_dlg_get_rq_reg(display_rq_regs_st *rq_regs,
#endif
print__rq_regs_st(mode_lib, rq_regs);
dml_print("DML_DLG::%s: Calculation for pipe[%d] done, num_pipes=%d\n", __func__, pipe_idx, num_pipes);
+ DC_FP_END();
}
void dml32_rq_dlg_get_dlg_reg(struct display_mode_lib *mode_lib,
@@ -263,6 +265,7 @@ void dml32_rq_dlg_get_dlg_reg(struct display_mode_lib *mode_lib,
double refcyc_per_meta_chunk_flip_l;
double refcyc_per_meta_chunk_flip_c;
+ DC_FP_START();
memset(dlg_regs, 0, sizeof(*dlg_regs));
memset(ttu_regs, 0, sizeof(*ttu_regs));
dml_print("DML_DLG::%s: Calculation for pipe[%d] starts, num_pipes=%d\n", __func__, pipe_idx, num_pipes);
@@ -611,5 +614,6 @@ void dml32_rq_dlg_get_dlg_reg(struct display_mode_lib *mode_lib,
print__ttu_regs_st(mode_lib, ttu_regs);
print__dlg_regs_st(mode_lib, dlg_regs);
dml_print("DML_DLG::%s: Calculation for pipe[%d] done, num_pipes=%d\n", __func__, pipe_idx, num_pipes);
+ DC_FP_END();
}
diff --git a/drivers/gpu/drm/amd/display/dc/dml/display_mode_lib.c b/drivers/gpu/drm/amd/display/dc/dml/display_mode_lib.c
index f5400eda07a5..7445089ecc5c 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/display_mode_lib.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/display_mode_lib.c
@@ -85,7 +85,7 @@ const struct dml_funcs dml314_funcs = {
const struct dml_funcs dml32_funcs = {
.validate = dml32_ModeSupportAndSystemConfigurationFull,
- .recalculate = dml32_recalculate,
+ .recalculate = dml32_recalculate,
.rq_dlg_get_dlg_reg_v2 = dml32_rq_dlg_get_dlg_reg,
.rq_dlg_get_rq_reg_v2 = dml32_rq_dlg_get_rq_reg
};
@@ -157,133 +157,6 @@ const char *dml_get_status_message(enum dm_validation_status status)
}
}
-void dml_log_pipe_params(
- struct display_mode_lib *mode_lib,
- display_e2e_pipe_params_st *pipes,
- int pipe_cnt)
-{
- display_pipe_source_params_st *pipe_src;
- display_pipe_dest_params_st *pipe_dest;
- scaler_ratio_depth_st *scale_ratio_depth;
- scaler_taps_st *scale_taps;
- display_output_params_st *dout;
- display_clocks_and_cfg_st *clks_cfg;
- int i;
-
- for (i = 0; i < pipe_cnt; i++) {
- pipe_src = &(pipes[i].pipe.src);
- pipe_dest = &(pipes[i].pipe.dest);
- scale_ratio_depth = &(pipes[i].pipe.scale_ratio_depth);
- scale_taps = &(pipes[i].pipe.scale_taps);
- dout = &(pipes[i].dout);
- clks_cfg = &(pipes[i].clks_cfg);
-
- dml_print("DML PARAMS: =====================================\n");
- dml_print("DML PARAMS: PIPE [%d] SOURCE PARAMS:\n", i);
- dml_print("DML PARAMS: source_format = %d\n", pipe_src->source_format);
- dml_print("DML PARAMS: dcc = %d\n", pipe_src->dcc);
- dml_print("DML PARAMS: dcc_rate = %d\n", pipe_src->dcc_rate);
- dml_print("DML PARAMS: dcc_use_global = %d\n", pipe_src->dcc_use_global);
- dml_print("DML PARAMS: vm = %d\n", pipe_src->vm);
- dml_print("DML PARAMS: gpuvm = %d\n", pipe_src->gpuvm);
- dml_print("DML PARAMS: hostvm = %d\n", pipe_src->hostvm);
- dml_print("DML PARAMS: gpuvm_levels_force_en = %d\n", pipe_src->gpuvm_levels_force_en);
- dml_print("DML PARAMS: gpuvm_levels_force = %d\n", pipe_src->gpuvm_levels_force);
- dml_print("DML PARAMS: source_scan = %d\n", pipe_src->source_scan);
- dml_print("DML PARAMS: sw_mode = %d\n", pipe_src->sw_mode);
- dml_print("DML PARAMS: macro_tile_size = %d\n", pipe_src->macro_tile_size);
- dml_print("DML PARAMS: viewport_width = %d\n", pipe_src->viewport_width);
- dml_print("DML PARAMS: viewport_height = %d\n", pipe_src->viewport_height);
- dml_print("DML PARAMS: viewport_y_y = %d\n", pipe_src->viewport_y_y);
- dml_print("DML PARAMS: viewport_y_c = %d\n", pipe_src->viewport_y_c);
- dml_print("DML PARAMS: viewport_width_c = %d\n", pipe_src->viewport_width_c);
- dml_print("DML PARAMS: viewport_height_c = %d\n", pipe_src->viewport_height_c);
- dml_print("DML PARAMS: data_pitch = %d\n", pipe_src->data_pitch);
- dml_print("DML PARAMS: data_pitch_c = %d\n", pipe_src->data_pitch_c);
- dml_print("DML PARAMS: meta_pitch = %d\n", pipe_src->meta_pitch);
- dml_print("DML PARAMS: meta_pitch_c = %d\n", pipe_src->meta_pitch_c);
- dml_print("DML PARAMS: cur0_src_width = %d\n", pipe_src->cur0_src_width);
- dml_print("DML PARAMS: cur0_bpp = %d\n", pipe_src->cur0_bpp);
- dml_print("DML PARAMS: cur1_src_width = %d\n", pipe_src->cur1_src_width);
- dml_print("DML PARAMS: cur1_bpp = %d\n", pipe_src->cur1_bpp);
- dml_print("DML PARAMS: num_cursors = %d\n", pipe_src->num_cursors);
- dml_print("DML PARAMS: is_hsplit = %d\n", pipe_src->is_hsplit);
- dml_print("DML PARAMS: hsplit_grp = %d\n", pipe_src->hsplit_grp);
- dml_print("DML PARAMS: dynamic_metadata_enable = %d\n", pipe_src->dynamic_metadata_enable);
- dml_print("DML PARAMS: dmdata_lines_before_active = %d\n", pipe_src->dynamic_metadata_lines_before_active);
- dml_print("DML PARAMS: dmdata_xmit_bytes = %d\n", pipe_src->dynamic_metadata_xmit_bytes);
- dml_print("DML PARAMS: immediate_flip = %d\n", pipe_src->immediate_flip);
- dml_print("DML PARAMS: v_total_min = %d\n", pipe_src->v_total_min);
- dml_print("DML PARAMS: v_total_max = %d\n", pipe_src->v_total_max);
- dml_print("DML PARAMS: =====================================\n");
-
- dml_print("DML PARAMS: PIPE [%d] DESTINATION PARAMS:\n", i);
- dml_print("DML PARAMS: recout_width = %d\n", pipe_dest->recout_width);
- dml_print("DML PARAMS: recout_height = %d\n", pipe_dest->recout_height);
- dml_print("DML PARAMS: full_recout_width = %d\n", pipe_dest->full_recout_width);
- dml_print("DML PARAMS: full_recout_height = %d\n", pipe_dest->full_recout_height);
- dml_print("DML PARAMS: hblank_start = %d\n", pipe_dest->hblank_start);
- dml_print("DML PARAMS: hblank_end = %d\n", pipe_dest->hblank_end);
- dml_print("DML PARAMS: vblank_start = %d\n", pipe_dest->vblank_start);
- dml_print("DML PARAMS: vblank_end = %d\n", pipe_dest->vblank_end);
- dml_print("DML PARAMS: htotal = %d\n", pipe_dest->htotal);
- dml_print("DML PARAMS: vtotal = %d\n", pipe_dest->vtotal);
- dml_print("DML PARAMS: vactive = %d\n", pipe_dest->vactive);
- dml_print("DML PARAMS: hactive = %d\n", pipe_dest->hactive);
- dml_print("DML PARAMS: vstartup_start = %d\n", pipe_dest->vstartup_start);
- dml_print("DML PARAMS: vupdate_offset = %d\n", pipe_dest->vupdate_offset);
- dml_print("DML PARAMS: vupdate_width = %d\n", pipe_dest->vupdate_width);
- dml_print("DML PARAMS: vready_offset = %d\n", pipe_dest->vready_offset);
- dml_print("DML PARAMS: interlaced = %d\n", pipe_dest->interlaced);
- dml_print("DML PARAMS: pixel_rate_mhz = %3.2f\n", pipe_dest->pixel_rate_mhz);
- dml_print("DML PARAMS: sync_vblank_all_planes = %d\n", pipe_dest->synchronized_vblank_all_planes);
- dml_print("DML PARAMS: otg_inst = %d\n", pipe_dest->otg_inst);
- dml_print("DML PARAMS: odm_combine = %d\n", pipe_dest->odm_combine);
- dml_print("DML PARAMS: use_maximum_vstartup = %d\n", pipe_dest->use_maximum_vstartup);
- dml_print("DML PARAMS: vtotal_max = %d\n", pipe_dest->vtotal_max);
- dml_print("DML PARAMS: vtotal_min = %d\n", pipe_dest->vtotal_min);
- dml_print("DML PARAMS: =====================================\n");
-
- dml_print("DML PARAMS: PIPE [%d] SCALER PARAMS:\n", i);
- dml_print("DML PARAMS: hscl_ratio = %3.4f\n", scale_ratio_depth->hscl_ratio);
- dml_print("DML PARAMS: vscl_ratio = %3.4f\n", scale_ratio_depth->vscl_ratio);
- dml_print("DML PARAMS: hscl_ratio_c = %3.4f\n", scale_ratio_depth->hscl_ratio_c);
- dml_print("DML PARAMS: vscl_ratio_c = %3.4f\n", scale_ratio_depth->vscl_ratio_c);
- dml_print("DML PARAMS: vinit = %3.4f\n", scale_ratio_depth->vinit);
- dml_print("DML PARAMS: vinit_c = %3.4f\n", scale_ratio_depth->vinit_c);
- dml_print("DML PARAMS: vinit_bot = %3.4f\n", scale_ratio_depth->vinit_bot);
- dml_print("DML PARAMS: vinit_bot_c = %3.4f\n", scale_ratio_depth->vinit_bot_c);
- dml_print("DML PARAMS: lb_depth = %d\n", scale_ratio_depth->lb_depth);
- dml_print("DML PARAMS: scl_enable = %d\n", scale_ratio_depth->scl_enable);
- dml_print("DML PARAMS: htaps = %d\n", scale_taps->htaps);
- dml_print("DML PARAMS: vtaps = %d\n", scale_taps->vtaps);
- dml_print("DML PARAMS: htaps_c = %d\n", scale_taps->htaps_c);
- dml_print("DML PARAMS: vtaps_c = %d\n", scale_taps->vtaps_c);
- dml_print("DML PARAMS: =====================================\n");
-
- dml_print("DML PARAMS: PIPE [%d] DISPLAY OUTPUT PARAMS:\n", i);
- dml_print("DML PARAMS: output_type = %d\n", dout->output_type);
- dml_print("DML PARAMS: output_format = %d\n", dout->output_format);
- dml_print("DML PARAMS: dsc_input_bpc = %d\n", dout->dsc_input_bpc);
- dml_print("DML PARAMS: output_bpp = %3.4f\n", dout->output_bpp);
- dml_print("DML PARAMS: dp_lanes = %d\n", dout->dp_lanes);
- dml_print("DML PARAMS: dsc_enable = %d\n", dout->dsc_enable);
- dml_print("DML PARAMS: dsc_slices = %d\n", dout->dsc_slices);
- dml_print("DML PARAMS: wb_enable = %d\n", dout->wb_enable);
- dml_print("DML PARAMS: num_active_wb = %d\n", dout->num_active_wb);
- dml_print("DML PARAMS: =====================================\n");
-
- dml_print("DML PARAMS: PIPE [%d] CLOCK CONFIG PARAMS:\n", i);
- dml_print("DML PARAMS: voltage = %d\n", clks_cfg->voltage);
- dml_print("DML PARAMS: dppclk_mhz = %3.2f\n", clks_cfg->dppclk_mhz);
- dml_print("DML PARAMS: refclk_mhz = %3.2f\n", clks_cfg->refclk_mhz);
- dml_print("DML PARAMS: dispclk_mhz = %3.2f\n", clks_cfg->dispclk_mhz);
- dml_print("DML PARAMS: dcfclk_mhz = %3.2f\n", clks_cfg->dcfclk_mhz);
- dml_print("DML PARAMS: socclk_mhz = %3.2f\n", clks_cfg->socclk_mhz);
- dml_print("DML PARAMS: =====================================\n");
- }
-}
-
void dml_log_mode_support_params(struct display_mode_lib *mode_lib)
{
int i;
diff --git a/drivers/gpu/drm/amd/display/dc/dml/display_mode_lib_fpu.c b/drivers/gpu/drm/amd/display/dc/dml/display_mode_lib_fpu.c
new file mode 100644
index 000000000000..17f440dfe33b
--- /dev/null
+++ b/drivers/gpu/drm/amd/display/dc/dml/display_mode_lib_fpu.c
@@ -0,0 +1,154 @@
+/*
+ * Copyright 2017 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
+ *
+ */
+
+#include "display_mode_lib.h"
+#include "dml_logger.h"
+
+void dml_log_pipe_params(
+ struct display_mode_lib *mode_lib,
+ display_e2e_pipe_params_st *pipes,
+ int pipe_cnt)
+{
+ display_pipe_source_params_st *pipe_src;
+ display_pipe_dest_params_st *pipe_dest;
+ scaler_ratio_depth_st *scale_ratio_depth;
+ scaler_taps_st *scale_taps;
+ display_output_params_st *dout;
+ display_clocks_and_cfg_st *clks_cfg;
+ int i;
+
+ for (i = 0; i < pipe_cnt; i++) {
+ pipe_src = &(pipes[i].pipe.src);
+ pipe_dest = &(pipes[i].pipe.dest);
+ scale_ratio_depth = &(pipes[i].pipe.scale_ratio_depth);
+ scale_taps = &(pipes[i].pipe.scale_taps);
+ dout = &(pipes[i].dout);
+ clks_cfg = &(pipes[i].clks_cfg);
+
+ dml_print("DML PARAMS: =====================================\n");
+ dml_print("DML PARAMS: PIPE [%d] SOURCE PARAMS:\n", i);
+ dml_print("DML PARAMS: source_format = %d\n", pipe_src->source_format);
+ dml_print("DML PARAMS: dcc = %d\n", pipe_src->dcc);
+ dml_print("DML PARAMS: dcc_rate = %d\n", pipe_src->dcc_rate);
+ dml_print("DML PARAMS: dcc_use_global = %d\n", pipe_src->dcc_use_global);
+ dml_print("DML PARAMS: vm = %d\n", pipe_src->vm);
+ dml_print("DML PARAMS: gpuvm = %d\n", pipe_src->gpuvm);
+ dml_print("DML PARAMS: hostvm = %d\n", pipe_src->hostvm);
+ dml_print("DML PARAMS: gpuvm_levels_force_en = %d\n", pipe_src->gpuvm_levels_force_en);
+ dml_print("DML PARAMS: gpuvm_levels_force = %d\n", pipe_src->gpuvm_levels_force);
+ dml_print("DML PARAMS: source_scan = %d\n", pipe_src->source_scan);
+ dml_print("DML PARAMS: sw_mode = %d\n", pipe_src->sw_mode);
+ dml_print("DML PARAMS: macro_tile_size = %d\n", pipe_src->macro_tile_size);
+ dml_print("DML PARAMS: viewport_width = %d\n", pipe_src->viewport_width);
+ dml_print("DML PARAMS: viewport_height = %d\n", pipe_src->viewport_height);
+ dml_print("DML PARAMS: viewport_y_y = %d\n", pipe_src->viewport_y_y);
+ dml_print("DML PARAMS: viewport_y_c = %d\n", pipe_src->viewport_y_c);
+ dml_print("DML PARAMS: viewport_width_c = %d\n", pipe_src->viewport_width_c);
+ dml_print("DML PARAMS: viewport_height_c = %d\n", pipe_src->viewport_height_c);
+ dml_print("DML PARAMS: data_pitch = %d\n", pipe_src->data_pitch);
+ dml_print("DML PARAMS: data_pitch_c = %d\n", pipe_src->data_pitch_c);
+ dml_print("DML PARAMS: meta_pitch = %d\n", pipe_src->meta_pitch);
+ dml_print("DML PARAMS: meta_pitch_c = %d\n", pipe_src->meta_pitch_c);
+ dml_print("DML PARAMS: cur0_src_width = %d\n", pipe_src->cur0_src_width);
+ dml_print("DML PARAMS: cur0_bpp = %d\n", pipe_src->cur0_bpp);
+ dml_print("DML PARAMS: cur1_src_width = %d\n", pipe_src->cur1_src_width);
+ dml_print("DML PARAMS: cur1_bpp = %d\n", pipe_src->cur1_bpp);
+ dml_print("DML PARAMS: num_cursors = %d\n", pipe_src->num_cursors);
+ dml_print("DML PARAMS: is_hsplit = %d\n", pipe_src->is_hsplit);
+ dml_print("DML PARAMS: hsplit_grp = %d\n", pipe_src->hsplit_grp);
+ dml_print("DML PARAMS: dynamic_metadata_enable = %d\n", pipe_src->dynamic_metadata_enable);
+ dml_print("DML PARAMS: dmdata_lines_before_active = %d\n", pipe_src->dynamic_metadata_lines_before_active);
+ dml_print("DML PARAMS: dmdata_xmit_bytes = %d\n", pipe_src->dynamic_metadata_xmit_bytes);
+ dml_print("DML PARAMS: immediate_flip = %d\n", pipe_src->immediate_flip);
+ dml_print("DML PARAMS: v_total_min = %d\n", pipe_src->v_total_min);
+ dml_print("DML PARAMS: v_total_max = %d\n", pipe_src->v_total_max);
+ dml_print("DML PARAMS: =====================================\n");
+
+ dml_print("DML PARAMS: PIPE [%d] DESTINATION PARAMS:\n", i);
+ dml_print("DML PARAMS: recout_width = %d\n", pipe_dest->recout_width);
+ dml_print("DML PARAMS: recout_height = %d\n", pipe_dest->recout_height);
+ dml_print("DML PARAMS: full_recout_width = %d\n", pipe_dest->full_recout_width);
+ dml_print("DML PARAMS: full_recout_height = %d\n", pipe_dest->full_recout_height);
+ dml_print("DML PARAMS: hblank_start = %d\n", pipe_dest->hblank_start);
+ dml_print("DML PARAMS: hblank_end = %d\n", pipe_dest->hblank_end);
+ dml_print("DML PARAMS: vblank_start = %d\n", pipe_dest->vblank_start);
+ dml_print("DML PARAMS: vblank_end = %d\n", pipe_dest->vblank_end);
+ dml_print("DML PARAMS: htotal = %d\n", pipe_dest->htotal);
+ dml_print("DML PARAMS: vtotal = %d\n", pipe_dest->vtotal);
+ dml_print("DML PARAMS: vactive = %d\n", pipe_dest->vactive);
+ dml_print("DML PARAMS: hactive = %d\n", pipe_dest->hactive);
+ dml_print("DML PARAMS: vstartup_start = %d\n", pipe_dest->vstartup_start);
+ dml_print("DML PARAMS: vupdate_offset = %d\n", pipe_dest->vupdate_offset);
+ dml_print("DML PARAMS: vupdate_width = %d\n", pipe_dest->vupdate_width);
+ dml_print("DML PARAMS: vready_offset = %d\n", pipe_dest->vready_offset);
+ dml_print("DML PARAMS: interlaced = %d\n", pipe_dest->interlaced);
+ dml_print("DML PARAMS: pixel_rate_mhz = %3.2f\n", pipe_dest->pixel_rate_mhz);
+ dml_print("DML PARAMS: sync_vblank_all_planes = %d\n", pipe_dest->synchronized_vblank_all_planes);
+ dml_print("DML PARAMS: otg_inst = %d\n", pipe_dest->otg_inst);
+ dml_print("DML PARAMS: odm_combine = %d\n", pipe_dest->odm_combine);
+ dml_print("DML PARAMS: use_maximum_vstartup = %d\n", pipe_dest->use_maximum_vstartup);
+ dml_print("DML PARAMS: vtotal_max = %d\n", pipe_dest->vtotal_max);
+ dml_print("DML PARAMS: vtotal_min = %d\n", pipe_dest->vtotal_min);
+ dml_print("DML PARAMS: =====================================\n");
+
+ dml_print("DML PARAMS: PIPE [%d] SCALER PARAMS:\n", i);
+ dml_print("DML PARAMS: hscl_ratio = %3.4f\n", scale_ratio_depth->hscl_ratio);
+ dml_print("DML PARAMS: vscl_ratio = %3.4f\n", scale_ratio_depth->vscl_ratio);
+ dml_print("DML PARAMS: hscl_ratio_c = %3.4f\n", scale_ratio_depth->hscl_ratio_c);
+ dml_print("DML PARAMS: vscl_ratio_c = %3.4f\n", scale_ratio_depth->vscl_ratio_c);
+ dml_print("DML PARAMS: vinit = %3.4f\n", scale_ratio_depth->vinit);
+ dml_print("DML PARAMS: vinit_c = %3.4f\n", scale_ratio_depth->vinit_c);
+ dml_print("DML PARAMS: vinit_bot = %3.4f\n", scale_ratio_depth->vinit_bot);
+ dml_print("DML PARAMS: vinit_bot_c = %3.4f\n", scale_ratio_depth->vinit_bot_c);
+ dml_print("DML PARAMS: lb_depth = %d\n", scale_ratio_depth->lb_depth);
+ dml_print("DML PARAMS: scl_enable = %d\n", scale_ratio_depth->scl_enable);
+ dml_print("DML PARAMS: htaps = %d\n", scale_taps->htaps);
+ dml_print("DML PARAMS: vtaps = %d\n", scale_taps->vtaps);
+ dml_print("DML PARAMS: htaps_c = %d\n", scale_taps->htaps_c);
+ dml_print("DML PARAMS: vtaps_c = %d\n", scale_taps->vtaps_c);
+ dml_print("DML PARAMS: =====================================\n");
+
+ dml_print("DML PARAMS: PIPE [%d] DISPLAY OUTPUT PARAMS:\n", i);
+ dml_print("DML PARAMS: output_type = %d\n", dout->output_type);
+ dml_print("DML PARAMS: output_format = %d\n", dout->output_format);
+ dml_print("DML PARAMS: dsc_input_bpc = %d\n", dout->dsc_input_bpc);
+ dml_print("DML PARAMS: output_bpp = %3.4f\n", dout->output_bpp);
+ dml_print("DML PARAMS: dp_lanes = %d\n", dout->dp_lanes);
+ dml_print("DML PARAMS: dsc_enable = %d\n", dout->dsc_enable);
+ dml_print("DML PARAMS: dsc_slices = %d\n", dout->dsc_slices);
+ dml_print("DML PARAMS: wb_enable = %d\n", dout->wb_enable);
+ dml_print("DML PARAMS: num_active_wb = %d\n", dout->num_active_wb);
+ dml_print("DML PARAMS: =====================================\n");
+
+ dml_print("DML PARAMS: PIPE [%d] CLOCK CONFIG PARAMS:\n", i);
+ dml_print("DML PARAMS: voltage = %d\n", clks_cfg->voltage);
+ dml_print("DML PARAMS: dppclk_mhz = %3.2f\n", clks_cfg->dppclk_mhz);
+ dml_print("DML PARAMS: refclk_mhz = %3.2f\n", clks_cfg->refclk_mhz);
+ dml_print("DML PARAMS: dispclk_mhz = %3.2f\n", clks_cfg->dispclk_mhz);
+ dml_print("DML PARAMS: dcfclk_mhz = %3.2f\n", clks_cfg->dcfclk_mhz);
+ dml_print("DML PARAMS: socclk_mhz = %3.2f\n", clks_cfg->socclk_mhz);
+ dml_print("DML PARAMS: =====================================\n");
+ }
+}
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dml_wrapper.c b/drivers/gpu/drm/amd/display/dc/dml/dml_wrapper.c
index b4b51e51fc25..14d7b6724baf 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dml_wrapper.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dml_wrapper.c
@@ -1347,7 +1347,9 @@ static bool dml_internal_validate(
goto validate_out;
}
+ DC_FP_START();
dml_log_pipe_params(&context->bw_ctx.dml, pipes, pipe_cnt);
+ DC_FP_END();
if (!fast_validate) {
dml_full_validate_bw_helper(dc, context, pipes, &vlevel, split, merge, &pipe_cnt);
--
2.37.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment