Commit c2fbe663 authored by Felipe Clark's avatar Felipe Clark Committed by Alex Deucher
Browse files

drm/amd/display: Firmware assisted MCLK switch and FS



[WHY]
Memory clock switching has great potential for power savings.

[HOW]
The driver code was modified to notify the DMCUB firmware that it should
stretch the vertical blank of frames when a memory clock switch is about
to start so that no blackouts happen on the screen due to unavailability
of the frame buffer.
The driver logic to determine when such firmware assisted strategy can
be initiated is also implemented and consists on checking prerequisites
of the feature.

Acked-by: default avatarAlan Liu <HaoPing.Liu@amd.com>
Signed-off-by: default avatarFelipe Clark <felipe.clark@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent a34136a3
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -397,7 +397,6 @@ bool dc_stream_adjust_vmin_vmax(struct dc *dc,
		struct dc_crtc_timing_adjust *adjust)
{
	int i;
	bool ret = false;

	stream->adjust.v_total_max = adjust->v_total_max;
	stream->adjust.v_total_mid = adjust->v_total_mid;
@@ -412,10 +411,10 @@ bool dc_stream_adjust_vmin_vmax(struct dc *dc,
					1,
					*adjust);

			ret = true;
			return true;
		}
	}
	return ret;
	return false;
}

/**
@@ -2650,6 +2649,9 @@ static void copy_stream_update_to_stream(struct dc *dc,
	if (update->vrr_infopacket)
		stream->vrr_infopacket = *update->vrr_infopacket;

	if (update->allow_freesync)
		stream->allow_freesync = *update->allow_freesync;

	if (update->crtc_timing_adjust)
		stream->adjust = *update->crtc_timing_adjust;

+2 −0
Original line number Diff line number Diff line
@@ -27,6 +27,8 @@
#include "dc_dmub_srv.h"
#include "../dmub/dmub_srv.h"
#include "dm_helpers.h"
#include "dc_hw_types.h"
#include "core_types.h"

#define CTX dc_dmub_srv->ctx
#define DC_LOGGER CTX->logger
+4 −1
Original line number Diff line number Diff line
@@ -31,6 +31,10 @@

struct dmub_srv;
struct dc;
struct pipe_ctx;
struct dc_crtc_timing_adjust;
struct dc_crtc_timing;
struct dc_state;

struct dc_reg_helper_state {
	bool gather_in_progress;
@@ -69,7 +73,6 @@ 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);
+2 −1
Original line number Diff line number Diff line
@@ -205,6 +205,7 @@ struct dc_stream_state {
	bool use_vsc_sdp_for_colorimetry;
	bool ignore_msa_timing_param;

	bool allow_freesync;
	bool freesync_on_desktop;

	bool converter_disable_audio;
@@ -295,9 +296,9 @@ struct dc_stream_update {
	struct dc_info_packet *vrr_infopacket;
	struct dc_info_packet *vsc_infopacket;
	struct dc_info_packet *vsp_infopacket;

	bool *dpms_off;
	bool integer_scaling_update;
	bool *allow_freesync;

	struct colorspace_transform *gamut_remap;
	enum dc_color_space *output_color_space;
+0 −1
Original line number Diff line number Diff line
@@ -2613,7 +2613,6 @@ void dcn10_update_mpcc(struct dc *dc, struct pipe_ctx *pipe_ctx)
	dc->hwss.update_visual_confirm_color(dc, pipe_ctx, &blnd_cfg.black_color, mpcc_id);

	ASSERT(new_mpcc != NULL);

	hubp->opp_id = pipe_ctx->stream_res.opp->inst;
	hubp->mpcc_id = mpcc_id;
}
Loading