Commit 35dad45d authored by David Francis's avatar David Francis Committed by Alex Deucher
Browse files

drm/amd/display: Detach backlight from stream

[Why]
Backlight is conceptually a property of links, not streams.
All backlight programming is done on links, but there is a
stream property bl_pwm_level that is used to restore backlight
on dpms on and s3 resume.  This is unnecessary, as backlight
is already restored by hardware with no driver intervention.

[How]
Remove bl_pwm_level, and the stream argument to set_backlight

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=109375


Signed-off-by: default avatarDavid Francis <David.Francis@amd.com>
Reviewed-by: default avatarHarry Wentland <Harry.Wentland@amd.com>
Acked-by: default avatarAnthony Koo <Anthony.Koo@amd.com>
Acked-by: default avatarLeo Li <sunpeng.li@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 923fe495)
parent 92b0730e
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -1772,7 +1772,7 @@ static int amdgpu_dm_backlight_update_status(struct backlight_device *bd)
		+ caps.min_input_signal * 0x101;
		+ caps.min_input_signal * 0x101;


	if (dc_link_set_backlight_level(dm->backlight_link,
	if (dc_link_set_backlight_level(dm->backlight_link,
			brightness, 0, 0))
			brightness, 0))
		return 0;
		return 0;
	else
	else
		return 1;
		return 1;
+1 −11
Original line number Original line Diff line number Diff line
@@ -2190,8 +2190,7 @@ int dc_link_get_backlight_level(const struct dc_link *link)


bool dc_link_set_backlight_level(const struct dc_link *link,
bool dc_link_set_backlight_level(const struct dc_link *link,
		uint32_t backlight_pwm_u16_16,
		uint32_t backlight_pwm_u16_16,
		uint32_t frame_ramp,
		uint32_t frame_ramp)
		const struct dc_stream_state *stream)
{
{
	struct dc  *core_dc = link->ctx->dc;
	struct dc  *core_dc = link->ctx->dc;
	struct abm *abm = core_dc->res_pool->abm;
	struct abm *abm = core_dc->res_pool->abm;
@@ -2206,10 +2205,6 @@ bool dc_link_set_backlight_level(const struct dc_link *link,
		(abm->funcs->set_backlight_level_pwm == NULL))
		(abm->funcs->set_backlight_level_pwm == NULL))
		return false;
		return false;


	if (stream)
		((struct dc_stream_state *)stream)->bl_pwm_level =
				backlight_pwm_u16_16;

	use_smooth_brightness = dmcu->funcs->is_dmcu_initialized(dmcu);
	use_smooth_brightness = dmcu->funcs->is_dmcu_initialized(dmcu);


	DC_LOG_BACKLIGHT("New Backlight level: %d (0x%X)\n",
	DC_LOG_BACKLIGHT("New Backlight level: %d (0x%X)\n",
@@ -2637,11 +2632,6 @@ void core_link_enable_stream(


		if (dc_is_dp_signal(pipe_ctx->stream->signal))
		if (dc_is_dp_signal(pipe_ctx->stream->signal))
			enable_stream_features(pipe_ctx);
			enable_stream_features(pipe_ctx);

		dc_link_set_backlight_level(pipe_ctx->stream->sink->link,
				pipe_ctx->stream->bl_pwm_level,
				0,
				pipe_ctx->stream);
	}
	}


}
}
+1 −2
Original line number Original line Diff line number Diff line
@@ -146,8 +146,7 @@ static inline struct dc_link *dc_get_link_at_index(struct dc *dc, uint32_t link_
 */
 */
bool dc_link_set_backlight_level(const struct dc_link *dc_link,
bool dc_link_set_backlight_level(const struct dc_link *dc_link,
		uint32_t backlight_pwm_u16_16,
		uint32_t backlight_pwm_u16_16,
		uint32_t frame_ramp,
		uint32_t frame_ramp);
		const struct dc_stream_state *stream);


int dc_link_get_backlight_level(const struct dc_link *dc_link);
int dc_link_get_backlight_level(const struct dc_link *dc_link);


+0 −1
Original line number Original line Diff line number Diff line
@@ -91,7 +91,6 @@ struct dc_stream_state {


	/* DMCU info */
	/* DMCU info */
	unsigned int abm_level;
	unsigned int abm_level;
	unsigned int bl_pwm_level;


	/* from core_stream struct */
	/* from core_stream struct */
	struct dc_context *ctx;
	struct dc_context *ctx;