AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: Harry Wentland <harry.wentland@amd.com>,
	Leo Li <sunpeng.li@amd.com>,
	Rodrigo Siqueira <rodrigo.siqueira@amd.com>,
	Hamza Mahfooz <hamza.mahfooz@amd.com>,
	Aurabindo Pillai <aurabindo.pillai@amd.com>,
	"Roman Li" <roman.li@amd.com>, Wayne Lin <wayne.lin@amd.com>,
	Tom Chung <chiahsuan.chung@amd.com>,
	Fangzhi Zuo <jerry.zuo@amd.com>,
	Zaeem Mohamed <zaeem.mohamed@amd.com>,
	Solomon Chiu <solomon.chiu@amd.com>,
	Daniel Wheeler <daniel.wheeler@amd.com>,
	Kaitlyn Tse <Kaitlyn.Tse@amd.com>,
	"Harry Vanzylldejong" <harry.vanzylldejong@amd.com>,
	Iswara Nagulendran <iswara.nagulendran@amd.com>,
	Anthony Koo <anthony.koo@amd.com>
Subject: [PATCH 25/26] drm/amd/display: Initialize new backlight_level_params structure
Date: Thu, 3 Oct 2024 17:33:43 -0600	[thread overview]
Message-ID: <20241003233509.210919-26-Rodrigo.Siqueira@amd.com> (raw)
In-Reply-To: <20241003233509.210919-1-Rodrigo.Siqueira@amd.com>

From: Kaitlyn Tse <Kaitlyn.Tse@amd.com>

[Why]
Initialize the new backlight_level_params structure as part of the ABC
framework, the information in this structure is needed to be passed down
to the DMCUB to identify the backlight control type, to adjust the
backlight of the panel and to perform any required conversions from PWM
to nits or vice versa.

[How]
Created initial framework of the backlight_level_params struct and
modified existing functions to include the new structure.

Reviewed-by: Harry Vanzylldejong <harry.vanzylldejong@amd.com>
Reviewed-by: Iswara Nagulendran <iswara.nagulendran@amd.com>
Reviewed-by: Anthony Koo <anthony.koo@amd.com>
Signed-off-by: Kaitlyn Tse <Kaitlyn.Tse@amd.com>
Signed-off-by: Rodrigo Siqueira <rodrigo.siqueira@amd.com>
---
 drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c | 5 +++--
 drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.h | 3 +--
 drivers/gpu/drm/amd/display/dc/hwss/dcn21/dcn21_hwseq.c   | 7 ++++---
 drivers/gpu/drm/amd/display/dc/hwss/dcn21/dcn21_hwseq.h   | 3 +--
 drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer.h        | 8 ++++++--
 .../display/dc/link/protocols/link_edp_panel_control.c    | 8 +++++---
 6 files changed, 20 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c b/drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c
