bool "DCN 2.1 family"
depends on DRM_AMD_DC && X86
depends on DRM_AMD_DC_DCN2_0
- select DRM_AMD_DC_DMUB
help
Choose this option if you want to have
Renoir support for display engine
if you want to support
HDCP authentication
-config DRM_AMD_DC_DMUB
- def_bool n
- help
- DMUB support for display engine
-
config DEBUG_KERNEL_DC
bool "Enable kgdb break in DC"
depends on DRM_AMD_DC
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/power
+subdir-ccflags-y += -I$(FULL_AMD_DISPLAY_PATH)/dmub/inc
+
ifdef CONFIG_DRM_AMD_DC_HDCP
subdir-ccflags-y += -I$(FULL_AMD_DISPLAY_PATH)/modules/hdcp
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
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
DAL_LIBS += modules/hdcp
endif
-ifdef CONFIG_DRM_AMD_DC_DMUB
-DAL_LIBS += dmub/src
-endif
-
AMD_DAL = $(addsuffix /Makefile, $(addprefix $(FULL_AMD_DISPLAY_PATH)/,$(DAL_LIBS)))
include $(AMD_DAL)
#include "dc.h"
#include "dc/inc/core_types.h"
#include "dal_asic_id.h"
-#ifdef CONFIG_DRM_AMD_DC_DMUB
#include "dmub/inc/dmub_srv.h"
#include "dc/inc/hw/dmcu.h"
#include "dc/inc/hw/abm.h"
#include "dc/dc_dmub_srv.h"
-#endif
#include "vid.h"
#include "amdgpu.h"
#include "modules/power/power_helpers.h"
#include "modules/inc/mod_info_packet.h"
-#ifdef CONFIG_DRM_AMD_DC_DMUB
#define FIRMWARE_RENOIR_DMUB "amdgpu/renoir_dmcub.bin"
MODULE_FIRMWARE(FIRMWARE_RENOIR_DMUB);
-#endif
+
#define FIRMWARE_RAVEN_DMCU "amdgpu/raven_dmcu.bin"
MODULE_FIRMWARE(FIRMWARE_RAVEN_DMCU);
}
}
-#ifdef CONFIG_DRM_AMD_DC_DMUB
static int dm_dmub_hw_init(struct amdgpu_device *adev)
{
const unsigned int psp_header_bytes = 0x100;
return 0;
}
-#endif
static int amdgpu_dm_init(struct amdgpu_device *adev)
{
struct dc_init_data init_data;
#ifdef CONFIG_DRM_AMD_DC_HDCP
struct dc_callback_init init_params;
#endif
-#ifdef CONFIG_DRM_AMD_DC_DMUB
int r;
-#endif
adev->dm.ddev = adev->ddev;
adev->dm.adev = adev;
dc_hardware_init(adev->dm.dc);
-#ifdef CONFIG_DRM_AMD_DC_DMUB
r = dm_dmub_hw_init(adev);
if (r) {
DRM_ERROR("DMUB interface failed to initialize: status=%d\n", r);
goto error;
}
-#endif
adev->dm.freesync_module = mod_freesync_create(adev->dm.dc);
if (!adev->dm.freesync_module) {
DRM_ERROR(
if (adev->dm.dc)
dc_deinit_callbacks(adev->dm.dc);
#endif
-#ifdef CONFIG_DRM_AMD_DC_DMUB
if (adev->dm.dc->ctx->dmub_srv) {
dc_dmub_srv_destroy(&adev->dm.dc->ctx->dmub_srv);
adev->dm.dc->ctx->dmub_srv = NULL;
amdgpu_bo_free_kernel(&adev->dm.dmub_bo,
&adev->dm.dmub_bo_gpu_addr,
&adev->dm.dmub_bo_cpu_addr);
-#endif
/* DC Destroy TODO: Replace destroy DAL */
if (adev->dm.dc)
return 0;
}
-#ifdef CONFIG_DRM_AMD_DC_DMUB
static uint32_t amdgpu_dm_dmub_reg_read(void *ctx, uint32_t address)
{
struct amdgpu_device *adev = ctx;
return 0;
}
-#endif
static int dm_sw_init(void *handle)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
-#ifdef CONFIG_DRM_AMD_DC_DMUB
int r;
r = dm_dmub_sw_init(adev);
if (r)
return r;
-#endif
-
return load_dmcu_fw(adev);
}
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
-#ifdef CONFIG_DRM_AMD_DC_DMUB
if (adev->dm.dmub_srv) {
dmub_srv_destroy(adev->dm.dmub_srv);
adev->dm.dmub_srv = NULL;
adev->dm.dmub_fw = NULL;
}
-#endif
if(adev->dm.fw_dmcu) {
release_firmware(adev->dm.fw_dmcu);
adev->dm.fw_dmcu = NULL;
struct drm_device;
struct amdgpu_dm_irq_handler_data;
struct dc;
-#ifdef CONFIG_DRM_AMD_DC_DMUB
struct amdgpu_bo;
struct dmub_srv;
-#endif
struct common_irq_params {
struct amdgpu_device *adev;
struct dc *dc;
-#ifdef CONFIG_DRM_AMD_DC_DMUB
/**
* @dmub_srv:
*
*/
uint32_t dmcub_fw_version;
-#endif
/**
* @cgs_device:
*
AMD_DISPLAY_FILES += $(AMD_DISPLAY_CORE)
AMD_DISPLAY_FILES += $(AMD_DM_REG_UPDATE)
-ifdef CONFIG_DRM_AMD_DC_DMUB
DC_DMUB += dc_dmub_srv.o
AMD_DISPLAY_DMUB = $(addprefix $(AMDDALPATH)/dc/,$(DC_DMUB))
AMD_DISPLAY_FILES += $(AMD_DISPLAY_DMUB)
-endif
-
#include "bios_parser_types_internal2.h"
#include "amdgpu.h"
-#ifdef CONFIG_DRM_AMD_DC_DMUB
#include "dc_dmub_srv.h"
#include "dc.h"
-#endif
#define DC_LOGGER \
bp->base.ctx->logger
}
}
-#ifdef CONFIG_DRM_AMD_DC_DMUB
static void encoder_control_dmcub(
struct dc_dmub_srv *dmcub,
struct dig_encoder_stream_setup_parameters_v1_5 *dig)
dc_dmub_srv_cmd_execute(dmcub);
dc_dmub_srv_wait_idle(dmcub);
}
-#endif
+
static enum bp_result encoder_control_digx_v1_5(
struct bios_parser *bp,
struct bp_encoder_control *cntl)
default:
break;
}
-#ifdef CONFIG_DRM_AMD_DC_DMUB
+
if (bp->base.ctx->dc->ctx->dmub_srv &&
bp->base.ctx->dc->debug.dmub_command_table) {
encoder_control_dmcub(bp->base.ctx->dmub_srv, ¶ms);
return BP_RESULT_OK;
}
-#endif
if (EXEC_BIOS_CMD_TABLE(digxencodercontrol, params))
result = BP_RESULT_OK;
break;
}
}
-#ifdef CONFIG_DRM_AMD_DC_DMUB
+
static void transmitter_control_dmcub(
struct dc_dmub_srv *dmcub,
struct dig_transmitter_control_parameters_v1_6 *dig)
dc_dmub_srv_cmd_execute(dmcub);
dc_dmub_srv_wait_idle(dmcub);
}
-#endif
+
static enum bp_result transmitter_control_v1_6(
struct bios_parser *bp,
struct bp_transmitter_control *cntl)
__func__, ps.param.symclk_10khz);
}
-
-#ifdef CONFIG_DRM_AMD_DC_DMUB
if (bp->base.ctx->dc->ctx->dmub_srv &&
bp->base.ctx->dc->debug.dmub_command_table) {
transmitter_control_dmcub(bp->base.ctx->dmub_srv, &ps.param);
return BP_RESULT_OK;
}
-#endif
/*color_depth not used any more, driver has deep color factor in the Phyclk*/
if (EXEC_BIOS_CMD_TABLE(dig1transmittercontrol, ps))
}
}
-#ifdef CONFIG_DRM_AMD_DC_DMUB
static void set_pixel_clock_dmcub(
struct dc_dmub_srv *dmcub,
struct set_pixel_clock_parameter_v1_7 *clk)
dc_dmub_srv_cmd_execute(dmcub);
dc_dmub_srv_wait_idle(dmcub);
}
-#endif
static enum bp_result set_pixel_clock_v7(
struct bios_parser *bp,
if (bp_params->signal_type == SIGNAL_TYPE_DVI_DUAL_LINK)
clk.miscinfo |= PIXEL_CLOCK_V7_MISC_DVI_DUALLINK_EN;
-#ifdef CONFIG_DRM_AMD_DC_DMUB
if (bp->base.ctx->dc->ctx->dmub_srv &&
bp->base.ctx->dc->debug.dmub_command_table) {
set_pixel_clock_dmcub(bp->base.ctx->dmub_srv, &clk);
return BP_RESULT_OK;
}
-#endif
+
if (EXEC_BIOS_CMD_TABLE(setpixelclock, clk))
result = BP_RESULT_OK;
}
break;
}
}
-#ifdef CONFIG_DRM_AMD_DC_DMUB
+
static void enable_disp_power_gating_dmcub(
struct dc_dmub_srv *dmcub,
struct enable_disp_power_gating_parameters_v2_1 *pwr)
dc_dmub_srv_cmd_execute(dmcub);
dc_dmub_srv_wait_idle(dmcub);
}
-#endif
+
static enum bp_result enable_disp_power_gating_v2_1(
struct bios_parser *bp,
enum controller_id crtc_id,
ps.param.enable =
bp->cmd_helper->disp_power_gating_action_to_atom(action);
-#ifdef CONFIG_DRM_AMD_DC_DMUB
if (bp->base.ctx->dc->ctx->dmub_srv &&
bp->base.ctx->dc->debug.dmub_command_table) {
enable_disp_power_gating_dmcub(bp->base.ctx->dmub_srv,
&ps.param);
return BP_RESULT_OK;
}
-#endif
+
if (EXEC_BIOS_CMD_TABLE(enabledisppowergating, ps.param))
result = BP_RESULT_OK;
#include "hubp.h"
#include "dc_link_dp.h"
-
-#ifdef CONFIG_DRM_AMD_DC_DMUB
#include "dc_dmub_srv.h"
-#endif
#ifdef CONFIG_DRM_AMD_DC_DSC_SUPPORT
#include "dsc.h"
switch (power_state) {
case DC_ACPI_CM_POWER_STATE_D0:
dc_resource_state_construct(dc, dc->current_state);
-#ifdef CONFIG_DRM_AMD_DC_DMUB
+
if (dc->ctx->dmub_srv)
dc_dmub_srv_wait_phy_init(dc->ctx->dmub_srv);
-#endif
dc->hwss.init_hw(dc);
bool disable_dp_clk_share;
bool psp_setup_panel_mode;
bool extended_aux_timeout_support;
-#ifdef CONFIG_DRM_AMD_DC_DMUB
bool dmcub_support;
-#endif
#ifdef CONFIG_DRM_AMD_DC_DCN2_0
bool hw_3d_lut;
#endif
unsigned int force_odm_combine; //bit vector based on otg inst
unsigned int force_fclk_khz;
bool disable_tri_buf;
-#ifdef CONFIG_DRM_AMD_DC_DMUB
bool dmub_offload_enabled;
bool dmcub_emulation;
bool dmub_command_table; /* for testing only */
-#endif
struct dc_bw_validation_profile bw_val_profile;
#ifdef CONFIG_DRM_AMD_DC_DSC_SUPPORT
bool disable_fec;
struct dc_bios *vbios_override;
enum dce_environment dce_environment;
-#ifdef CONFIG_DRM_AMD_DC_DMUB
struct dmub_offload_funcs *dmub_if;
struct dc_reg_helper_state *dmub_offload;
-#endif
+
struct dc_config flags;
uint32_t log_mask;
#ifdef CONFIG_DRM_AMD_DC_DCN2_0
#include "dm_services.h"
#include <stdarg.h>
-#ifdef CONFIG_DRM_AMD_DC_DMUB
#include "dc.h"
#include "dc_dmub_srv.h"
ctx->dmub_srv->reg_helper_offload.gather_in_progress = gather;
}
-#endif
struct dc_reg_value_masks {
uint32_t value;
}
}
-#ifdef CONFIG_DRM_AMD_DC_DMUB
static void dmub_flush_buffer_execute(
struct dc_reg_helper_state *offload,
const struct dc_context *ctx)
cmd_buf->reg_wait.time_out_us = time_out_us;
}
-#endif
-
uint32_t generic_reg_update_ex(const struct dc_context *ctx,
uint32_t addr, int n,
uint8_t shift1, uint32_t mask1, uint32_t field_value1,
va_end(ap);
-#ifdef CONFIG_DRM_AMD_DC_DMUB
if (ctx->dmub_srv &&
ctx->dmub_srv->reg_helper_offload.gather_in_progress)
return dmub_reg_value_pack(ctx, addr, &field_value_mask);
/* todo: return void so we can decouple code running in driver from register states */
-#endif
/* mmio write directly */
reg_val = dm_read_reg(ctx, addr);
/* mmio write directly */
reg_val = (reg_val & ~field_value_mask.mask) | field_value_mask.value;
-#ifdef CONFIG_DRM_AMD_DC_DMUB
+
if (ctx->dmub_srv &&
ctx->dmub_srv->reg_helper_offload.gather_in_progress) {
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 */
}
-#endif
+
dm_write_reg(ctx, addr, reg_val);
return reg_val;
}
}
#endif
-#ifdef CONFIG_DRM_AMD_DC_DMUB
if (ctx->dmub_srv &&
ctx->dmub_srv->reg_helper_offload.gather_in_progress &&
!ctx->dmub_srv->reg_helper_offload.should_burst_write) {
ASSERT(false);
return 0;
}
-#endif
value = cgs_read_register(ctx->cgs_device, address);
trace_amdgpu_dc_rreg(&ctx->perf_trace->read_count, address, value);
uint32_t reg_val;
int i;
-#ifdef CONFIG_DRM_AMD_DC_DMUB
if (ctx->dmub_srv &&
ctx->dmub_srv->reg_helper_offload.gather_in_progress) {
dmub_reg_wait_done_pack(ctx, addr, mask, shift, condition_value,
delay_between_poll_us * time_out_num_tries);
return;
}
-#endif
/* something is terribly wrong if time out is > 200ms. (5Hz) */
ASSERT(delay_between_poll_us * time_out_num_tries <= 3000000);
uint32_t index)
{
uint32_t value = 0;
-#ifdef CONFIG_DRM_AMD_DC_DMUB
+
// when reg read, there should not be any offload.
if (ctx->dmub_srv &&
ctx->dmub_srv->reg_helper_offload.gather_in_progress) {
ASSERT(false);
}
-#endif
dm_write_reg(ctx, addr_index, index);
value = dm_read_reg(ctx, addr_data);
return reg_val;
}
-#ifdef CONFIG_DRM_AMD_DC_DMUB
void reg_sequence_start_gather(const struct dc_context *ctx)
{
/* if reg sequence is supported and enabled, set flag to
dc_dmub_srv_wait_idle(ctx->dmub_srv);
}
}
-
-
-#endif
struct dc_link;
struct dc_sink;
struct dal;
-#ifdef CONFIG_DRM_AMD_DC_DMUB
struct dc_dmub_srv;
-#endif
/********************************
* Environment definitions
uint32_t dc_sink_id_count;
uint32_t dc_stream_id_count;
uint64_t fbc_gpu_addr;
-#ifdef CONFIG_DRM_AMD_DC_DMUB
struct dc_dmub_srv *dmub_srv;
-#endif
+
#ifdef CONFIG_DRM_AMD_DC_HDCP
struct cp_psp cp_psp;
#endif
uint32_t i;
struct dcn10_dpp *dpp = TO_DCN10_DPP(dpp_base);
-#ifdef CONFIG_DRM_AMD_DC_DMUB
REG_SEQ_START();
-#endif
+
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].green_reg);
BREAK_TO_DEBUGGER();
break;
}
-#ifdef CONFIG_DRM_AMD_DC_DMUB
+
REG_SEQ_SUBMIT();
REG_SEQ_WAIT_DONE();
-#endif
}
void dpp1_degamma_ram_select(
REG_UPDATE(CONTROL,
VTG0_ENABLE, 1);
-#ifdef CONFIG_DRM_AMD_DC_DMUB
REG_SEQ_START();
-#endif
+
/* Enable CRTC */
REG_UPDATE_2(OTG_CONTROL,
OTG_DISABLE_POINT_CNTL, 3,
OTG_MASTER_EN, 1);
-#ifdef CONFIG_DRM_AMD_DC_DMUB
REG_SEQ_SUBMIT();
REG_SEQ_WAIT_DONE();
-#endif
return true;
}
uint32_t i;
struct dcn20_mpc *mpc20 = TO_DCN20_MPC(mpc);
-#ifdef CONFIG_DRM_AMD_DC_DMUB
PERF_TRACE();
REG_SEQ_START();
-#endif
for (i = 0 ; i < num; i++) {
REG_SET(MPCC_OGAM_LUT_DATA[mpcc_id], 0, MPCC_OGAM_LUT_DATA, rgb[i].red_reg);
ASSERT(!mpc_disabled);
ASSERT(!mpc_idle);
}
-#ifdef CONFIG_DRM_AMD_DC_DMUB
+
REG_SEQ_SUBMIT();
PERF_TRACE();
REG_SEQ_WAIT_DONE();
PERF_TRACE();
-#endif
}
static void mpc2_init_mpcc(struct mpcc *mpcc, int mpcc_inst)
dc->caps.post_blend_color_processing = true;
dc->caps.force_dp_tps4_for_cp2520 = true;
dc->caps.extended_aux_timeout_support = true;
-#ifdef CONFIG_DRM_AMD_DC_DMUB
dc->caps.dmcub_support = true;
-#endif
if (dc->ctx->dce_environment == DCE_ENV_PRODUCTION_DRV)
dc->debug = debug_defaults_drv;
#undef DEPRECATED
-#ifdef CONFIG_DRM_AMD_DC_DMUB
struct dmub_srv;
struct dc_dmub_srv;
-#endif
irq_handler_idx dm_register_interrupt(
struct dc_context *ctx,
struct dc_interrupt_params *int_params,
uint32_t addr, int n,
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);
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_execute(const struct dc_context *ctx);
void reg_sequence_wait_done(const struct dc_context *ctx);
-#endif
#define FD(reg_field) reg_field ## __SHIFT, \
reg_field ## _MASK
uint8_t shift1, uint32_t mask1, uint32_t field_value1,
...);
-
-#ifdef CONFIG_DRM_AMD_DC_DMUB
/* register offload macros
*
* instead of MMIO to register directly, in some cases we want
/* wait for the last REG_SEQ_SUBMIT to finish */
#define REG_SEQ_WAIT_DONE() \
reg_sequence_wait_done(CTX)
-#endif
#endif /* DRIVERS_GPU_DRM_AMD_DC_DEV_DC_INC_REG_HELPER_H_ */
# OTHER DEALINGS IN THE SOFTWARE.
#
-ifdef CONFIG_DRM_AMD_DC_DMUB
DMUB = dmub_srv.o dmub_reg.o dmub_dcn20.o dmub_dcn21.o
AMD_DAL_DMUB = $(addprefix $(AMDDALPATH)/dmub/src/,$(DMUB))
AMD_DISPLAY_FILES += $(AMD_DAL_DMUB)
-endif