* drm/amd/display: Pass pwrseq inst for backlight and ABM
@ 2024-01-17 16:16 Alex Deucher
2024-01-17 16:49 ` Greg KH
2024-12-02 11:33 ` Christoph Biedl
0 siblings, 2 replies; 8+ messages in thread
From: Alex Deucher @ 2024-01-17 16:16 UTC (permalink / raw)
To: Greg KH, Sasha Levin, stable; +Cc: Siqueira, Rodrigo
Hi Greg, Sasha,
Please cherry pick upstream commit b17ef04bf3a4 ("drm/amd/display:
Pass pwrseq inst for backlight and ABM") to stable kernel 6.6.x and
newer.
This fixes broken backlight adjustment on some AMD platforms with eDP panels.
Thanks,
Alex
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: drm/amd/display: Pass pwrseq inst for backlight and ABM
2024-01-17 16:16 drm/amd/display: Pass pwrseq inst for backlight and ABM Alex Deucher
@ 2024-01-17 16:49 ` Greg KH
2024-01-17 17:21 ` Alex Deucher
2024-12-02 11:33 ` Christoph Biedl
1 sibling, 1 reply; 8+ messages in thread
From: Greg KH @ 2024-01-17 16:49 UTC (permalink / raw)
To: Alex Deucher; +Cc: Sasha Levin, stable, Siqueira, Rodrigo
On Wed, Jan 17, 2024 at 11:16:27AM -0500, Alex Deucher wrote:
> Hi Greg, Sasha,
>
> Please cherry pick upstream commit b17ef04bf3a4 ("drm/amd/display:
> Pass pwrseq inst for backlight and ABM") to stable kernel 6.6.x and
> newer.
It does not apply to 6.6.y, how did you test this? I've applied it to
6.7.y now.
For 6.6.y, we need a backported, and tested, version of the commit to do
anything here.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: drm/amd/display: Pass pwrseq inst for backlight and ABM
2024-01-17 16:49 ` Greg KH
@ 2024-01-17 17:21 ` Alex Deucher
2024-01-18 9:57 ` Greg KH
0 siblings, 1 reply; 8+ messages in thread
From: Alex Deucher @ 2024-01-17 17:21 UTC (permalink / raw)
To: Greg KH; +Cc: Sasha Levin, stable, Siqueira, Rodrigo
[-- Attachment #1: Type: text/plain, Size: 831 bytes --]
On Wed, Jan 17, 2024 at 11:49 AM Greg KH <gregkh@linuxfoundation.org> wrote:
>
> On Wed, Jan 17, 2024 at 11:16:27AM -0500, Alex Deucher wrote:
> > Hi Greg, Sasha,
> >
> > Please cherry pick upstream commit b17ef04bf3a4 ("drm/amd/display:
> > Pass pwrseq inst for backlight and ABM") to stable kernel 6.6.x and
> > newer.
>
> It does not apply to 6.6.y, how did you test this? I've applied it to
> 6.7.y now.
>
> For 6.6.y, we need a backported, and tested, version of the commit to do
> anything here.
Weird. `git cherry-pick -x b17ef04bf3a4346d66404454d6a646343ddc9749`
worked fine here and we tested that.
Oh, I see, there is an unused variable warning in the cherry-pick
depending on the config. That must have been what failed. Attached
patch should resolve that. Sorry for the confusion.
Alex
[-- Attachment #2: 0001-drm-amd-display-Pass-pwrseq-inst-for-backlight-and-A.patch --]
[-- Type: text/x-patch, Size: 21342 bytes --]
From d6c3483a9a8257a5b43f76f0a06e1254f043d922 Mon Sep 17 00:00:00 2001
From: Lewis Huang <lewis.huang@amd.com>
Date: Fri, 1 Dec 2023 06:25:02 -0700
Subject: [PATCH] drm/amd/display: Pass pwrseq inst for backlight and ABM
[Why]
OTG inst and pwrseq inst mapping is not align therefore we cannot use
otg_inst as pwrseq inst to get DCIO register.
[How]
1. Pass the correct pwrseq instance to dmub when set abm pipe.
2. LVTMA control index change from panel_inst to pwrseq_inst.
Fix unused variable warning in 6.6 (Alex).
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Reviewed-by: Phil Hsieh <phil.hsieh@amd.com>
Acked-by: Rodrigo Siqueira <rodrigo.siqueira@amd.com>
Signed-off-by: Lewis Huang <lewis.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit b17ef04bf3a4346d66404454d6a646343ddc9749)
---
.../drm/amd/display/dc/bios/bios_parser2.c | 4 +-
.../drm/amd/display/dc/bios/command_table2.c | 12 ++--
.../drm/amd/display/dc/bios/command_table2.h | 2 +-
.../gpu/drm/amd/display/dc/dc_bios_types.h | 2 +-
drivers/gpu/drm/amd/display/dc/dce/dmub_abm.c | 8 ++-
.../gpu/drm/amd/display/dc/dce/dmub_abm_lcd.c | 7 ++-
.../gpu/drm/amd/display/dc/dce/dmub_abm_lcd.h | 2 +-
.../display/dc/dce110/dce110_hw_sequencer.c | 16 +++---
.../drm/amd/display/dc/dcn21/dcn21_hwseq.c | 36 +++++++++---
.../amd/display/dc/dcn31/dcn31_panel_cntl.c | 5 +-
drivers/gpu/drm/amd/display/dc/inc/hw/abm.h | 3 +-
.../drm/amd/display/dc/inc/hw/panel_cntl.h | 2 +
.../drm/amd/display/dc/link/link_factory.c | 56 +++++++++++++------
.../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 14 ++++-
14 files changed, 116 insertions(+), 53 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c b/drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c
index 484d62bcf2c2..566efc43c393 100644
--- a/drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c
+++ b/drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c
@@ -1692,7 +1692,7 @@ static enum bp_result bios_parser_enable_disp_power_gating(
static enum bp_result bios_parser_enable_lvtma_control(
struct dc_bios *dcb,
uint8_t uc_pwr_on,
- uint8_t panel_instance,
+ uint8_t pwrseq_instance,
uint8_t bypass_panel_control_wait)
{
struct bios_parser *bp = BP_FROM_DCB(dcb);
@@ -1700,7 +1700,7 @@ static enum bp_result bios_parser_enable_lvtma_control(
if (!bp->cmd_tbl.enable_lvtma_control)
return BP_RESULT_FAILURE;
- return bp->cmd_tbl.enable_lvtma_control(bp, uc_pwr_on, panel_instance, bypass_panel_control_wait);
+ return bp->cmd_tbl.enable_lvtma_control(bp, uc_pwr_on, pwrseq_instance, bypass_panel_control_wait);
}
static bool bios_parser_is_accelerated_mode(
diff --git a/drivers/gpu/drm/amd/display/dc/bios/command_table2.c b/drivers/gpu/drm/amd/display/dc/bios/command_table2.c
index 90a02d7bd3da..ab0adabf9dd4 100644
--- a/drivers/gpu/drm/amd/display/dc/bios/command_table2.c
+++ b/drivers/gpu/drm/amd/display/dc/bios/command_table2.c
@@ -976,7 +976,7 @@ static unsigned int get_smu_clock_info_v3_1(struct bios_parser *bp, uint8_t id)
static enum bp_result enable_lvtma_control(
struct bios_parser *bp,
uint8_t uc_pwr_on,
- uint8_t panel_instance,
+ uint8_t pwrseq_instance,
uint8_t bypass_panel_control_wait);
static void init_enable_lvtma_control(struct bios_parser *bp)
@@ -989,7 +989,7 @@ static void init_enable_lvtma_control(struct bios_parser *bp)
static void enable_lvtma_control_dmcub(
struct dc_dmub_srv *dmcub,
uint8_t uc_pwr_on,
- uint8_t panel_instance,
+ uint8_t pwrseq_instance,
uint8_t bypass_panel_control_wait)
{
@@ -1002,8 +1002,8 @@ static void enable_lvtma_control_dmcub(
DMUB_CMD__VBIOS_LVTMA_CONTROL;
cmd.lvtma_control.data.uc_pwr_action =
uc_pwr_on;
- cmd.lvtma_control.data.panel_inst =
- panel_instance;
+ cmd.lvtma_control.data.pwrseq_inst =
+ pwrseq_instance;
cmd.lvtma_control.data.bypass_panel_control_wait =
bypass_panel_control_wait;
dm_execute_dmub_cmd(dmcub->ctx, &cmd, DM_DMUB_WAIT_TYPE_WAIT);
@@ -1012,7 +1012,7 @@ static void enable_lvtma_control_dmcub(
static enum bp_result enable_lvtma_control(
struct bios_parser *bp,
uint8_t uc_pwr_on,
- uint8_t panel_instance,
+ uint8_t pwrseq_instance,
uint8_t bypass_panel_control_wait)
{
enum bp_result result = BP_RESULT_FAILURE;
@@ -1021,7 +1021,7 @@ static enum bp_result enable_lvtma_control(
bp->base.ctx->dc->debug.dmub_command_table) {
enable_lvtma_control_dmcub(bp->base.ctx->dmub_srv,
uc_pwr_on,
- panel_instance,
+ pwrseq_instance,
bypass_panel_control_wait);
return BP_RESULT_OK;
}
diff --git a/drivers/gpu/drm/amd/display/dc/bios/command_table2.h b/drivers/gpu/drm/amd/display/dc/bios/command_table2.h
index b6d09bf6cf72..41c8c014397f 100644
--- a/drivers/gpu/drm/amd/display/dc/bios/command_table2.h
+++ b/drivers/gpu/drm/amd/display/dc/bios/command_table2.h
@@ -96,7 +96,7 @@ struct cmd_tbl {
struct bios_parser *bp, uint8_t id);
enum bp_result (*enable_lvtma_control)(struct bios_parser *bp,
uint8_t uc_pwr_on,
- uint8_t panel_instance,
+ uint8_t pwrseq_instance,
uint8_t bypass_panel_control_wait);
};
diff --git a/drivers/gpu/drm/amd/display/dc/dc_bios_types.h b/drivers/gpu/drm/amd/display/dc/dc_bios_types.h
index be9aa1a71847..26940d94d8fb 100644
--- a/drivers/gpu/drm/amd/display/dc/dc_bios_types.h
+++ b/drivers/gpu/drm/amd/display/dc/dc_bios_types.h
@@ -140,7 +140,7 @@ struct dc_vbios_funcs {
enum bp_result (*enable_lvtma_control)(
struct dc_bios *bios,
uint8_t uc_pwr_on,
- uint8_t panel_instance,
+ uint8_t pwrseq_instance,
uint8_t bypass_panel_control_wait);
enum bp_result (*get_soc_bb_info)(
diff --git a/drivers/gpu/drm/amd/display/dc/dce/dmub_abm.c b/drivers/gpu/drm/amd/display/dc/dce/dmub_abm.c
index d3e6544022b7..930fd929e93a 100644
--- a/drivers/gpu/drm/amd/display/dc/dce/dmub_abm.c
+++ b/drivers/gpu/drm/amd/display/dc/dce/dmub_abm.c
@@ -145,7 +145,11 @@ static bool dmub_abm_save_restore_ex(
return ret;
}
-static bool dmub_abm_set_pipe_ex(struct abm *abm, uint32_t otg_inst, uint32_t option, uint32_t panel_inst)
+static bool dmub_abm_set_pipe_ex(struct abm *abm,
+ uint32_t otg_inst,
+ uint32_t option,
+ uint32_t panel_inst,
+ uint32_t pwrseq_inst)
{
bool ret = false;
unsigned int feature_support;
@@ -153,7 +157,7 @@ static bool dmub_abm_set_pipe_ex(struct abm *abm, uint32_t otg_inst, uint32_t op
feature_support = abm_feature_support(abm, panel_inst);
if (feature_support == ABM_LCD_SUPPORT)
- ret = dmub_abm_set_pipe(abm, otg_inst, option, panel_inst);
+ ret = dmub_abm_set_pipe(abm, otg_inst, option, panel_inst, pwrseq_inst);
return ret;
}
diff --git a/drivers/gpu/drm/amd/display/dc/dce/dmub_abm_lcd.c b/drivers/gpu/drm/amd/display/dc/dce/dmub_abm_lcd.c
index 592a8f7a1c6d..42c802afc468 100644
--- a/drivers/gpu/drm/amd/display/dc/dce/dmub_abm_lcd.c
+++ b/drivers/gpu/drm/amd/display/dc/dce/dmub_abm_lcd.c
@@ -254,7 +254,11 @@ bool dmub_abm_save_restore(
return true;
}
-bool dmub_abm_set_pipe(struct abm *abm, uint32_t otg_inst, uint32_t option, uint32_t panel_inst)
+bool dmub_abm_set_pipe(struct abm *abm,
+ uint32_t otg_inst,
+ uint32_t option,
+ uint32_t panel_inst,
+ uint32_t pwrseq_inst)
{
union dmub_rb_cmd cmd;
struct dc_context *dc = abm->ctx;
@@ -264,6 +268,7 @@ bool dmub_abm_set_pipe(struct abm *abm, uint32_t otg_inst, uint32_t option, uint
cmd.abm_set_pipe.header.type = DMUB_CMD__ABM;
cmd.abm_set_pipe.header.sub_type = DMUB_CMD__ABM_SET_PIPE;
cmd.abm_set_pipe.abm_set_pipe_data.otg_inst = otg_inst;
+ cmd.abm_set_pipe.abm_set_pipe_data.pwrseq_inst = pwrseq_inst;
cmd.abm_set_pipe.abm_set_pipe_data.set_pipe_option = option;
cmd.abm_set_pipe.abm_set_pipe_data.panel_inst = panel_inst;
cmd.abm_set_pipe.abm_set_pipe_data.ramping_boundary = ramping_boundary;
diff --git a/drivers/gpu/drm/amd/display/dc/dce/dmub_abm_lcd.h b/drivers/gpu/drm/amd/display/dc/dce/dmub_abm_lcd.h
index 853564d7f471..07ea6c8d414f 100644
--- a/drivers/gpu/drm/amd/display/dc/dce/dmub_abm_lcd.h
+++ b/drivers/gpu/drm/amd/display/dc/dce/dmub_abm_lcd.h
@@ -44,7 +44,7 @@ bool dmub_abm_save_restore(
struct dc_context *dc,
unsigned int panel_inst,
struct abm_save_restore *pData);
-bool dmub_abm_set_pipe(struct abm *abm, uint32_t otg_inst, uint32_t option, uint32_t panel_inst);
+bool dmub_abm_set_pipe(struct abm *abm, uint32_t otg_inst, uint32_t option, uint32_t panel_inst, uint32_t pwrseq_inst);
bool dmub_abm_set_backlight_level(struct abm *abm,
unsigned int backlight_pwm_u16_16,
unsigned int frame_ramp,
diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
index 9c78e42418f3..7fbbad69064f 100644
--- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
+++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
@@ -788,7 +788,7 @@ void dce110_edp_power_control(
struct dc_context *ctx = link->ctx;
struct bp_transmitter_control cntl = { 0 };
enum bp_result bp_result;
- uint8_t panel_instance;
+ uint8_t pwrseq_instance;
if (dal_graphics_object_id_get_connector_id(link->link_enc->connector)
@@ -871,7 +871,7 @@ void dce110_edp_power_control(
cntl.coherent = false;
cntl.lanes_number = LANE_COUNT_FOUR;
cntl.hpd_sel = link->link_enc->hpd_source;
- panel_instance = link->panel_cntl->inst;
+ pwrseq_instance = link->panel_cntl->pwrseq_inst;
if (ctx->dc->ctx->dmub_srv &&
ctx->dc->debug.dmub_command_table) {
@@ -879,11 +879,11 @@ void dce110_edp_power_control(
if (cntl.action == TRANSMITTER_CONTROL_POWER_ON) {
bp_result = ctx->dc_bios->funcs->enable_lvtma_control(ctx->dc_bios,
LVTMA_CONTROL_POWER_ON,
- panel_instance, link->link_powered_externally);
+ pwrseq_instance, link->link_powered_externally);
} else {
bp_result = ctx->dc_bios->funcs->enable_lvtma_control(ctx->dc_bios,
LVTMA_CONTROL_POWER_OFF,
- panel_instance, link->link_powered_externally);
+ pwrseq_instance, link->link_powered_externally);
}
}
@@ -954,7 +954,7 @@ void dce110_edp_backlight_control(
{
struct dc_context *ctx = link->ctx;
struct bp_transmitter_control cntl = { 0 };
- uint8_t panel_instance;
+ uint8_t pwrseq_instance;
unsigned int pre_T11_delay = OLED_PRE_T11_DELAY;
unsigned int post_T7_delay = OLED_POST_T7_DELAY;
@@ -1007,7 +1007,7 @@ void dce110_edp_backlight_control(
*/
/* dc_service_sleep_in_milliseconds(50); */
/*edp 1.2*/
- panel_instance = link->panel_cntl->inst;
+ pwrseq_instance = link->panel_cntl->pwrseq_inst;
if (cntl.action == TRANSMITTER_CONTROL_BACKLIGHT_ON) {
if (!link->dc->config.edp_no_power_sequencing)
@@ -1032,11 +1032,11 @@ void dce110_edp_backlight_control(
if (cntl.action == TRANSMITTER_CONTROL_BACKLIGHT_ON)
ctx->dc_bios->funcs->enable_lvtma_control(ctx->dc_bios,
LVTMA_CONTROL_LCD_BLON,
- panel_instance, link->link_powered_externally);
+ pwrseq_instance, link->link_powered_externally);
else
ctx->dc_bios->funcs->enable_lvtma_control(ctx->dc_bios,
LVTMA_CONTROL_LCD_BLOFF,
- panel_instance, link->link_powered_externally);
+ pwrseq_instance, link->link_powered_externally);
}
link_transmitter_control(ctx->dc_bios, &cntl);
diff --git a/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hwseq.c b/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hwseq.c
index 43463d08f21b..f99b1bc49694 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hwseq.c
@@ -137,7 +137,8 @@ void dcn21_PLAT_58856_wa(struct dc_state *context, struct pipe_ctx *pipe_ctx)
pipe_ctx->stream->dpms_off = true;
}
-static bool dmub_abm_set_pipe(struct abm *abm, uint32_t otg_inst, uint32_t option, uint32_t panel_inst)
+static bool dmub_abm_set_pipe(struct abm *abm, uint32_t otg_inst,
+ uint32_t option, uint32_t panel_inst, uint32_t pwrseq_inst)
{
union dmub_rb_cmd cmd;
struct dc_context *dc = abm->ctx;
@@ -147,6 +148,7 @@ static bool dmub_abm_set_pipe(struct abm *abm, uint32_t otg_inst, uint32_t optio
cmd.abm_set_pipe.header.type = DMUB_CMD__ABM;
cmd.abm_set_pipe.header.sub_type = DMUB_CMD__ABM_SET_PIPE;
cmd.abm_set_pipe.abm_set_pipe_data.otg_inst = otg_inst;
+ cmd.abm_set_pipe.abm_set_pipe_data.pwrseq_inst = pwrseq_inst;
cmd.abm_set_pipe.abm_set_pipe_data.set_pipe_option = option;
cmd.abm_set_pipe.abm_set_pipe_data.panel_inst = panel_inst;
cmd.abm_set_pipe.abm_set_pipe_data.ramping_boundary = ramping_boundary;
@@ -179,7 +181,6 @@ void dcn21_set_abm_immediate_disable(struct pipe_ctx *pipe_ctx)
struct abm *abm = pipe_ctx->stream_res.abm;
uint32_t otg_inst = pipe_ctx->stream_res.tg->inst;
struct panel_cntl *panel_cntl = pipe_ctx->stream->link->panel_cntl;
-
struct dmcu *dmcu = pipe_ctx->stream->ctx->dc->res_pool->dmcu;
if (dmcu) {
@@ -190,9 +191,13 @@ void dcn21_set_abm_immediate_disable(struct pipe_ctx *pipe_ctx)
if (abm && panel_cntl) {
if (abm->funcs && abm->funcs->set_pipe_ex) {
abm->funcs->set_pipe_ex(abm, otg_inst, SET_ABM_PIPE_IMMEDIATELY_DISABLE,
- panel_cntl->inst);
+ panel_cntl->inst, panel_cntl->pwrseq_inst);
} else {
- dmub_abm_set_pipe(abm, otg_inst, SET_ABM_PIPE_IMMEDIATELY_DISABLE, panel_cntl->inst);
+ dmub_abm_set_pipe(abm,
+ otg_inst,
+ SET_ABM_PIPE_IMMEDIATELY_DISABLE,
+ panel_cntl->inst,
+ panel_cntl->pwrseq_inst);
}
panel_cntl->funcs->store_backlight_level(panel_cntl);
}
@@ -212,9 +217,16 @@ void dcn21_set_pipe(struct pipe_ctx *pipe_ctx)
if (abm && panel_cntl) {
if (abm->funcs && abm->funcs->set_pipe_ex) {
- abm->funcs->set_pipe_ex(abm, otg_inst, SET_ABM_PIPE_NORMAL, panel_cntl->inst);
+ abm->funcs->set_pipe_ex(abm,
+ otg_inst,
+ SET_ABM_PIPE_NORMAL,
+ panel_cntl->inst,
+ panel_cntl->pwrseq_inst);
} else {
- dmub_abm_set_pipe(abm, otg_inst, SET_ABM_PIPE_NORMAL, panel_cntl->inst);
+ dmub_abm_set_pipe(abm, otg_inst,
+ SET_ABM_PIPE_NORMAL,
+ panel_cntl->inst,
+ panel_cntl->pwrseq_inst);
}
}
}
@@ -237,9 +249,17 @@ bool dcn21_set_backlight_level(struct pipe_ctx *pipe_ctx,
if (abm && panel_cntl) {
if (abm->funcs && abm->funcs->set_pipe_ex) {
- abm->funcs->set_pipe_ex(abm, otg_inst, SET_ABM_PIPE_NORMAL, panel_cntl->inst);
+ abm->funcs->set_pipe_ex(abm,
+ otg_inst,
+ SET_ABM_PIPE_NORMAL,
+ panel_cntl->inst,
+ panel_cntl->pwrseq_inst);
} else {
- dmub_abm_set_pipe(abm, otg_inst, SET_ABM_PIPE_NORMAL, panel_cntl->inst);
+ dmub_abm_set_pipe(abm,
+ otg_inst,
+ SET_ABM_PIPE_NORMAL,
+ panel_cntl->inst,
+ panel_cntl->pwrseq_inst);
}
}
}
diff --git a/drivers/gpu/drm/amd/display/dc/dcn31/dcn31_panel_cntl.c b/drivers/gpu/drm/amd/display/dc/dcn31/dcn31_panel_cntl.c
index 217acd4e292a..d849b1eaa4a5 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn31/dcn31_panel_cntl.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn31/dcn31_panel_cntl.c
@@ -50,7 +50,7 @@ static bool dcn31_query_backlight_info(struct panel_cntl *panel_cntl, union dmub
cmd->panel_cntl.header.type = DMUB_CMD__PANEL_CNTL;
cmd->panel_cntl.header.sub_type = DMUB_CMD__PANEL_CNTL_QUERY_BACKLIGHT_INFO;
cmd->panel_cntl.header.payload_bytes = sizeof(cmd->panel_cntl.data);
- cmd->panel_cntl.data.inst = dcn31_panel_cntl->base.inst;
+ cmd->panel_cntl.data.pwrseq_inst = dcn31_panel_cntl->base.pwrseq_inst;
return dm_execute_dmub_cmd(dc_dmub_srv->ctx, cmd, DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY);
}
@@ -78,7 +78,7 @@ static uint32_t dcn31_panel_cntl_hw_init(struct panel_cntl *panel_cntl)
cmd.panel_cntl.header.type = DMUB_CMD__PANEL_CNTL;
cmd.panel_cntl.header.sub_type = DMUB_CMD__PANEL_CNTL_HW_INIT;
cmd.panel_cntl.header.payload_bytes = sizeof(cmd.panel_cntl.data);
- cmd.panel_cntl.data.inst = dcn31_panel_cntl->base.inst;
+ cmd.panel_cntl.data.pwrseq_inst = dcn31_panel_cntl->base.pwrseq_inst;
cmd.panel_cntl.data.bl_pwm_cntl = panel_cntl->stored_backlight_registers.BL_PWM_CNTL;
cmd.panel_cntl.data.bl_pwm_period_cntl = panel_cntl->stored_backlight_registers.BL_PWM_PERIOD_CNTL;
cmd.panel_cntl.data.bl_pwm_ref_div1 =
@@ -157,4 +157,5 @@ void dcn31_panel_cntl_construct(
dcn31_panel_cntl->base.funcs = &dcn31_link_panel_cntl_funcs;
dcn31_panel_cntl->base.ctx = init_data->ctx;
dcn31_panel_cntl->base.inst = init_data->inst;
+ dcn31_panel_cntl->base.pwrseq_inst = init_data->pwrseq_inst;
}
diff --git a/drivers/gpu/drm/amd/display/dc/inc/hw/abm.h b/drivers/gpu/drm/amd/display/dc/inc/hw/abm.h
index 33db15d69f23..9f521cf0fc5a 100644
--- a/drivers/gpu/drm/amd/display/dc/inc/hw/abm.h
+++ b/drivers/gpu/drm/amd/display/dc/inc/hw/abm.h
@@ -64,7 +64,8 @@ struct abm_funcs {
bool (*set_pipe_ex)(struct abm *abm,
unsigned int otg_inst,
unsigned int option,
- unsigned int panel_inst);
+ unsigned int panel_inst,
+ unsigned int pwrseq_inst);
};
#endif
diff --git a/drivers/gpu/drm/amd/display/dc/inc/hw/panel_cntl.h b/drivers/gpu/drm/amd/display/dc/inc/hw/panel_cntl.h
index 24af9d80b937..248adc1705e3 100644
--- a/drivers/gpu/drm/amd/display/dc/inc/hw/panel_cntl.h
+++ b/drivers/gpu/drm/amd/display/dc/inc/hw/panel_cntl.h
@@ -56,12 +56,14 @@ struct panel_cntl_funcs {
struct panel_cntl_init_data {
struct dc_context *ctx;
uint32_t inst;
+ uint32_t pwrseq_inst;
};
struct panel_cntl {
const struct panel_cntl_funcs *funcs;
struct dc_context *ctx;
uint32_t inst;
+ uint32_t pwrseq_inst;
/* registers setting needs to be saved and restored at InitBacklight */
struct panel_cntl_backlight_registers stored_backlight_registers;
};
diff --git a/drivers/gpu/drm/amd/display/dc/link/link_factory.c b/drivers/gpu/drm/amd/display/dc/link/link_factory.c
index e406561c2c23..2c366866f570 100644
--- a/drivers/gpu/drm/amd/display/dc/link/link_factory.c
+++ b/drivers/gpu/drm/amd/display/dc/link/link_factory.c
@@ -367,6 +367,27 @@ static enum transmitter translate_encoder_to_transmitter(
}
}
+static uint8_t translate_dig_inst_to_pwrseq_inst(struct dc_link *link)
+{
+ uint8_t pwrseq_inst = 0xF;
+
+ switch (link->eng_id) {
+ case ENGINE_ID_DIGA:
+ pwrseq_inst = 0;
+ break;
+ case ENGINE_ID_DIGB:
+ pwrseq_inst = 1;
+ break;
+ default:
+ DC_LOG_WARNING("Unsupported pwrseq engine id: %d!\n", link->eng_id);
+ ASSERT(false);
+ break;
+ }
+
+ return pwrseq_inst;
+}
+
+
static void link_destruct(struct dc_link *link)
{
int i;
@@ -594,24 +615,6 @@ static bool construct_phy(struct dc_link *link,
link->ddc_hw_inst =
dal_ddc_get_line(get_ddc_pin(link->ddc));
-
- if (link->dc->res_pool->funcs->panel_cntl_create &&
- (link->link_id.id == CONNECTOR_ID_EDP ||
- link->link_id.id == CONNECTOR_ID_LVDS)) {
- panel_cntl_init_data.ctx = dc_ctx;
- panel_cntl_init_data.inst =
- panel_cntl_init_data.ctx->dc_edp_id_count;
- link->panel_cntl =
- link->dc->res_pool->funcs->panel_cntl_create(
- &panel_cntl_init_data);
- panel_cntl_init_data.ctx->dc_edp_id_count++;
-
- if (link->panel_cntl == NULL) {
- DC_ERROR("Failed to create link panel_cntl!\n");
- goto panel_cntl_create_fail;
- }
- }
-
enc_init_data.ctx = dc_ctx;
bp_funcs->get_src_obj(dc_ctx->dc_bios, link->link_id, 0,
&enc_init_data.encoder);
@@ -642,6 +645,23 @@ static bool construct_phy(struct dc_link *link,
link->dc->res_pool->dig_link_enc_count++;
link->link_enc_hw_inst = link->link_enc->transmitter;
+
+ if (link->dc->res_pool->funcs->panel_cntl_create &&
+ (link->link_id.id == CONNECTOR_ID_EDP ||
+ link->link_id.id == CONNECTOR_ID_LVDS)) {
+ panel_cntl_init_data.ctx = dc_ctx;
+ panel_cntl_init_data.inst = panel_cntl_init_data.ctx->dc_edp_id_count;
+ panel_cntl_init_data.pwrseq_inst = translate_dig_inst_to_pwrseq_inst(link);
+ link->panel_cntl =
+ link->dc->res_pool->funcs->panel_cntl_create(
+ &panel_cntl_init_data);
+ panel_cntl_init_data.ctx->dc_edp_id_count++;
+
+ if (link->panel_cntl == NULL) {
+ DC_ERROR("Failed to create link panel_cntl!\n");
+ goto panel_cntl_create_fail;
+ }
+ }
for (i = 0; i < 4; i++) {
if (bp_funcs->get_device_tag(dc_ctx->dc_bios,
link->link_id, i,
diff --git a/drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h b/drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h
index 7afa78b918b5..d58cb7f63a4b 100644
--- a/drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h
+++ b/drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h
@@ -3301,6 +3301,16 @@ struct dmub_cmd_abm_set_pipe_data {
* TODO: Remove.
*/
uint8_t ramping_boundary;
+
+ /**
+ * PwrSeq HW Instance.
+ */
+ uint8_t pwrseq_inst;
+
+ /**
+ * Explicit padding to 4 byte boundary.
+ */
+ uint8_t pad[3];
};
/**
@@ -3715,7 +3725,7 @@ enum dmub_cmd_panel_cntl_type {
* struct dmub_cmd_panel_cntl_data - Panel control data.
*/
struct dmub_cmd_panel_cntl_data {
- uint32_t inst; /**< panel instance */
+ uint32_t pwrseq_inst; /**< pwrseq instance */
uint32_t current_backlight; /* in/out */
uint32_t bl_pwm_cntl; /* in/out */
uint32_t bl_pwm_period_cntl; /* in/out */
@@ -3742,7 +3752,7 @@ struct dmub_cmd_lvtma_control_data {
uint8_t uc_pwr_action; /**< LVTMA_ACTION */
uint8_t bypass_panel_control_wait;
uint8_t reserved_0[2]; /**< For future use */
- uint8_t panel_inst; /**< LVTMA control instance */
+ uint8_t pwrseq_inst; /**< LVTMA control instance */
uint8_t reserved_1[3]; /**< For future use */
};
--
2.42.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: drm/amd/display: Pass pwrseq inst for backlight and ABM
2024-01-17 17:21 ` Alex Deucher
@ 2024-01-18 9:57 ` Greg KH
0 siblings, 0 replies; 8+ messages in thread
From: Greg KH @ 2024-01-18 9:57 UTC (permalink / raw)
To: Alex Deucher; +Cc: Sasha Levin, stable, Siqueira, Rodrigo
On Wed, Jan 17, 2024 at 12:21:27PM -0500, Alex Deucher wrote:
> On Wed, Jan 17, 2024 at 11:49 AM Greg KH <gregkh@linuxfoundation.org> wrote:
> >
> > On Wed, Jan 17, 2024 at 11:16:27AM -0500, Alex Deucher wrote:
> > > Hi Greg, Sasha,
> > >
> > > Please cherry pick upstream commit b17ef04bf3a4 ("drm/amd/display:
> > > Pass pwrseq inst for backlight and ABM") to stable kernel 6.6.x and
> > > newer.
> >
> > It does not apply to 6.6.y, how did you test this? I've applied it to
> > 6.7.y now.
> >
> > For 6.6.y, we need a backported, and tested, version of the commit to do
> > anything here.
>
> Weird. `git cherry-pick -x b17ef04bf3a4346d66404454d6a646343ddc9749`
> worked fine here and we tested that.
>
> Oh, I see, there is an unused variable warning in the cherry-pick
> depending on the config. That must have been what failed. Attached
> patch should resolve that. Sorry for the confusion.
Thanks, now queued up.
greg k-h
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: drm/amd/display: Pass pwrseq inst for backlight and ABM
2024-01-17 16:16 drm/amd/display: Pass pwrseq inst for backlight and ABM Alex Deucher
2024-01-17 16:49 ` Greg KH
@ 2024-12-02 11:33 ` Christoph Biedl
2024-12-02 12:35 ` Greg KH
1 sibling, 1 reply; 8+ messages in thread
From: Christoph Biedl @ 2024-12-02 11:33 UTC (permalink / raw)
To: Alex Deucher; +Cc: Greg KH, Sasha Levin, stable, Siqueira, Rodrigo
[-- Attachment #1: Type: text/plain, Size: 2116 bytes --]
Alex Deucher wrote... [ back in January ]
> Please cherry pick upstream commit b17ef04bf3a4 ("drm/amd/display:
> Pass pwrseq inst for backlight and ABM") to stable kernel 6.6.x and
> newer.
>
> This fixes broken backlight adjustment on some AMD platforms with eDP panels.
Hello,
tl;dr: Was it possible to have this in 6.1.y?
after a lenghty bisect session it seems[1] this commit b17ef04bf3a4
("drm/amd/display: Pass pwrseq inst for backlight and ABM") indeed
fixes an issue with a HP mt645[2]: Without it, the backlight stays at
full brightness all the time, writing various values to the usual sysfs
place has no effect.
That commit was backported to 6.6.y (as 71be0f674070) but not to 6.1.y -
which is the series where I'd like to see that issue fixed. However, is
does not apply, lot of failed hunks and missing files. So I was
wondering whether it had been skipped deliberately because a backport
was deemed impossible - or whether it might be doable with some
more-than-usual effort. In the latter case, I might be willing to do the
task, but quite frankly, lacking any understanding of what the code
does, I'd only try to resolve the conflicts and check whether things
work.
So I'd be glad if you could give me some insight here: Would it be worth
the efforts trying to bring this to 6.1.y?
Kind regards,
Christoph
[1] Being a bit blurry here for a reason: I bisected on the 6.6.y
branch, had to skip several commits as X would no longer start, and
ended up with
| There are only 'skip'ped commits left to test.
| The first bad commit could be any of:
| 18562b1691e2280858f291d00678468cf70bda5a
| a5ba95c226b5c25cd5c8b9df29a1953c85a1531e
| 71be0f674070a5ad54a1c4fb112bb2923b28ea50
| We cannot bisect more!
where the last one looks like the most obvious candidate, even more
after reading this thread, and re-testing with that one on top of the
last usable commit indeed gave a positive result.
[2]
From lspci:
| e5:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Rembrandt [Radeon 680M] [1002:1681] (rev 0d)
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: drm/amd/display: Pass pwrseq inst for backlight and ABM
2024-12-02 11:33 ` Christoph Biedl
@ 2024-12-02 12:35 ` Greg KH
2024-12-05 13:02 ` Christoph Biedl
0 siblings, 1 reply; 8+ messages in thread
From: Greg KH @ 2024-12-02 12:35 UTC (permalink / raw)
To: Christoph Biedl; +Cc: Alex Deucher, Sasha Levin, stable, Siqueira, Rodrigo
On Mon, Dec 02, 2024 at 12:33:48PM +0100, Christoph Biedl wrote:
> Alex Deucher wrote... [ back in January ]
>
> > Please cherry pick upstream commit b17ef04bf3a4 ("drm/amd/display:
> > Pass pwrseq inst for backlight and ABM") to stable kernel 6.6.x and
> > newer.
> >
> > This fixes broken backlight adjustment on some AMD platforms with eDP panels.
>
> Hello,
>
> tl;dr: Was it possible to have this in 6.1.y?
>
> after a lenghty bisect session it seems[1] this commit b17ef04bf3a4
> ("drm/amd/display: Pass pwrseq inst for backlight and ABM") indeed
> fixes an issue with a HP mt645[2]: Without it, the backlight stays at
> full brightness all the time, writing various values to the usual sysfs
> place has no effect.
>
> That commit was backported to 6.6.y (as 71be0f674070) but not to 6.1.y -
> which is the series where I'd like to see that issue fixed. However, is
> does not apply, lot of failed hunks and missing files. So I was
> wondering whether it had been skipped deliberately because a backport
> was deemed impossible - or whether it might be doable with some
> more-than-usual effort. In the latter case, I might be willing to do the
> task, but quite frankly, lacking any understanding of what the code
> does, I'd only try to resolve the conflicts and check whether things
> work.
>
> So I'd be glad if you could give me some insight here: Would it be worth
> the efforts trying to bring this to 6.1.y?
Why not just move to 6.6.y instead? What's preventing that from
happening?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: drm/amd/display: Pass pwrseq inst for backlight and ABM
2024-12-02 12:35 ` Greg KH
@ 2024-12-05 13:02 ` Christoph Biedl
2024-12-05 14:11 ` Greg KH
0 siblings, 1 reply; 8+ messages in thread
From: Christoph Biedl @ 2024-12-05 13:02 UTC (permalink / raw)
To: Greg KH; +Cc: Alex Deucher, Sasha Levin, stable, Siqueira, Rodrigo
Greg KH wrote...
> On Mon, Dec 02, 2024 at 12:33:48PM +0100, Christoph Biedl wrote:
> > tl;dr: Was it possible to have this in 6.1.y?
(...)
> Why not just move to 6.6.y instead? What's preventing that from
> happening?
Reasons are mostly political, also switching series this is a bigger
change that naturally requires way more careful testing for regressions.
It will happen somewhen in the next year anyway, a cherry-picked fix
could have been shipped now-ish. But it seems this is not an option.
Christoph
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: drm/amd/display: Pass pwrseq inst for backlight and ABM
2024-12-05 13:02 ` Christoph Biedl
@ 2024-12-05 14:11 ` Greg KH
0 siblings, 0 replies; 8+ messages in thread
From: Greg KH @ 2024-12-05 14:11 UTC (permalink / raw)
To: Christoph Biedl; +Cc: Alex Deucher, Sasha Levin, stable, Siqueira, Rodrigo
On Thu, Dec 05, 2024 at 02:02:29PM +0100, Christoph Biedl wrote:
> Greg KH wrote...
>
> > On Mon, Dec 02, 2024 at 12:33:48PM +0100, Christoph Biedl wrote:
>
> > > tl;dr: Was it possible to have this in 6.1.y?
> (...)
> > Why not just move to 6.6.y instead? What's preventing that from
> > happening?
>
> Reasons are mostly political, also switching series this is a bigger
> change that naturally requires way more careful testing for regressions.
Then your testing infrastructure is wrong. You need to do careful
testing for every stable release, as we sometimes do "major" things in
them (like rewrite the syscall path, no one noticed that...)
Your testing framework should be the same for any kernel change, "major"
or "minor".
> It will happen somewhen in the next year anyway, a cherry-picked fix
> could have been shipped now-ish. But it seems this is not an option.
Feel free to take it for your own tree if you feel it is needed.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2024-12-05 14:11 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-17 16:16 drm/amd/display: Pass pwrseq inst for backlight and ABM Alex Deucher
2024-01-17 16:49 ` Greg KH
2024-01-17 17:21 ` Alex Deucher
2024-01-18 9:57 ` Greg KH
2024-12-02 11:33 ` Christoph Biedl
2024-12-02 12:35 ` Greg KH
2024-12-05 13:02 ` Christoph Biedl
2024-12-05 14:11 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox