Commit 556a979d authored by Chun-Liang Chang's avatar Chun-Liang Chang Committed by Alex Deucher
Browse files

drm/amd/display: DMUB Outbound Interrupt Process-X86



[Why]
dmub would notify x86 response time violation by GPINT_DATAOUT

[How]
1. Use GPINT_DATAOUT to trigger x86 interrupt
2. Register GPINT_DATAOUT interrupt handler.
3. Trigger ACR while GPINT_DATAOUT occurred.

Signed-off-by: default avatarChun-Liang Chang <Chun-Liang.Chang@amd.com>
Reviewed-by: default avatarJun Lei <Jun.Lei@amd.com>
Acked-by: default avatarRodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 1bc6c29f
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -62,3 +62,27 @@ void dc_stat_get_dmub_notification(const struct dc *dc, struct dmub_notification
	status = dmub_srv_stat_get_notification(dmub, notify);
	ASSERT(status == DMUB_STATUS_OK);
}

/**
 *****************************************************************************
 *  Function: dc_stat_get_dmub_dataout
 *
 *  @brief
 *		Calls dmub layer to retrieve dmub gpint dataout
 *
 *  @param
 *		[in] dc: dc structure
 *		[in] dataout: dmub gpint dataout
 *
 *  @return
 *     None
 *****************************************************************************
 */
void dc_stat_get_dmub_dataout(const struct dc *dc, uint32_t *dataout)
{
	struct dmub_srv *dmub = dc->ctx->dmub_srv->dmub;
	enum dmub_status status;

	status = dmub_srv_get_gpint_dataout(dmub, dataout);
	ASSERT(status == DMUB_STATUS_OK);
}
+1 −0
Original line number Diff line number Diff line
@@ -38,5 +38,6 @@
#include "dmub/dmub_srv.h"

void dc_stat_get_dmub_notification(const struct dc *dc, struct dmub_notification *notify);
void dc_stat_get_dmub_dataout(const struct dc *dc, uint32_t *dataout);

#endif /* _DC_STAT_H_ */
+1 −1
Original line number Diff line number Diff line
@@ -152,7 +152,7 @@ enum dc_irq_source {
	DC_IRQ_SOURCE_DC6_VLINE1,
	DC_IRQ_SOURCE_DMCUB_OUTBOX,
	DC_IRQ_SOURCE_DMCUB_OUTBOX0,

	DC_IRQ_SOURCE_DMCUB_GENERAL_DATAOUT,
	DAL_IRQ_SOURCES_NUMBER
};

+18 −0
Original line number Diff line number Diff line
@@ -352,6 +352,8 @@ struct dmub_srv_hw_funcs {

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

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

	void (*send_inbox0_cmd)(struct dmub_srv *dmub, union dmub_inbox0_data_register data);
	uint32_t (*get_current_time)(struct dmub_srv *dmub);

@@ -676,6 +678,22 @@ dmub_srv_send_gpint_command(struct dmub_srv *dmub,
enum dmub_status dmub_srv_get_gpint_response(struct dmub_srv *dmub,
					     uint32_t *response);

/**
 * dmub_srv_get_gpint_dataout() - Queries the GPINT DATAOUT.
 * @dmub: the dmub service
 * @dataout: the data for the GPINT DATAOUT
 *
 * Returns the response code for the last GPINT DATAOUT interrupt.
 *
 * Can be called after software initialization.
 *
 * Return:
 *   DMUB_STATUS_OK - success
 *   DMUB_STATUS_INVALID - unspecified error
 */
enum dmub_status dmub_srv_get_gpint_dataout(struct dmub_srv *dmub,
					     uint32_t *dataout);

/**
 * dmub_flush_buffer_mem() - Read back entire frame buffer region.
 * This ensures that the write from x86 has been flushed and will not
+15 −0
Original line number Diff line number Diff line
@@ -305,6 +305,21 @@ uint32_t dmub_dcn31_get_gpint_response(struct dmub_srv *dmub)
	return REG_READ(DMCUB_SCRATCH7);
}

uint32_t dmub_dcn31_get_gpint_dataout(struct dmub_srv *dmub)
{
	uint32_t dataout = REG_READ(DMCUB_GPINT_DATAOUT);

	REG_UPDATE(DMCUB_INTERRUPT_ENABLE, DMCUB_GPINT_IH_INT_EN, 0);

	REG_WRITE(DMCUB_GPINT_DATAOUT, 0);
	REG_UPDATE(DMCUB_INTERRUPT_ACK, DMCUB_GPINT_IH_INT_ACK, 1);
	REG_UPDATE(DMCUB_INTERRUPT_ACK, DMCUB_GPINT_IH_INT_ACK, 0);

	REG_UPDATE(DMCUB_INTERRUPT_ENABLE, DMCUB_GPINT_IH_INT_EN, 1);

	return dataout;
}

union dmub_fw_boot_status dmub_dcn31_get_fw_boot_status(struct dmub_srv *dmub)
{
	union dmub_fw_boot_status status;
Loading