From: Tony Cheng <tony.cheng@xxxxxxx> - overrride param added in 65c31cba - looks like was quick workaround for amdsoc to support persistence issue - simplify by removing indirections - DAL_PARAM_ENABLE_GPU_SCALING enabled on all platforms and not used. remove - DAL_PARAM_DISABLE_CLOCK_SHARING still needed. replace with disable_disp_pll_sharing in dc_config. * note: behavior change: fix DP + HDMI timing sync in case of disable_disp_pll_sharing = 1 Signed-off-by: Tony Cheng <tony.cheng at amd.com> Acked-by: Harry Wentland <harry.wentland at amd.com> --- drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm.c | 17 ---- .../gpu/drm/amd/dal/dc/adapter/adapter_service.c | 110 ++------------------- drivers/gpu/drm/amd/dal/dc/core/dc.c | 3 +- drivers/gpu/drm/amd/dal/dc/core/dc_resource.c | 18 ++-- drivers/gpu/drm/amd/dal/dc/dc.h | 2 +- drivers/gpu/drm/amd/dal/dc/dc_types.h | 44 --------- .../amd/dal/include/adapter_service_interface.h | 3 - 7 files changed, 20 insertions(+), 177 deletions(-) diff --git a/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm.c index d67e77ada6c0..f667620e30e9 100644 --- a/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm.c @@ -54,15 +54,6 @@ #include "modules/inc/mod_freesync.h" -/* Define variables here - * These values will be passed to DAL for feature enable purpose - * Disable ALL for HDMI light up - * TODO: follow up if need this mechanism*/ -struct dal_override_parameters display_param = { - .bool_param_enable_mask = 0, - .bool_param_values = 0, -}; - /* Debug facilities */ #define AMDGPU_DM_NOT_IMPL(fmt, ...) \ DRM_INFO("DM_NOT_IMPL: " fmt, ##__VA_ARGS__) @@ -280,8 +271,6 @@ int amdgpu_dm_init(struct amdgpu_device *adev) goto error; } - init_data.display_param = display_param; - init_data.asic_id.chip_family = adev->family; init_data.asic_id.pci_revision_id = adev->rev_id; @@ -310,12 +299,6 @@ int amdgpu_dm_init(struct amdgpu_device *adev) adev->dm.dal = NULL; - /* enable gpu scaling in DAL */ - init_data.display_param.bool_param_enable_mask |= - 1 << DAL_PARAM_ENABLE_GPU_SCALING; - init_data.display_param.bool_param_values |= - 1 << DAL_PARAM_ENABLE_GPU_SCALING; - init_data.dce_environment = DCE_ENV_PRODUCTION_DRV; /* Display Core create. */ 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 245438229623..21fd3249b0c1 100644 --- a/drivers/gpu/drm/amd/dal/dc/adapter/adapter_service.c +++ b/drivers/gpu/drm/amd/dal/dc/adapter/adapter_service.c @@ -136,7 +136,6 @@ static const struct feature_source_entry feature_entry_table[] = { {FEATURE_MAX_BACKLIGHT_LEVEL, 255, false}, {FEATURE_LOAD_DMCU_FIRMWARE, true, true}, {FEATURE_DISABLE_AZ_CLOCK_GATING, false, true}, - {FEATURE_ENABLE_GPU_SCALING, false, true}, {FEATURE_DONGLE_SINK_COUNT_CHECK, true, true}, {FEATURE_INSTANT_UP_SCALE_DOWN_SCALE, false, true}, {FEATURE_TILED_DISPLAY, false, true}, @@ -161,7 +160,6 @@ static const struct feature_source_entry feature_entry_table[] = { {FEATURE_DISABLE_FBC_COMP_CLK_GATE, false, true}, {FEATURE_PIXEL_PERFECT_OUTPUT, false, true}, {FEATURE_8BPP_SUPPORTED, false, true}, - {FEATURE_DISABLE_CLOCK_SHARING, false, true} }; enum { @@ -335,90 +333,6 @@ static void initialize_backlight_caps( } as->backlight_caps_initialized = true; } - -static void log_overriden_features( - struct adapter_service *as, - const char *feature_name, - enum adapter_feature_id id, - bool bool_feature, - uint32_t value) -{ - if (bool_feature) - dm_logger_write(as->ctx->logger, LOG_FEATURE_OVERRIDE, - "Overridden %s is %s now\n", - feature_name, - (value == 0) ? "disabled" : "enabled"); - else - dm_logger_write(as->ctx->logger, LOG_FEATURE_OVERRIDE, - "Overridden %s new value: %d\n", - feature_name, - value); -} - -/************************************* - * Local static functions definition * - *************************************/ - -#define check_bool_feature(feature) \ -case FEATURE_ ## feature: \ - if (param->bool_param_enable_mask & \ - (1 << DAL_PARAM_ ## feature)) { \ - *data = param->bool_param_values & \ - (1 << DAL_PARAM_ ## feature); \ - ret = true; \ - feature_name = "FEATURE_" #feature; \ - } \ - break - -/* - * override_default_parameters - * - * Override features (from runtime parameter) - * corresponding to Adapter Service Feature ID - */ -static bool override_default_parameters( - struct adapter_service *as, - const struct dal_override_parameters *param, - const uint32_t idx, - uint32_t *data) -{ - bool ret = false; - bool bool_feature = true; - char *feature_name; - - if (idx >= get_feature_entries_num()) { - ASSERT_CRITICAL(false); - return false; - } - - switch (feature_entry_table[idx].feature_id) { - check_bool_feature(MAXIMIZE_STUTTER_MARKS); - check_bool_feature(MAXIMIZE_URGENCY_WATERMARKS); - check_bool_feature(USE_MAX_DISPLAY_CLK); - check_bool_feature(ENABLE_DFS_BYPASS); - check_bool_feature(POWER_GATING_PIPE_IN_TILE); - check_bool_feature(POWER_GATING_LB_PORTION); - check_bool_feature(PSR_ENABLE); - check_bool_feature(VARI_BRIGHT_ENABLE); - check_bool_feature(USE_PPLIB); - check_bool_feature(DISABLE_LPT_SUPPORT); - check_bool_feature(DUMMY_FBC_BACKEND); - check_bool_feature(ENABLE_GPU_SCALING); - check_bool_feature(DISABLE_CLOCK_SHARING); - default: - return false; - } - if (ret) - log_overriden_features( - as, - feature_name, - feature_entry_table[idx].feature_id, - bool_feature, - *data); - - return ret; -} - /* * get_feature_value_from_data_sources * @@ -536,8 +450,7 @@ static void set_bool_value( * Generate the internal feature set from multiple data sources */ static bool generate_feature_set( - struct adapter_service *as, - const struct dal_override_parameters *param) + struct adapter_service *as) { uint32_t i = 0; uint32_t value = 0; @@ -561,17 +474,14 @@ static bool generate_feature_set( set_idx = (uint32_t)((entry->feature_id - 1) / 32); internal_idx = (uint32_t)((entry->feature_id - 1) % 32); - /* TODO: wireless, runtime parameter, vbios */ - if (!override_default_parameters(as, param, i, &value)) { - if (!get_feature_value_from_data_sources( - as, i, &value)) { - /* - * Can't find feature values from - * above data sources - * Assign default value - */ - value = as->default_values[entry->feature_id]; - } + if (!get_feature_value_from_data_sources( + as, i, &value)) { + /* + * Can't find feature values from + * above data sources + * Assign default value + */ + value = as->default_values[entry->feature_id]; } if (entry->is_boolean_type) @@ -645,7 +555,7 @@ static bool adapter_service_construct( } /* Generate feature set table */ - if (!generate_feature_set(as, init_data->display_param)) { + if (!generate_feature_set(as)) { ASSERT_CRITICAL(false); goto failed_to_generate_features; } diff --git a/drivers/gpu/drm/amd/dal/dc/core/dc.c b/drivers/gpu/drm/amd/dal/dc/core/dc.c index 3b29ac471056..cfc8e8f95d5b 100644 --- a/drivers/gpu/drm/amd/dal/dc/core/dc.c +++ b/drivers/gpu/drm/amd/dal/dc/core/dc.c @@ -185,7 +185,6 @@ static struct adapter_service *create_as( init_data.hw_init_data.vram_width = init->asic_id.vram_width; init_data.hw_init_data.vram_type = init->asic_id.vram_type; - init_data.display_param = &init->display_param; init_data.vbios_override = init->vbios_override; init_data.dce_environment = init->dce_environment; @@ -689,7 +688,7 @@ struct dc *dc_create(const struct dc_init_data *init_params) core_dc->public.caps.max_links = core_dc->link_count; core_dc->public.caps.max_audios = core_dc->res_pool->audio_count; - core_dc->public.config.gpu_vm_support = init_params->flags.gpu_vm_support; + core_dc->public.config = init_params->flags; dm_logger_write(core_dc->ctx->logger, LOG_DC, "Display Core initialized\n"); diff --git a/drivers/gpu/drm/amd/dal/dc/core/dc_resource.c b/drivers/gpu/drm/amd/dal/dc/core/dc_resource.c index 4c93d539ef8a..a4061c68596a 100644 --- a/drivers/gpu/drm/amd/dal/dc/core/dc_resource.c +++ b/drivers/gpu/drm/amd/dal/dc/core/dc_resource.c @@ -301,15 +301,11 @@ struct clock_source *resource_find_used_clk_src_for_sharing( struct resource_context *res_ctx, struct pipe_ctx *pipe_ctx) { - if (!dal_adapter_service_is_feature_supported( - res_ctx->pool->adapter_srv, - FEATURE_DISABLE_CLOCK_SHARING)) { - int i; - - for (i = 0; i < MAX_PIPES; i++) { - if (is_sharable_clk_src(&res_ctx->pipe_ctx[i], pipe_ctx)) - return res_ctx->pipe_ctx[i].clock_source; - } + int i; + + for (i = 0; i < MAX_PIPES; i++) { + if (is_sharable_clk_src(&res_ctx->pipe_ctx[i], pipe_ctx)) + return res_ctx->pipe_ctx[i].clock_source; } return NULL; @@ -1869,7 +1865,9 @@ enum dc_status resource_map_clock_resources( pipe_ctx->clock_source = context->res_ctx.pool->dp_clock_source; else { - pipe_ctx->clock_source = + pipe_ctx->clock_source = NULL; + + if (!dc->public.config.disable_disp_pll_sharing) resource_find_used_clk_src_for_sharing( &context->res_ctx, pipe_ctx); diff --git a/drivers/gpu/drm/amd/dal/dc/dc.h b/drivers/gpu/drm/amd/dal/dc/dc.h index ba8190f8d168..044fea7ce32a 100644 --- a/drivers/gpu/drm/amd/dal/dc/dc.h +++ b/drivers/gpu/drm/amd/dal/dc/dc.h @@ -132,6 +132,7 @@ struct dc_link_funcs { /* Structure to hold configuration flags set by dm at dc creation. */ struct dc_config { bool gpu_vm_support; + bool disable_disp_pll_sharing; }; struct dc_debug { @@ -151,7 +152,6 @@ struct dc { struct dc_init_data { struct hw_asic_id asic_id; - struct dal_override_parameters display_param; void *driver; /* ctx */ struct cgs_device *cgs_device; diff --git a/drivers/gpu/drm/amd/dal/dc/dc_types.h b/drivers/gpu/drm/amd/dal/dc/dc_types.h index 15f45180a0cf..30e12e5cbe1b 100644 --- a/drivers/gpu/drm/amd/dal/dc/dc_types.h +++ b/drivers/gpu/drm/amd/dal/dc/dc_types.h @@ -121,50 +121,6 @@ struct hw_asic_id { void *atombios_base_address; }; -/* array index for integer override parameters*/ -enum int_param_array_index { - DAL_PARAM_MAX_COFUNC_NON_DP_DISPLAYS = 0, - DAL_PARAM_DRR_SUPPORT, - DAL_INT_PARAM_MAX -}; - -struct dal_override_parameters { - uint32_t bool_param_enable_mask; - uint32_t bool_param_values; -}; - -/* - * shift values for bool override parameter mask - * bmask is for this struct,if we touch this feature - * bval indicates every bit fields for this struct too,1 is enable this feature - * amdgpu.disp_bval=1594, amdgpu.disp_bmask=1594 , - * finally will show log like this: - * Overridden FEATURE_LIGHT_SLEEP is enabled now - * Overridden FEATURE_USE_MAX_DISPLAY_CLK is enabled now - * Overridden FEATURE_ENABLE_DFS_BYPASS is enabled now - * Overridden FEATURE_POWER_GATING_PIPE_IN_TILE is enabled now - * Overridden FEATURE_USE_PPLIB is enabled now - * Overridden FEATURE_DISABLE_LPT_SUPPORT is enabled now - * Overridden FEATURE_DUMMY_FBC_BACKEND is enabled now - * */ -enum bool_param_shift { - DAL_PARAM_MAXIMIZE_STUTTER_MARKS = 0, - DAL_PARAM_LIGHT_SLEEP, - DAL_PARAM_MAXIMIZE_URGENCY_WATERMARKS, - DAL_PARAM_USE_MAX_DISPLAY_CLK, - DAL_PARAM_ENABLE_DFS_BYPASS, - DAL_PARAM_POWER_GATING_PIPE_IN_TILE, - DAL_PARAM_POWER_GATING_LB_PORTION, - DAL_PARAM_PSR_ENABLE, - DAL_PARAM_VARI_BRIGHT_ENABLE, - DAL_PARAM_USE_PPLIB, - DAL_PARAM_DISABLE_LPT_SUPPORT, - DAL_PARAM_DUMMY_FBC_BACKEND, - DAL_PARAM_ENABLE_GPU_SCALING, - DAL_PARAM_DISABLE_CLOCK_SHARING, - DAL_BOOL_PARAM_MAX -}; - #define MAX_EDID_BUFFER_SIZE 512 #define EDID_BLOCK_SIZE 128 #define MAX_SURFACE_NUM 2 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 35ca9ca96467..bb4964743a4d 100644 --- a/drivers/gpu/drm/amd/dal/include/adapter_service_interface.h +++ b/drivers/gpu/drm/amd/dal/include/adapter_service_interface.h @@ -115,7 +115,6 @@ enum adapter_feature_id { FEATURE_ABM_2_0, FEATURE_SUPPORT_MIRABILIS, FEATURE_LOAD_DMCU_FIRMWARE, /* 20th */ - FEATURE_ENABLE_GPU_SCALING, FEATURE_DONGLE_SINK_COUNT_CHECK, FEATURE_INSTANT_UP_SCALE_DOWN_SCALE, FEATURE_TILED_DISPLAY, @@ -126,7 +125,6 @@ enum adapter_feature_id { FEATURE_SUPPORT_SMOOTH_BRIGHTNESS, FEATURE_ALLOW_DIRECT_MEMORY_ACCESS_TRIG, /* 30th */ FEATURE_POWER_GATING_LB_PORTION, - FEATURE_DISABLE_CLOCK_SHARING, /* 32nd. Set Done. */ FEATURE_SET_02_END = FEATURE_SET_02_START + 31, /* UInt set, 1 entry: DCP Bit Depth Reduction Mode */ @@ -317,7 +315,6 @@ enum as_drr_support { struct as_init_data { struct hw_asic_id hw_init_data; struct dc_context *ctx; - const struct dal_override_parameters *display_param; struct dc_bios *vbios_override; enum dce_environment dce_environment; }; -- 2.10.1