Commit ac2e555e authored by Aurabindo Pillai's avatar Aurabindo Pillai Committed by Alex Deucher
Browse files

drm/amd/display: Add DMCUB source files and changes for DCN32/321



DMCUB is the display engine microcontroller which aids in modesetting
and other display related features.

Signed-off-by: default avatarAurabindo Pillai <aurabindo.pillai@amd.com>
Acked-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 4f29f9cf
Loading
Loading
Loading
Loading
+31 −0
Original line number Diff line number Diff line
@@ -250,6 +250,37 @@ void dc_dmub_trace_event_control(struct dc *dc, bool enable)
	dm_helpers_dmub_outbox_interrupt_control(dc->ctx, enable);
}

void dc_dmub_srv_query_caps_cmd(struct dmub_srv *dmub)
{
	union dmub_rb_cmd cmd = { 0 };
	enum dmub_status status;

	if (!dmub) {
		return;
	}

	memset(&cmd, 0, sizeof(cmd));

	/* Prepare fw command */
	cmd.query_feature_caps.header.type = DMUB_CMD__QUERY_FEATURE_CAPS;
	cmd.query_feature_caps.header.sub_type = 0;
	cmd.query_feature_caps.header.ret_status = 1;
	cmd.query_feature_caps.header.payload_bytes = sizeof(struct dmub_cmd_query_feature_caps_data);

	/* Send command to fw */
	status = dmub_srv_cmd_with_reply_data(dmub, &cmd);

	ASSERT(status == DMUB_STATUS_OK);

	/* If command was processed, copy feature caps to dmub srv */
	if (status == DMUB_STATUS_OK &&
	    cmd.query_feature_caps.header.ret_status == 0) {
		memcpy(&dmub->feature_caps,
		       &cmd.query_feature_caps.query_feature_caps_data,
		       sizeof(struct dmub_feature_caps));
	}
}

bool dc_dmub_srv_get_diagnostic_data(struct dc_dmub_srv *dc_dmub_srv, struct dmub_diagnostic_data *diag_data)
{
	if (!dc_dmub_srv || !dc_dmub_srv->dmub || !diag_data)
+2 −0
Original line number Diff line number Diff line
@@ -68,6 +68,8 @@ bool dc_dmub_srv_get_dmub_outbox0_msg(const struct dc *dc, struct dmcub_trace_bu

void dc_dmub_trace_event_control(struct dc *dc, bool enable);

void dc_dmub_srv_query_caps_cmd(struct dmub_srv *dmub);

void dc_dmub_srv_clear_inbox0_ack(struct dc_dmub_srv *dmub_srv);
void dc_dmub_srv_wait_for_inbox0_ack(struct dc_dmub_srv *dmub_srv);
void dc_dmub_srv_send_inbox0_cmd(struct dc_dmub_srv *dmub_srv, union dmub_inbox0_data_register data);
+6 −0
Original line number Diff line number Diff line
@@ -246,6 +246,7 @@ struct dmub_srv_hw_params {
	bool dpia_supported;
	bool disable_dpia;
	bool usb4_cm_version;
	bool fw_in_system_memory;
};

/**
@@ -310,6 +311,9 @@ struct dmub_srv_hw_funcs {
			      const struct dmub_window *cw0,
			      const struct dmub_window *cw1);

	void (*backdoor_load_zfb_mode)(struct dmub_srv *dmub,
			      const struct dmub_window *cw0,
			      const struct dmub_window *cw1);
	void (*setup_windows)(struct dmub_srv *dmub,
			      const struct dmub_window *cw2,
			      const struct dmub_window *cw3,
@@ -365,6 +369,7 @@ struct dmub_srv_hw_funcs {

	uint32_t (*get_gpint_dataout)(struct dmub_srv *dmub);

	void (*configure_dmub_in_system_memory)(struct dmub_srv *dmub);
	void (*clear_inbox0_ack_register)(struct dmub_srv *dmub);
	uint32_t (*read_inbox0_ack_register)(struct dmub_srv *dmub);
	void (*send_inbox0_cmd)(struct dmub_srv *dmub, union dmub_inbox0_data_register data);
@@ -412,6 +417,7 @@ struct dmub_srv {
	/* private: internal use only */
	const struct dmub_srv_common_regs *regs;
	const struct dmub_srv_dcn31_regs *regs_dcn31;
	const struct dmub_srv_dcn32_regs *regs_dcn32;

	struct dmub_srv_base_funcs funcs;
	struct dmub_srv_hw_funcs hw_funcs;
+25 −1
Original line number Diff line number Diff line
@@ -641,7 +641,10 @@ enum dmub_cmd_type {
	 * Command type used for all panel control commands.
	 */
	DMUB_CMD__PANEL_CNTL = 74,

	/**
	 * Command type used for <TODO:description>
	 */
	DMUB_CMD__CAB_FOR_SS = 75,
	/**
	 * Command type used for interfacing with DPIA.
	 */
@@ -878,6 +881,23 @@ struct dmub_rb_cmd_mall {
	uint8_t reserved2; /**< Reserved bits */
};

/**
 * enum dmub_cmd_cab_type - TODO:
 */
enum dmub_cmd_cab_type {
	DMUB_CMD__CAB_NO_IDLE_OPTIMIZATION = 0,
	DMUB_CMD__CAB_NO_DCN_REQ = 1,
	DMUB_CMD__CAB_DCN_SS_FIT_IN_CAB = 2,
};

/**
 * struct dmub_rb_cmd_cab_for_ss - TODO:
 */
struct dmub_rb_cmd_cab_for_ss {
	struct dmub_cmd_header header;
	uint8_t cab_alloc_ways; /* total number of ways */
	uint8_t debug_bits;     /* debug bits */
};
/**
 * enum dmub_cmd_idle_opt_type - Idle optimization command type.
 */
@@ -2693,6 +2713,10 @@ union dmub_rb_cmd {
	 * Definition of a DMUB_CMD__MALL command.
	 */
	struct dmub_rb_cmd_mall mall;
	/**
	 * Definition of a DMUB_CMD__CAB command.
	 */
	struct dmub_rb_cmd_cab_for_ss cab;
	/**
	 * Definition of a DMUB_CMD__IDLE_OPT_DCN_RESTORE command.
	 */
+1 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@
DMUB = dmub_srv.o dmub_srv_stat.o dmub_reg.o dmub_dcn20.o dmub_dcn21.o
DMUB += dmub_dcn30.o dmub_dcn301.o dmub_dcn302.o dmub_dcn303.o
DMUB += dmub_dcn31.o dmub_dcn315.o dmub_dcn316.o
DMUB += dmub_dcn32.o

AMD_DAL_DMUB = $(addprefix $(AMDDALPATH)/dmub/src/,$(DMUB))

Loading