Commit 2200eb9e authored by Nicholas Kazlauskas's avatar Nicholas Kazlauskas Committed by Alex Deucher

drm/amd/display: Drop CONFIG_DRM_AMD_DC_DMUB guards

[Why]
Support for DMUB only depends on support for DC. It doesn't use floating
point so we don't need to guard it by any specific DCN revision.

[How]
Drop the guards and cleanup the newlines around each one.
Signed-off-by: default avatarNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Reviewed-by: default avatarHersen Wu <hersenxs.wu@amd.com>
Acked-by: default avatarHarry Wentland <harry.wentland@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 9a71c7d3
...@@ -30,7 +30,6 @@ config DRM_AMD_DC_DCN2_1 ...@@ -30,7 +30,6 @@ config DRM_AMD_DC_DCN2_1
bool "DCN 2.1 family" bool "DCN 2.1 family"
depends on DRM_AMD_DC && X86 depends on DRM_AMD_DC && X86
depends on DRM_AMD_DC_DCN2_0 depends on DRM_AMD_DC_DCN2_0
select DRM_AMD_DC_DMUB
help help
Choose this option if you want to have Choose this option if you want to have
Renoir support for display engine Renoir support for display engine
...@@ -53,11 +52,6 @@ config DRM_AMD_DC_HDCP ...@@ -53,11 +52,6 @@ config DRM_AMD_DC_HDCP
if you want to support if you want to support
HDCP authentication HDCP authentication
config DRM_AMD_DC_DMUB
def_bool n
help
DMUB support for display engine
config DEBUG_KERNEL_DC config DEBUG_KERNEL_DC
bool "Enable kgdb break in DC" bool "Enable kgdb break in DC"
depends on DRM_AMD_DC depends on DRM_AMD_DC
......
...@@ -34,27 +34,21 @@ subdir-ccflags-y += -I$(FULL_AMD_DISPLAY_PATH)/modules/freesync ...@@ -34,27 +34,21 @@ subdir-ccflags-y += -I$(FULL_AMD_DISPLAY_PATH)/modules/freesync
subdir-ccflags-y += -I$(FULL_AMD_DISPLAY_PATH)/modules/color subdir-ccflags-y += -I$(FULL_AMD_DISPLAY_PATH)/modules/color
subdir-ccflags-y += -I$(FULL_AMD_DISPLAY_PATH)/modules/info_packet subdir-ccflags-y += -I$(FULL_AMD_DISPLAY_PATH)/modules/info_packet
subdir-ccflags-y += -I$(FULL_AMD_DISPLAY_PATH)/modules/power subdir-ccflags-y += -I$(FULL_AMD_DISPLAY_PATH)/modules/power
subdir-ccflags-y += -I$(FULL_AMD_DISPLAY_PATH)/dmub/inc
ifdef CONFIG_DRM_AMD_DC_HDCP ifdef CONFIG_DRM_AMD_DC_HDCP
subdir-ccflags-y += -I$(FULL_AMD_DISPLAY_PATH)/modules/hdcp subdir-ccflags-y += -I$(FULL_AMD_DISPLAY_PATH)/modules/hdcp
endif endif
ifdef CONFIG_DRM_AMD_DC_DMUB
subdir-ccflags-y += -I$(FULL_AMD_DISPLAY_PATH)/dmub/inc
endif
#TODO: remove when Timing Sync feature is complete #TODO: remove when Timing Sync feature is complete
subdir-ccflags-y += -DBUILD_FEATURE_TIMING_SYNC=0 subdir-ccflags-y += -DBUILD_FEATURE_TIMING_SYNC=0
DAL_LIBS = amdgpu_dm dc modules/freesync modules/color modules/info_packet modules/power DAL_LIBS = amdgpu_dm dc modules/freesync modules/color modules/info_packet modules/power dmub/src
ifdef CONFIG_DRM_AMD_DC_HDCP ifdef CONFIG_DRM_AMD_DC_HDCP
DAL_LIBS += modules/hdcp DAL_LIBS += modules/hdcp
endif endif
ifdef CONFIG_DRM_AMD_DC_DMUB
DAL_LIBS += dmub/src
endif
AMD_DAL = $(addsuffix /Makefile, $(addprefix $(FULL_AMD_DISPLAY_PATH)/,$(DAL_LIBS))) AMD_DAL = $(addsuffix /Makefile, $(addprefix $(FULL_AMD_DISPLAY_PATH)/,$(DAL_LIBS)))
include $(AMD_DAL) include $(AMD_DAL)
...@@ -30,12 +30,10 @@ ...@@ -30,12 +30,10 @@
#include "dc.h" #include "dc.h"
#include "dc/inc/core_types.h" #include "dc/inc/core_types.h"
#include "dal_asic_id.h" #include "dal_asic_id.h"
#ifdef CONFIG_DRM_AMD_DC_DMUB
#include "dmub/inc/dmub_srv.h" #include "dmub/inc/dmub_srv.h"
#include "dc/inc/hw/dmcu.h" #include "dc/inc/hw/dmcu.h"
#include "dc/inc/hw/abm.h" #include "dc/inc/hw/abm.h"
#include "dc/dc_dmub_srv.h" #include "dc/dc_dmub_srv.h"
#endif
#include "vid.h" #include "vid.h"
#include "amdgpu.h" #include "amdgpu.h"
...@@ -93,10 +91,9 @@ ...@@ -93,10 +91,9 @@
#include "modules/power/power_helpers.h" #include "modules/power/power_helpers.h"
#include "modules/inc/mod_info_packet.h" #include "modules/inc/mod_info_packet.h"
#ifdef CONFIG_DRM_AMD_DC_DMUB
#define FIRMWARE_RENOIR_DMUB "amdgpu/renoir_dmcub.bin" #define FIRMWARE_RENOIR_DMUB "amdgpu/renoir_dmcub.bin"
MODULE_FIRMWARE(FIRMWARE_RENOIR_DMUB); MODULE_FIRMWARE(FIRMWARE_RENOIR_DMUB);
#endif
#define FIRMWARE_RAVEN_DMCU "amdgpu/raven_dmcu.bin" #define FIRMWARE_RAVEN_DMCU "amdgpu/raven_dmcu.bin"
MODULE_FIRMWARE(FIRMWARE_RAVEN_DMCU); MODULE_FIRMWARE(FIRMWARE_RAVEN_DMCU);
...@@ -677,7 +674,6 @@ void amdgpu_dm_audio_eld_notify(struct amdgpu_device *adev, int pin) ...@@ -677,7 +674,6 @@ void amdgpu_dm_audio_eld_notify(struct amdgpu_device *adev, int pin)
} }
} }
#ifdef CONFIG_DRM_AMD_DC_DMUB
static int dm_dmub_hw_init(struct amdgpu_device *adev) static int dm_dmub_hw_init(struct amdgpu_device *adev)
{ {
const unsigned int psp_header_bytes = 0x100; const unsigned int psp_header_bytes = 0x100;
...@@ -816,16 +812,13 @@ static int dm_dmub_hw_init(struct amdgpu_device *adev) ...@@ -816,16 +812,13 @@ static int dm_dmub_hw_init(struct amdgpu_device *adev)
return 0; return 0;
} }
#endif
static int amdgpu_dm_init(struct amdgpu_device *adev) static int amdgpu_dm_init(struct amdgpu_device *adev)
{ {
struct dc_init_data init_data; struct dc_init_data init_data;
#ifdef CONFIG_DRM_AMD_DC_HDCP #ifdef CONFIG_DRM_AMD_DC_HDCP
struct dc_callback_init init_params; struct dc_callback_init init_params;
#endif #endif
#ifdef CONFIG_DRM_AMD_DC_DMUB
int r; int r;
#endif
adev->dm.ddev = adev->ddev; adev->dm.ddev = adev->ddev;
adev->dm.adev = adev; adev->dm.adev = adev;
...@@ -902,14 +895,12 @@ static int amdgpu_dm_init(struct amdgpu_device *adev) ...@@ -902,14 +895,12 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
dc_hardware_init(adev->dm.dc); dc_hardware_init(adev->dm.dc);
#ifdef CONFIG_DRM_AMD_DC_DMUB
r = dm_dmub_hw_init(adev); r = dm_dmub_hw_init(adev);
if (r) { if (r) {
DRM_ERROR("DMUB interface failed to initialize: status=%d\n", r); DRM_ERROR("DMUB interface failed to initialize: status=%d\n", r);
goto error; goto error;
} }
#endif
adev->dm.freesync_module = mod_freesync_create(adev->dm.dc); adev->dm.freesync_module = mod_freesync_create(adev->dm.dc);
if (!adev->dm.freesync_module) { if (!adev->dm.freesync_module) {
DRM_ERROR( DRM_ERROR(
...@@ -982,7 +973,6 @@ static void amdgpu_dm_fini(struct amdgpu_device *adev) ...@@ -982,7 +973,6 @@ static void amdgpu_dm_fini(struct amdgpu_device *adev)
if (adev->dm.dc) if (adev->dm.dc)
dc_deinit_callbacks(adev->dm.dc); dc_deinit_callbacks(adev->dm.dc);
#endif #endif
#ifdef CONFIG_DRM_AMD_DC_DMUB
if (adev->dm.dc->ctx->dmub_srv) { if (adev->dm.dc->ctx->dmub_srv) {
dc_dmub_srv_destroy(&adev->dm.dc->ctx->dmub_srv); dc_dmub_srv_destroy(&adev->dm.dc->ctx->dmub_srv);
adev->dm.dc->ctx->dmub_srv = NULL; adev->dm.dc->ctx->dmub_srv = NULL;
...@@ -992,7 +982,6 @@ static void amdgpu_dm_fini(struct amdgpu_device *adev) ...@@ -992,7 +982,6 @@ static void amdgpu_dm_fini(struct amdgpu_device *adev)
amdgpu_bo_free_kernel(&adev->dm.dmub_bo, amdgpu_bo_free_kernel(&adev->dm.dmub_bo,
&adev->dm.dmub_bo_gpu_addr, &adev->dm.dmub_bo_gpu_addr,
&adev->dm.dmub_bo_cpu_addr); &adev->dm.dmub_bo_cpu_addr);
#endif
/* DC Destroy TODO: Replace destroy DAL */ /* DC Destroy TODO: Replace destroy DAL */
if (adev->dm.dc) if (adev->dm.dc)
...@@ -1104,7 +1093,6 @@ static int load_dmcu_fw(struct amdgpu_device *adev) ...@@ -1104,7 +1093,6 @@ static int load_dmcu_fw(struct amdgpu_device *adev)
return 0; return 0;
} }
#ifdef CONFIG_DRM_AMD_DC_DMUB
static uint32_t amdgpu_dm_dmub_reg_read(void *ctx, uint32_t address) static uint32_t amdgpu_dm_dmub_reg_read(void *ctx, uint32_t address)
{ {
struct amdgpu_device *adev = ctx; struct amdgpu_device *adev = ctx;
...@@ -1190,19 +1178,15 @@ static int dm_dmub_sw_init(struct amdgpu_device *adev) ...@@ -1190,19 +1178,15 @@ static int dm_dmub_sw_init(struct amdgpu_device *adev)
return 0; return 0;
} }
#endif
static int dm_sw_init(void *handle) static int dm_sw_init(void *handle)
{ {
struct amdgpu_device *adev = (struct amdgpu_device *)handle; struct amdgpu_device *adev = (struct amdgpu_device *)handle;
#ifdef CONFIG_DRM_AMD_DC_DMUB
int r; int r;
r = dm_dmub_sw_init(adev); r = dm_dmub_sw_init(adev);
if (r) if (r)
return r; return r;
#endif
return load_dmcu_fw(adev); return load_dmcu_fw(adev);
} }
...@@ -1210,7 +1194,6 @@ static int dm_sw_fini(void *handle) ...@@ -1210,7 +1194,6 @@ static int dm_sw_fini(void *handle)
{ {
struct amdgpu_device *adev = (struct amdgpu_device *)handle; struct amdgpu_device *adev = (struct amdgpu_device *)handle;
#ifdef CONFIG_DRM_AMD_DC_DMUB
if (adev->dm.dmub_srv) { if (adev->dm.dmub_srv) {
dmub_srv_destroy(adev->dm.dmub_srv); dmub_srv_destroy(adev->dm.dmub_srv);
adev->dm.dmub_srv = NULL; adev->dm.dmub_srv = NULL;
...@@ -1221,7 +1204,6 @@ static int dm_sw_fini(void *handle) ...@@ -1221,7 +1204,6 @@ static int dm_sw_fini(void *handle)
adev->dm.dmub_fw = NULL; adev->dm.dmub_fw = NULL;
} }
#endif
if(adev->dm.fw_dmcu) { if(adev->dm.fw_dmcu) {
release_firmware(adev->dm.fw_dmcu); release_firmware(adev->dm.fw_dmcu);
adev->dm.fw_dmcu = NULL; adev->dm.fw_dmcu = NULL;
......
...@@ -57,10 +57,8 @@ struct amdgpu_device; ...@@ -57,10 +57,8 @@ struct amdgpu_device;
struct drm_device; struct drm_device;
struct amdgpu_dm_irq_handler_data; struct amdgpu_dm_irq_handler_data;
struct dc; struct dc;
#ifdef CONFIG_DRM_AMD_DC_DMUB
struct amdgpu_bo; struct amdgpu_bo;
struct dmub_srv; struct dmub_srv;
#endif
struct common_irq_params { struct common_irq_params {
struct amdgpu_device *adev; struct amdgpu_device *adev;
...@@ -125,7 +123,6 @@ struct amdgpu_display_manager { ...@@ -125,7 +123,6 @@ struct amdgpu_display_manager {
struct dc *dc; struct dc *dc;
#ifdef CONFIG_DRM_AMD_DC_DMUB
/** /**
* @dmub_srv: * @dmub_srv:
* *
...@@ -170,7 +167,6 @@ struct amdgpu_display_manager { ...@@ -170,7 +167,6 @@ struct amdgpu_display_manager {
*/ */
uint32_t dmcub_fw_version; uint32_t dmcub_fw_version;
#endif
/** /**
* @cgs_device: * @cgs_device:
* *
......
...@@ -70,9 +70,6 @@ AMD_DM_REG_UPDATE = $(addprefix $(AMDDALPATH)/dc/,dc_helper.o) ...@@ -70,9 +70,6 @@ AMD_DM_REG_UPDATE = $(addprefix $(AMDDALPATH)/dc/,dc_helper.o)
AMD_DISPLAY_FILES += $(AMD_DISPLAY_CORE) AMD_DISPLAY_FILES += $(AMD_DISPLAY_CORE)
AMD_DISPLAY_FILES += $(AMD_DM_REG_UPDATE) AMD_DISPLAY_FILES += $(AMD_DM_REG_UPDATE)
ifdef CONFIG_DRM_AMD_DC_DMUB
DC_DMUB += dc_dmub_srv.o DC_DMUB += dc_dmub_srv.o
AMD_DISPLAY_DMUB = $(addprefix $(AMDDALPATH)/dc/,$(DC_DMUB)) AMD_DISPLAY_DMUB = $(addprefix $(AMDDALPATH)/dc/,$(DC_DMUB))
AMD_DISPLAY_FILES += $(AMD_DISPLAY_DMUB) AMD_DISPLAY_FILES += $(AMD_DISPLAY_DMUB)
endif
...@@ -37,10 +37,8 @@ ...@@ -37,10 +37,8 @@
#include "bios_parser_types_internal2.h" #include "bios_parser_types_internal2.h"
#include "amdgpu.h" #include "amdgpu.h"
#ifdef CONFIG_DRM_AMD_DC_DMUB
#include "dc_dmub_srv.h" #include "dc_dmub_srv.h"
#include "dc.h" #include "dc.h"
#endif
#define DC_LOGGER \ #define DC_LOGGER \
bp->base.ctx->logger bp->base.ctx->logger
...@@ -107,7 +105,6 @@ static void init_dig_encoder_control(struct bios_parser *bp) ...@@ -107,7 +105,6 @@ static void init_dig_encoder_control(struct bios_parser *bp)
} }
} }
#ifdef CONFIG_DRM_AMD_DC_DMUB
static void encoder_control_dmcub( static void encoder_control_dmcub(
struct dc_dmub_srv *dmcub, struct dc_dmub_srv *dmcub,
struct dig_encoder_stream_setup_parameters_v1_5 *dig) struct dig_encoder_stream_setup_parameters_v1_5 *dig)
...@@ -121,7 +118,7 @@ static void encoder_control_dmcub( ...@@ -121,7 +118,7 @@ static void encoder_control_dmcub(
dc_dmub_srv_cmd_execute(dmcub); dc_dmub_srv_cmd_execute(dmcub);
dc_dmub_srv_wait_idle(dmcub); dc_dmub_srv_wait_idle(dmcub);
} }
#endif
static enum bp_result encoder_control_digx_v1_5( static enum bp_result encoder_control_digx_v1_5(
struct bios_parser *bp, struct bios_parser *bp,
struct bp_encoder_control *cntl) struct bp_encoder_control *cntl)
...@@ -173,13 +170,12 @@ static enum bp_result encoder_control_digx_v1_5( ...@@ -173,13 +170,12 @@ static enum bp_result encoder_control_digx_v1_5(
default: default:
break; break;
} }
#ifdef CONFIG_DRM_AMD_DC_DMUB
if (bp->base.ctx->dc->ctx->dmub_srv && if (bp->base.ctx->dc->ctx->dmub_srv &&
bp->base.ctx->dc->debug.dmub_command_table) { bp->base.ctx->dc->debug.dmub_command_table) {
encoder_control_dmcub(bp->base.ctx->dmub_srv, &params); encoder_control_dmcub(bp->base.ctx->dmub_srv, &params);
return BP_RESULT_OK; return BP_RESULT_OK;
} }
#endif
if (EXEC_BIOS_CMD_TABLE(digxencodercontrol, params)) if (EXEC_BIOS_CMD_TABLE(digxencodercontrol, params))
result = BP_RESULT_OK; result = BP_RESULT_OK;
...@@ -216,7 +212,7 @@ static void init_transmitter_control(struct bios_parser *bp) ...@@ -216,7 +212,7 @@ static void init_transmitter_control(struct bios_parser *bp)
break; break;
} }
} }
#ifdef CONFIG_DRM_AMD_DC_DMUB
static void transmitter_control_dmcub( static void transmitter_control_dmcub(
struct dc_dmub_srv *dmcub, struct dc_dmub_srv *dmcub,
struct dig_transmitter_control_parameters_v1_6 *dig) struct dig_transmitter_control_parameters_v1_6 *dig)
...@@ -230,7 +226,7 @@ static void transmitter_control_dmcub( ...@@ -230,7 +226,7 @@ static void transmitter_control_dmcub(
dc_dmub_srv_cmd_execute(dmcub); dc_dmub_srv_cmd_execute(dmcub);
dc_dmub_srv_wait_idle(dmcub); dc_dmub_srv_wait_idle(dmcub);
} }
#endif
static enum bp_result transmitter_control_v1_6( static enum bp_result transmitter_control_v1_6(
struct bios_parser *bp, struct bios_parser *bp,
struct bp_transmitter_control *cntl) struct bp_transmitter_control *cntl)
...@@ -262,14 +258,11 @@ static enum bp_result transmitter_control_v1_6( ...@@ -262,14 +258,11 @@ static enum bp_result transmitter_control_v1_6(
__func__, ps.param.symclk_10khz); __func__, ps.param.symclk_10khz);
} }
#ifdef CONFIG_DRM_AMD_DC_DMUB
if (bp->base.ctx->dc->ctx->dmub_srv && if (bp->base.ctx->dc->ctx->dmub_srv &&
bp->base.ctx->dc->debug.dmub_command_table) { bp->base.ctx->dc->debug.dmub_command_table) {
transmitter_control_dmcub(bp->base.ctx->dmub_srv, &ps.param); transmitter_control_dmcub(bp->base.ctx->dmub_srv, &ps.param);
return BP_RESULT_OK; return BP_RESULT_OK;
} }
#endif
/*color_depth not used any more, driver has deep color factor in the Phyclk*/ /*color_depth not used any more, driver has deep color factor in the Phyclk*/
if (EXEC_BIOS_CMD_TABLE(dig1transmittercontrol, ps)) if (EXEC_BIOS_CMD_TABLE(dig1transmittercontrol, ps))
...@@ -303,7 +296,6 @@ static void init_set_pixel_clock(struct bios_parser *bp) ...@@ -303,7 +296,6 @@ static void init_set_pixel_clock(struct bios_parser *bp)
} }
} }
#ifdef CONFIG_DRM_AMD_DC_DMUB
static void set_pixel_clock_dmcub( static void set_pixel_clock_dmcub(
struct dc_dmub_srv *dmcub, struct dc_dmub_srv *dmcub,
struct set_pixel_clock_parameter_v1_7 *clk) struct set_pixel_clock_parameter_v1_7 *clk)
...@@ -317,7 +309,6 @@ static void set_pixel_clock_dmcub( ...@@ -317,7 +309,6 @@ static void set_pixel_clock_dmcub(
dc_dmub_srv_cmd_execute(dmcub); dc_dmub_srv_cmd_execute(dmcub);
dc_dmub_srv_wait_idle(dmcub); dc_dmub_srv_wait_idle(dmcub);
} }
#endif
static enum bp_result set_pixel_clock_v7( static enum bp_result set_pixel_clock_v7(
struct bios_parser *bp, struct bios_parser *bp,
...@@ -393,13 +384,12 @@ static enum bp_result set_pixel_clock_v7( ...@@ -393,13 +384,12 @@ static enum bp_result set_pixel_clock_v7(
if (bp_params->signal_type == SIGNAL_TYPE_DVI_DUAL_LINK) if (bp_params->signal_type == SIGNAL_TYPE_DVI_DUAL_LINK)
clk.miscinfo |= PIXEL_CLOCK_V7_MISC_DVI_DUALLINK_EN; clk.miscinfo |= PIXEL_CLOCK_V7_MISC_DVI_DUALLINK_EN;
#ifdef CONFIG_DRM_AMD_DC_DMUB
if (bp->base.ctx->dc->ctx->dmub_srv && if (bp->base.ctx->dc->ctx->dmub_srv &&
bp->base.ctx->dc->debug.dmub_command_table) { bp->base.ctx->dc->debug.dmub_command_table) {
set_pixel_clock_dmcub(bp->base.ctx->dmub_srv, &clk); set_pixel_clock_dmcub(bp->base.ctx->dmub_srv, &clk);
return BP_RESULT_OK; return BP_RESULT_OK;
} }
#endif
if (EXEC_BIOS_CMD_TABLE(setpixelclock, clk)) if (EXEC_BIOS_CMD_TABLE(setpixelclock, clk))
result = BP_RESULT_OK; result = BP_RESULT_OK;
} }
...@@ -653,7 +643,7 @@ static void init_enable_disp_power_gating( ...@@ -653,7 +643,7 @@ static void init_enable_disp_power_gating(
break; break;
} }
} }
#ifdef CONFIG_DRM_AMD_DC_DMUB
static void enable_disp_power_gating_dmcub( static void enable_disp_power_gating_dmcub(
struct dc_dmub_srv *dmcub, struct dc_dmub_srv *dmcub,
struct enable_disp_power_gating_parameters_v2_1 *pwr) struct enable_disp_power_gating_parameters_v2_1 *pwr)
...@@ -667,7 +657,7 @@ static void enable_disp_power_gating_dmcub( ...@@ -667,7 +657,7 @@ static void enable_disp_power_gating_dmcub(
dc_dmub_srv_cmd_execute(dmcub); dc_dmub_srv_cmd_execute(dmcub);
dc_dmub_srv_wait_idle(dmcub); dc_dmub_srv_wait_idle(dmcub);
} }
#endif
static enum bp_result enable_disp_power_gating_v2_1( static enum bp_result enable_disp_power_gating_v2_1(
struct bios_parser *bp, struct bios_parser *bp,
enum controller_id crtc_id, enum controller_id crtc_id,
...@@ -687,14 +677,13 @@ static enum bp_result enable_disp_power_gating_v2_1( ...@@ -687,14 +677,13 @@ static enum bp_result enable_disp_power_gating_v2_1(
ps.param.enable = ps.param.enable =
bp->cmd_helper->disp_power_gating_action_to_atom(action); bp->cmd_helper->disp_power_gating_action_to_atom(action);
#ifdef CONFIG_DRM_AMD_DC_DMUB
if (bp->base.ctx->dc->ctx->dmub_srv && if (bp->base.ctx->dc->ctx->dmub_srv &&
bp->base.ctx->dc->debug.dmub_command_table) { bp->base.ctx->dc->debug.dmub_command_table) {
enable_disp_power_gating_dmcub(bp->base.ctx->dmub_srv, enable_disp_power_gating_dmcub(bp->base.ctx->dmub_srv,
&ps.param); &ps.param);
return BP_RESULT_OK; return BP_RESULT_OK;
} }
#endif
if (EXEC_BIOS_CMD_TABLE(enabledisppowergating, ps.param)) if (EXEC_BIOS_CMD_TABLE(enabledisppowergating, ps.param))
result = BP_RESULT_OK; result = BP_RESULT_OK;
......
...@@ -58,10 +58,7 @@ ...@@ -58,10 +58,7 @@
#include "hubp.h" #include "hubp.h"
#include "dc_link_dp.h" #include "dc_link_dp.h"
#ifdef CONFIG_DRM_AMD_DC_DMUB
#include "dc_dmub_srv.h" #include "dc_dmub_srv.h"
#endif
#ifdef CONFIG_DRM_AMD_DC_DSC_SUPPORT #ifdef CONFIG_DRM_AMD_DC_DSC_SUPPORT
#include "dsc.h" #include "dsc.h"
...@@ -2410,10 +2407,9 @@ void dc_set_power_state( ...@@ -2410,10 +2407,9 @@ void dc_set_power_state(
switch (power_state) { switch (power_state) {
case DC_ACPI_CM_POWER_STATE_D0: case DC_ACPI_CM_POWER_STATE_D0:
dc_resource_state_construct(dc, dc->current_state); dc_resource_state_construct(dc, dc->current_state);
#ifdef CONFIG_DRM_AMD_DC_DMUB
if (dc->ctx->dmub_srv) if (dc->ctx->dmub_srv)
dc_dmub_srv_wait_phy_init(dc->ctx->dmub_srv); dc_dmub_srv_wait_phy_init(dc->ctx->dmub_srv);
#endif
dc->hwss.init_hw(dc); dc->hwss.init_hw(dc);
......
...@@ -112,9 +112,7 @@ struct dc_caps { ...@@ -112,9 +112,7 @@ struct dc_caps {
bool disable_dp_clk_share; bool disable_dp_clk_share;
bool psp_setup_panel_mode; bool psp_setup_panel_mode;
bool extended_aux_timeout_support; bool extended_aux_timeout_support;
#ifdef CONFIG_DRM_AMD_DC_DMUB
bool dmcub_support; bool dmcub_support;
#endif
#ifdef CONFIG_DRM_AMD_DC_DCN2_0 #ifdef CONFIG_DRM_AMD_DC_DCN2_0
bool hw_3d_lut; bool hw_3d_lut;
#endif #endif
...@@ -404,11 +402,9 @@ struct dc_debug_options { ...@@ -404,11 +402,9 @@ struct dc_debug_options {
unsigned int force_odm_combine; //bit vector based on otg inst unsigned int force_odm_combine; //bit vector based on otg inst
unsigned int force_fclk_khz; unsigned int force_fclk_khz;
bool disable_tri_buf; bool disable_tri_buf;
#ifdef CONFIG_DRM_AMD_DC_DMUB
bool dmub_offload_enabled; bool dmub_offload_enabled;
bool dmcub_emulation; bool dmcub_emulation;
bool dmub_command_table; /* for testing only */ bool dmub_command_table; /* for testing only */
#endif
struct dc_bw_validation_profile bw_val_profile; struct dc_bw_validation_profile bw_val_profile;
#ifdef CONFIG_DRM_AMD_DC_DSC_SUPPORT #ifdef CONFIG_DRM_AMD_DC_DSC_SUPPORT
bool disable_fec; bool disable_fec;
...@@ -566,10 +562,9 @@ struct dc_init_data { ...@@ -566,10 +562,9 @@ struct dc_init_data {
struct dc_bios *vbios_override; struct dc_bios *vbios_override;
enum dce_environment dce_environment; enum dce_environment dce_environment;
#ifdef CONFIG_DRM_AMD_DC_DMUB
struct dmub_offload_funcs *dmub_if; struct dmub_offload_funcs *dmub_if;
struct dc_reg_helper_state *dmub_offload; struct dc_reg_helper_state *dmub_offload;
#endif
struct dc_config flags; struct dc_config flags;
uint32_t log_mask; uint32_t log_mask;
#ifdef CONFIG_DRM_AMD_DC_DCN2_0 #ifdef CONFIG_DRM_AMD_DC_DCN2_0
......
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
#include "dm_services.h" #include "dm_services.h"
#include <stdarg.h> #include <stdarg.h>
#ifdef CONFIG_DRM_AMD_DC_DMUB
#include "dc.h" #include "dc.h"
#include "dc_dmub_srv.h" #include "dc_dmub_srv.h"
...@@ -100,7 +99,6 @@ static inline void submit_dmub_reg_wait( ...@@ -100,7 +99,6 @@ static inline void submit_dmub_reg_wait(
ctx->dmub_srv->reg_helper_offload.gather_in_progress = gather; ctx->dmub_srv->reg_helper_offload.gather_in_progress = gather;
} }
#endif
struct dc_reg_value_masks { struct dc_reg_value_masks {
uint32_t value; uint32_t value;
...@@ -147,7 +145,6 @@ static void set_reg_field_values(struct dc_reg_value_masks *field_value_mask, ...@@ -147,7 +145,6 @@ static void set_reg_field_values(struct dc_reg_value_masks *field_value_mask,
} }
} }
#ifdef CONFIG_DRM_AMD_DC_DMUB
static void dmub_flush_buffer_execute( static void dmub_flush_buffer_execute(
struct dc_reg_helper_state *offload, struct dc_reg_helper_state *offload,
const struct dc_context *ctx) const struct dc_context *ctx)
...@@ -239,8 +236,6 @@ static void dmub_reg_wait_done_pack(const struct dc_context *ctx, uint32_t addr, ...@@ -239,8 +236,6 @@ static void dmub_reg_wait_done_pack(const struct dc_context *ctx, uint32_t addr,
cmd_buf->reg_wait.time_out_us = time_out_us; cmd_buf->reg_wait.time_out_us = time_out_us;
} }
#endif
uint32_t generic_reg_update_ex(const struct dc_context *ctx, uint32_t generic_reg_update_ex(const struct dc_context *ctx,
uint32_t addr, int n, uint32_t addr, int n,
uint8_t shift1, uint32_t mask1, uint32_t field_value1, uint8_t shift1, uint32_t mask1, uint32_t field_value1,
...@@ -257,12 +252,10 @@ uint32_t generic_reg_update_ex(const struct dc_context *ctx, ...@@ -257,12 +252,10 @@ uint32_t generic_reg_update_ex(const struct dc_context *ctx,
va_end(ap); va_end(ap);
#ifdef CONFIG_DRM_AMD_DC_DMUB
if (ctx->dmub_srv && if (ctx->dmub_srv &&
ctx->dmub_srv->reg_helper_offload.gather_in_progress) ctx->dmub_srv->reg_helper_offload.gather_in_progress)
return dmub_reg_value_pack(ctx, addr, &field_value_mask); return dmub_reg_value_pack(ctx, addr, &field_value_mask);
/* todo: return void so we can decouple code running in driver from register states */ /* todo: return void so we can decouple code running in driver from register states */
#endif
/* mmio write directly */ /* mmio write directly */
reg_val = dm_read_reg(ctx, addr); reg_val = dm_read_reg(ctx, addr);
...@@ -289,13 +282,13 @@ uint32_t generic_reg_set_ex(const struct dc_context *ctx, ...@@ -289,13 +282,13 @@ uint32_t generic_reg_set_ex(const struct dc_context *ctx,
/* mmio write directly */ /* mmio write directly */
reg_val = (reg_val & ~field_value_mask.mask) | field_value_mask.value; reg_val = (reg_val & ~field_value_mask.mask) | field_value_mask.value;
#ifdef CONFIG_DRM_AMD_DC_DMUB
if (ctx->dmub_srv && if (ctx->dmub_srv &&
ctx->dmub_srv->reg_helper_offload.gather_in_progress) { ctx->dmub_srv->reg_helper_offload.gather_in_progress) {
return dmub_reg_value_burst_set_pack(ctx, addr, reg_val); return dmub_reg_value_burst_set_pack(ctx, addr, reg_val);
/* todo: return void so we can decouple code running in driver from register states */ /* todo: return void so we can decouple code running in driver from register states */
} }
#endif
dm_write_reg(ctx, addr, reg_val); dm_write_reg(ctx, addr, reg_val);
return reg_val; return reg_val;
} }
...@@ -313,14 +306,12 @@ uint32_t dm_read_reg_func( ...@@ -313,14 +306,12 @@ uint32_t dm_read_reg_func(
} }
#endif #endif
#ifdef CONFIG_DRM_AMD_DC_DMUB
if (ctx->dmub_srv && if (ctx->dmub_srv &&
ctx->dmub_srv->reg_helper_offload.gather_in_progress && ctx->dmub_srv->reg_helper_offload.gather_in_progress &&
!ctx->dmub_srv->reg_helper_offload.should_burst_write) { !ctx->dmub_srv->reg_helper_offload.should_burst_write) {
ASSERT(false); ASSERT(false);
return 0; return 0;
} }
#endif
value = cgs_read_register(ctx->cgs_device, address); value = cgs_read_register(ctx->cgs_device, address);
trace_amdgpu_dc_rreg(&ctx->perf_trace->read_count, address, value); trace_amdgpu_dc_rreg(&ctx->perf_trace->read_count, address, value);
...@@ -487,14 +478,12 @@ void generic_reg_wait(const struct dc_context *ctx, ...@@ -487,14 +478,12 @@ void generic_reg_wait(const struct dc_context *ctx,
uint32_t reg_val; uint32_t reg_val;
int i; int i;
#ifdef CONFIG_DRM_AMD_DC_DMUB
if (ctx->dmub_srv && if (ctx->dmub_srv &&
ctx->dmub_srv->reg_helper_offload.gather_in_progress) { ctx->dmub_srv->reg_helper_offload.gather_in_progress) {
dmub_reg_wait_done_pack(ctx, addr, mask, shift, condition_value, dmub_reg_wait_done_pack(ctx, addr, mask, shift, condition_value,
delay_between_poll_us * time_out_num_tries); delay_between_poll_us * time_out_num_tries);
return; return;
} }
#endif
/* something is terribly wrong if time out is > 200ms. (5Hz) */ /* something is terribly wrong if time out is > 200ms. (5Hz) */
ASSERT(delay_between_poll_us * time_out_num_tries <= 3000000); ASSERT(delay_between_poll_us * time_out_num_tries <= 3000000);
...@@ -542,13 +531,12 @@ uint32_t generic_read_indirect_reg(const struct dc_context *ctx, ...@@ -542,13 +531,12 @@ uint32_t generic_read_indirect_reg(const struct dc_context *ctx,
uint32_t index) uint32_t index)
{ {
uint32_t value = 0; uint32_t value = 0;
#ifdef CONFIG_DRM_AMD_DC_DMUB
// when reg read, there should not be any offload. // when reg read, there should not be any offload.
if (ctx->dmub_srv && if (ctx->dmub_srv &&
ctx->dmub_srv->reg_helper_offload.gather_in_progress) { ctx->dmub_srv->reg_helper_offload.gather_in_progress) {
ASSERT(false); ASSERT(false);
} }
#endif
dm_write_reg(ctx, addr_index, index); dm_write_reg(ctx, addr_index, index);
value = dm_read_reg(ctx, addr_data); value = dm_read_reg(ctx, addr_data);
...@@ -587,7 +575,6 @@ uint32_t generic_indirect_reg_update_ex(const struct dc_context *ctx, ...@@ -587,7 +575,6 @@ uint32_t generic_indirect_reg_update_ex(const struct dc_context *ctx,
return reg_val; return reg_val;
} }
#ifdef CONFIG_DRM_AMD_DC_DMUB
void reg_sequence_start_gather(const struct dc_context *ctx) void reg_sequence_start_gather(const struct dc_context *ctx)
{ {
/* if reg sequence is supported and enabled, set flag to /* if reg sequence is supported and enabled, set flag to
...@@ -652,6 +639,3 @@ void reg_sequence_wait_done(const struct dc_context *ctx) ...@@ -652,6 +639,3 @@ void reg_sequence_wait_done(const struct dc_context *ctx)
dc_dmub_srv_wait_idle(ctx->dmub_srv); dc_dmub_srv_wait_idle(ctx->dmub_srv);
} }
} }
#endif
...@@ -48,9 +48,7 @@ struct dc_stream_state; ...@@ -48,9 +48,7 @@ struct dc_stream_state;
struct dc_link; struct dc_link;
struct dc_sink; struct dc_sink;
struct dal; struct dal;
#ifdef CONFIG_DRM_AMD_DC_DMUB
struct dc_dmub_srv; struct dc_dmub_srv;
#endif
/******************************** /********************************
* Environment definitions * Environment definitions
...@@ -112,9 +110,8 @@ struct dc_context { ...@@ -112,9 +110,8 @@ struct dc_context {
uint32_t dc_sink_id_count; uint32_t dc_sink_id_count;
uint32_t dc_stream_id_count; uint32_t dc_stream_id_count;
uint64_t fbc_gpu_addr; uint64_t fbc_gpu_addr;
#ifdef CONFIG_DRM_AMD_DC_DMUB
struct dc_dmub_srv *dmub_srv; struct dc_dmub_srv *dmub_srv;
#endif
#ifdef CONFIG_DRM_AMD_DC_HDCP #ifdef CONFIG_DRM_AMD_DC_HDCP
struct cp_psp cp_psp; struct cp_psp cp_psp;
#endif #endif
......
...@@ -352,9 +352,8 @@ void dpp1_cm_program_regamma_lut(struct dpp *dpp_base, ...@@ -352,9 +352,8 @@ void dpp1_cm_program_regamma_lut(struct dpp *dpp_base,
uint32_t i; uint32_t i;
struct dcn10_dpp *dpp = TO_DCN10_DPP(dpp_base); struct dcn10_dpp *dpp = TO_DCN10_DPP(dpp_base);
#ifdef CONFIG_DRM_AMD_DC_DMUB
REG_SEQ_START(); REG_SEQ_START();
#endif
for (i = 0 ; i < num; i++) { for (i = 0 ; i < num; i++) {
REG_SET(CM_RGAM_LUT_DATA, 0, CM_RGAM_LUT_DATA, rgb[i].red_reg); REG_SET(CM_RGAM_LUT_DATA, 0, CM_RGAM_LUT_DATA, rgb[i].red_reg);
REG_SET(CM_RGAM_LUT_DATA, 0, CM_RGAM_LUT_DATA, rgb[i].green_reg); REG_SET(CM_RGAM_LUT_DATA, 0, CM_RGAM_LUT_DATA, rgb[i].green_reg);
...@@ -633,10 +632,9 @@ void dpp1_set_degamma( ...@@ -633,10 +632,9 @@ void dpp1_set_degamma(
BREAK_TO_DEBUGGER(); BREAK_TO_DEBUGGER();
break; break;
} }
#ifdef CONFIG_DRM_AMD_DC_DMUB
REG_SEQ_SUBMIT(); REG_SEQ_SUBMIT();
REG_SEQ_WAIT_DONE(); REG_SEQ_WAIT_DONE();
#endif
} }
void dpp1_degamma_ram_select( void dpp1_degamma_ram_select(
......
...@@ -457,18 +457,15 @@ static bool optc1_enable_crtc(struct timing_generator *optc) ...@@ -457,18 +457,15 @@ static bool optc1_enable_crtc(struct timing_generator *optc)
REG_UPDATE(CONTROL, REG_UPDATE(CONTROL,
VTG0_ENABLE, 1); VTG0_ENABLE, 1);
#ifdef CONFIG_DRM_AMD_DC_DMUB
REG_SEQ_START(); REG_SEQ_START();
#endif
/* Enable CRTC */ /* Enable CRTC */
REG_UPDATE_2(OTG_CONTROL, REG_UPDATE_2(OTG_CONTROL,
OTG_DISABLE_POINT_CNTL, 3, OTG_DISABLE_POINT_CNTL, 3,
OTG_MASTER_EN, 1); OTG_MASTER_EN, 1);
#ifdef CONFIG_DRM_AMD_DC_DMUB
REG_SEQ_SUBMIT(); REG_SEQ_SUBMIT();
REG_SEQ_WAIT_DONE(); REG_SEQ_WAIT_DONE();
#endif
return true; return true;
} }
......
...@@ -345,10 +345,8 @@ static void mpc20_program_ogam_pwl( ...@@ -345,10 +345,8 @@ static void mpc20_program_ogam_pwl(
uint32_t i; uint32_t i;
struct dcn20_mpc *mpc20 = TO_DCN20_MPC(mpc); struct dcn20_mpc *mpc20 = TO_DCN20_MPC(mpc);
#ifdef CONFIG_DRM_AMD_DC_DMUB
PERF_TRACE(); PERF_TRACE();
REG_SEQ_START(); REG_SEQ_START();
#endif
for (i = 0 ; i < num; i++) { for (i = 0 ; i < num; i++) {
REG_SET(MPCC_OGAM_LUT_DATA[mpcc_id], 0, MPCC_OGAM_LUT_DATA, rgb[i].red_reg); REG_SET(MPCC_OGAM_LUT_DATA[mpcc_id], 0, MPCC_OGAM_LUT_DATA, rgb[i].red_reg);
...@@ -468,12 +466,11 @@ void mpc2_assert_mpcc_idle_before_connect(struct mpc *mpc, int mpcc_id) ...@@ -468,12 +466,11 @@ void mpc2_assert_mpcc_idle_before_connect(struct mpc *mpc, int mpcc_id)
ASSERT(!mpc_disabled); ASSERT(!mpc_disabled);
ASSERT(!mpc_idle); ASSERT(!mpc_idle);
} }
#ifdef CONFIG_DRM_AMD_DC_DMUB
REG_SEQ_SUBMIT(); REG_SEQ_SUBMIT();
PERF_TRACE(); PERF_TRACE();
REG_SEQ_WAIT_DONE(); REG_SEQ_WAIT_DONE();
PERF_TRACE(); PERF_TRACE();
#endif
} }
static void mpc2_init_mpcc(struct mpcc *mpcc, int mpcc_inst) static void mpc2_init_mpcc(struct mpcc *mpcc, int mpcc_inst)
......
...@@ -1678,9 +1678,7 @@ static bool construct( ...@@ -1678,9 +1678,7 @@ static bool construct(
dc->caps.post_blend_color_processing = true; dc->caps.post_blend_color_processing = true;
dc->caps.force_dp_tps4_for_cp2520 = true; dc->caps.force_dp_tps4_for_cp2520 = true;
dc->caps.extended_aux_timeout_support = true; dc->caps.extended_aux_timeout_support = true;
#ifdef CONFIG_DRM_AMD_DC_DMUB
dc->caps.dmcub_support = true; dc->caps.dmcub_support = true;
#endif
if (dc->ctx->dce_environment == DCE_ENV_PRODUCTION_DRV) if (dc->ctx->dce_environment == DCE_ENV_PRODUCTION_DRV)
dc->debug = debug_defaults_drv; dc->debug = debug_defaults_drv;
......
...@@ -40,11 +40,9 @@ ...@@ -40,11 +40,9 @@
#undef DEPRECATED #undef DEPRECATED
#ifdef CONFIG_DRM_AMD_DC_DMUB
struct dmub_srv; struct dmub_srv;
struct dc_dmub_srv; struct dc_dmub_srv;
#endif
irq_handler_idx dm_register_interrupt( irq_handler_idx dm_register_interrupt(
struct dc_context *ctx, struct dc_context *ctx,
struct dc_interrupt_params *int_params, struct dc_interrupt_params *int_params,
...@@ -144,14 +142,12 @@ uint32_t generic_reg_update_ex(const struct dc_context *ctx, ...@@ -144,14 +142,12 @@ uint32_t generic_reg_update_ex(const struct dc_context *ctx,
uint32_t addr, int n, uint32_t addr, int n,
uint8_t shift1, uint32_t mask1, uint32_t field_value1, ...); uint8_t shift1, uint32_t mask1, uint32_t field_value1, ...);
#ifdef CONFIG_DRM_AMD_DC_DMUB
struct dc_dmub_srv *dc_dmub_srv_create(struct dc *dc, struct dmub_srv *dmub); struct dc_dmub_srv *dc_dmub_srv_create(struct dc *dc, struct dmub_srv *dmub);
void dc_dmub_srv_destroy(struct dc_dmub_srv **dmub_srv); void dc_dmub_srv_destroy(struct dc_dmub_srv **dmub_srv);
void reg_sequence_start_gather(const struct dc_context *ctx); void reg_sequence_start_gather(const struct dc_context *ctx);
void reg_sequence_start_execute(const struct dc_context *ctx); void reg_sequence_start_execute(const struct dc_context *ctx);
void reg_sequence_wait_done(const struct dc_context *ctx); void reg_sequence_wait_done(const struct dc_context *ctx);
#endif
#define FD(reg_field) reg_field ## __SHIFT, \ #define FD(reg_field) reg_field ## __SHIFT, \
reg_field ## _MASK reg_field ## _MASK
......
...@@ -485,8 +485,6 @@ uint32_t generic_indirect_reg_update_ex(const struct dc_context *ctx, ...@@ -485,8 +485,6 @@ uint32_t generic_indirect_reg_update_ex(const struct dc_context *ctx,
uint8_t shift1, uint32_t mask1, uint32_t field_value1, uint8_t shift1, uint32_t mask1, uint32_t field_value1,
...); ...);
#ifdef CONFIG_DRM_AMD_DC_DMUB
/* register offload macros /* register offload macros
* *
* instead of MMIO to register directly, in some cases we want * instead of MMIO to register directly, in some cases we want
...@@ -505,6 +503,5 @@ uint32_t generic_indirect_reg_update_ex(const struct dc_context *ctx, ...@@ -505,6 +503,5 @@ uint32_t generic_indirect_reg_update_ex(const struct dc_context *ctx,
/* wait for the last REG_SEQ_SUBMIT to finish */ /* wait for the last REG_SEQ_SUBMIT to finish */
#define REG_SEQ_WAIT_DONE() \ #define REG_SEQ_WAIT_DONE() \
reg_sequence_wait_done(CTX) reg_sequence_wait_done(CTX)
#endif
#endif /* DRIVERS_GPU_DRM_AMD_DC_DEV_DC_INC_REG_HELPER_H_ */ #endif /* DRIVERS_GPU_DRM_AMD_DC_DEV_DC_INC_REG_HELPER_H_ */
...@@ -20,10 +20,8 @@ ...@@ -20,10 +20,8 @@
# OTHER DEALINGS IN THE SOFTWARE. # OTHER DEALINGS IN THE SOFTWARE.
# #
ifdef CONFIG_DRM_AMD_DC_DMUB
DMUB = dmub_srv.o dmub_reg.o dmub_dcn20.o dmub_dcn21.o DMUB = dmub_srv.o dmub_reg.o dmub_dcn20.o dmub_dcn21.o
AMD_DAL_DMUB = $(addprefix $(AMDDALPATH)/dmub/src/,$(DMUB)) AMD_DAL_DMUB = $(addprefix $(AMDDALPATH)/dmub/src/,$(DMUB))
AMD_DISPLAY_FILES += $(AMD_DAL_DMUB) AMD_DISPLAY_FILES += $(AMD_DAL_DMUB)
endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment