[PATCH] drm/amd/display: clean up some inconsistent indenting

2024-06-06 Thread Jiapeng Chong
No functional modification involved.

drivers/gpu/drm/amd/amdgpu/../display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c:529 
dcn32_auto_dpm_test_log() warn: inconsistent indenting.

Reported-by: Abaci Robot 
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=9294
Signed-off-by: Jiapeng Chong 
---
 .../display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c  | 36 +--
 1 file changed, 17 insertions(+), 19 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c 
b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c
index ff5fdc7b1198..7300e793d506 100644
--- a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c
+++ b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c
@@ -525,25 +525,23 @@ static void dcn32_auto_dpm_test_log(
 
mall_ss_size_bytes = context->bw_ctx.bw.dcn.mall_ss_size_bytes;
 
-dispclk_khz_reg= REG_READ(CLK1_CLK0_CURRENT_CNT); // DISPCLK
-dppclk_khz_reg = REG_READ(CLK1_CLK1_CURRENT_CNT); // DPPCLK
-dprefclk_khz_reg   = REG_READ(CLK1_CLK2_CURRENT_CNT); // DPREFCLK
-dcfclk_khz_reg = REG_READ(CLK1_CLK3_CURRENT_CNT); // DCFCLK
-dtbclk_khz_reg = REG_READ(CLK1_CLK4_CURRENT_CNT); // DTBCLK
-fclk_khz_reg   = REG_READ(CLK4_CLK0_CURRENT_CNT); // FCLK
-
-// Overrides for these clocks in case there is no p_state change support
-dramclk_khz_override = new_clocks->dramclk_khz;
-fclk_khz_override = new_clocks->fclk_khz;
-
-num_fclk_levels = 
clk_mgr->base.bw_params->clk_table.num_entries_per_clk.num_fclk_levels - 1;
-
-if (!new_clocks->p_state_change_support) {
-   dramclk_khz_override = clk_mgr->base.bw_params->max_memclk_mhz * 
1000;
-}
-if (!new_clocks->fclk_p_state_change_support) {
-   fclk_khz_override = 
clk_mgr->base.bw_params->clk_table.entries[num_fclk_levels].fclk_mhz * 1000;
-}
+   dispclk_khz_reg= REG_READ(CLK1_CLK0_CURRENT_CNT); // DISPCLK
+   dppclk_khz_reg = REG_READ(CLK1_CLK1_CURRENT_CNT); // DPPCLK
+   dprefclk_khz_reg   = REG_READ(CLK1_CLK2_CURRENT_CNT); // DPREFCLK
+   dcfclk_khz_reg = REG_READ(CLK1_CLK3_CURRENT_CNT); // DCFCLK
+   dtbclk_khz_reg = REG_READ(CLK1_CLK4_CURRENT_CNT); // DTBCLK
+   fclk_khz_reg   = REG_READ(CLK4_CLK0_CURRENT_CNT); // FCLK
+
+   // Overrides for these clocks in case there is no p_state change support
+   dramclk_khz_override = new_clocks->dramclk_khz;
+   fclk_khz_override = new_clocks->fclk_khz;
+
+   num_fclk_levels = 
clk_mgr->base.bw_params->clk_table.num_entries_per_clk.num_fclk_levels - 1;
+
+   if (!new_clocks->p_state_change_support)
+   dramclk_khz_override = clk_mgr->base.bw_params->max_memclk_mhz 
* 1000;
+   if (!new_clocks->fclk_p_state_change_support)
+   fclk_khz_override = 
clk_mgr->base.bw_params->clk_table.entries[num_fclk_levels].fclk_mhz * 1000;
 


//  IMPORTANT:  When adding more clocks to these logs, do NOT 
put a newline
-- 
2.20.1.7.g153144c



Re: [PATCH] drm/amd/display: clean up some inconsistent indenting

2024-05-24 Thread Alex Deucher
Applied.  Thanks!

On Thu, May 23, 2024 at 10:37 PM Jiapeng Chong
 wrote:
>
> No functional modification involved.
>
> drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c:5200 
> dc_power_down_on_boot() warn: inconsistent indenting.
>
> Reported-by: Abaci Robot 
> Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=9166
> Signed-off-by: Jiapeng Chong 
> ---
>  drivers/gpu/drm/amd/display/dc/core/dc.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c 
> b/drivers/gpu/drm/amd/display/dc/core/dc.c
> index 3a2101b052ea..4612c60edebd 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
> @@ -5194,9 +5194,7 @@ void dc_power_down_on_boot(struct dc *dc)
> }
>  }
>
> -void dc_set_power_state(
> -   struct dc *dc,
> -   enum dc_acpi_cm_power_state power_state)
> +void dc_set_power_state(struct dc *dc, enum dc_acpi_cm_power_state 
> power_state)
>  {
> if (!dc->current_state)
> return;
> --
> 2.20.1.7.g153144c
>


[PATCH] drm/amd/display: clean up some inconsistent indenting

2024-05-23 Thread Jiapeng Chong
No functional modification involved.

drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c:5200 dc_power_down_on_boot() 
warn: inconsistent indenting.

Reported-by: Abaci Robot 
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=9166
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/amd/display/dc/core/dc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c 
b/drivers/gpu/drm/amd/display/dc/core/dc.c
index 3a2101b052ea..4612c60edebd 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -5194,9 +5194,7 @@ void dc_power_down_on_boot(struct dc *dc)
}
 }
 
-void dc_set_power_state(
-   struct dc *dc,
-   enum dc_acpi_cm_power_state power_state)
+void dc_set_power_state(struct dc *dc, enum dc_acpi_cm_power_state power_state)
 {
if (!dc->current_state)
return;
-- 
2.20.1.7.g153144c



[PATCH] drm/amd/display: clean up some inconsistent indenting

2024-05-10 Thread Jiapeng Chong
No functional modification involved.

drivers/gpu/drm/amd/amdgpu/../display/dc/resource/dcn401/dcn401_resource.c:792 
dcn401_i2c_hw_create() warn: inconsistent indenting.
drivers/gpu/drm/amd/amdgpu/../display/dc/resource/dcn401/dcn401_resource.c:894 
dcn401_hubp_create() warn: inconsistent indenting.
drivers/gpu/drm/amd/amdgpu/../display/dc/resource/dcn401/dcn401_resource.c:1738 
dcn401_resource_construct() warn: inconsistent indenting.

Reported-by: Abaci Robot 
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=9002
Signed-off-by: Jiapeng Chong 
---
 .../dc/resource/dcn401/dcn401_resource.c  | 29 +--
 1 file changed, 14 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn401/dcn401_resource.c 
b/drivers/gpu/drm/amd/display/dc/resource/dcn401/dcn401_resource.c
index 75e2c62ae792..3e1bfddc6e43 100644
--- a/drivers/gpu/drm/amd/display/dc/resource/dcn401/dcn401_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/resource/dcn401/dcn401_resource.c
@@ -784,14 +784,13 @@ static struct dce_i2c_hw *dcn401_i2c_hw_create(
 
 #undef REG_STRUCT
 #define REG_STRUCT i2c_hw_regs
-   i2c_inst_regs_init(1),
-   i2c_inst_regs_init(2),
-   i2c_inst_regs_init(3),
-   i2c_inst_regs_init(4);
+   i2c_inst_regs_init(1),
+   i2c_inst_regs_init(2),
+   i2c_inst_regs_init(3),
+   i2c_inst_regs_init(4);
 
dcn2_i2c_hw_construct(dce_i2c_hw, ctx, inst,
-   _hw_regs[inst], _shifts, 
_masks);
-
+ _hw_regs[inst], _shifts, _masks);
return dce_i2c_hw;
 }
 
@@ -886,13 +885,13 @@ static struct hubp *dcn401_hubp_create(
 
 #undef REG_STRUCT
 #define REG_STRUCT hubp_regs
-   hubp_regs_init(0),
-   hubp_regs_init(1),
-   hubp_regs_init(2),
-   hubp_regs_init(3);
+   hubp_regs_init(0),
+   hubp_regs_init(1),
+   hubp_regs_init(2),
+   hubp_regs_init(3);
 
if (hubp401_construct(hubp2, ctx, inst,
-   _regs[inst], _shift, _mask))
+ _regs[inst], _shift, _mask))
return >base;
 
BREAK_TO_DEBUGGER();
@@ -1735,10 +1734,10 @@ static bool dcn401_resource_construct(
 
 #undef REG_STRUCT
 #define REG_STRUCT abm_regs
-   abm_regs_init(0),
-   abm_regs_init(1),
-   abm_regs_init(2),
-   abm_regs_init(3);
+   abm_regs_init(0),
+   abm_regs_init(1),
+   abm_regs_init(2),
+   abm_regs_init(3);
 
 #undef REG_STRUCT
 #define REG_STRUCT dccg_regs
-- 
2.20.1.7.g153144c



[PATCH] drm/amd/display: clean up some inconsistent indenting

2024-03-22 Thread Jiapeng Chong
No functional modification involved.

drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn351/dcn351_fpu.c:569 
dcn351_decide_zstate_support() warn: inconsistent indenting.

Reported-by: Abaci Robot 
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=8608
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/amd/display/dc/dml/dcn351/dcn351_fpu.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn351/dcn351_fpu.c 
b/drivers/gpu/drm/amd/display/dc/dml/dcn351/dcn351_fpu.c
index dc9e1b758ed6..1c16c5f2ce78 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn351/dcn351_fpu.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn351/dcn351_fpu.c
@@ -564,9 +564,8 @@ void dcn351_decide_zstate_support(struct dc *dc, struct 
dc_state *context)
dc->debug.minimum_z8_residency_time > 0 ? 
dc->debug.minimum_z8_residency_time : 1000;
bool allow_z8 = context->bw_ctx.dml.vba.StutterPeriod > 
(double)minmum_z8_residency;
 
-
/*for psr1/psr-su, we allow z8 and z10 based on latency, for 
replay with IPS enabled, it will enter ips2*/
-if (is_pwrseq0 && (is_psr || is_replay))
+   if (is_pwrseq0 && (is_psr || is_replay))
support = allow_z8 ? allow_z8 : 
DCN_ZSTATE_SUPPORT_DISALLOW;
 
}
-- 
2.20.1.7.g153144c



[PATCH] drm/amd/display: clean up some inconsistent indenting

2023-11-16 Thread Jiapeng Chong
No functional modification involved.

drivers/gpu/drm/amd/amdgpu/../display/dc/link/link_dpms.c:2461 
link_set_dpms_on() warn: if statement not indented.

Reported-by: Abaci Robot 
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=7579
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/amd/display/dc/link/link_dpms.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/link/link_dpms.c 
b/drivers/gpu/drm/amd/display/dc/link/link_dpms.c
index 34a4a8c0e18c..3586d7c519a3 100644
--- a/drivers/gpu/drm/amd/display/dc/link/link_dpms.c
+++ b/drivers/gpu/drm/amd/display/dc/link/link_dpms.c
@@ -2454,9 +2454,9 @@ void link_set_dpms_on(
 
/* eDP lit up by bios already, no need to enable again. */
if (pipe_ctx->stream->signal == SIGNAL_TYPE_EDP &&
-   apply_edp_fast_boot_optimization &&
-   !pipe_ctx->stream->timing.flags.DSC &&
-   !pipe_ctx->next_odm_pipe) {
+   apply_edp_fast_boot_optimization &&
+   !pipe_ctx->stream->timing.flags.DSC &&
+   !pipe_ctx->next_odm_pipe) {
pipe_ctx->stream->dpms_off = false;
update_psp_stream_config(pipe_ctx, false);
return;
-- 
2.20.1.7.g153144c



[PATCH] drm/amd/display: clean up some inconsistent indenting

2023-11-09 Thread Jiapeng Chong
No functional modification involved.

drivers/gpu/drm/amd/amdgpu/../display/dc/dml2/display_mode_util.c:118 
dml_floor() warn: if statement not indented.

Reported-by: Abaci Robot 
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=7224
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/amd/display/dc/dml2/display_mode_util.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dml2/display_mode_util.c 
b/drivers/gpu/drm/amd/display/dc/dml2/display_mode_util.c
index c247aee89caf..16f4c506a334 100644
--- a/drivers/gpu/drm/amd/display/dc/dml2/display_mode_util.c
+++ b/drivers/gpu/drm/amd/display/dc/dml2/display_mode_util.c
@@ -116,7 +116,7 @@ dml_float_t dml_ceil(dml_float_t x, dml_float_t granularity)
 dml_float_t dml_floor(dml_float_t x, dml_float_t granularity)
 {
if (granularity == 0)
-   return 0;
+   return 0;
//return (dml_float_t) (floor(x / granularity) * granularity);
return (dml_float_t)dcn_bw_floor2(x, granularity);
 }
-- 
2.20.1.7.g153144c



Re: [PATCH] drm/amd/display: clean up some inconsistent indenting

2023-10-19 Thread Alex Deucher
Applied.  Thanks!

Alex

On Wed, Oct 18, 2023 at 11:38 PM Jiapeng Chong
 wrote:
>
> No functional modification involved.
>
> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:2902 dm_resume() 
> warn: inconsistent indenting.
>
> Reported-by: Abaci Robot 
> Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=6940
> Signed-off-by: Jiapeng Chong 
> ---
>  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c 
> b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index 801f87a12ccf..0e1f8c5d7f9b 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -2899,7 +2899,7 @@ static int dm_resume(void *handle)
> }
>
> /* power on hardware */
> -dc_set_power_state(dm->dc, DC_ACPI_CM_POWER_STATE_D0);
> +   dc_set_power_state(dm->dc, DC_ACPI_CM_POWER_STATE_D0);
>
> /* program HPD filter */
> dc_resume(dm->dc);
> --
> 2.20.1.7.g153144c
>


[PATCH] drm/amd/display: clean up some inconsistent indenting

2023-10-18 Thread Jiapeng Chong
No functional modification involved.

drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:2902 dm_resume() 
warn: inconsistent indenting.

Reported-by: Abaci Robot 
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=6940
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c 
b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 801f87a12ccf..0e1f8c5d7f9b 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -2899,7 +2899,7 @@ static int dm_resume(void *handle)
}
 
/* power on hardware */
-dc_set_power_state(dm->dc, DC_ACPI_CM_POWER_STATE_D0);
+   dc_set_power_state(dm->dc, DC_ACPI_CM_POWER_STATE_D0);
 
/* program HPD filter */
dc_resume(dm->dc);
-- 
2.20.1.7.g153144c



Re: [PATCH] drm/amd/display: clean up some inconsistent indenting

2023-09-11 Thread Hamza Mahfooz

On 9/8/23 03:54, Jiapeng Chong wrote:

No functional modification involved.

drivers/gpu/drm/amd/amdgpu/../display/dc/link/link_dpms.c:2476 
link_set_dpms_on() warn: if statement not indented.

Reported-by: Abaci Robot 
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=6502
Signed-off-by: Jiapeng Chong 


Applied, thanks!


---
  drivers/gpu/drm/amd/display/dc/link/link_dpms.c | 5 ++---
  1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/link/link_dpms.c 
b/drivers/gpu/drm/amd/display/dc/link/link_dpms.c
index cd9dd270b05f..e7e528c68cb6 100644
--- a/drivers/gpu/drm/amd/display/dc/link/link_dpms.c
+++ b/drivers/gpu/drm/amd/display/dc/link/link_dpms.c
@@ -2474,9 +2474,8 @@ void link_set_dpms_on(
 */
if (pipe_ctx->stream->timing.flags.DSC) {
if (dc_is_dp_signal(pipe_ctx->stream->signal) ||
-   dc_is_virtual_signal(pipe_ctx->stream->signal))
-   link_set_dsc_enable(pipe_ctx, true);
-
+   dc_is_virtual_signal(pipe_ctx->stream->signal))
+   link_set_dsc_enable(pipe_ctx, true);
}
  
  	status = enable_link(state, pipe_ctx);

--
Hamza



[PATCH] drm/amd/display: clean up some inconsistent indenting

2023-09-08 Thread Jiapeng Chong
No functional modification involved.

drivers/gpu/drm/amd/amdgpu/../display/dc/link/link_dpms.c:2476 
link_set_dpms_on() warn: if statement not indented.

Reported-by: Abaci Robot 
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=6502
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/amd/display/dc/link/link_dpms.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/link/link_dpms.c 
b/drivers/gpu/drm/amd/display/dc/link/link_dpms.c
index cd9dd270b05f..e7e528c68cb6 100644
--- a/drivers/gpu/drm/amd/display/dc/link/link_dpms.c
+++ b/drivers/gpu/drm/amd/display/dc/link/link_dpms.c
@@ -2474,9 +2474,8 @@ void link_set_dpms_on(
 */
if (pipe_ctx->stream->timing.flags.DSC) {
if (dc_is_dp_signal(pipe_ctx->stream->signal) ||
-   dc_is_virtual_signal(pipe_ctx->stream->signal))
-   link_set_dsc_enable(pipe_ctx, true);
-
+   dc_is_virtual_signal(pipe_ctx->stream->signal))
+   link_set_dsc_enable(pipe_ctx, true);
}
 
status = enable_link(state, pipe_ctx);
-- 
2.20.1.7.g153144c



Re: [PATCH] drm/amd/display: clean up some inconsistent indenting

2023-06-02 Thread Hamza Mahfooz

On 6/2/23 02:17, Jiapeng Chong wrote:

No functional modification involved.

drivers/gpu/drm/amd/amdgpu/../display/dc/link/link_dpms.c:2377 
link_set_dpms_on() warn: inconsistent indenting.

Reported-by: Abaci Robot 
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5376
Signed-off-by: Jiapeng Chong 


Applied, thanks!


---
  drivers/gpu/drm/amd/display/dc/link/link_dpms.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/link/link_dpms.c 
b/drivers/gpu/drm/amd/display/dc/link/link_dpms.c
index 2963267fe74a..f7f1a1586f3b 100644
--- a/drivers/gpu/drm/amd/display/dc/link/link_dpms.c
+++ b/drivers/gpu/drm/amd/display/dc/link/link_dpms.c
@@ -2374,8 +2374,8 @@ void link_set_dpms_on(
}
}
  
-		if (dc_is_virtual_signal(pipe_ctx->stream->signal))

-   return;
+   if (dc_is_virtual_signal(pipe_ctx->stream->signal))
+   return;
  
  	link_enc = link_enc_cfg_get_link_enc(link);

ASSERT(link_enc);

--
Hamza



Re: [PATCH] drm/amd/display: clean up some inconsistent indenting

2023-06-02 Thread Alex Deucher
Acked-by: Alex Deucher 

On Fri, Jun 2, 2023 at 2:18 AM Jiapeng Chong
 wrote:
>
> No functional modification involved.
>
> drivers/gpu/drm/amd/amdgpu/../display/dc/link/link_dpms.c:2377 
> link_set_dpms_on() warn: inconsistent indenting.
>
> Reported-by: Abaci Robot 
> Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5376
> Signed-off-by: Jiapeng Chong 
> ---
>  drivers/gpu/drm/amd/display/dc/link/link_dpms.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/link/link_dpms.c 
> b/drivers/gpu/drm/amd/display/dc/link/link_dpms.c
> index 2963267fe74a..f7f1a1586f3b 100644
> --- a/drivers/gpu/drm/amd/display/dc/link/link_dpms.c
> +++ b/drivers/gpu/drm/amd/display/dc/link/link_dpms.c
> @@ -2374,8 +2374,8 @@ void link_set_dpms_on(
> }
> }
>
> -   if (dc_is_virtual_signal(pipe_ctx->stream->signal))
> -   return;
> +   if (dc_is_virtual_signal(pipe_ctx->stream->signal))
> +   return;
>
> link_enc = link_enc_cfg_get_link_enc(link);
> ASSERT(link_enc);
> --
> 2.20.1.7.g153144c
>


[PATCH] drm/amd/display: clean up some inconsistent indenting

2023-06-02 Thread Jiapeng Chong
No functional modification involved.

drivers/gpu/drm/amd/amdgpu/../display/dc/link/link_dpms.c:2377 
link_set_dpms_on() warn: inconsistent indenting.

Reported-by: Abaci Robot 
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5376
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/amd/display/dc/link/link_dpms.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/link/link_dpms.c 
b/drivers/gpu/drm/amd/display/dc/link/link_dpms.c
index 2963267fe74a..f7f1a1586f3b 100644
--- a/drivers/gpu/drm/amd/display/dc/link/link_dpms.c
+++ b/drivers/gpu/drm/amd/display/dc/link/link_dpms.c
@@ -2374,8 +2374,8 @@ void link_set_dpms_on(
}
}
 
-   if (dc_is_virtual_signal(pipe_ctx->stream->signal))
-   return;
+   if (dc_is_virtual_signal(pipe_ctx->stream->signal))
+   return;
 
link_enc = link_enc_cfg_get_link_enc(link);
ASSERT(link_enc);
-- 
2.20.1.7.g153144c



Re: [PATCH] drm/amd/display: Clean up some inconsistent indenting

2023-03-22 Thread Hamza Mahfooz

On 3/21/23 23:14, Jiapeng Chong wrote:

No functional modification involved.

Reported-by: Abaci Robot 
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4585
Signed-off-by: Jiapeng Chong 


Applied, thanks!


---
  drivers/gpu/drm/amd/display/modules/power/power_helpers.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/modules/power/power_helpers.c 
b/drivers/gpu/drm/amd/display/modules/power/power_helpers.c
index fa469de3e935..0d3a983cb9ec 100644
--- a/drivers/gpu/drm/amd/display/modules/power/power_helpers.c
+++ b/drivers/gpu/drm/amd/display/modules/power/power_helpers.c
@@ -758,8 +758,8 @@ bool dmcu_load_iram(struct dmcu *dmcu,
  
  	if (dmcu->dmcu_version.abm_version == 0x24) {

fill_iram_v_2_3((struct iram_table_v_2_2 *)ram_table, params, 
true);
-   result = dmcu->funcs->load_iram(
-   dmcu, 0, (char *)(_table), 
IRAM_RESERVE_AREA_START_V2_2);
+   result = dmcu->funcs->load_iram(dmcu, 0, (char *)(_table),
+   IRAM_RESERVE_AREA_START_V2_2);
} else if (dmcu->dmcu_version.abm_version == 0x23) {
fill_iram_v_2_3((struct iram_table_v_2_2 *)ram_table, params, 
true);
  


--
Hamza



[PATCH] drm/amd/display: Clean up some inconsistent indenting

2023-03-21 Thread Jiapeng Chong
No functional modification involved.

Reported-by: Abaci Robot 
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4585
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/amd/display/modules/power/power_helpers.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/modules/power/power_helpers.c 
b/drivers/gpu/drm/amd/display/modules/power/power_helpers.c
index fa469de3e935..0d3a983cb9ec 100644
--- a/drivers/gpu/drm/amd/display/modules/power/power_helpers.c
+++ b/drivers/gpu/drm/amd/display/modules/power/power_helpers.c
@@ -758,8 +758,8 @@ bool dmcu_load_iram(struct dmcu *dmcu,
 
if (dmcu->dmcu_version.abm_version == 0x24) {
fill_iram_v_2_3((struct iram_table_v_2_2 *)ram_table, params, 
true);
-   result = dmcu->funcs->load_iram(
-   dmcu, 0, (char *)(_table), 
IRAM_RESERVE_AREA_START_V2_2);
+   result = dmcu->funcs->load_iram(dmcu, 0, (char *)(_table),
+   IRAM_RESERVE_AREA_START_V2_2);
} else if (dmcu->dmcu_version.abm_version == 0x23) {
fill_iram_v_2_3((struct iram_table_v_2_2 *)ram_table, params, 
true);
 
-- 
2.20.1.7.g153144c



Re: [PATCH] drm/amd/display: Clean up some inconsistent indenting

2023-02-23 Thread Alex Deucher
Wrong subject line?  Should be drm/gma500?

Alex

On Mon, Feb 20, 2023 at 10:45 PM Jiapeng Chong
 wrote:
>
> No functional modification involved.
>
> drivers/gpu/drm/gma500/cdv_device.c:218 cdv_errata() warn: inconsistent 
> indenting.
>
> Reported-by: Abaci Robot 
> Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4126
> Signed-off-by: Jiapeng Chong 
> ---
>  drivers/gpu/drm/gma500/cdv_device.c | 27 ---
>  1 file changed, 16 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/gpu/drm/gma500/cdv_device.c 
> b/drivers/gpu/drm/gma500/cdv_device.c
> index 3e83299113e3..765f359365b9 100644
> --- a/drivers/gpu/drm/gma500/cdv_device.c
> +++ b/drivers/gpu/drm/gma500/cdv_device.c
> @@ -78,7 +78,8 @@ static u32 cdv_get_max_backlight(struct drm_device *dev)
> if (max == 0) {
> DRM_DEBUG_KMS("LVDS Panel PWM value is 0!\n");
> /* i915 does this, I believe which means that we should not
> -* smash PWM control as firmware will take control of it. */
> +* smash PWM control as firmware will take control of it.
> +*/
> return 1;
> }
>
> @@ -149,6 +150,7 @@ static inline u32 CDV_MSG_READ32(int domain, uint port, 
> uint offset)
> int mcr = (0x10<<24) | (port << 16) | (offset << 8);
> uint32_t ret_val = 0;
> struct pci_dev *pci_root = pci_get_domain_bus_and_slot(domain, 0, 0);
> +
> pci_write_config_dword(pci_root, 0xD0, mcr);
> pci_read_config_dword(pci_root, 0xD4, _val);
> pci_dev_put(pci_root);
> @@ -160,6 +162,7 @@ static inline void CDV_MSG_WRITE32(int domain, uint port, 
> uint offset,
>  {
> int mcr = (0x11<<24) | (port << 16) | (offset << 8) | 0xF0;
> struct pci_dev *pci_root = pci_get_domain_bus_and_slot(domain, 0, 0);
> +
> pci_write_config_dword(pci_root, 0xD4, value);
> pci_write_config_dword(pci_root, 0xD0, mcr);
> pci_dev_put(pci_root);
> @@ -180,10 +183,8 @@ static void cdv_init_pm(struct drm_device *dev)
> int domain = pci_domain_nr(pdev->bus);
> int i;
>
> -   dev_priv->apm_base = CDV_MSG_READ32(domain, PSB_PUNIT_PORT,
> -   PSB_APMBA) & 0x;
> -   dev_priv->ospm_base = CDV_MSG_READ32(domain, PSB_PUNIT_PORT,
> -   PSB_OSPMBA) & 0x;
> +   dev_priv->apm_base = CDV_MSG_READ32(domain, PSB_PUNIT_PORT, 
> PSB_APMBA) & 0x;
> +   dev_priv->ospm_base = CDV_MSG_READ32(domain, PSB_PUNIT_PORT, 
> PSB_OSPMBA) & 0x;
>
> /* Power status */
> pwr_cnt = inl(dev_priv->apm_base + PSB_APM_CMD);
> @@ -196,6 +197,7 @@ static void cdv_init_pm(struct drm_device *dev)
> /* Wait for the GPU power */
> for (i = 0; i < 5; i++) {
> u32 pwr_sts = inl(dev_priv->apm_base + PSB_APM_STS);
> +
> if ((pwr_sts & PSB_PWRGT_GFX_MASK) == 0)
> return;
> udelay(10);
> @@ -215,7 +217,7 @@ static void cdv_errata(struct drm_device *dev)
>  *  Bonus Launch to work around the issue, by degrading
>  *  performance.
>  */
> -CDV_MSG_WRITE32(pci_domain_nr(pdev->bus), 3, 0x30, 0x08027108);
> +   CDV_MSG_WRITE32(pci_domain_nr(pdev->bus), 3, 0x30, 0x08027108);
>  }
>
>  /**
> @@ -401,20 +403,21 @@ static int cdv_power_up(struct drm_device *dev)
>
>  static void cdv_hotplug_work_func(struct work_struct *work)
>  {
> -struct drm_psb_private *dev_priv = container_of(work, struct 
> drm_psb_private,
> +   struct drm_psb_private *dev_priv = container_of(work, struct 
> drm_psb_private,
> hotplug_work);
> struct drm_device *dev = _priv->dev;
>
> -/* Just fire off a uevent and let userspace tell us what to do */
> -drm_helper_hpd_irq_event(dev);
> +   /* Just fire off a uevent and let userspace tell us what to do */
> +   drm_helper_hpd_irq_event(dev);
>  }
>
>  /* The core driver has received a hotplug IRQ. We are in IRQ context
> -   so extract the needed information and kick off queued processing */
> -
> + * so extract the needed information and kick off queued processing
> + */
>  static int cdv_hotplug_event(struct drm_device *dev)
>  {
> struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
> +
> schedule_work(_priv->hotplug_work);
> REG_WRITE(PORT_HOTPLUG_STAT, REG_READ(PORT_HOTPLUG_STAT));
> return 1;
> @@ -424,6 +427,7 @@ static void cdv_hotplug_enable(struct drm_device *dev, 
> bool on)
>  {
> if (on) {
> u32 hotplug = REG_READ(PORT_HOTPLUG_EN);
> +
> hotplug |= HDMIB_HOTPLUG_INT_EN | HDMIC_HOTPLUG_INT_EN |
>HDMID_HOTPLUG_INT_EN | CRT_HOTPLUG_INT_EN;
> REG_WRITE(PORT_HOTPLUG_EN, hotplug);
> @@ -549,6 +553,7 @@ static 

[PATCH] drm/amd/display: Clean up some inconsistent indenting

2023-02-20 Thread Jiapeng Chong
No functional modification involved.

drivers/gpu/drm/gma500/cdv_device.c:218 cdv_errata() warn: inconsistent 
indenting.

Reported-by: Abaci Robot 
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4126
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/gma500/cdv_device.c | 27 ---
 1 file changed, 16 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/gma500/cdv_device.c 
b/drivers/gpu/drm/gma500/cdv_device.c
index 3e83299113e3..765f359365b9 100644
--- a/drivers/gpu/drm/gma500/cdv_device.c
+++ b/drivers/gpu/drm/gma500/cdv_device.c
@@ -78,7 +78,8 @@ static u32 cdv_get_max_backlight(struct drm_device *dev)
if (max == 0) {
DRM_DEBUG_KMS("LVDS Panel PWM value is 0!\n");
/* i915 does this, I believe which means that we should not
-* smash PWM control as firmware will take control of it. */
+* smash PWM control as firmware will take control of it.
+*/
return 1;
}
 
@@ -149,6 +150,7 @@ static inline u32 CDV_MSG_READ32(int domain, uint port, 
uint offset)
int mcr = (0x10<<24) | (port << 16) | (offset << 8);
uint32_t ret_val = 0;
struct pci_dev *pci_root = pci_get_domain_bus_and_slot(domain, 0, 0);
+
pci_write_config_dword(pci_root, 0xD0, mcr);
pci_read_config_dword(pci_root, 0xD4, _val);
pci_dev_put(pci_root);
@@ -160,6 +162,7 @@ static inline void CDV_MSG_WRITE32(int domain, uint port, 
uint offset,
 {
int mcr = (0x11<<24) | (port << 16) | (offset << 8) | 0xF0;
struct pci_dev *pci_root = pci_get_domain_bus_and_slot(domain, 0, 0);
+
pci_write_config_dword(pci_root, 0xD4, value);
pci_write_config_dword(pci_root, 0xD0, mcr);
pci_dev_put(pci_root);
@@ -180,10 +183,8 @@ static void cdv_init_pm(struct drm_device *dev)
int domain = pci_domain_nr(pdev->bus);
int i;
 
-   dev_priv->apm_base = CDV_MSG_READ32(domain, PSB_PUNIT_PORT,
-   PSB_APMBA) & 0x;
-   dev_priv->ospm_base = CDV_MSG_READ32(domain, PSB_PUNIT_PORT,
-   PSB_OSPMBA) & 0x;
+   dev_priv->apm_base = CDV_MSG_READ32(domain, PSB_PUNIT_PORT, PSB_APMBA) 
& 0x;
+   dev_priv->ospm_base = CDV_MSG_READ32(domain, PSB_PUNIT_PORT, 
PSB_OSPMBA) & 0x;
 
/* Power status */
pwr_cnt = inl(dev_priv->apm_base + PSB_APM_CMD);
@@ -196,6 +197,7 @@ static void cdv_init_pm(struct drm_device *dev)
/* Wait for the GPU power */
for (i = 0; i < 5; i++) {
u32 pwr_sts = inl(dev_priv->apm_base + PSB_APM_STS);
+
if ((pwr_sts & PSB_PWRGT_GFX_MASK) == 0)
return;
udelay(10);
@@ -215,7 +217,7 @@ static void cdv_errata(struct drm_device *dev)
 *  Bonus Launch to work around the issue, by degrading
 *  performance.
 */
-CDV_MSG_WRITE32(pci_domain_nr(pdev->bus), 3, 0x30, 0x08027108);
+   CDV_MSG_WRITE32(pci_domain_nr(pdev->bus), 3, 0x30, 0x08027108);
 }
 
 /**
@@ -401,20 +403,21 @@ static int cdv_power_up(struct drm_device *dev)
 
 static void cdv_hotplug_work_func(struct work_struct *work)
 {
-struct drm_psb_private *dev_priv = container_of(work, struct 
drm_psb_private,
+   struct drm_psb_private *dev_priv = container_of(work, struct 
drm_psb_private,
hotplug_work);
struct drm_device *dev = _priv->dev;
 
-/* Just fire off a uevent and let userspace tell us what to do */
-drm_helper_hpd_irq_event(dev);
+   /* Just fire off a uevent and let userspace tell us what to do */
+   drm_helper_hpd_irq_event(dev);
 }
 
 /* The core driver has received a hotplug IRQ. We are in IRQ context
-   so extract the needed information and kick off queued processing */
-
+ * so extract the needed information and kick off queued processing
+ */
 static int cdv_hotplug_event(struct drm_device *dev)
 {
struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
+
schedule_work(_priv->hotplug_work);
REG_WRITE(PORT_HOTPLUG_STAT, REG_READ(PORT_HOTPLUG_STAT));
return 1;
@@ -424,6 +427,7 @@ static void cdv_hotplug_enable(struct drm_device *dev, bool 
on)
 {
if (on) {
u32 hotplug = REG_READ(PORT_HOTPLUG_EN);
+
hotplug |= HDMIB_HOTPLUG_INT_EN | HDMIC_HOTPLUG_INT_EN |
   HDMID_HOTPLUG_INT_EN | CRT_HOTPLUG_INT_EN;
REG_WRITE(PORT_HOTPLUG_EN, hotplug);
@@ -549,6 +553,7 @@ static const struct psb_offset cdv_regmap[2] = {
 static int cdv_chip_setup(struct drm_device *dev)
 {
struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
+
INIT_WORK(_priv->hotplug_work, cdv_hotplug_work_func);
 
dev_priv->use_msi = true;
-- 
2.20.1.7.g153144c



Re: [PATCH] drm/amd/display: clean up some inconsistent indenting

2022-05-13 Thread Alex Deucher
Applied.  Thanks!

Alex

On Thu, May 12, 2022 at 3:19 AM Jiapeng Chong
 wrote:
>
> Eliminate the follow smatch warning:
>
> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:9687
> amdgpu_dm_atomic_commit_tail() warn: inconsistent indenting.
>
> Reported-by: Abaci Robot 
> Signed-off-by: Jiapeng Chong 
> ---
>  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 7 ---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c 
> b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index e2b57cf6506c..a92cfb055c15 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -9681,9 +9681,10 @@ static void amdgpu_dm_atomic_commit_tail(struct 
> drm_atomic_state *state)
> dm_enable_per_frame_crtc_master_sync(dc_state);
> mutex_lock(>dc_lock);
> WARN_ON(!dc_commit_state(dm->dc, dc_state));
> -   /* Allow idle optimization when vblank count is 0 for display 
> off */
> -   if (dm->active_vblank_irq_count == 0)
> -   dc_allow_idle_optimizations(dm->dc,true);
> +
> +   /* Allow idle optimization when vblank count is 0 for display 
> off */
> +   if (dm->active_vblank_irq_count == 0)
> +   dc_allow_idle_optimizations(dm->dc, true);
> mutex_unlock(>dc_lock);
> }
>
> --
> 2.20.1.7.g153144c
>


[PATCH] drm/amd/display: clean up some inconsistent indenting

2022-05-12 Thread Jiapeng Chong
Eliminate the follow smatch warning:

drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:9687
amdgpu_dm_atomic_commit_tail() warn: inconsistent indenting.

Reported-by: Abaci Robot 
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c 
b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index e2b57cf6506c..a92cfb055c15 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -9681,9 +9681,10 @@ static void amdgpu_dm_atomic_commit_tail(struct 
drm_atomic_state *state)
dm_enable_per_frame_crtc_master_sync(dc_state);
mutex_lock(>dc_lock);
WARN_ON(!dc_commit_state(dm->dc, dc_state));
-   /* Allow idle optimization when vblank count is 0 for display 
off */
-   if (dm->active_vblank_irq_count == 0)
-   dc_allow_idle_optimizations(dm->dc,true);
+
+   /* Allow idle optimization when vblank count is 0 for display 
off */
+   if (dm->active_vblank_irq_count == 0)
+   dc_allow_idle_optimizations(dm->dc, true);
mutex_unlock(>dc_lock);
}
 
-- 
2.20.1.7.g153144c



Re: [PATCH] drm/amd/display: Clean up some inconsistent indenting

2021-11-12 Thread Alex Deucher
Applied.  Thanks!

Alex

On Thu, Nov 11, 2021 at 5:09 AM Christian König
 wrote:
>
>
>
> Am 11.11.21 um 11:03 schrieb Jiapeng Chong:
> > Eliminate the follow smatch warning:
> >
> > drivers/gpu/drm/amd/amdgpu/../display/dmub/src/dmub_srv.c:622
> > dmub_srv_cmd_execute() warn: inconsistent indenting.
> >
> > Reported-by: Abaci Robot 
> > Signed-off-by: Jiapeng Chong 
>
> Reviewed-by: Christian König 
>
> > ---
> >   drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c 
> > b/drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c
> > index 56a0332..e9fadf1 100644
> > --- a/drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c
> > +++ b/drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c
> > @@ -618,8 +618,8 @@ enum dmub_status dmub_srv_cmd_execute(struct dmub_srv 
> > *dmub)
> >* read back stale, fully invalid or partially invalid data.
> >*/
> >   dmub_rb_flush_pending(>inbox1_rb);
> > + dmub->hw_funcs.set_inbox1_wptr(dmub, dmub->inbox1_rb.wrpt);
> >
> > - dmub->hw_funcs.set_inbox1_wptr(dmub, dmub->inbox1_rb.wrpt);
> >   return DMUB_STATUS_OK;
> >   }
> >
>


Re: [PATCH] drm/amd/display: Clean up some inconsistent indenting

2021-11-11 Thread Christian König




Am 11.11.21 um 11:03 schrieb Jiapeng Chong:

Eliminate the follow smatch warning:

drivers/gpu/drm/amd/amdgpu/../display/dmub/src/dmub_srv.c:622
dmub_srv_cmd_execute() warn: inconsistent indenting.

Reported-by: Abaci Robot 
Signed-off-by: Jiapeng Chong 


Reviewed-by: Christian König 


---
  drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c 
b/drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c
index 56a0332..e9fadf1 100644
--- a/drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c
+++ b/drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c
@@ -618,8 +618,8 @@ enum dmub_status dmub_srv_cmd_execute(struct dmub_srv *dmub)
 * read back stale, fully invalid or partially invalid data.
 */
dmub_rb_flush_pending(>inbox1_rb);
+   dmub->hw_funcs.set_inbox1_wptr(dmub, dmub->inbox1_rb.wrpt);
  
-		dmub->hw_funcs.set_inbox1_wptr(dmub, dmub->inbox1_rb.wrpt);

return DMUB_STATUS_OK;
  }
  




Re: [PATCH] drm/amd/display: clean up some inconsistent indenting

2021-11-11 Thread Christian König

Am 11.11.21 um 10:58 schrieb Jiapeng Chong:

Eliminate the follow smatch warning:

drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_debugfs.c:2245
dp_dsc_slice_bpg_offset_read() warn: inconsistent indenting.

drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_debugfs.c:2044
dp_dsc_pic_width_read() warn: inconsistent indenting.

drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_debugfs.c:2101
dp_dsc_pic_height_read() warn: inconsistent indenting.

drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_debugfs.c:2173
dp_dsc_chunk_size_read() warn: inconsistent indenting.

drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_debugfs.c:1868
dp_dsc_bits_per_pixel_read() warn: inconsistent indenting.

drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_debugfs.c:1965
dp_dsc_bits_per_pixel_write() warn: inconsistent indenting.

drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_debugfs.c:1787
dp_dsc_slice_height_write() warn: inconsistent indenting.

drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_debugfs.c:1602
dp_dsc_slice_width_write() warn: inconsistent indenting.

drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_debugfs.c:1687
dp_dsc_slice_height_read() warn: inconsistent indenting.

vers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_debugfs.c:1417
dp_dsc_clock_en_write() warn: inconsistent indenting.

drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_debugfs.c:1502
dp_dsc_slice_width_read() warn: inconsistent indenting.

drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_debugfs.c:1315
dp_dsc_clock_en_read() warn: inconsistent indenting.

Reported-by: Abaci Robot 
Signed-off-by: Jiapeng Chong 


Looks like the same code was copied over and over again, maybe make this 
an even wider cleanup and add a helper function to find the pipe_ctx for 
a specific dc_link.


Regards,
Christian.


---
  .../drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c  | 72 +++---
  1 file changed, 36 insertions(+), 36 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c 
b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
index 9d43ecb..50ef248 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
@@ -1312,9 +1312,9 @@ static ssize_t dp_dsc_clock_en_read(struct file *f, char 
__user *buf,
  
  	for (i = 0; i < MAX_PIPES; i++) {

pipe_ctx = 
>dc_link->dc->current_state->res_ctx.pipe_ctx[i];
-   if (pipe_ctx && pipe_ctx->stream &&
-   pipe_ctx->stream->link == aconnector->dc_link)
-   break;
+   if (pipe_ctx && pipe_ctx->stream &&
+   pipe_ctx->stream->link == aconnector->dc_link)
+   break;
}
  
  	if (!pipe_ctx)

@@ -1414,9 +1414,9 @@ static ssize_t dp_dsc_clock_en_write(struct file *f, 
const char __user *buf,
  
  	for (i = 0; i < MAX_PIPES; i++) {

pipe_ctx = 
>dc_link->dc->current_state->res_ctx.pipe_ctx[i];
-   if (pipe_ctx && pipe_ctx->stream &&
-   pipe_ctx->stream->link == aconnector->dc_link)
-   break;
+   if (pipe_ctx && pipe_ctx->stream &&
+   pipe_ctx->stream->link == aconnector->dc_link)
+   break;
}
  
  	if (!pipe_ctx || !pipe_ctx->stream)

@@ -1499,9 +1499,9 @@ static ssize_t dp_dsc_slice_width_read(struct file *f, 
char __user *buf,
  
  	for (i = 0; i < MAX_PIPES; i++) {

pipe_ctx = 
>dc_link->dc->current_state->res_ctx.pipe_ctx[i];
-   if (pipe_ctx && pipe_ctx->stream &&
-   pipe_ctx->stream->link == aconnector->dc_link)
-   break;
+   if (pipe_ctx && pipe_ctx->stream &&
+   pipe_ctx->stream->link == aconnector->dc_link)
+   break;
}
  
  	if (!pipe_ctx)

@@ -1599,9 +1599,9 @@ static ssize_t dp_dsc_slice_width_write(struct file *f, 
const char __user *buf,
  
  	for (i = 0; i < MAX_PIPES; i++) {

pipe_ctx = 
>dc_link->dc->current_state->res_ctx.pipe_ctx[i];
-   if (pipe_ctx && pipe_ctx->stream &&
-   pipe_ctx->stream->link == aconnector->dc_link)
-   break;
+   if (pipe_ctx && pipe_ctx->stream &&
+   pipe_ctx->stream->link == aconnector->dc_link)
+   break;
}
  
  	if (!pipe_ctx || !pipe_ctx->stream)

@@ -1684,9 +1684,9 @@ static ssize_t dp_dsc_slice_height_read(struct file *f, 
char __user *buf,
  
  	for (i = 0; i < MAX_PIPES; i++) {

pipe_ctx = 
>dc_link->dc->current_state->res_ctx.pipe_ctx[i];
-   if (pipe_ctx && pipe_ctx->stream &&
-   pipe_ctx->stream->link == 

[PATCH] drm/amd/display: Clean up some inconsistent indenting

2021-11-11 Thread Jiapeng Chong
Eliminate the follow smatch warning:

drivers/gpu/drm/amd/amdgpu/../display/dmub/src/dmub_srv.c:622
dmub_srv_cmd_execute() warn: inconsistent indenting.

Reported-by: Abaci Robot 
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c 
b/drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c
index 56a0332..e9fadf1 100644
--- a/drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c
+++ b/drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c
@@ -618,8 +618,8 @@ enum dmub_status dmub_srv_cmd_execute(struct dmub_srv *dmub)
 * read back stale, fully invalid or partially invalid data.
 */
dmub_rb_flush_pending(>inbox1_rb);
+   dmub->hw_funcs.set_inbox1_wptr(dmub, dmub->inbox1_rb.wrpt);
 
-   dmub->hw_funcs.set_inbox1_wptr(dmub, dmub->inbox1_rb.wrpt);
return DMUB_STATUS_OK;
 }
 
-- 
1.8.3.1



[PATCH] drm/amd/display: clean up some inconsistent indenting

2021-11-11 Thread Jiapeng Chong
Eliminate the follow smatch warning:

drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_debugfs.c:2245
dp_dsc_slice_bpg_offset_read() warn: inconsistent indenting.

drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_debugfs.c:2044
dp_dsc_pic_width_read() warn: inconsistent indenting.

drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_debugfs.c:2101
dp_dsc_pic_height_read() warn: inconsistent indenting.

drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_debugfs.c:2173
dp_dsc_chunk_size_read() warn: inconsistent indenting.

drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_debugfs.c:1868
dp_dsc_bits_per_pixel_read() warn: inconsistent indenting.

drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_debugfs.c:1965
dp_dsc_bits_per_pixel_write() warn: inconsistent indenting.

drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_debugfs.c:1787
dp_dsc_slice_height_write() warn: inconsistent indenting.

drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_debugfs.c:1602
dp_dsc_slice_width_write() warn: inconsistent indenting.

drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_debugfs.c:1687
dp_dsc_slice_height_read() warn: inconsistent indenting.

vers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_debugfs.c:1417
dp_dsc_clock_en_write() warn: inconsistent indenting.

drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_debugfs.c:1502
dp_dsc_slice_width_read() warn: inconsistent indenting.

drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_debugfs.c:1315
dp_dsc_clock_en_read() warn: inconsistent indenting.

Reported-by: Abaci Robot 
Signed-off-by: Jiapeng Chong 
---
 .../drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c  | 72 +++---
 1 file changed, 36 insertions(+), 36 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c 
b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
index 9d43ecb..50ef248 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
@@ -1312,9 +1312,9 @@ static ssize_t dp_dsc_clock_en_read(struct file *f, char 
__user *buf,
 
for (i = 0; i < MAX_PIPES; i++) {
pipe_ctx = 
>dc_link->dc->current_state->res_ctx.pipe_ctx[i];
-   if (pipe_ctx && pipe_ctx->stream &&
-   pipe_ctx->stream->link == aconnector->dc_link)
-   break;
+   if (pipe_ctx && pipe_ctx->stream &&
+   pipe_ctx->stream->link == aconnector->dc_link)
+   break;
}
 
if (!pipe_ctx)
@@ -1414,9 +1414,9 @@ static ssize_t dp_dsc_clock_en_write(struct file *f, 
const char __user *buf,
 
for (i = 0; i < MAX_PIPES; i++) {
pipe_ctx = 
>dc_link->dc->current_state->res_ctx.pipe_ctx[i];
-   if (pipe_ctx && pipe_ctx->stream &&
-   pipe_ctx->stream->link == aconnector->dc_link)
-   break;
+   if (pipe_ctx && pipe_ctx->stream &&
+   pipe_ctx->stream->link == aconnector->dc_link)
+   break;
}
 
if (!pipe_ctx || !pipe_ctx->stream)
@@ -1499,9 +1499,9 @@ static ssize_t dp_dsc_slice_width_read(struct file *f, 
char __user *buf,
 
for (i = 0; i < MAX_PIPES; i++) {
pipe_ctx = 
>dc_link->dc->current_state->res_ctx.pipe_ctx[i];
-   if (pipe_ctx && pipe_ctx->stream &&
-   pipe_ctx->stream->link == aconnector->dc_link)
-   break;
+   if (pipe_ctx && pipe_ctx->stream &&
+   pipe_ctx->stream->link == aconnector->dc_link)
+   break;
}
 
if (!pipe_ctx)
@@ -1599,9 +1599,9 @@ static ssize_t dp_dsc_slice_width_write(struct file *f, 
const char __user *buf,
 
for (i = 0; i < MAX_PIPES; i++) {
pipe_ctx = 
>dc_link->dc->current_state->res_ctx.pipe_ctx[i];
-   if (pipe_ctx && pipe_ctx->stream &&
-   pipe_ctx->stream->link == aconnector->dc_link)
-   break;
+   if (pipe_ctx && pipe_ctx->stream &&
+   pipe_ctx->stream->link == aconnector->dc_link)
+   break;
}
 
if (!pipe_ctx || !pipe_ctx->stream)
@@ -1684,9 +1684,9 @@ static ssize_t dp_dsc_slice_height_read(struct file *f, 
char __user *buf,
 
for (i = 0; i < MAX_PIPES; i++) {
pipe_ctx = 
>dc_link->dc->current_state->res_ctx.pipe_ctx[i];
-   if (pipe_ctx && pipe_ctx->stream &&
-   pipe_ctx->stream->link == aconnector->dc_link)
-   break;
+   if (pipe_ctx && pipe_ctx->stream &&
+   pipe_ctx->stream->link == aconnector->dc_link)
+   break;
}