[PATCH 43/76] drm/amd/dal: remove unnessary adapter service functions
Harry Wentland
harry.wentland at amd.com
Mon Nov 21 23:01:03 UTC 2016
From: Tony Cheng <tony.cheng at amd.com>
- remove FEATURE_USE_MAX_DISPLAY_CLK. move to dc_debug option
- DFS bypass query bios directly. add debug option
Signed-off-by: Tony Cheng <tony.cheng at amd.com>
Acked-by: Harry Wentland <harry.wentland at amd.com>
---
.../gpu/drm/amd/dal/dc/adapter/adapter_service.c | 38 ----------------------
drivers/gpu/drm/amd/dal/dc/core/dc.c | 4 +++
drivers/gpu/drm/amd/dal/dc/dc.h | 2 ++
.../amd/dal/dc/gpu/dce110/display_clock_dce110.c | 14 +++++---
.../drm/amd/dal/dc/gpu/dce80/display_clock_dce80.c | 15 +++++----
.../amd/dal/include/adapter_service_interface.h | 9 -----
6 files changed, 23 insertions(+), 59 deletions(-)
diff --git a/drivers/gpu/drm/amd/dal/dc/adapter/adapter_service.c b/drivers/gpu/drm/amd/dal/dc/adapter/adapter_service.c
index e6a5bd08d997..6034c7416ac0 100644
--- a/drivers/gpu/drm/amd/dal/dc/adapter/adapter_service.c
+++ b/drivers/gpu/drm/amd/dal/dc/adapter/adapter_service.c
@@ -86,7 +86,6 @@ static const struct feature_source_entry feature_entry_table[] = {
{FEATURE_MAXIMIZE_URGENCY_WATERMARKS, false, true},
{FEATURE_MAXIMIZE_STUTTER_MARKS, false, true},
{FEATURE_MAXIMIZE_NBP_MARKS, false, true},
- {FEATURE_USE_MAX_DISPLAY_CLK, false, true},
{FEATURE_ALLOW_EDP_RESOURCE_SHARING, false, true},
{FEATURE_SUPPORT_DP_YUV, false, true},
{FEATURE_SUPPORT_DP_Y_ONLY, false, true},
@@ -94,7 +93,6 @@ static const struct feature_source_entry feature_entry_table[] = {
{FEATURE_DCP_BIT_DEPTH_REDUCTION_MODE, 0, false},
{FEATURE_DCP_DITHER_MODE, 0, false},
{FEATURE_DCP_PROGRAMMING_WA, 0, false},
- {FEATURE_ENABLE_DFS_BYPASS, false, true},
{FEATURE_WIRELESS_FULL_TIMING_ADJUSTMENT, false, true},
{FEATURE_WIRELESS_LIMIT_720P, false, true},
{FEATURE_MODIFY_TIMINGS_FOR_WIRELESS, false, true},
@@ -629,42 +627,6 @@ void dal_adapter_service_destroy(
*as = NULL;
}
-/*
- * dal_adapter_service_is_feature_supported
- *
- * Return if a given feature is supported by the ASIC. The feature has to be
- * a boolean type.
- */
-bool dal_adapter_service_is_feature_supported(struct adapter_service *as,
- enum adapter_feature_id feature_id)
-{
- bool data = 0;
-
- dal_adapter_service_get_feature_value(as, feature_id, &data, sizeof(bool));
-
- return data;
-}
-
-/*
- * dal_adapter_service_is_dfs_bypass_enabled
- *
- * Check if DFS bypass is enabled
- */
-bool dal_adapter_service_is_dfs_bypass_enabled(
- struct adapter_service *as)
-{
- struct dc_bios *bp = as->ctx->dc_bios;
-
- if (bp->integrated_info == NULL)
- return false;
- if ((bp->integrated_info->gpu_cap_info & DFS_BYPASS_ENABLE) &&
- dal_adapter_service_is_feature_supported(as,
- FEATURE_ENABLE_DFS_BYPASS))
- return true;
- else
- return false;
-}
-
struct dal_asic_runtime_flags dal_adapter_service_get_asic_runtime_flags(
struct adapter_service *as)
{
diff --git a/drivers/gpu/drm/amd/dal/dc/core/dc.c b/drivers/gpu/drm/amd/dal/dc/core/dc.c
index 994b91967ad8..e3ec5c5163b8 100644
--- a/drivers/gpu/drm/amd/dal/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/dal/dc/core/dc.c
@@ -692,6 +692,10 @@ struct dc *dc_create(const struct dc_init_data *init_params)
dm_logger_write(core_dc->ctx->logger, LOG_DC,
"Display Core initialized\n");
+
+ /* TODO: missing feature to be enabled */
+ core_dc->public.debug.disalbe_dfs_bypass = true;
+
return &core_dc->public;
construct_fail:
diff --git a/drivers/gpu/drm/amd/dal/dc/dc.h b/drivers/gpu/drm/amd/dal/dc/dc.h
index 044fea7ce32a..22ed46d3844c 100644
--- a/drivers/gpu/drm/amd/dal/dc/dc.h
+++ b/drivers/gpu/drm/amd/dal/dc/dc.h
@@ -139,6 +139,8 @@ struct dc_debug {
bool surface_visual_confirm;
bool disable_stutter;
bool disable_dcc;
+ bool disalbe_dfs_bypass;
+ bool max_disp_clk;
};
struct dc {
diff --git a/drivers/gpu/drm/amd/dal/dc/gpu/dce110/display_clock_dce110.c b/drivers/gpu/drm/amd/dal/dc/gpu/dce110/display_clock_dce110.c
index ec0f6ae61542..af04348d2a7a 100644
--- a/drivers/gpu/drm/amd/dal/dc/gpu/dce110/display_clock_dce110.c
+++ b/drivers/gpu/drm/amd/dal/dc/gpu/dce110/display_clock_dce110.c
@@ -36,6 +36,7 @@
#include "../divider_range.h"
#include "display_clock_dce110.h"
+#include "dc.h"
#define FROM_DISPLAY_CLOCK(base) \
container_of(base, struct display_clock_dce110, disp_clk_base)
@@ -670,6 +671,7 @@ static bool display_clock_integrated_info_construct(
struct display_clock_dce110 *disp_clk,
struct adapter_service *as)
{
+ struct dc_debug *debug = &disp_clk->disp_clk_base.ctx->dc->debug;
struct dc_bios *bp = disp_clk->disp_clk_base.ctx->dc_bios;
struct integrated_info info;
struct firmware_info fw_info;
@@ -730,11 +732,13 @@ static bool display_clock_integrated_info_construct(
info.disp_clk_voltage[i].max_supported_clk;
}
}
- disp_clk->dfs_bypass_enabled =
- dal_adapter_service_is_dfs_bypass_enabled(as);
- disp_clk->use_max_disp_clk =
- dal_adapter_service_is_feature_supported(as,
- FEATURE_USE_MAX_DISPLAY_CLK);
+
+ disp_clk->dfs_bypass_enabled = false;
+ if (!debug->disalbe_dfs_bypass)
+ if (bp->integrated_info->gpu_cap_info & DFS_BYPASS_ENABLE)
+ disp_clk->dfs_bypass_enabled = true;
+
+ disp_clk->use_max_disp_clk = debug->max_disp_clk;
return true;
}
diff --git a/drivers/gpu/drm/amd/dal/dc/gpu/dce80/display_clock_dce80.c b/drivers/gpu/drm/amd/dal/dc/gpu/dce80/display_clock_dce80.c
index 68134a0e70b4..3f93a0a3875a 100644
--- a/drivers/gpu/drm/amd/dal/dc/gpu/dce80/display_clock_dce80.c
+++ b/drivers/gpu/drm/amd/dal/dc/gpu/dce80/display_clock_dce80.c
@@ -35,6 +35,7 @@
#include "../divider_range.h"
#include "display_clock_dce80.h"
+#include "dc.h"
#define DCE80_DFS_BYPASS_THRESHOLD_KHZ 100000
@@ -754,6 +755,7 @@ static bool display_clock_integrated_info_construct(
struct display_clock_dce80 *disp_clk,
struct adapter_service *as)
{
+ struct dc_debug *debug = &disp_clk->disp_clk.ctx->dc->debug;
struct dc_bios *bp = disp_clk->disp_clk.ctx->dc_bios;
struct integrated_info info = { { { 0 } } };
struct firmware_info fw_info = { { 0 } };
@@ -809,14 +811,13 @@ static bool display_clock_integrated_info_construct(
}
}
- disp_clk->dfs_bypass_enabled =
- dal_adapter_service_is_dfs_bypass_enabled(as) &&
- dal_adapter_service_is_feature_supported(as,
- FEATURE_ENABLE_DFS_BYPASS);
+ disp_clk->dfs_bypass_enabled = false;
+ if (!debug->disalbe_dfs_bypass)
+ if (bp->integrated_info->gpu_cap_info & DFS_BYPASS_ENABLE)
+ disp_clk->dfs_bypass_enabled = true;
+
+ disp_clk->use_max_disp_clk = debug->max_disp_clk;
- disp_clk->use_max_disp_clk =
- dal_adapter_service_is_feature_supported(as,
- FEATURE_USE_MAX_DISPLAY_CLK);
return true;
}
diff --git a/drivers/gpu/drm/amd/dal/include/adapter_service_interface.h b/drivers/gpu/drm/amd/dal/include/adapter_service_interface.h
index eee36b421950..4cc9c6272a06 100644
--- a/drivers/gpu/drm/amd/dal/include/adapter_service_interface.h
+++ b/drivers/gpu/drm/amd/dal/include/adapter_service_interface.h
@@ -76,11 +76,9 @@ enum adapter_feature_id {
FEATURE_MAXIMIZE_URGENCY_WATERMARKS,
FEATURE_MAXIMIZE_STUTTER_MARKS,
FEATURE_MAXIMIZE_NBP_MARKS,
- FEATURE_USE_MAX_DISPLAY_CLK,
FEATURE_ALLOW_EDP_RESOURCE_SHARING,
FEATURE_SUPPORT_DP_YUV,
FEATURE_SUPPORT_DP_Y_ONLY,
- FEATURE_ENABLE_DFS_BYPASS,
FEATURE_LB_HIGH_RESOLUTION,
FEATURE_DP_DISPLAY_FORCE_SS_ENABLE,
FEATURE_REPORT_CE_MODE_ONLY,
@@ -324,13 +322,6 @@ struct adapter_service *dal_adapter_service_create(
void dal_adapter_service_destroy(
struct adapter_service **as);
-/* Check if DFS bypass is enabled */
-bool dal_adapter_service_is_dfs_bypass_enabled(struct adapter_service *as);
-
-/* Return if a given feature is supported by the ASIC */
-bool dal_adapter_service_is_feature_supported(struct adapter_service *as,
- enum adapter_feature_id feature_id);
-
/* Get the cached value of a given feature */
bool dal_adapter_service_get_feature_value(struct adapter_service *as,
const enum adapter_feature_id feature_id,
--
2.10.1
More information about the amd-gfx
mailing list