index 9d00d8dc5ae8..c31ec44ccd8c 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c
@@ -3142,9 +3142,10 @@ static void dce110_set_cursor_attribute(struct pipe_ctx *pipe_ctx)
 }
 
 bool dce110_set_backlight_level(struct pipe_ctx *pipe_ctx,
-		uint32_t backlight_pwm_u16_16,
-		uint32_t frame_ramp)
+	struct set_backlight_level_params *params)
 {
+	uint32_t backlight_pwm_u16_16 = params->backlight_pwm_u16_16;
+	uint32_t frame_ramp = params->frame_ramp;
 	struct dc_link *link = pipe_ctx->stream->link;
 	struct dc  *dc = link->ctx->dc;
 	struct abm *abm = pipe_ctx->stream_res.abm;
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.h b/drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.h
index ed3cc3648e8e..06789ac3a224 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.h
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.h
@@ -88,8 +88,7 @@ void dce110_edp_wait_for_hpd_ready(
 		bool power_up);
 
 bool dce110_set_backlight_level(struct pipe_ctx *pipe_ctx,
-		uint32_t backlight_pwm_u16_16,
-		uint32_t frame_ramp);
+	struct set_backlight_level_params *params);
 void dce110_set_abm_immediate_disable(struct pipe_ctx *pipe_ctx);
 void dce110_set_pipe(struct pipe_ctx *pipe_ctx);
 void dce110_disable_link_output(struct dc_link *link,
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn21/dcn21_hwseq.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn21/dcn21_hwseq.c
index 1ea95f8d4cbc..630e05f32c80 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn21/dcn21_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn21/dcn21_hwseq.c
@@ -242,14 +242,15 @@ void dcn21_set_pipe(struct pipe_ctx *pipe_ctx)
 }
 
 bool dcn21_set_backlight_level(struct pipe_ctx *pipe_ctx,
-		uint32_t backlight_pwm_u16_16,
-		uint32_t frame_ramp)
+	struct set_backlight_level_params *params)
 {
 	struct dc_context *dc = pipe_ctx->stream->ctx;
 	struct abm *abm = pipe_ctx->stream_res.abm;
 	struct timing_generator *tg = pipe_ctx->stream_res.tg;
 	struct panel_cntl *panel_cntl = pipe_ctx->stream->link->panel_cntl;
 	uint32_t otg_inst;
+	uint32_t backlight_pwm_u16_16 = params->backlight_pwm_u16_16;
+	uint32_t frame_ramp = params->frame_ramp;
 
 	if (!abm || !tg || !panel_cntl)
 		return false;
@@ -257,7 +258,7 @@ bool dcn21_set_backlight_level(struct pipe_ctx *pipe_ctx,
 	otg_inst = tg->inst;
 
 	if (dc->dc->res_pool->dmcu) {
-		dce110_set_backlight_level(pipe_ctx, backlight_pwm_u16_16, frame_ramp);
+		dce110_set_backlight_level(pipe_ctx, params);
 		return true;
 	}
 
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn21/dcn21_hwseq.h b/drivers/gpu/drm/amd/display/dc/hwss/dcn21/dcn21_hwseq.h
index 9cee9bdb8de9..a7eaaa4596be 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn21/dcn21_hwseq.h
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn21/dcn21_hwseq.h
@@ -50,8 +50,7 @@ void dcn21_PLAT_58856_wa(struct dc_state *context,
 void dcn21_set_pipe(struct pipe_ctx *pipe_ctx);
 void dcn21_set_abm_immediate_disable(struct pipe_ctx *pipe_ctx);
 bool dcn21_set_backlight_level(struct pipe_ctx *pipe_ctx,
-		uint32_t backlight_pwm_u16_16,
-		uint32_t frame_ramp);
+	struct set_backlight_level_params *params);
 bool dcn21_is_abm_supported(struct dc *dc,
 		struct dc_state *context, struct dc_stream_state *stream);
 
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer.h b/drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer.h
index 2f56c36e4251..1df17c54f3a9 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer.h
+++ b/drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer.h
@@ -174,6 +174,11 @@ union block_sequence_params {
 	struct fams2_global_control_lock_fast_params fams2_global_control_lock_fast_params;
 };
 
+struct set_backlight_level_params {
+	uint32_t backlight_pwm_u16_16;
+	uint32_t frame_ramp;
+};
+
 enum block_sequence_func {
 	DMUB_SUBVP_PIPE_CONTROL_LOCK_FAST = 0,
 	OPTC_PIPE_CONTROL_LOCK,
@@ -365,8 +370,7 @@ struct hw_sequencer_funcs {
 	void (*clear_status_bits)(struct dc *dc, unsigned int mask);
 
 	bool (*set_backlight_level)(struct pipe_ctx *pipe_ctx,
-			uint32_t backlight_pwm_u16_16,
-			uint32_t frame_ramp);
+		struct set_backlight_level_params *params);
 
 	void (*set_abm_immediate_disable)(struct pipe_ctx *pipe_ctx);
 
diff --git a/drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c b/drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c
index cbea36916d35..43a467f6ce7b 100644
--- a/drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c
+++ b/drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c
@@ -521,13 +521,13 @@ bool edp_set_backlight_level(const struct dc_link *link,
 		uint32_t frame_ramp)
 {
 	struct dc  *dc = link->ctx->dc;
-
 	DC_LOGGER_INIT(link->ctx->logger);
 	DC_LOG_BACKLIGHT("New Backlight level: %d (0x%X)\n",
 			backlight_pwm_u16_16, backlight_pwm_u16_16);
 
 	if (dc_is_embedded_signal(link->connector_signal)) {
 		struct pipe_ctx *pipe_ctx = get_pipe_from_link(link);
+		struct set_backlight_level_params backlight_level_param = { 0 };
 
 		if (link->panel_cntl)
 			link->panel_cntl->stored_backlight_registers.USER_LEVEL = backlight_pwm_u16_16;
@@ -542,10 +542,12 @@ bool edp_set_backlight_level(const struct dc_link *link,
 			return false;
 		}
 
+		backlight_level_param.backlight_pwm_u16_16 = backlight_pwm_u16_16;
+		backlight_level_param.frame_ramp = frame_ramp;
+
 		dc->hwss.set_backlight_level(
 				pipe_ctx,
-				backlight_pwm_u16_16,
-				frame_ramp);
+				&backlight_level_param);
 	}
 	return true;
 }
-- 
2.45.2


  parent reply	other threads:[~2024-10-03 23:36 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-03 23:33 [PATCH 00/26] DC Patches October 3rd, 2024 Rodrigo Siqueira
2024-10-03 23:33 ` [PATCH 01/26] drm/amd/display: Unify blank_phantom and blank_pixel_data Rodrigo Siqueira
2024-10-03 23:33 ` [PATCH 02/26] drm/amd/display: skip disable CRTC in seemless bootup case Rodrigo Siqueira
2024-10-03 23:33 ` [PATCH 03/26] drm/amd/display: Flip All Planes Under OTG Master When Flip Immediate Rodrigo Siqueira
2024-10-03 23:33 ` [PATCH 04/26] drm/amd/display: Revert commit Update Interface to Check UCLK DPM Rodrigo Siqueira
2024-10-03 23:33 ` [PATCH 05/26] drm/amd/display: force TBT4 dock dsc on Rodrigo Siqueira
2024-10-03 23:33 ` [PATCH 06/26] drm/amd/display: Assign socclk in dml Rodrigo Siqueira
2024-10-03 23:33 ` [PATCH 07/26] drm/amd/display: Fix garbage or black screen when resetting otg Rodrigo Siqueira
2024-10-03 23:33 ` [PATCH 08/26] drm/amd/display: Display lost signal on playing video Rodrigo Siqueira
2024-10-03 23:33 ` [PATCH 09/26] drm/amd/display: Noitfy DMCUB of D0/D3 state in hardware init Rodrigo Siqueira
2024-10-03 23:33 ` [PATCH 10/26] drm/amd/display: Fix low black values by increasing error Rodrigo Siqueira
2024-10-03 23:33 ` [PATCH 11/26] drm/amd/display: Remove programming outstanding updates for dcn35 Rodrigo Siqueira
2024-10-03 23:33 ` [PATCH 12/26] drm/amd/display: update sr_exit latency for z8 Rodrigo Siqueira
2024-10-03 23:33 ` [PATCH 13/26] drm/amd/display: Clear update flags after update has been applied Rodrigo Siqueira
2024-10-04 12:56   ` Melissa Wen
2024-10-04 18:20     ` Matthew Schwartz
2024-10-03 23:33 ` [PATCH 14/26] drm/amd/display: fix a memleak issue when driver is removed Rodrigo Siqueira
2024-10-03 23:33 ` [PATCH 15/26] drm/amd/display: calculate final viewport before TAP optimization Rodrigo Siqueira
2024-10-03 23:33 ` [PATCH 16/26] drm/amd/display: Align static screen idle worker with IPX mode Rodrigo Siqueira
2024-10-03 23:33 ` [PATCH 17/26] drm/amd/display: Skip Invalid Streams from DSC Policy Rodrigo Siqueira
2024-10-03 23:33 ` [PATCH 18/26] drm/amd/display: Allow Latency Increase For Last Strategy Rodrigo Siqueira
2024-10-03 23:33 ` [PATCH 19/26] drm/amd/display: Move Link Encoder Assignment Out Of dc_global_validate Rodrigo Siqueira
2024-10-03 23:33 ` [PATCH 20/26] drm/amd/display: Update Interface to Check UCLK DPM Rodrigo Siqueira
2024-10-03 23:33 ` [PATCH 21/26] drm/amd/display: Add DMUB debug offset Rodrigo Siqueira
2024-10-03 23:33 ` [PATCH 22/26] drm/amd/display: Remove unnecessary assignments Rodrigo Siqueira
2024-10-03 23:33 ` [PATCH 23/26] drm/amd/display: Remove redundant assignments Rodrigo Siqueira
2024-10-03 23:33 ` [PATCH 24/26] drm/amd/display: Initialize replay_config var Rodrigo Siqueira
2024-10-03 23:33 ` Rodrigo Siqueira [this message]
2024-10-03 23:33 ` [PATCH 26/26] drm/amd/display: 3.2.304 Rodrigo Siqueira
2024-10-04 15:05 ` [PATCH 00/26] DC Patches October 3rd, 2024 Wheeler, Daniel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241003233509.210919-26-Rodrigo.Siqueira@amd.com \
    --to=rodrigo.siqueira@amd.com \
    --cc=Kaitlyn.Tse@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=anthony.koo@amd.com \
    --cc=aurabindo.pillai@amd.com \
    --cc=chiahsuan.chung@amd.com \
    --cc=daniel.wheeler@amd.com \
    --cc=hamza.mahfooz@amd.com \
    --cc=harry.vanzylldejong@amd.com \
    --cc=harry.wentland@amd.com \
    --cc=iswara.nagulendran@amd.com \
    --cc=jerry.zuo@amd.com \
    --cc=roman.li@amd.com \
    --cc=solomon.chiu@amd.com \
    --cc=sunpeng.li@amd.com \
    --cc=wayne.lin@amd.com \
    --cc=zaeem.mohamed@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox